2014-01-12 01:24:09 +00:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
* Xenia : Xbox 360 Emulator Research Project *
|
|
|
|
******************************************************************************
|
|
|
|
* Copyright 2013 Ben Vanik. All rights reserved. *
|
|
|
|
* Released under the BSD license - see LICENSE in the root for more details. *
|
|
|
|
******************************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef XENIA_KERNEL_XBOXKRNL_XUSER_MODULE_H_
|
|
|
|
#define XENIA_KERNEL_XBOXKRNL_XUSER_MODULE_H_
|
|
|
|
|
2015-05-09 07:56:42 +00:00
|
|
|
#include <string>
|
2014-01-12 01:24:09 +00:00
|
|
|
|
2015-05-02 09:11:11 +00:00
|
|
|
#include "xenia/cpu/export_resolver.h"
|
2015-05-09 07:56:42 +00:00
|
|
|
#include "xenia/kernel/objects/xmodule.h"
|
2015-02-01 06:49:47 +00:00
|
|
|
#include "xenia/kernel/util/xex2.h"
|
|
|
|
#include "xenia/xbox.h"
|
2014-01-12 01:24:09 +00:00
|
|
|
|
|
|
|
namespace xe {
|
|
|
|
namespace kernel {
|
|
|
|
|
|
|
|
class XUserModule : public XModule {
|
2014-08-17 20:13:03 +00:00
|
|
|
public:
|
2014-01-12 01:24:09 +00:00
|
|
|
XUserModule(KernelState* kernel_state, const char* path);
|
2015-05-06 01:52:37 +00:00
|
|
|
~XUserModule() override;
|
2014-01-12 01:24:09 +00:00
|
|
|
|
|
|
|
xe_xex2_ref xex();
|
|
|
|
const xe_xex2_header_t* xex_header();
|
|
|
|
|
2015-05-09 07:56:42 +00:00
|
|
|
X_STATUS LoadFromFile(std::string path);
|
2014-01-12 01:24:09 +00:00
|
|
|
X_STATUS LoadFromMemory(const void* addr, const size_t length);
|
|
|
|
|
2015-05-06 01:52:37 +00:00
|
|
|
uint32_t GetProcAddressByOrdinal(uint16_t ordinal) override;
|
|
|
|
uint32_t GetProcAddressByName(const char* name) override;
|
|
|
|
X_STATUS GetSection(const char* name, uint32_t* out_section_data,
|
|
|
|
uint32_t* out_section_size) override;
|
2015-06-28 03:41:09 +00:00
|
|
|
X_STATUS GetOptHeader(xe_xex2_header_keys key, uint32_t* out_header_guest_ptr);
|
2014-01-12 01:24:09 +00:00
|
|
|
|
|
|
|
X_STATUS Launch(uint32_t flags);
|
|
|
|
|
|
|
|
void Dump();
|
|
|
|
|
2014-08-17 20:13:03 +00:00
|
|
|
private:
|
|
|
|
xe_xex2_ref xex_;
|
2015-06-28 03:00:58 +00:00
|
|
|
uint32_t xex_header_;
|
2014-01-12 01:24:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace kernel
|
|
|
|
} // namespace xe
|
|
|
|
|
|
|
|
#endif // XENIA_KERNEL_XBOXKRNL_XUSER_MODULE_H_
|