23.03.2013 Views

Quick introduction to reverse engineering for beginners

Quick introduction to reverse engineering for beginners

Quick introduction to reverse engineering for beginners

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

mov [esp+70h+var_70], eax<br />

call _printf<br />

add [esp+70h+i], 1<br />

loc_8048441:<br />

cmp [esp+70h+i], 13h<br />

jle short loc_804841B<br />

mov eax, 0<br />

leave<br />

retn<br />

main endp<br />

1.13.1 Buffer overflow<br />

So, array indexing is just array[index]. If you study generated code closely, you’ll probably note missing<br />

index bounds checking, which could check index, if it is less than 20. What if index will be greater than 20?<br />

That’s the one C/C++ feature it’s often blamed <strong>for</strong>.<br />

Here is a code successfully compiling and working:<br />

#include <br />

int main()<br />

{<br />

int a[20];<br />

int i;<br />

};<br />

<strong>for</strong> (i=0; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!