-
Hello, I would like to go from this (a): I was able to go from the first to the second by tokenizing the instruction and adding whatever code was needed to go from (a) to (b). I used the Formatter03 and ZydisDisasm examples to get there. The first question I have is: are there properties/options that can be set in the formatter that would minimize or eliminate the need to tokenize the instruction in order to go from (a) to (b) ? The second question is: is there a way to inform the dis-assembler that the addresses are CS relative (instead of DS which is what it's using). Thank you for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi!
You mean you used formatter hooks to achieve that?
The hexadecimal formatting is completely customizable. You can remove the If you look in the source, we already have the
Zydis currently sets the wrong default segment for branch instructions with memory operands. We should fix this by adding some more logic here: Line 1930 in ffde0f4 As a workaround you can simply modify the segment register of the operand before passing the |
Beta Was this translation helpful? Give feedback.
What I was trying to suggest is using the regular
INTEL
formatter style (notMASM
) and useZydisFormatterSetProperty
to customize the hexadecimal value prefix/suffix and address padding (use the defaults from theMASM
style here; but nothing else). This should allow you to get your desired address output.The regular
INTEL
formatter should respect the runtime address.That would be the recommended way of getting rid of the
[
and]
tokens which as well would allow you to use the regularZydisFormatterFormatInstruction
instead of the tokenizing one.