pyasm2 icon indicating copy to clipboard operation
pyasm2 copied to clipboard

memory addresses with segment

Open jbremer opened this issue 12 years ago • 0 comments

When referencing an address with a segment, e.g. in the following snippet.

mov(eax, dword[fs:eax])

Then, because the python index limit for 32bit versions is MAX_INT which is 1<<31, we have to store the memory address temporarily in a global dictionary, with a random key. The key, an integer, is passed along in __getitem__ so that the MemoryAddress object (e.g. byte, dword, ..) can read the memory address from the global dictionary (and delete it from the dictionary afterwards.) After the object has been passed, all is well.

jbremer avatar Jul 04 '12 20:07 jbremer