/* =================== idSWFSpriteInstance::Run =================== */ bool idSWFSpriteInstance::Run() { if ( !isVisible ) { return false; } if ( childrenRunning ) { childrenRunning = false; for ( int i = 0; i < displayList.Num(); i++ ) { if ( displayList[i].spriteInstance != NULL ) { Prefetch( displayList[i].spriteInstance, 0 ); } } for ( int i = 0; i < displayList.Num(); i++ ) { if ( displayList[i].spriteInstance != NULL ) { childrenRunning |= displayList[i].spriteInstance->Run(); } } } if ( isPlaying ) { if ( currentFrame == frameCount ) { if ( frameCount > 1 ) { FreeDisplayList(); RunTo( 1 ); } } else { RunTo( currentFrame + 1 ); } } return childrenRunning || isPlaying; }
/* ======================== idSWFSpriteInstance::StopFrame ======================== */ void idSWFSpriteInstance::StopFrame( const idSWFParmList & parms ) { if ( parms.Num() > 0 ) { if ( parms[0].IsNumeric() && parms[0].ToInteger() < 1 ) { RunTo( FindFrame( "1" ) ); } else { RunTo( FindFrame( parms[0].ToString() ) ); } Stop(); } else { idLib::Warning( "gotoAndStop: expected 1 paramater" ); } }
int KHero::LuaMoveToTarget(Lua_State* L) { BOOL bRetCode = false; int nDestX = 0; int nDestY = 0; int nDestZ = 0; int nDirection = 0; BOOL bWalk = false; int nTopIndex = 0; nTopIndex = Lua_GetTopIndex(L); KG_PROCESS_ERROR(nTopIndex == 1); bWalk = Lua_ValueToBoolean(L, 1); bRetCode = GetAITargetPos(nDestX, nDestY, nDestZ); KG_PROCESS_ERROR(bRetCode); nDirection = g_GetDirection(m_nX, m_nY, nDestX, nDestY); if (bWalk) bRetCode = WalkTo(nDirection, true); else bRetCode = RunTo(nDirection, true); Exit0: return 0; }
int LoadHookDLL() { MyLoadLibraryA = (DWORD)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA"); char backbuf[256]; LPSTR filelocation = "TeknoBorg.dll"; DWORD OEP = FilePEFile.image_nt_headers.OptionalHeader.AddressOfEntryPoint + FilePEFile.image_nt_headers.OptionalHeader.ImageBase; DWORD TextLocation = OEP + 0x0C; DWORD CallLoadLibraryA = MyLoadLibraryA - (OEP + 10); ReadProcessMemory(pi.hProcess,(LPVOID)OEP,backbuf,256,0); WriteProcessMemory(pi.hProcess,(LPVOID)OEP,"\x68\x00\x00\x00\x00\xE8\x00\x00\x00\x00\xEB\xFE",0x0C,0); WriteProcessMemory(pi.hProcess,(LPVOID)(OEP + 1), &TextLocation,4,0); WriteProcessMemory(pi.hProcess,(LPVOID)(OEP + 6), &CallLoadLibraryA,4,0); WriteProcessMemory(pi.hProcess,(LPVOID)TextLocation,filelocation,13,0); GetThreadContext(pi.hThread, &mycontext); Sleep(1000); if(!RunTo(OEP + 10,0,0)) { printf("Failed to Load DLL!"); return 0; } if(mycontext.Eax == 0) { printf("Failed to Load DLL!"); return 0; } GetThreadContext(pi.hThread, &mycontext); mycontext.Eip = FilePEFile.image_nt_headers.OptionalHeader.AddressOfEntryPoint + FilePEFile.image_nt_headers.OptionalHeader.ImageBase; SetThreadContext(pi.hThread,&mycontext); WriteProcessMemory(pi.hProcess,(LPVOID)OEP,backbuf,256,0); printf("DLL Loaded!\n");// %08x\n", mycontext.Eax); return 1; }
/* =================== idSWFSpriteInstance::PrevFrame =================== */ void idSWFSpriteInstance::PrevFrame() { if( currentFrame > 1 ) { RunTo( currentFrame - 1 ); } }
/* =================== idSWFSpriteInstance::NextFrame =================== */ void idSWFSpriteInstance::NextFrame() { if( currentFrame < frameCount ) { RunTo( currentFrame + 1 ); } }
/* ======================== idSWFSpriteInstance::PlayFrame ======================== */ void idSWFSpriteInstance::PlayFrame( const idSWFParmList & parms ) { if ( parms.Num() > 0 ) { actions.Clear(); RunTo( FindFrame( parms[0].ToString() ) ); Play(); } else { idLib::Warning( "gotoAndPlay: expected 1 paramater" ); } }
void ProgramControlHandle::StepOver() { auto threadMarker = vm.managers.ThreadManager().CreateExecutionMarker(); Common::UInt32 word = *vm.allocator.ToPointer<Common::UInt32>(pc); PPCVM::Instruction inst = word.Get(); if (inst.OPCD == 18 && inst.LK == 1) { uint32_t sp = vm.state.r1; uint32_t desiredPC = pc + 4; do { RunTo(desiredPC); } while (vm.state.r1 != sp); } else StepInto(); }
int main(int argc, char *argv[]) { WIN32_FIND_DATA filedata; HANDLE hFind; char szDir[512]; char szDir2[512]; char h**o[256]; printf("TeknoBorg - Star Trek Borg Modernizer\nFor Borg.exe only!\nhttp://www.teknogods.com - Modding Gurus!\nSupported OS: Windows XP x86/x64, Windows Vista x86/x64, Windows 7 x86/x64\nCode: Reaver\n"); GetCurrentDirectoryA(400, szDir); sprintf_s(szDir2, "%s\\TeknoBorg.dll", szDir); hFind = FindFirstFile("borg.exe", &filedata); if(hFind == INVALID_HANDLE_VALUE) { printf("Unable to find borg.exe"); _getch(); return 1; } else { printf("borg.exe found, starting process\n"); FilePEFile = getPEFileInformation("borg.exe"); if( !CreateProcess( "borg.exe", // No module name (use command line). argv[1], // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. CREATE_SUSPENDED | CREATE_NEW_PROCESS_GROUP, // suspended creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) { printf("Failed to load process!"); _getch(); return 1; } mycontext.ContextFlags = 0x00010000+1+2+4+8+0x10; GetThreadContext(pi.hThread, &mycontext); Sleep(1000); if(!RunTo(FilePEFile.image_nt_headers.OptionalHeader.AddressOfEntryPoint + FilePEFile.image_nt_headers.OptionalHeader.ImageBase,1,0)) { printf("Failed to run the process"); TerminateProcess(pi.hProcess, 0); _getch(); return 1; } sprintf(h**o, "Tekno%08x", pi.dwProcessId ^ 0x60); CreateMutex(0, true, h**o); if(!LoadHookDLL()) { TerminateProcess(pi.hProcess, 0); _getch(); return 1; } printf("Resuming game!\n"); ResumeThread(pi.hThread); while(GetThreadContext(pi.hThread, &mycontext)) Sleep(2000); printf("Reaver thanks you for using this tool!\n"); _getch(); } }