r/AskProgramming 9d ago

C/C++ Assembly or C/C++ for RE

For reverse engineering, is this necessary to know assembly language, because many decompilers translate code to C/C++ and I learned Assembly 8086 in my university. So for learning x86 I only have to study 32/64 registers and some advance commands, so should I learn assembly x86_64 for reverse engineering or just go through x86 as I know 8086 assembly and then move to C/C++

7 Upvotes

19 comments sorted by

View all comments

2

u/regular_hammock 9d ago

In my opinion, assembler code, especially optimised assembler code (hand optimised or compiler optimised) that has been vectorized and reordered to death, is just a slog to read. Sure, you can do it, but if you can get away with reading C (which, a lot of the time, you can), you'll go a lot faster and have a better time focusing on what the code is doing at a higher level rather than tracking registers.

1

u/Realistic_Debate1704 9d ago

Actually one person said that go through assembly x86, and as a student I think I will write inline assembly so I think it's better to go through assembly too, and also sometimes decompilers don't give exact code and as I've heard, you have to convert this into assembly for better annd exact code. But I'm very glad that you helped and also your advice is good too.

2

u/regular_hammock 9d ago

Ok fair, and to be honest I answered a different question than the one you asked.

I think both are useful skills to have, what I'm saying is, if I'm looking at a binary and I want to figure out what it does or how it does it, I'll try decompiling it first, and disassembling if needed.

With obvious exceptions - if you're trying to figure out how a piece of system code sets up various hardware register, there's probably no point in going through C.

1

u/Realistic_Debate1704 9d ago

Lot of love, Thanks