This post is part of the series of Practical Malware Analysis Exercises.
Rogue opcodes are inserted after conditional jump instructions. Since the conditional jumps always evaluate to true, the bogus opcode is never called, but IDA disassembles the "branch" as if it were.
Changing the rogue opcode to data (d
hotkey) and forcing the rest of the bytes to code (c
hotkey) revealed the true instructions.
Rogue opcodes for the CALL
instruction, E8
, are inserted after conditional jump instructions. The next byte is 8B
, the opcode for a MOV
instruction.
It is used five times at the following locations:
- rogueop_1 00401010
- rogueop_2 00401023
- rogueop_3 00401037
- rogueop_4 0040104B
- rogueop_5 00401062
The command line argument being looked for is pdq
which prints the success string.
The program checks for the characters out of sequence: byte 0, 2, 1.