예제 #1
0
int main(int argc, char** argv)
{
	printf("EBP located at: %p\n",getEIP());
	return 0;
}
예제 #2
0
파일: jump.cpp 프로젝트: awesomekling/vomit
void CPU::_CALL_imm32(Instruction& insn)
{
    push32(getEIP());
    jumpRelative32(insn.imm32());
}
예제 #3
0
파일: jump.cpp 프로젝트: awesomekling/vomit
void CPU::_CALL_RM32(Instruction& insn)
{
    push32(getEIP());
    jumpAbsolute32(insn.modrm().read32());
}
예제 #4
0
파일: nt_bop.c 프로젝트: chunhualiu/OpenNT
void MS_bop_1(void) {

    if (!WowModeInitialized) {
    //Load the WOW DLL
    if ((hWOWDll = SafeLoadLibrary("WOW32")) == NULL)
    {
#ifndef PROD
        HostDebugBreak();
#endif
        TerminateVDM();
        return;
    }

    // Get the init entry point and dispatch entry point
    if ((WOWInitEntry = (MYFARPROC)GetProcAddress(hWOWDll, "W32Init")) == NULL)
    {
#ifndef PROD
        HostDebugBreak();
#endif
        FreeLibrary(hWOWDll);
        TerminateVDM();
        return;
    }

    if ((WOWDispatchEntry = GetProcAddress(hWOWDll, "W32Dispatch")) == NULL)
    {
#ifndef PROD
        HostDebugBreak();
#endif
        FreeLibrary(hWOWDll);
        TerminateVDM();
        return;
    }

    //Get Comms functions
    if ((GetCommHandle = (GCHfn) GetProcAddress(hWOWDll, "GetCommHandle")) == NULL)
    {
#ifndef PROD
        HostDebugBreak();
#endif
        FreeLibrary(hWOWDll);
        TerminateVDM();
        return;
    }

    if ((GetCommShadowMSR = (GCSfn) GetProcAddress(hWOWDll, "GetCommShadowMSR")) == NULL)
    {
#ifndef PROD
        HostDebugBreak();
#endif
        FreeLibrary(hWOWDll);
        TerminateVDM();
        return;
    }

    //Get hung app Notification routine
    pW32HungAppNotifyThread = (VOID(*)(UINT))GetProcAddress( hWOWDll,
                                                    "W32HungAppNotifyThread");
    if (!pW32HungAppNotifyThread)
    {
#ifndef PROD
        HostDebugBreak();
#endif
        FreeLibrary(hWOWDll);
        TerminateVDM();
        return;
    }


    // Call the init routine
    if ((*WOWInitEntry)() == FALSE)
    {
#ifndef PROD
        HostDebugBreak();
#endif
        TerminateVDM();
        return;
    }

    WowModeInitialized = TRUE;
    }

#if !defined(CPU_40_STYLE) || defined(CCPU)
    (*WOWDispatchEntry)();
#else
    // Dispatch to WOW dispatcher
    {
	static BYTE **AddressOfLocal;
	BYTE *localSimulateContext = GLOBAL_SimulateContext;

	AddressOfLocal = &localSimulateContext;

	(*WOWDispatchEntry)();

	SET_GLOBAL_SimulateContext(localSimulateContext);

	if(AddressOfLocal != &localSimulateContext)
	{
	    //Thread switch detected via stack change, force CPU to
	    //abort the current fragment, reseting GDP var's refering
	    //to the host stack

	    setEIP(getEIP());
	}
    }
#endif	/* CPU_40_STYLE */
}