Skip to content

Instantly share code, notes, and snippets.

@50n1cd347h9
Created October 31, 2024 17:42
Show Gist options
  • Save 50n1cd347h9/28a00f921b84c84c51926ae6c0ed065d to your computer and use it in GitHub Desktop.
Save 50n1cd347h9/28a00f921b84c84c51926ae6c0ed065d to your computer and use it in GitHub Desktop.

Note that no blank lines are allowed.

def exec_patch():
    addr = 0x224
    addr2 = 0x224
    count = 0x18d
    while True:
        d1 = bv.read(addr, 1)[0]
        addr += 1
        d1 -= 0x41
        d1 = (d1 << 4)
        d2 = bv.read(addr, 1)[0]
        addr += 1
        d2 -= 0x41
        d2 += d1
        d2 = d2.to_bytes(1, 'little')
        bv.write(addr2, d2)
        addr2 += 1
        count -= 1
        if count == 0:
            break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment