I need to understand what the following obfuscated application does:
interpreter.py: string = "lambda x : obfuscated_code_to_interpret_variable_x" interpreter = eval(string) instructions = read_instructions(argv) interpreter(instructions) instructions.txt: 04GFUHSDSLGHLDFIHGLDSHLFHGLSDGHFLFSHGLIFSHLGFLGFIIGFL...
You run the application typing the command
python3 interpreter.py instructions.txt
instructions.txt contains machine code (of some hypothetical machine).
interpreter.py contains an interpreter that runs the machine code.
I want to modify the interpreter by adding
print(variable) statements inside the
to see what the code does.
The problem is that somewhere in the
instructions.txt file, a file
interpreter.py is read as a string, hashed, and checked that the hash equals to a predefined value. Thus, any modification to the
interpreter variable will invalidate the hash.
I also have no idea what the numbers inside the
instructions.txt file mean, because only the obfuscated interpreter understands the meaning of those numbers. So I can't remove the hash check from the
instructions.txt file, because I don't know where it is.
Any ideas, how to deobfuscate such application?