P
P
p0sd2016-03-19 12:54:57
C++ / C#
p0sd, 2016-03-19 12:54:57

How to modify exe files compiled under win 8.1?

Hello, I have the following problem, the solution of which has not yet been found anywhere.
Essence:
There is a C ++ console application built using VS 2015, it checks the
entered password and displays whether it is correct or not. The password is read from STDIN, then a function is called
that returns true if the password is correct, false otherwise. Actually, with the help of x64dbg, I found a place where the eax register is reset before exiting the password check function ( xor al, al ) and replaced this command with mov al, 1 , actually replaced 2 bytes with 2 bytes - 32 02 replaced with B0 01. The application worked up to the end in x64dbg and displayed the correct result - it accepted the wrong password. Calculate the offset. I closed the file, with the help of HxD I switched to the desired offset, there really were these 2 bytes ( 32 02 ), I replaced them, the file was saved. After that, the exe stopped running, crashes with the error "The application cannot be launched on your PC."
Actually a question - and in what there can be a problem? The file size should not have changed, no extra shifts should have appeared, but that's all. Maybe it's the checksum, which seems to be in the PE header, but I have not yet figured out how to recalculate it - from the entire file or from some part of it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Martyanov, 2016-03-19
@p0sd

The checksum can be stupidly nullified, for example. In general, you would need to compare files before and after editing byte by byte, all of a sudden there are other changes after all ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question