Skip to content

Commit

Permalink
add memory.py sample script
Browse files Browse the repository at this point in the history
  • Loading branch information
vphuongdd committed Jun 27, 2022
1 parent 62d1613 commit 370f937
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions example script/memory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from x64dbg import *

if __name__ == "__main__":
currentAddr = Register.GetEIP()
print("Current address: 0x%X" % currentAddr)
print("Now read 100 bytes from address 0x%X" % currentAddr)

data = Memory.Read(currentAddr, 100)
print(data)

print("Now write 100 bytes to address 0x%X" % currentAddr)
sampleData = b""
for i in range(0, 100):
sampleData += i.to_bytes(1, "little")

ret = Memory.Write(currentAddr, sampleData)
print("%d byte(s) written to address 0x%X" % (ret, currentAddr))

0 comments on commit 370f937

Please sign in to comment.