I am trying to decompile asm code to python. I encountered the following line
movsx eax, byte ptr [edi]
I am looking for a way to do signed extension of a byte in python. I am currently using bytearray to get the individual bytes. After getting the individual bytes I need to do a signed extension for each of them.
I use the following snippet:
In your case b will be 8. You can probably precalculate the masks for a bit of speedup.
The referenced hack can be found here.