|
xor eax,eax Home Fireworks SparcZ Win32 asm Kunthrandum Linkz page Guestbook Misc... About me XXXXXXXX 793 |
GDTR-vomiter : Win32 coding trick for ASM warriors..! When windows programs crashes.. the operating system vomits the contents of CPU registers, stack, etc. over the face of the unfortunate user. This nasty feature, especially the 16x DWORD stack dump, can be used as an output interface where Hexadecimal numbers are enough..! ie. very useful for that lazy win32asm coder who just started a new project and want to see immediate intermediate results. I've been using this bloody cruel trick for a long period as an asm devTool. Following example is a similar one which shows the address of Global Descriptor Table. .486p .model flat,stdcall option casemap:none .data mgdt db 0,0,0,0,0,0 .code findgdt: mov eax,offset mgdt sgdt [eax] ; get GDTR contents movzx edx,word ptr[eax] ; store size of GDT in EDX mov ecx,[eax+2] ; store address of GDT in ECX mov eax,offset findgdt mov ebx,cs:[eax] mov cs:[eax],eax ; writing to code area irritates kernel ret end findgdt ![]() GDTR tells that Global Descriptor Table is located at 'c25bd000h' and sized '0fffh' bytes... ;) |