Drop dependency on old-style xex2 headers

This commit is contained in:
Dr. Chat
2015-06-29 01:39:07 -05:00
parent fe87c08424
commit 029babaf5d
9 changed files with 141 additions and 58 deletions

View File

@@ -78,6 +78,18 @@ bool XexModule::GetOptHeader(const xex2_header* header, xe_xex2_header_keys key,
return false;
}
bool XexModule::GetOptHeader(xe_xex2_header_keys key, void** out_ptr) const {
return XexModule::GetOptHeader(xex_header_, key, out_ptr);
}
uint32_t XexModule::GetProcAddress(uint16_t ordinal) const {
return xe_xex2_lookup_export(xex_, ordinal);
}
uint32_t XexModule::GetProcAddress(const char* name) const {
return xe_xex2_lookup_export(xex_, name);
}
bool XexModule::ApplyPatch(XexModule* module) {
auto header = reinterpret_cast<const xex2_header*>(module->xex_header());
if (!(header->module_flags &

View File

@@ -40,6 +40,10 @@ class XexModule : public xe::cpu::Module {
// not a pointer!
static bool GetOptHeader(const xex2_header* header, xe_xex2_header_keys key,
void** out_ptr);
bool GetOptHeader(xe_xex2_header_keys key, void** out_ptr) const;
uint32_t GetProcAddress(uint16_t ordinal) const;
uint32_t GetProcAddress(const char* name) const;
bool ApplyPatch(XexModule* module);
bool Load(const std::string& name, const std::string& path,