Quick fix for RtlImageXexHeaderField - still some more to do.
This commit is contained in:
parent
e772a8cb92
commit
996f99bd85
|
@ -196,11 +196,12 @@ void KernelState::SetExecutableModule(object_ref<XUserModule> module) {
|
||||||
// Setup the kernel's XexExecutableModuleHandle field.
|
// Setup the kernel's XexExecutableModuleHandle field.
|
||||||
auto export = processor()->export_resolver()->GetExportByOrdinal(
|
auto export = processor()->export_resolver()->GetExportByOrdinal(
|
||||||
"xboxkrnl.exe", ordinals::XexExecutableModuleHandle);
|
"xboxkrnl.exe", ordinals::XexExecutableModuleHandle);
|
||||||
assert_not_null(export);
|
if (export) {
|
||||||
assert_not_zero(export->variable_ptr);
|
assert_not_zero(export->variable_ptr);
|
||||||
auto variable_ptr =
|
auto variable_ptr =
|
||||||
memory()->TranslateVirtual<xe::be<uint32_t>*>(export->variable_ptr);
|
memory()->TranslateVirtual<xe::be<uint32_t>*>(export->variable_ptr);
|
||||||
*variable_ptr = executable_module_->hmodule_ptr();
|
*variable_ptr = executable_module_->hmodule_ptr();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KernelState::LoadKernelModule(object_ref<XKernelModule> kernel_module) {
|
void KernelState::LoadKernelModule(object_ref<XKernelModule> kernel_module) {
|
||||||
|
|
|
@ -390,17 +390,16 @@ SHIM_CALL RtlImageXexHeaderField_shim(PPCContext* ppc_context,
|
||||||
auto header =
|
auto header =
|
||||||
kernel_memory()->TranslateVirtual<xex2_header*>(xex_header_base);
|
kernel_memory()->TranslateVirtual<xex2_header*>(xex_header_base);
|
||||||
if (!header) {
|
if (!header) {
|
||||||
SHIM_SET_RETURN_32(X_STATUS_UNSUCCESSFUL);
|
SHIM_SET_RETURN_32(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* hdr = xex2_get_opt_header(header, image_field);
|
uint8_t* field_ptr = xex2_get_opt_header(header, image_field);
|
||||||
if (!hdr) {
|
if (!field_ptr) {
|
||||||
SHIM_SET_RETURN_32(X_STATUS_NOT_FOUND);
|
SHIM_SET_RETURN_32(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
SHIM_SET_RETURN_32(uint32_t(field_ptr - kernel_memory()->virtual_membase()));
|
||||||
SHIM_SET_RETURN_32((uint32_t)(hdr - kernel_memory()->virtual_membase()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unfortunately the Windows RTL_CRITICAL_SECTION object is bigger than the one
|
// Unfortunately the Windows RTL_CRITICAL_SECTION object is bigger than the one
|
||||||
|
|
Loading…
Reference in New Issue