rendered paste body// DIZ IS A UBER VIRUS
void x86EnumStackFrames(void){
MEMORY_BASIC_INFORMATION minfo;
DWORD stackbase;
DWORD stacktop;
DWORD framebase;
__asm {
mov stacktop, esp
mov framebase, ebp
}
VirtualQuery((LPCVOID)stacktop, &minfo, sizeof(minfo));
stackbase = (DWORD)minfo.AllocationBase;
int framenum = 0;
printf("%X\n%X", stacktop, stackbase);
while(framebase >= stacktop && stackbase <= framebase){
DWORD oldframebase = framebase;
framebase = * (DWORD *)(framebase);
if(framebase <= oldframebase){
printf("Invalid stack frame found: %i", framebase);
break;
} else {
DWORD retaddr = * (PDWORD)(4 + oldframebase);
printf("Frame %i:\n\n\tTop:\t%X\n\tBottom:\t%X\n\nReturn Address:\t%X\n\n", framenum, oldframebase, framebase, retaddr);
}
framenum++;
}
}