x64dbg / x64dbgpy

Automating x64dbg using Python, Snapshots:
https://ci.appveyor.com/project/mrexodia/x64dbg-python/build/artifacts
MIT License
1.47k stars 70 forks source link

about get string #53

Open qux-bbb opened 4 years ago

qux-bbb commented 4 years ago

Maybe these two functions can be put into library functions. I'm not sure where to put them.

import scriptapi

def get_ansi_str(addr):
    final_str = ''
    i = 0
    while True:
        c = scriptapi.Memory.read(addr+i, 1)
        if c == '\x00':
            break
        final_str += c
        i += 1
    return final_str

def get_wide_str(addr):
    final_str = ''
    i = 0
    while True:
        c = scriptapi.Memory.read(addr+i, 2)
        if c == '\x00\x00':
            break
        final_str += c
        i += 2
    return final_str