hellman / libformatstr

Simplify format string exploitation.
339 stars 43 forks source link

64bit bug #9

Closed Kyle-Kyle closed 7 years ago

Kyle-Kyle commented 7 years ago

I'm using unamer's version. The problem is that on 64bit binary, the library can only modify higher 2 bytes. I wonder whether there is something to do with %hn and %n python code:

f = FormatStr(isx64=1)
f[0x6cb018] = 0x12345678
f[0x6cb010] = 0x12345678
f[0x6cb000] = 0x12345678
f.payload(6, start_len=0)
(gdb) x/10wx 0x6cb000
0x6cb000:   0x12340000  0x00000000  0x00000000  0x00000000
0x6cb010:   0x12340000  0x00000000  0x1234a5a0  0x00000000
0x6cb020:   0x0043d590  0x00000000