I was just wondering if there was a way to force an interpretation of a block of code in x64dbg.
The section im analyzing fluctuates between this:
and this:
I was just wondering if there was a way to force an interpretation of a block of code in x64dbg.
The section im analyzing fluctuates between this:
and this:
You are encountering the issue of backwards disassembly. When you give x64dbg an address to disassemble at it will start decoding at exactly this address, go to the next instruction, etc.
For example if you have the bytes:
EB 00 48 83 C4 38 C3
And you start disassembling at the first byte you will see:
0 | EB 00 | jmp 2
2 | 48 83 C4 38 | add rsp,38
6 | C3 | ret
If you start disassembling at the second byte you will see:
1 | 00 48 83 | add byte ptr ds:[rax-7D],cl
4 | C4 | ???
5 | 38 C3 | cmp bl,al
The reason you are seeing garbage like this when scolling up is that x64dbg has no idea about instruction starts and tries to heuristically determine what the previous instruction was based on the bytes. If the result of this algorithm is wrong x64dbg will disassemble at an incorrect location causing strange looking instructions. You can find the implementation of that algorithm here. It is based on the algorithm used inside OllyDbg.
As some users suggested you can use analysis, but the results of this are not used during backwards disassembly because generally everything works fine.