Live data from Hacker News

A Gentle Primer on Reverse Engineering

emily.st

41–50 of 64 posts

Re: A Gentle Primer on Reverse Engineering

#41
post #38
post #11

First: great article. One nit, though. There's a subtle error in the main function: char* input; printf("Please input a word: "); scanf("%s", input); Local variables are not automatically initialized in C, and we never assign input to point to any particular block of memory. This means it's probably pointing off to some random location - basically whatever address happened to be sitting on the stack when main was cal…

Um, nice example of mansplaining.

Don't write things like this on HN.

Re: A Gentle Primer on Reverse Engineering

#43
post #13
post #11

First: great article. One nit, though. There's a subtle error in the main function: char* input; printf("Please input a word: "); scanf("%s", input); Local variables are not automatically initialized in C, and we never assign input to point to any particular block of memory. This means it's probably pointing off to some random location - basically whatever address happened to be sitting on the stack when main was cal…

The author addresses this in footnote #2. They're simplifying the C code to get to the point of the article faster.

The author was wrong, and then corrected their post. Why get indignant on their behalf?

Re: A Gentle Primer on Reverse Engineering

#44
post #35

Earlier quoted context omitted.

The C code is literally the least interesting part of this essay. This bug, such as it is, does not matter . It is entirely and completely beside the point.

This isn't art class. facts fucking matter. unless you proffer incompetence.

Not helping.

Re: A Gentle Primer on Reverse Engineering

#45
post #18

C lacks a boolean type This is false, as of C99 we have booleans in C, just include stdbool.h in your code, e.g.: #include ... bool test = true; ...

Let's look at the source of stdbool.h: #define true 1 #define false 0 http://clang.llvm.org/doxygen/stdbool_8h_source.html

You're missing

   #define bool _Bool
Since bool wasn't reserved prior to C99, they use the _Bool keyword (which was reserved). [http://stackoverflow.com/questions/8724349/difference-betwee...]

Re: A Gentle Primer on Reverse Engineering

#46
post #12
post #8

The title seems a bit misleading, e.g. one could reverse engineer source code into UML. Perhaps a more appropriate title would be: A Gentle Primer on Code disassembling.

For what she's describing, " reverse engineering " is actually the more common phrase rather than "code disassembling". If you search amazon.com, " reverse engineering " is in the titles of the first 2 books: http://www.amazon.com/s/ref=nb_sb_noss_1?&field-keywords=rev... The way most people use the terminology now, I'd say "reverse engineering" encompasses all the strategies of analyzing and unraveling the logic of…

That's a bit misleading. Reverse engineering has, on the face, little to do with assembler of any sort; it's about understanding your target and choosing the best angle of attack to learn more about it. That often depends on how the target was produced in the first place. If it's written in C or C++, sure, go to the assembler. If it's some Adobe Air program that is really just a launcher for a SWF, well, you're not going to have much luck. Similarly, the application logic in a program like EVE Online is almost entirely written in Python; you wouldn't exactly know it from the outside, because they've wrapped all the native things they need. But then you won't learn much either just looking at the assembly of what are various layers and layers of wrappers.

Re: A Gentle Primer on Reverse Engineering

#47

I used emacs hexl-mode and http://support.amd.com/TechDocs/24594.pdf to edit a je to a jne which caused the program to think I put in the correct password. That was fun.

But it doesn't work anymore with the correct password...

I always found it was cleaner to either force (jmp) or remove (nopnop) the jump rather than inversing its condition. It's more explicit.

Also, in the real world, cracking's usually a bit more than finding the right jump to force/remove. Although, if it's enough to reach your goal, you should do it.

Re: A Gentle Primer on Reverse Engineering

#49
Slightly off-topic. Could somebody recommend good resources on reverse engineering (especially C and Linux)? I'm writing C code for living, but binary level security is not my strong side and I wish to improve it.

Re: A Gentle Primer on Reverse Engineering

#50
post #13
post #11

First: great article. One nit, though. There's a subtle error in the main function: char* input; printf("Please input a word: "); scanf("%s", input); Local variables are not automatically initialized in C, and we never assign input to point to any particular block of memory. This means it's probably pointing off to some random location - basically whatever address happened to be sitting on the stack when main was cal…

The author addresses this in footnote #2. They're simplifying the C code to get to the point of the article faster.

I would expect an article on reverse engineering to have correct C code.

If you think that having undefined behavior in your code is fine as long as it works for you, do not be surprised that one moment a vile dragon appears and starts spewing fire.

Post reply on HN