Closed 440bx closed 5 months ago
Could you please format that code? (guide)
The results obtained from the 32 bit version of the program do not match the results obtained from the 64 bit version (the results from the 32 bit version are incorrect.)
Can you provide those outputs?
I read the guide you linked to but, I didn't see what else I can do. I used backticks to insert that code. I don't know what else I can do. Any suggestions you may have are welcome.
As far as the program output, I got that.
the first line, which shows the correct output is when the hook is not in place. the second line is when the hook (which does nothing) is in place.
for
multiline
content
use
triple
backticks
with newline after opening backticks and before closing ones
Your code is bugged:
default_print_register = (ZydisFormatterFunc)&ZydisFormatterPrintRegister;
ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_FUNC_PRINT_REGISTER,
(const void**)&default_print_register);
ZydisFormatterPrintRegister
in your code follows ZydisFormatterFunc
prototype while it should follow ZydisFormatterRegisterFunc
instead.
Thank you mappzor for pointing out the triple tick and taking the time to find the bug in my code. I totally forgot about the two formatter functions that have different prototypes, mea culpa.
Thank you again.
the 32 bit version of a program that hooks the ZYDIS_FORMATTER_FUNC_PRINT_REGISTER yields incorrect results. the 64 bit version of the same program (identical) yields correct results.
the following code is a slightly modified version of formatter02.c to demonstrate the problem. The results obtained from the 32 bit version of the program do not match the results obtained from the 64 bit version (the results from the 32 bit version are incorrect.)
Note: the changes in the code are few and are conditional to the #define bug32. I posted the entire program for context purposes but, the total number of changes is about 20 lines.