$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
I just read an answer on StackOverflow with this code:
1 2 3 4 5 6 7 8 9 10 11 12 | var eu:DWORD; begin asm mov eax,[fs:$4] mov ebx,[fs:$8] sub eax,ebx mov eu,eax end; ShowMessage(IntToStr(eu)); end; |
Unfortunately it lacked explanation, so what does this code do?
It reads offset $4 from the Thread Information Block (the top of stack) into eax and then offset $8 (stack base) into ebx.
Then it substracts the two and moves that into variable eu, that’s all!
One Response for "Determining stack size"
I think you can get the same results using Cardinal(NtCurrentTeb^.NtTib.StackBase) – Cardinal(NtCurrentTeb^.NtTib.StackLimit), but without using assembler code 🙂
Leave a reply