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.
A Gentle Primer on Reverse Engineering
41–50 of 64 posts
Re: A Gentle Primer on Reverse Engineering
#42I 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.
Re: A Gentle Primer on Reverse Engineering
#43First: 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.
Re: A Gentle Primer on Reverse Engineering
#44Re: A Gentle Primer on Reverse Engineering
#45C 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
#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
#46The 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…
Re: A Gentle Primer on Reverse Engineering
#47I 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.
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
#48Re: A Gentle Primer on Reverse Engineering
#49Re: A Gentle Primer on Reverse Engineering
#50First: 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.
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.