-
1. Data: 2009-07-10 09:25:53
Temat: zawartosc rejestru EIP
Od: Krzysztof Poc <f...@w...pl>
Witajcie
W jaki sposob moge w C++ wypisac zawartosc rejestru EIP.
Napisalem ponizszy programik, ktory niestety nie dziala dla eip.
unsigned regVal;
asm ( "movl %%eip, %0;"
: "=r"(regVal) );
dzieki za pomoc
-
2. Data: 2009-07-10 17:30:41
Temat: Re: zawartosc rejestru EIP
Od: "Mariusz Marszałkowski" <b...@g...SKASUJ-TO.pl>
Krzysztof Poc <f...@w...pl> napisał(a):
> Witajcie
>
> W jaki sposob moge w C++ wypisac zawartosc rejestru EIP.
> Napisalem ponizszy programik, ktory niestety nie dziala dla eip.
W wikipedii http://en.wikipedia.org/wiki/X86_assembly_language
jest taki tekst:
Using the instruction pointer register
There is also a 32-bit instruction pointer, named EIP. The EIP register points
to where in the program the processor is currently executing its code. The EIP
register cannot be accessed by the programmer directly. Instead, a sequence
like the following can be done to retrieve the address of next_line into EAX:
call next_line
next_line:
pop eax
This works even in position-independent code because call takes an
EIP-relative immediate operand. To write to EIP is simple:
jmp eax
Pozdrawiam
--
Wysłano z serwisu Usenet w portalu Gazeta.pl -> http://www.gazeta.pl/usenet/