Do you have to reverse engineer assembly code to C code?

Do you have to reverse engineer assembly code to C code?

I have to reverse engineer this assembly code to c code. I’ll also provide what I think is going on so you can hopefully point to where I went wrong and I can learn from my mistakes now.

Can you go back to source from Assembly Stack Overflow?

Most likely this code was compiled with some sort of optimization or someone wrote it themself like that to demonstrate a point. As others have said, you can’t go exactly back to the source from the disassembly. It’s up to the interpretation of the person reading the assembly to come up with equivalent C code.

Can You reproduce the original source in reverse engineering?

You can’t reproduce the original source, you can only reproduce an equivalent source. In your case the calculation for t2 can appear anywhere after t1 and before retval. When reverse engineering, you don’t care about the original source code line by line, you care about what it does.

How does asm2c work on assembly source code?

For that purpose, it needs to get its address. It does that by making two calls. Calls will make new stack frames, at which point it can just pop the saved stack frame. There’s also asm2c that works on assembly source code instead of executables or objects files.

Can a reverse engineering tool be used in Windows?

In this blog however, we will be using the same source code of the binary but compile and debug it in Windows. Reverse engineering tools in Windows are highly different from that of Linux, but on the assembly level, it would somewhat be the same.

What’s the aim of reverse engineering x64 for beginners?

As for now, our primary aim is to find the actual password and secondary aim is to modify the RAX register to Zero, to display ‘Correct Password’ since our check_pass () function returns 0 or 1 depending upon whether the password is right or wrong.

Which is the best tool for reverse engineering x86 binaries?

Immunity Debugger is an awesome tool if you are debugging x86 binaries. However, since we are only focusing on x64, we will have to use x64dbg which supports both x86 and x64 disassembly. Once you have downloaded the required debugger, you can compile the source code which is uploaded on my Git repo here.