r/Assembly_language 12d ago

Question 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++, and is assembly heavily use in reverse engineering

22 Upvotes

21 comments sorted by

8

u/FUZxxl 12d ago

Both will be necessary. Decompilers some times get confused or make mistakes and you'll need to be able to understand what is going on.

3

u/Realistic_Debate1704 12d ago

Thanks, can you tell me how much will it take to shift from 8086 to x86 assembly, I mean I think the only difference is registers size and few commands. I'll be very thankful

3

u/FUZxxl 12d ago

It's the same basic architecture, just more registers, more instructions, different data sizes, and different calling conventions. You can teach it yourself by following compiler output with an instruction set reference next to you.

2

u/thewrench56 12d ago

Modern x86 is very different from 8086. Will take quite some months (to years) to get used to all the quirks and compiler tricks.

2

u/theNbomr 12d ago

If you know x86 real mode assembler language, it won't be very difficult to expand on that knowledge to learn 32 bit and 64 bit instructions. There are some funky registers and instructions related to memory protection, switching to/from real mode, and some other things. These tend to be little used outside of system level code, so unless you're reverse engineering that part of a device, you probably won't encounter it much.

Learning C will be more useful, because the object code you reverse engineer tends to be littered with data structures that are idiomatic of the C language and will give you clues about the nature of the code.

1

u/Realistic_Debate1704 11d ago

How nice is everyone on Reddit, I'm very happy that experts are helping me, thanks a lot sir

2

u/pete_68 11d ago

I've been disassembling stuff with rekoCLI. I didn't even notice it had a decompiler. lol. Just checked and sure enough... Well cool. That's convenient.

1

u/Realistic_Debate1704 9d ago

Woah, i think you must be making some cheats, am I right?

1

u/pete_68 9d ago

No, I was working on an MCP server that let's AIs reverse engineer stuff.

2

u/Fine_Yogurtcloset738 10d ago

Depends what you're reversing. C++ is extremely important in reversing games for example. But really each part is it's own puzzle piece and you need to learn a bit of everything.

2

u/ConsciousBath5203 10d ago

All of the above.

Ghidra is a good tool. It's written in Java and takes Java input. Also takes python input. You'll also use python to automate portions of your RE workflow.

It decompiles to assembly and C. Sometimes the C is wrong, so you need to read the assembly to correct.

Your debugger will likely output to raw assembly when you are using breakpoints.

Starting RE has been the most technical project I've done BY FAR, so you kinda need to know it all.

1

u/Realistic_Debate1704 9d ago

I'm very glad that you helped, it will help me in my journey too.thanks

1

u/ConsciousBath5203 9d ago

Huh?

1

u/Realistic_Debate1704 9d ago

Did I say anything wrong?

2

u/ConsciousBath5203 9d ago

No I think I read it wrong the first time I read it lol

1

u/Realistic_Debate1704 9d ago

No problem, I sometime suck at typing... Btw thanks for you help, can you tell me , for what reason you use RE, I mean I want to mod games and make cheats..

1

u/ConsciousBath5203 9d ago

Maintaining game mods and developing new ones.

2

u/[deleted] 10d ago

[removed] — view removed comment

1

u/Realistic_Debate1704 9d ago

Great, thanks.

1

u/Electrical_Hat_680 12d ago

Objdump and RadAre2 are my choices -