XexExecutableModuleHandle export now points to the executing HMODULE

This commit is contained in:
Dr. Chat
2015-06-27 23:17:56 -05:00
parent 944b39c51d
commit bb900ba9db
3 changed files with 23 additions and 46 deletions

View File

@@ -89,17 +89,9 @@ XboxkrnlModule::XboxkrnlModule(Emulator* emulator, KernelState* kernel_state)
// 0x80101058 <- pointer to xex header
// 0x80101100 <- xex header base
uint32_t ppXexExecutableModuleHandle = memory_->SystemHeapAlloc(4);
auto lppXexExecutableModuleHandle =
memory_->TranslateVirtual(ppXexExecutableModuleHandle);
export_resolver_->SetVariableMapping("xboxkrnl.exe",
ordinals::XexExecutableModuleHandle,
ppXexExecutableModuleHandle);
uint32_t pXexExecutableModuleHandle = memory_->SystemHeapAlloc(256);
auto lpXexExecutableModuleHandle =
memory_->TranslateVirtual(pXexExecutableModuleHandle);
xe::store_and_swap<uint32_t>(lppXexExecutableModuleHandle,
pXexExecutableModuleHandle);
xe::store_and_swap<uint32_t>(lpXexExecutableModuleHandle + 0x58, 0x80101100);
// ExLoadedCommandLine (char*)
// The name of the xex. Not sure this is ever really used on real devices.