-
-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the call is far, zydisdecoderdecodefull cannot work normally #360
Comments
What's the problem here? What "key data" is missing? Zydis decodes this as You seem to be having trouble with understanding how RIP-relative operands work. Decoding process itself does not depend on runtime address. In above example ( |
@mappzor Thank you for your answer, but my first question doesn't seem to have been solved. FF15 02000000 EB08 8967452301000000 |
Did you mess up the encoding in the byte-stream? I can see the |
@flobernd |
Not sure what you expect here? I don't use CheatEngine, but these are definitely multiple instructions. Besides that, there is no |
Yeah, you are looking at a RIP-rel instruction (like @mappzor explained to you).
This points to the memory Whatever generated this call, placed data ( Remember: |
@flobernd |
The generic solution is very complex (you have to create a control flow graph). If it's always this specific case all the time, you could try to detect that pattern and jump over the data payload. Something like (pseudo code):
|
@flobernd |
This issue seems very similar to issue #188 from a year ago - what happens appears to be that someone somewhere has come up with some cute code idioms to express functionality that does not natively exist as x86 instructions (jmp/call with absolute address), and with both #188 and this issue, CheatEngine will recognize the idiom and display it as an instruction, even though it really isn't. Looking at CheatEngine's disassembler source code (see e.g. https://github.com/cheat-engine/cheat-engine/blob/master/Cheat%20Engine/disassembler.pas#L15381 ), its recognizers appear to be very specific - CheatEngine will very specifically recognize exactly the 8-byte sequence Since this construct is not a 'real' instruction - it consists of two instructions and one 64-bit data item, after all - it's not going to be recognized by Zydis as such (nor do I think it should be). If OP wants to recognize it, they should probably add their own test specifically for the 8-byte (similarly, for the jump in issue #188, if CheatEngine-like behavior is what they want, they should add their own test for the 6-byte sequence |
As far as I can tell, both of these issues (#188 and this one) originate from MinHook. MinHook is a hooking library which allocates rwx memory for their trampoline allowing them to mix data and code for this weird jmp/call to an absolute address (see https://github.com/TsudaKageyu/minhook/blob/4a455528f61b5a375b1f9d44e7d296d47f18bb18/src/trampoline.c#L79) |
Closing because this is not actually an issue in Zydis. |
00600000 - FF15 02000000 EB08 8967452301000000 - call 123456789
Zydisdecoderdecodefull will only decode into:
1CA8E63D630 - FF 15 02000000 - call qword ptr [1CA8E63D638]
The text was updated successfully, but these errors were encountered: