Page 2 of 2
Re:Jumping to TSS
Posted: Tue Apr 29, 2003 12:53 am
by Perica
..
Re:Jumping to TSS
Posted: Tue Apr 29, 2003 2:56 am
by Pype.Clicker
is encoded as 0x6A 0x0C. when executed, it will put 0x00000012 on the stack (32 bytes, i don't remember if the value is sign-extended or zero-extended)
is 0x68 0x0C 0x00 0x00 0x00, but it will have the very same effect on the stack.
http://courses.ece.uiuc.edu/ece291/arch ... f-pop.html
this should be all explained in the nasm docs as well ...
Re:Jumping to TSS
Posted: Tue Apr 29, 2003 9:30 am
by Tim
Perica Senjak wrote:So when retrieving arguments from the stack, i should take into account the padding??
No -- the opposite. You can assume that anything on the stack is a dword.
If you have a function like:
Code: Select all
void fn(unsigned char a, unsigned short b, unsigned long c, unsigned long long d);
...the stack will look like:
[tt]00 00 00 aa
00 00 bb bb
cc cc cc cc
dd dd dd dd
dd dd dd dd[/tt]
That is, a and b are padded with zeroes; c is unchanged; and d is split across two dwords. If a and b were signed then they would be padded with copies of their top bits; that is, 0xFF if they are negative, or 0x00 if they are zero or positive.
Re:Jumping to TSS
Posted: Sat May 03, 2003 4:21 pm
by shad
Is it me, or is the information (free information) on task switching (hardware or software) really this scarce?