xb format --all (we are now format clean). Buildbot will yell at you.
This commit is contained in:
@@ -302,7 +302,7 @@ X_RESULT XXMPApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
|
||||
playlist_name = L"";
|
||||
} else {
|
||||
playlist_name = xe::load_and_swap<std::wstring>(
|
||||
memory_->TranslateVirtual(playlist_name_ptr));
|
||||
memory_->TranslateVirtual(playlist_name_ptr));
|
||||
}
|
||||
// dummy_alloc_ptr is the result of a XamAlloc of storage_size.
|
||||
assert_true(storage_size == 4 + song_count * 128);
|
||||
|
||||
@@ -20,7 +20,8 @@ Device::Device(const std::string& path) : path_(path) {}
|
||||
Device::~Device() = default;
|
||||
|
||||
// TODO(gibbed): make virtual + move implementation into HostPathDevice/etc.
|
||||
X_STATUS Device::QueryVolumeInfo(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length) {
|
||||
X_STATUS Device::QueryVolumeInfo(X_FILE_FS_VOLUME_INFORMATION* out_info,
|
||||
size_t length) {
|
||||
assert_not_null(out_info);
|
||||
const char* name = "test"; // TODO(gibbed): actual value
|
||||
|
||||
@@ -39,17 +40,19 @@ X_STATUS Device::QueryVolumeInfo(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t
|
||||
}
|
||||
|
||||
// TODO(gibbed): make virtual + move implementation into HostPathDevice/etc.
|
||||
X_STATUS Device::QuerySizeInfo(X_FILE_FS_SIZE_INFORMATION* out_info, size_t length) {
|
||||
X_STATUS Device::QuerySizeInfo(X_FILE_FS_SIZE_INFORMATION* out_info,
|
||||
size_t length) {
|
||||
assert_not_null(out_info);
|
||||
out_info->total_allocation_units = 1234; // TODO(gibbed): actual value
|
||||
out_info->available_allocation_units = 0; // TODO(gibbed): actual value
|
||||
out_info->total_allocation_units = 1234; // TODO(gibbed): actual value
|
||||
out_info->available_allocation_units = 0; // TODO(gibbed): actual value
|
||||
out_info->sectors_per_allocation_unit = 1; // TODO(gibbed): actual value
|
||||
out_info->bytes_per_sector = 1024; // TODO(gibbed): actual value
|
||||
out_info->bytes_per_sector = 1024; // TODO(gibbed): actual value
|
||||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// TODO(gibbed): make virtual + move implementation into HostPathDevice/etc.
|
||||
X_STATUS Device::QueryAttributeInfo(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info, size_t length) {
|
||||
X_STATUS Device::QueryAttributeInfo(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info,
|
||||
size_t length) {
|
||||
assert_not_null(out_info);
|
||||
const char* name = "test"; // TODO(gibbed): actual value
|
||||
|
||||
|
||||
@@ -30,9 +30,12 @@ class Device {
|
||||
|
||||
virtual std::unique_ptr<Entry> ResolvePath(const char* path) = 0;
|
||||
|
||||
virtual X_STATUS QueryVolumeInfo(X_FILE_FS_VOLUME_INFORMATION* out_info, size_t length);
|
||||
virtual X_STATUS QuerySizeInfo(X_FILE_FS_SIZE_INFORMATION* out_info, size_t length);
|
||||
virtual X_STATUS QueryAttributeInfo(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info, size_t length);
|
||||
virtual X_STATUS QueryVolumeInfo(X_FILE_FS_VOLUME_INFORMATION* out_info,
|
||||
size_t length);
|
||||
virtual X_STATUS QuerySizeInfo(X_FILE_FS_SIZE_INFORMATION* out_info,
|
||||
size_t length);
|
||||
virtual X_STATUS QueryAttributeInfo(X_FILE_FS_ATTRIBUTE_INFORMATION* out_info,
|
||||
size_t length);
|
||||
|
||||
protected:
|
||||
std::string path_;
|
||||
|
||||
@@ -47,8 +47,9 @@ X_STATUS DiscImageEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
X_STATUS DiscImageEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
X_STATUS DiscImageEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) {
|
||||
assert_not_null(out_info);
|
||||
|
||||
GDFXEntry* entry(nullptr);
|
||||
|
||||
@@ -35,8 +35,9 @@ X_STATUS DiscImageFile::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
return entry_->QueryInfo(out_info);
|
||||
}
|
||||
|
||||
X_STATUS DiscImageFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
X_STATUS DiscImageFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) {
|
||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,9 @@ X_STATUS HostPathEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
X_STATUS HostPathEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
X_STATUS HostPathEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) {
|
||||
assert_not_null(out_info);
|
||||
|
||||
WIN32_FIND_DATA ffd;
|
||||
|
||||
@@ -35,8 +35,9 @@ X_STATUS HostPathFile::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
return entry_->QueryInfo(out_info);
|
||||
}
|
||||
|
||||
X_STATUS HostPathFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
X_STATUS HostPathFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) {
|
||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ STFSContainerEntry::STFSContainerEntry(Device* device, const char* path,
|
||||
|
||||
STFSContainerEntry::~STFSContainerEntry() = default;
|
||||
|
||||
X_STATUS STFSContainerEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
X_STATUS STFSContainerEntry::QueryInfo(
|
||||
X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
assert_not_null(out_info);
|
||||
out_info->creation_time = stfs_entry_->update_timestamp;
|
||||
out_info->last_access_time = stfs_entry_->access_timestamp;
|
||||
@@ -38,10 +39,9 @@ X_STATUS STFSContainerEntry::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info
|
||||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
X_STATUS STFSContainerEntry::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length,
|
||||
const char* file_name,
|
||||
bool restart) {
|
||||
X_STATUS STFSContainerEntry::QueryDirectory(
|
||||
X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
assert_not_null(out_info);
|
||||
|
||||
STFSEntry* entry(nullptr);
|
||||
|
||||
@@ -31,13 +31,14 @@ const std::string& STFSContainerFile::name() const { return entry_->name(); }
|
||||
|
||||
Device* STFSContainerFile::device() const { return entry_->device(); }
|
||||
|
||||
X_STATUS STFSContainerFile::QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
X_STATUS STFSContainerFile::QueryInfo(
|
||||
X_FILE_NETWORK_OPEN_INFORMATION* out_info) {
|
||||
return entry_->QueryInfo(out_info);
|
||||
}
|
||||
|
||||
X_STATUS STFSContainerFile::QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) {
|
||||
X_STATUS STFSContainerFile::QueryDirectory(
|
||||
X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) {
|
||||
return entry_->QueryDirectory(out_info, length, file_name, restart);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,8 +65,9 @@ class Entry {
|
||||
bool is_read_only() const;
|
||||
|
||||
virtual X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) = 0;
|
||||
virtual X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) = 0;
|
||||
virtual X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) = 0;
|
||||
|
||||
virtual bool can_map() { return false; }
|
||||
|
||||
|
||||
@@ -187,7 +187,8 @@ std::unique_ptr<Entry> FileSystem::ResolvePath(const std::string& path) {
|
||||
}
|
||||
}
|
||||
|
||||
XELOGE("ResolvePath(%s) failed - device not found (%s)", path.c_str(), device_path.c_str());
|
||||
XELOGE("ResolvePath(%s) failed - device not found (%s)", path.c_str(),
|
||||
device_path.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ namespace xe {
|
||||
namespace kernel {
|
||||
namespace fs {
|
||||
|
||||
#define XEGETUINT24BE(p) \
|
||||
(((uint32_t)xe::load_and_swap<uint8_t>((p)+0) << 16) | \
|
||||
((uint32_t)xe::load_and_swap<uint8_t>((p)+1) << 8) | \
|
||||
(uint32_t)xe::load_and_swap<uint8_t>((p)+2))
|
||||
#define XEGETUINT24LE(p) \
|
||||
(((uint32_t)xe::load<uint8_t>((p)+2) << 16) | \
|
||||
((uint32_t)xe::load<uint8_t>((p)+1) << 8) | \
|
||||
(uint32_t)xe::load<uint8_t>((p)+0))
|
||||
#define XEGETUINT24BE(p) \
|
||||
(((uint32_t)xe::load_and_swap<uint8_t>((p) + 0) << 16) | \
|
||||
((uint32_t)xe::load_and_swap<uint8_t>((p) + 1) << 8) | \
|
||||
(uint32_t)xe::load_and_swap<uint8_t>((p) + 2))
|
||||
#define XEGETUINT24LE(p) \
|
||||
(((uint32_t)xe::load<uint8_t>((p) + 2) << 16) | \
|
||||
((uint32_t)xe::load<uint8_t>((p) + 1) << 8) | \
|
||||
(uint32_t)xe::load<uint8_t>((p) + 0))
|
||||
|
||||
bool STFSVolumeDescriptor::Read(const uint8_t* p) {
|
||||
descriptor_size = xe::load_and_swap<uint8_t>(p + 0x00);
|
||||
|
||||
@@ -70,7 +70,7 @@ X_STATUS ObjectTable::FindFreeSlot(uint32_t* out_slot) {
|
||||
// Zero out new memory.
|
||||
if (new_table_size > old_table_size) {
|
||||
std::memset(reinterpret_cast<uint8_t*>(new_table) + old_table_size, 0,
|
||||
new_table_size - old_table_size);
|
||||
new_table_size - old_table_size);
|
||||
}
|
||||
last_free_entry_ = table_capacity_;
|
||||
table_capacity_ = new_table_capacity;
|
||||
@@ -120,7 +120,7 @@ X_STATUS ObjectTable::DuplicateHandle(X_HANDLE handle, X_HANDLE* out_handle) {
|
||||
XObject* object = LookupObject(handle, false);
|
||||
if (object) {
|
||||
result = AddHandle(object, out_handle);
|
||||
object->Release(); // Release the ref that LookupObject took
|
||||
object->Release(); // Release the ref that LookupObject took
|
||||
} else {
|
||||
result = X_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
@@ -145,8 +145,9 @@ class XFile : public XObject {
|
||||
void set_position(size_t value) { position_ = value; }
|
||||
|
||||
virtual X_STATUS QueryInfo(X_FILE_NETWORK_OPEN_INFORMATION* out_info) = 0;
|
||||
virtual X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info, size_t length,
|
||||
const char* file_name, bool restart) = 0;
|
||||
virtual X_STATUS QueryDirectory(X_FILE_DIRECTORY_INFORMATION* out_info,
|
||||
size_t length, const char* file_name,
|
||||
bool restart) = 0;
|
||||
|
||||
X_STATUS Read(void* buffer, size_t buffer_length, size_t byte_offset,
|
||||
size_t* out_bytes_read);
|
||||
|
||||
@@ -169,7 +169,8 @@ X_STATUS XThread::Create() {
|
||||
uint32_t tls_extended_size = 0;
|
||||
if (module && module->xex_header()) {
|
||||
const xe_xex2_header_t* header = module->xex_header();
|
||||
tls_slots = header->tls_info.slot_count ? header->tls_info.slot_count : kDefaultTlsSlotCount;
|
||||
tls_slots = header->tls_info.slot_count ? header->tls_info.slot_count
|
||||
: kDefaultTlsSlotCount;
|
||||
tls_extended_size = header->tls_info.data_size;
|
||||
} else {
|
||||
tls_slots = kDefaultTlsSlotCount;
|
||||
@@ -179,7 +180,7 @@ X_STATUS XThread::Create() {
|
||||
// HACK: we're currently not using the extra memory allocated for TLS slots
|
||||
// and instead relying on native TLS slots, so don't allocate anything for
|
||||
// the slots.
|
||||
uint32_t tls_slot_size = 0; // tls_slots * 4;
|
||||
uint32_t tls_slot_size = 0; // tls_slots * 4;
|
||||
uint32_t tls_total_size = tls_slot_size + tls_extended_size;
|
||||
tls_address_ = memory()->SystemHeapAlloc(tls_total_size);
|
||||
if (!tls_address_) {
|
||||
@@ -193,8 +194,7 @@ X_STATUS XThread::Create() {
|
||||
// If game has extended data, copy in the default values.
|
||||
const xe_xex2_header_t* header = module->xex_header();
|
||||
assert_not_zero(header->tls_info.raw_data_address);
|
||||
memory()->Copy(tls_address_,
|
||||
header->tls_info.raw_data_address,
|
||||
memory()->Copy(tls_address_, header->tls_info.raw_data_address,
|
||||
header->tls_info.raw_data_size);
|
||||
}
|
||||
|
||||
@@ -271,8 +271,8 @@ X_STATUS XThread::Create() {
|
||||
struct XTEB {
|
||||
xe::be<uint32_t> unk_00; // 0x0
|
||||
xe::be<uint32_t> unk_04; // 0x4
|
||||
X_LIST_ENTRY unk_08; // 0x8
|
||||
X_LIST_ENTRY unk_10; // 0x10
|
||||
X_LIST_ENTRY unk_08; // 0x8
|
||||
X_LIST_ENTRY unk_10; // 0x10
|
||||
};
|
||||
|
||||
// Setup the thread state block (last error/etc)
|
||||
@@ -373,11 +373,10 @@ static uint32_t __stdcall XThreadStartCallbackWin32(void* param) {
|
||||
X_STATUS XThread::PlatformCreate() {
|
||||
Retain();
|
||||
bool suspended = creation_params_.creation_flags & 0x1;
|
||||
const size_t kStackSize = 16 * 1024 * 1024; // let's do the stupid thing
|
||||
thread_handle_ =
|
||||
CreateThread(NULL, kStackSize,
|
||||
(LPTHREAD_START_ROUTINE)XThreadStartCallbackWin32,
|
||||
this, suspended ? CREATE_SUSPENDED : 0, NULL);
|
||||
const size_t kStackSize = 16 * 1024 * 1024; // let's do the stupid thing
|
||||
thread_handle_ = CreateThread(
|
||||
NULL, kStackSize, (LPTHREAD_START_ROUTINE)XThreadStartCallbackWin32, this,
|
||||
suspended ? CREATE_SUSPENDED : 0, NULL);
|
||||
if (!thread_handle_) {
|
||||
uint32_t last_error = GetLastError();
|
||||
// TODO(benvanik): translate?
|
||||
|
||||
@@ -64,7 +64,7 @@ struct XAPC {
|
||||
struct X_THREAD {
|
||||
X_DISPATCH_HEADER header;
|
||||
xe::be<uint64_t> cycle_time;
|
||||
xe::be<uint32_t> high_cycle_time; // FIXME: Needed?
|
||||
xe::be<uint32_t> high_cycle_time; // FIXME: Needed?
|
||||
xe::be<uint64_t> quantum_target;
|
||||
xe::be<uint32_t> initial_stack_ptr;
|
||||
xe::be<uint32_t> stack_limit_ptr;
|
||||
@@ -166,14 +166,14 @@ class XThread : public XObject {
|
||||
};
|
||||
|
||||
class XHostThread : public XThread {
|
||||
public:
|
||||
XHostThread(KernelState* kernel_state, uint32_t stack_size,
|
||||
uint32_t creation_flags, std::function<int()> host_fn);
|
||||
public:
|
||||
XHostThread(KernelState* kernel_state, uint32_t stack_size,
|
||||
uint32_t creation_flags, std::function<int()> host_fn);
|
||||
|
||||
virtual void Execute();
|
||||
virtual void Execute();
|
||||
|
||||
private:
|
||||
std::function<int()> host_fn_;
|
||||
private:
|
||||
std::function<int()> host_fn_;
|
||||
};
|
||||
|
||||
} // namespace kernel
|
||||
|
||||
@@ -66,9 +66,10 @@ class UserProfile {
|
||||
Int32Setting(uint32_t setting_id, int32_t value)
|
||||
: Setting(setting_id, Type::INT32, 4), value(value) {}
|
||||
int32_t value;
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
xe::store_and_swap<int32_t>(user_data + kValueOffset, value);
|
||||
return buffer_offset;
|
||||
}
|
||||
@@ -77,9 +78,10 @@ class UserProfile {
|
||||
Int64Setting(uint32_t setting_id, int64_t value)
|
||||
: Setting(setting_id, Type::INT64, 8), value(value) {}
|
||||
int64_t value;
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
xe::store_and_swap<int64_t>(user_data + kValueOffset, value);
|
||||
return buffer_offset;
|
||||
}
|
||||
@@ -88,9 +90,10 @@ class UserProfile {
|
||||
DoubleSetting(uint32_t setting_id, double value)
|
||||
: Setting(setting_id, Type::DOUBLE, 8), value(value) {}
|
||||
double value;
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
xe::store_and_swap<double>(user_data + kValueOffset, value);
|
||||
return buffer_offset;
|
||||
}
|
||||
@@ -102,9 +105,10 @@ class UserProfile {
|
||||
size_t extra_size() const override {
|
||||
return value.empty() ? 0 : 2 * (static_cast<int32_t>(value.size()) + 1);
|
||||
}
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
int32_t length;
|
||||
if (value.empty()) {
|
||||
length = 0;
|
||||
@@ -113,8 +117,9 @@ class UserProfile {
|
||||
} else {
|
||||
length = 2 * (static_cast<int32_t>(value.size()) + 1);
|
||||
xe::store_and_swap<int32_t>(user_data + kValueOffset, length);
|
||||
xe::store_and_swap<uint32_t>(user_data + kPointerOffset,
|
||||
buffer_ptr + static_cast<uint32_t>(buffer_offset));
|
||||
xe::store_and_swap<uint32_t>(
|
||||
user_data + kPointerOffset,
|
||||
buffer_ptr + static_cast<uint32_t>(buffer_offset));
|
||||
memcpy(buffer + buffer_offset, value.data(), length);
|
||||
}
|
||||
return buffer_offset + length;
|
||||
@@ -124,9 +129,10 @@ class UserProfile {
|
||||
FloatSetting(uint32_t setting_id, float value)
|
||||
: Setting(setting_id, Type::FLOAT, 4), value(value) {}
|
||||
float value;
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
xe::store_and_swap<float>(user_data + kValueOffset, value);
|
||||
return buffer_offset;
|
||||
}
|
||||
@@ -138,9 +144,10 @@ class UserProfile {
|
||||
size_t extra_size() const override {
|
||||
return static_cast<int32_t>(value.size());
|
||||
}
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
int32_t length;
|
||||
if (value.empty()) {
|
||||
length = 0;
|
||||
@@ -149,8 +156,9 @@ class UserProfile {
|
||||
} else {
|
||||
length = static_cast<int32_t>(value.size());
|
||||
xe::store_and_swap<int32_t>(user_data + kValueOffset, length);
|
||||
xe::store_and_swap<uint32_t>(user_data + kPointerOffset,
|
||||
buffer_ptr + static_cast<uint32_t>(buffer_offset));
|
||||
xe::store_and_swap<uint32_t>(
|
||||
user_data + kPointerOffset,
|
||||
buffer_ptr + static_cast<uint32_t>(buffer_offset));
|
||||
memcpy(buffer + buffer_offset, value.data(), length);
|
||||
}
|
||||
return buffer_offset + length;
|
||||
@@ -160,9 +168,10 @@ class UserProfile {
|
||||
DateTimeSetting(uint32_t setting_id, int64_t value)
|
||||
: Setting(setting_id, Type::DATETIME, 8), value(value) {}
|
||||
int64_t value;
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer,
|
||||
uint32_t buffer_ptr, size_t buffer_offset) override {
|
||||
buffer_offset = Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
size_t Append(uint8_t* user_data, uint8_t* buffer, uint32_t buffer_ptr,
|
||||
size_t buffer_offset) override {
|
||||
buffer_offset =
|
||||
Setting::Append(user_data, buffer, buffer_ptr, buffer_offset);
|
||||
xe::store_and_swap<int64_t>(user_data + kValueOffset, value);
|
||||
return buffer_offset;
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header,
|
||||
return 1;
|
||||
}
|
||||
uint8_t *buffer = memory->TranslateVirtual(header->exe_address);
|
||||
std::memset(buffer, 0, total_size); // Quickly zero the contents.
|
||||
std::memset(buffer, 0, total_size); // Quickly zero the contents.
|
||||
uint8_t *d = buffer;
|
||||
|
||||
uint32_t rk[4 * (MAXNR + 1)];
|
||||
|
||||
@@ -13,82 +13,82 @@
|
||||
#include <cstdint>
|
||||
|
||||
typedef enum {
|
||||
XEX_HEADER_RESOURCE_INFO = 0x000002FF,
|
||||
XEX_HEADER_FILE_FORMAT_INFO = 0x000003FF,
|
||||
XEX_HEADER_DELTA_PATCH_DESCRIPTOR = 0x000005FF,
|
||||
XEX_HEADER_BASE_REFERENCE = 0x00000405,
|
||||
XEX_HEADER_BOUNDING_PATH = 0x000080FF,
|
||||
XEX_HEADER_DEVICE_ID = 0x00008105,
|
||||
XEX_HEADER_ORIGINAL_BASE_ADDRESS = 0x00010001,
|
||||
XEX_HEADER_ENTRY_POINT = 0x00010100,
|
||||
XEX_HEADER_IMAGE_BASE_ADDRESS = 0x00010201,
|
||||
XEX_HEADER_IMPORT_LIBRARIES = 0x000103FF,
|
||||
XEX_HEADER_CHECKSUM_TIMESTAMP = 0x00018002,
|
||||
XEX_HEADER_ENABLED_FOR_CALLCAP = 0x00018102,
|
||||
XEX_HEADER_ENABLED_FOR_FASTCAP = 0x00018200,
|
||||
XEX_HEADER_ORIGINAL_PE_NAME = 0x000183FF,
|
||||
XEX_HEADER_STATIC_LIBRARIES = 0x000200FF,
|
||||
XEX_HEADER_TLS_INFO = 0x00020104,
|
||||
XEX_HEADER_DEFAULT_STACK_SIZE = 0x00020200,
|
||||
XEX_HEADER_DEFAULT_FILESYSTEM_CACHE_SIZE = 0x00020301,
|
||||
XEX_HEADER_DEFAULT_HEAP_SIZE = 0x00020401,
|
||||
XEX_HEADER_PAGE_HEAP_SIZE_AND_FLAGS = 0x00028002,
|
||||
XEX_HEADER_SYSTEM_FLAGS = 0x00030000,
|
||||
XEX_HEADER_EXECUTION_INFO = 0x00040006,
|
||||
XEX_HEADER_TITLE_WORKSPACE_SIZE = 0x00040201,
|
||||
XEX_HEADER_GAME_RATINGS = 0x00040310,
|
||||
XEX_HEADER_LAN_KEY = 0x00040404,
|
||||
XEX_HEADER_XBOX360_LOGO = 0x000405FF,
|
||||
XEX_HEADER_MULTIDISC_MEDIA_IDS = 0x000406FF,
|
||||
XEX_HEADER_ALTERNATE_TITLE_IDS = 0x000407FF,
|
||||
XEX_HEADER_ADDITIONAL_TITLE_MEMORY = 0x00040801,
|
||||
XEX_HEADER_EXPORTS_BY_NAME = 0x00E10402,
|
||||
XEX_HEADER_RESOURCE_INFO = 0x000002FF,
|
||||
XEX_HEADER_FILE_FORMAT_INFO = 0x000003FF,
|
||||
XEX_HEADER_DELTA_PATCH_DESCRIPTOR = 0x000005FF,
|
||||
XEX_HEADER_BASE_REFERENCE = 0x00000405,
|
||||
XEX_HEADER_BOUNDING_PATH = 0x000080FF,
|
||||
XEX_HEADER_DEVICE_ID = 0x00008105,
|
||||
XEX_HEADER_ORIGINAL_BASE_ADDRESS = 0x00010001,
|
||||
XEX_HEADER_ENTRY_POINT = 0x00010100,
|
||||
XEX_HEADER_IMAGE_BASE_ADDRESS = 0x00010201,
|
||||
XEX_HEADER_IMPORT_LIBRARIES = 0x000103FF,
|
||||
XEX_HEADER_CHECKSUM_TIMESTAMP = 0x00018002,
|
||||
XEX_HEADER_ENABLED_FOR_CALLCAP = 0x00018102,
|
||||
XEX_HEADER_ENABLED_FOR_FASTCAP = 0x00018200,
|
||||
XEX_HEADER_ORIGINAL_PE_NAME = 0x000183FF,
|
||||
XEX_HEADER_STATIC_LIBRARIES = 0x000200FF,
|
||||
XEX_HEADER_TLS_INFO = 0x00020104,
|
||||
XEX_HEADER_DEFAULT_STACK_SIZE = 0x00020200,
|
||||
XEX_HEADER_DEFAULT_FILESYSTEM_CACHE_SIZE = 0x00020301,
|
||||
XEX_HEADER_DEFAULT_HEAP_SIZE = 0x00020401,
|
||||
XEX_HEADER_PAGE_HEAP_SIZE_AND_FLAGS = 0x00028002,
|
||||
XEX_HEADER_SYSTEM_FLAGS = 0x00030000,
|
||||
XEX_HEADER_EXECUTION_INFO = 0x00040006,
|
||||
XEX_HEADER_TITLE_WORKSPACE_SIZE = 0x00040201,
|
||||
XEX_HEADER_GAME_RATINGS = 0x00040310,
|
||||
XEX_HEADER_LAN_KEY = 0x00040404,
|
||||
XEX_HEADER_XBOX360_LOGO = 0x000405FF,
|
||||
XEX_HEADER_MULTIDISC_MEDIA_IDS = 0x000406FF,
|
||||
XEX_HEADER_ALTERNATE_TITLE_IDS = 0x000407FF,
|
||||
XEX_HEADER_ADDITIONAL_TITLE_MEMORY = 0x00040801,
|
||||
XEX_HEADER_EXPORTS_BY_NAME = 0x00E10402,
|
||||
} xe_xex2_header_keys;
|
||||
|
||||
typedef enum {
|
||||
XEX_MODULE_TITLE = 0x00000001,
|
||||
XEX_MODULE_EXPORTS_TO_TITLE = 0x00000002,
|
||||
XEX_MODULE_SYSTEM_DEBUGGER = 0x00000004,
|
||||
XEX_MODULE_DLL_MODULE = 0x00000008,
|
||||
XEX_MODULE_MODULE_PATCH = 0x00000010,
|
||||
XEX_MODULE_PATCH_FULL = 0x00000020,
|
||||
XEX_MODULE_PATCH_DELTA = 0x00000040,
|
||||
XEX_MODULE_USER_MODE = 0x00000080,
|
||||
XEX_MODULE_TITLE = 0x00000001,
|
||||
XEX_MODULE_EXPORTS_TO_TITLE = 0x00000002,
|
||||
XEX_MODULE_SYSTEM_DEBUGGER = 0x00000004,
|
||||
XEX_MODULE_DLL_MODULE = 0x00000008,
|
||||
XEX_MODULE_MODULE_PATCH = 0x00000010,
|
||||
XEX_MODULE_PATCH_FULL = 0x00000020,
|
||||
XEX_MODULE_PATCH_DELTA = 0x00000040,
|
||||
XEX_MODULE_USER_MODE = 0x00000080,
|
||||
} xe_xex2_module_flags;
|
||||
|
||||
typedef enum {
|
||||
XEX_SYSTEM_NO_FORCED_REBOOT = 0x00000001,
|
||||
XEX_SYSTEM_FOREGROUND_TASKS = 0x00000002,
|
||||
XEX_SYSTEM_NO_ODD_MAPPING = 0x00000004,
|
||||
XEX_SYSTEM_HANDLE_MCE_INPUT = 0x00000008,
|
||||
XEX_SYSTEM_RESTRICTED_HUD_FEATURES = 0x00000010,
|
||||
XEX_SYSTEM_HANDLE_GAMEPAD_DISCONNECT = 0x00000020,
|
||||
XEX_SYSTEM_INSECURE_SOCKETS = 0x00000040,
|
||||
XEX_SYSTEM_XBOX1_INTEROPERABILITY = 0x00000080,
|
||||
XEX_SYSTEM_DASH_CONTEXT = 0x00000100,
|
||||
XEX_SYSTEM_USES_GAME_VOICE_CHANNEL = 0x00000200,
|
||||
XEX_SYSTEM_PAL50_INCOMPATIBLE = 0x00000400,
|
||||
XEX_SYSTEM_INSECURE_UTILITY_DRIVE = 0x00000800,
|
||||
XEX_SYSTEM_XAM_HOOKS = 0x00001000,
|
||||
XEX_SYSTEM_ACCESS_PII = 0x00002000,
|
||||
XEX_SYSTEM_CROSS_PLATFORM_SYSTEM_LINK = 0x00004000,
|
||||
XEX_SYSTEM_MULTIDISC_SWAP = 0x00008000,
|
||||
XEX_SYSTEM_MULTIDISC_INSECURE_MEDIA = 0x00010000,
|
||||
XEX_SYSTEM_AP25_MEDIA = 0x00020000,
|
||||
XEX_SYSTEM_NO_CONFIRM_EXIT = 0x00040000,
|
||||
XEX_SYSTEM_ALLOW_BACKGROUND_DOWNLOAD = 0x00080000,
|
||||
XEX_SYSTEM_CREATE_PERSISTABLE_RAMDRIVE = 0x00100000,
|
||||
XEX_SYSTEM_INHERIT_PERSISTENT_RAMDRIVE = 0x00200000,
|
||||
XEX_SYSTEM_ALLOW_HUD_VIBRATION = 0x00400000,
|
||||
XEX_SYSTEM_ACCESS_UTILITY_PARTITIONS = 0x00800000,
|
||||
XEX_SYSTEM_IPTV_INPUT_SUPPORTED = 0x01000000,
|
||||
XEX_SYSTEM_PREFER_BIG_BUTTON_INPUT = 0x02000000,
|
||||
XEX_SYSTEM_ALLOW_EXTENDED_SYSTEM_RESERVATION = 0x04000000,
|
||||
XEX_SYSTEM_MULTIDISC_CROSS_TITLE = 0x08000000,
|
||||
XEX_SYSTEM_INSTALL_INCOMPATIBLE = 0x10000000,
|
||||
XEX_SYSTEM_ALLOW_AVATAR_GET_METADATA_BY_XUID = 0x20000000,
|
||||
XEX_SYSTEM_ALLOW_CONTROLLER_SWAPPING = 0x40000000,
|
||||
XEX_SYSTEM_DASH_EXTENSIBILITY_MODULE = 0x80000000,
|
||||
XEX_SYSTEM_NO_FORCED_REBOOT = 0x00000001,
|
||||
XEX_SYSTEM_FOREGROUND_TASKS = 0x00000002,
|
||||
XEX_SYSTEM_NO_ODD_MAPPING = 0x00000004,
|
||||
XEX_SYSTEM_HANDLE_MCE_INPUT = 0x00000008,
|
||||
XEX_SYSTEM_RESTRICTED_HUD_FEATURES = 0x00000010,
|
||||
XEX_SYSTEM_HANDLE_GAMEPAD_DISCONNECT = 0x00000020,
|
||||
XEX_SYSTEM_INSECURE_SOCKETS = 0x00000040,
|
||||
XEX_SYSTEM_XBOX1_INTEROPERABILITY = 0x00000080,
|
||||
XEX_SYSTEM_DASH_CONTEXT = 0x00000100,
|
||||
XEX_SYSTEM_USES_GAME_VOICE_CHANNEL = 0x00000200,
|
||||
XEX_SYSTEM_PAL50_INCOMPATIBLE = 0x00000400,
|
||||
XEX_SYSTEM_INSECURE_UTILITY_DRIVE = 0x00000800,
|
||||
XEX_SYSTEM_XAM_HOOKS = 0x00001000,
|
||||
XEX_SYSTEM_ACCESS_PII = 0x00002000,
|
||||
XEX_SYSTEM_CROSS_PLATFORM_SYSTEM_LINK = 0x00004000,
|
||||
XEX_SYSTEM_MULTIDISC_SWAP = 0x00008000,
|
||||
XEX_SYSTEM_MULTIDISC_INSECURE_MEDIA = 0x00010000,
|
||||
XEX_SYSTEM_AP25_MEDIA = 0x00020000,
|
||||
XEX_SYSTEM_NO_CONFIRM_EXIT = 0x00040000,
|
||||
XEX_SYSTEM_ALLOW_BACKGROUND_DOWNLOAD = 0x00080000,
|
||||
XEX_SYSTEM_CREATE_PERSISTABLE_RAMDRIVE = 0x00100000,
|
||||
XEX_SYSTEM_INHERIT_PERSISTENT_RAMDRIVE = 0x00200000,
|
||||
XEX_SYSTEM_ALLOW_HUD_VIBRATION = 0x00400000,
|
||||
XEX_SYSTEM_ACCESS_UTILITY_PARTITIONS = 0x00800000,
|
||||
XEX_SYSTEM_IPTV_INPUT_SUPPORTED = 0x01000000,
|
||||
XEX_SYSTEM_PREFER_BIG_BUTTON_INPUT = 0x02000000,
|
||||
XEX_SYSTEM_ALLOW_EXTENDED_SYSTEM_RESERVATION = 0x04000000,
|
||||
XEX_SYSTEM_MULTIDISC_CROSS_TITLE = 0x08000000,
|
||||
XEX_SYSTEM_INSTALL_INCOMPATIBLE = 0x10000000,
|
||||
XEX_SYSTEM_ALLOW_AVATAR_GET_METADATA_BY_XUID = 0x20000000,
|
||||
XEX_SYSTEM_ALLOW_CONTROLLER_SWAPPING = 0x40000000,
|
||||
XEX_SYSTEM_DASH_EXTENSIBILITY_MODULE = 0x80000000,
|
||||
// TODO: figure out how stored
|
||||
/*XEX_SYSTEM_ALLOW_NETWORK_READ_CANCEL = 0x0,
|
||||
XEX_SYSTEM_UNINTERRUPTABLE_READS = 0x0,
|
||||
@@ -101,198 +101,198 @@ typedef enum {
|
||||
|
||||
// ESRB (Entertainment Software Rating Board)
|
||||
typedef enum {
|
||||
XEX_RATING_ESRB_eC = 0x00,
|
||||
XEX_RATING_ESRB_E = 0x02,
|
||||
XEX_RATING_ESRB_E10 = 0x04,
|
||||
XEX_RATING_ESRB_T = 0x06,
|
||||
XEX_RATING_ESRB_M = 0x08,
|
||||
XEX_RATING_ESRB_AO = 0x0E,
|
||||
XEX_RATING_ESRB_UNRATED = 0xFF,
|
||||
XEX_RATING_ESRB_eC = 0x00,
|
||||
XEX_RATING_ESRB_E = 0x02,
|
||||
XEX_RATING_ESRB_E10 = 0x04,
|
||||
XEX_RATING_ESRB_T = 0x06,
|
||||
XEX_RATING_ESRB_M = 0x08,
|
||||
XEX_RATING_ESRB_AO = 0x0E,
|
||||
XEX_RATING_ESRB_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_esrb_value;
|
||||
// PEGI (Pan European Game Information)
|
||||
typedef enum {
|
||||
XEX_RATING_PEGI_3_PLUS = 0,
|
||||
XEX_RATING_PEGI_7_PLUS = 4,
|
||||
XEX_RATING_PEGI_12_PLUS = 9,
|
||||
XEX_RATING_PEGI_16_PLUS = 13,
|
||||
XEX_RATING_PEGI_18_PLUS = 14,
|
||||
XEX_RATING_PEGI_UNRATED = 0xFF,
|
||||
XEX_RATING_PEGI_3_PLUS = 0,
|
||||
XEX_RATING_PEGI_7_PLUS = 4,
|
||||
XEX_RATING_PEGI_12_PLUS = 9,
|
||||
XEX_RATING_PEGI_16_PLUS = 13,
|
||||
XEX_RATING_PEGI_18_PLUS = 14,
|
||||
XEX_RATING_PEGI_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_pegi_value;
|
||||
// PEGI (Pan European Game Information) - Finland
|
||||
typedef enum {
|
||||
XEX_RATING_PEGI_FI_3_PLUS = 0,
|
||||
XEX_RATING_PEGI_FI_7_PLUS = 4,
|
||||
XEX_RATING_PEGI_FI_11_PLUS = 8,
|
||||
XEX_RATING_PEGI_FI_15_PLUS = 12,
|
||||
XEX_RATING_PEGI_FI_18_PLUS = 14,
|
||||
XEX_RATING_PEGI_FI_UNRATED = 0xFF,
|
||||
XEX_RATING_PEGI_FI_3_PLUS = 0,
|
||||
XEX_RATING_PEGI_FI_7_PLUS = 4,
|
||||
XEX_RATING_PEGI_FI_11_PLUS = 8,
|
||||
XEX_RATING_PEGI_FI_15_PLUS = 12,
|
||||
XEX_RATING_PEGI_FI_18_PLUS = 14,
|
||||
XEX_RATING_PEGI_FI_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_pegi_fi_value;
|
||||
// PEGI (Pan European Game Information) - Portugal
|
||||
typedef enum {
|
||||
XEX_RATING_PEGI_PT_4_PLUS = 1,
|
||||
XEX_RATING_PEGI_PT_6_PLUS = 3,
|
||||
XEX_RATING_PEGI_PT_12_PLUS = 9,
|
||||
XEX_RATING_PEGI_PT_16_PLUS = 13,
|
||||
XEX_RATING_PEGI_PT_18_PLUS = 14,
|
||||
XEX_RATING_PEGI_PT_UNRATED = 0xFF,
|
||||
XEX_RATING_PEGI_PT_4_PLUS = 1,
|
||||
XEX_RATING_PEGI_PT_6_PLUS = 3,
|
||||
XEX_RATING_PEGI_PT_12_PLUS = 9,
|
||||
XEX_RATING_PEGI_PT_16_PLUS = 13,
|
||||
XEX_RATING_PEGI_PT_18_PLUS = 14,
|
||||
XEX_RATING_PEGI_PT_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_pegi_pt_value;
|
||||
// BBFC (British Board of Film Classification) - UK/Ireland
|
||||
typedef enum {
|
||||
XEX_RATING_BBFC_UNIVERSAL = 1,
|
||||
XEX_RATING_BBFC_PG = 5,
|
||||
XEX_RATING_BBFC_3_PLUS = 0,
|
||||
XEX_RATING_BBFC_7_PLUS = 4,
|
||||
XEX_RATING_BBFC_12_PLUS = 9,
|
||||
XEX_RATING_BBFC_15_PLUS = 12,
|
||||
XEX_RATING_BBFC_16_PLUS = 13,
|
||||
XEX_RATING_BBFC_18_PLUS = 14,
|
||||
XEX_RATING_BBFC_UNRATED = 0xFF,
|
||||
XEX_RATING_BBFC_UNIVERSAL = 1,
|
||||
XEX_RATING_BBFC_PG = 5,
|
||||
XEX_RATING_BBFC_3_PLUS = 0,
|
||||
XEX_RATING_BBFC_7_PLUS = 4,
|
||||
XEX_RATING_BBFC_12_PLUS = 9,
|
||||
XEX_RATING_BBFC_15_PLUS = 12,
|
||||
XEX_RATING_BBFC_16_PLUS = 13,
|
||||
XEX_RATING_BBFC_18_PLUS = 14,
|
||||
XEX_RATING_BBFC_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_bbfc_value;
|
||||
// CERO (Computer Entertainment Rating Organization)
|
||||
typedef enum {
|
||||
XEX_RATING_CERO_A = 0,
|
||||
XEX_RATING_CERO_B = 2,
|
||||
XEX_RATING_CERO_C = 4,
|
||||
XEX_RATING_CERO_D = 6,
|
||||
XEX_RATING_CERO_Z = 8,
|
||||
XEX_RATING_CERO_UNRATED = 0xFF,
|
||||
XEX_RATING_CERO_A = 0,
|
||||
XEX_RATING_CERO_B = 2,
|
||||
XEX_RATING_CERO_C = 4,
|
||||
XEX_RATING_CERO_D = 6,
|
||||
XEX_RATING_CERO_Z = 8,
|
||||
XEX_RATING_CERO_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_cero_value;
|
||||
// USK (Unterhaltungssoftware SelbstKontrolle)
|
||||
typedef enum {
|
||||
XEX_RATING_USK_ALL = 0,
|
||||
XEX_RATING_USK_6_PLUS = 2,
|
||||
XEX_RATING_USK_12_PLUS = 4,
|
||||
XEX_RATING_USK_16_PLUS = 6,
|
||||
XEX_RATING_USK_18_PLUS = 8,
|
||||
XEX_RATING_USK_UNRATED = 0xFF,
|
||||
XEX_RATING_USK_ALL = 0,
|
||||
XEX_RATING_USK_6_PLUS = 2,
|
||||
XEX_RATING_USK_12_PLUS = 4,
|
||||
XEX_RATING_USK_16_PLUS = 6,
|
||||
XEX_RATING_USK_18_PLUS = 8,
|
||||
XEX_RATING_USK_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_usk_value;
|
||||
// OFLC (Office of Film and Literature Classification) - Australia
|
||||
typedef enum {
|
||||
XEX_RATING_OFLC_AU_G = 0,
|
||||
XEX_RATING_OFLC_AU_PG = 2,
|
||||
XEX_RATING_OFLC_AU_M = 4,
|
||||
XEX_RATING_OFLC_AU_MA15_PLUS = 6,
|
||||
XEX_RATING_OFLC_AU_UNRATED = 0xFF,
|
||||
XEX_RATING_OFLC_AU_G = 0,
|
||||
XEX_RATING_OFLC_AU_PG = 2,
|
||||
XEX_RATING_OFLC_AU_M = 4,
|
||||
XEX_RATING_OFLC_AU_MA15_PLUS = 6,
|
||||
XEX_RATING_OFLC_AU_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_oflc_au_value;
|
||||
// OFLC (Office of Film and Literature Classification) - New Zealand
|
||||
typedef enum {
|
||||
XEX_RATING_OFLC_NZ_G = 0,
|
||||
XEX_RATING_OFLC_NZ_PG = 2,
|
||||
XEX_RATING_OFLC_NZ_M = 4,
|
||||
XEX_RATING_OFLC_NZ_MA15_PLUS = 6,
|
||||
XEX_RATING_OFLC_NZ_UNRATED = 0xFF,
|
||||
XEX_RATING_OFLC_NZ_G = 0,
|
||||
XEX_RATING_OFLC_NZ_PG = 2,
|
||||
XEX_RATING_OFLC_NZ_M = 4,
|
||||
XEX_RATING_OFLC_NZ_MA15_PLUS = 6,
|
||||
XEX_RATING_OFLC_NZ_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_oflc_nz_value;
|
||||
// KMRB (Korea Media Rating Board)
|
||||
typedef enum {
|
||||
XEX_RATING_KMRB_ALL = 0,
|
||||
XEX_RATING_KMRB_12_PLUS = 2,
|
||||
XEX_RATING_KMRB_15_PLUS = 4,
|
||||
XEX_RATING_KMRB_18_PLUS = 6,
|
||||
XEX_RATING_KMRB_UNRATED = 0xFF,
|
||||
XEX_RATING_KMRB_ALL = 0,
|
||||
XEX_RATING_KMRB_12_PLUS = 2,
|
||||
XEX_RATING_KMRB_15_PLUS = 4,
|
||||
XEX_RATING_KMRB_18_PLUS = 6,
|
||||
XEX_RATING_KMRB_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_kmrb_value;
|
||||
// Brazil
|
||||
typedef enum {
|
||||
XEX_RATING_BRAZIL_ALL = 0,
|
||||
XEX_RATING_BRAZIL_12_PLUS = 2,
|
||||
XEX_RATING_BRAZIL_14_PLUS = 4,
|
||||
XEX_RATING_BRAZIL_16_PLUS = 5,
|
||||
XEX_RATING_BRAZIL_18_PLUS = 8,
|
||||
XEX_RATING_BRAZIL_UNRATED = 0xFF,
|
||||
XEX_RATING_BRAZIL_ALL = 0,
|
||||
XEX_RATING_BRAZIL_12_PLUS = 2,
|
||||
XEX_RATING_BRAZIL_14_PLUS = 4,
|
||||
XEX_RATING_BRAZIL_16_PLUS = 5,
|
||||
XEX_RATING_BRAZIL_18_PLUS = 8,
|
||||
XEX_RATING_BRAZIL_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_brazil_value;
|
||||
// FPB (Film and Publication Board)
|
||||
typedef enum {
|
||||
XEX_RATING_FPB_ALL = 0,
|
||||
XEX_RATING_FPB_PG = 6,
|
||||
XEX_RATING_FPB_10_PLUS = 7,
|
||||
XEX_RATING_FPB_13_PLUS = 10,
|
||||
XEX_RATING_FPB_16_PLUS = 13,
|
||||
XEX_RATING_FPB_18_PLUS = 14,
|
||||
XEX_RATING_FPB_UNRATED = 0xFF,
|
||||
XEX_RATING_FPB_ALL = 0,
|
||||
XEX_RATING_FPB_PG = 6,
|
||||
XEX_RATING_FPB_10_PLUS = 7,
|
||||
XEX_RATING_FPB_13_PLUS = 10,
|
||||
XEX_RATING_FPB_16_PLUS = 13,
|
||||
XEX_RATING_FPB_18_PLUS = 14,
|
||||
XEX_RATING_FPB_UNRATED = 0xFF,
|
||||
} xe_xex2_rating_fpb_value;
|
||||
|
||||
typedef struct {
|
||||
xe_xex2_rating_esrb_value esrb;
|
||||
xe_xex2_rating_pegi_value pegi;
|
||||
xe_xex2_rating_pegi_fi_value pegifi;
|
||||
xe_xex2_rating_pegi_pt_value pegipt;
|
||||
xe_xex2_rating_bbfc_value bbfc;
|
||||
xe_xex2_rating_cero_value cero;
|
||||
xe_xex2_rating_usk_value usk;
|
||||
xe_xex2_rating_oflc_au_value oflcau;
|
||||
xe_xex2_rating_oflc_nz_value oflcnz;
|
||||
xe_xex2_rating_kmrb_value kmrb;
|
||||
xe_xex2_rating_brazil_value brazil;
|
||||
xe_xex2_rating_fpb_value fpb;
|
||||
xe_xex2_rating_esrb_value esrb;
|
||||
xe_xex2_rating_pegi_value pegi;
|
||||
xe_xex2_rating_pegi_fi_value pegifi;
|
||||
xe_xex2_rating_pegi_pt_value pegipt;
|
||||
xe_xex2_rating_bbfc_value bbfc;
|
||||
xe_xex2_rating_cero_value cero;
|
||||
xe_xex2_rating_usk_value usk;
|
||||
xe_xex2_rating_oflc_au_value oflcau;
|
||||
xe_xex2_rating_oflc_nz_value oflcnz;
|
||||
xe_xex2_rating_kmrb_value kmrb;
|
||||
xe_xex2_rating_brazil_value brazil;
|
||||
xe_xex2_rating_fpb_value fpb;
|
||||
} xe_xex2_game_ratings_t;
|
||||
|
||||
typedef union {
|
||||
uint32_t value;
|
||||
uint32_t value;
|
||||
struct {
|
||||
uint32_t major : 4;
|
||||
uint32_t minor : 4;
|
||||
uint32_t build : 16;
|
||||
uint32_t qfe : 8;
|
||||
uint32_t major : 4;
|
||||
uint32_t minor : 4;
|
||||
uint32_t build : 16;
|
||||
uint32_t qfe : 8;
|
||||
};
|
||||
} xe_xex2_version_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t key;
|
||||
uint32_t length;
|
||||
uint32_t key;
|
||||
uint32_t length;
|
||||
union {
|
||||
uint32_t value;
|
||||
uint32_t offset;
|
||||
uint32_t value;
|
||||
uint32_t offset;
|
||||
};
|
||||
} xe_xex2_opt_header_t;
|
||||
|
||||
typedef struct {
|
||||
char name[9];
|
||||
uint32_t address;
|
||||
uint32_t size;
|
||||
char name[9];
|
||||
uint32_t address;
|
||||
uint32_t size;
|
||||
} xe_xex2_resource_info_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t media_id;
|
||||
xe_xex2_version_t version;
|
||||
xe_xex2_version_t base_version;
|
||||
uint32_t title_id;
|
||||
uint8_t platform;
|
||||
uint8_t executable_table;
|
||||
uint8_t disc_number;
|
||||
uint8_t disc_count;
|
||||
uint32_t savegame_id;
|
||||
uint32_t media_id;
|
||||
xe_xex2_version_t version;
|
||||
xe_xex2_version_t base_version;
|
||||
uint32_t title_id;
|
||||
uint8_t platform;
|
||||
uint8_t executable_table;
|
||||
uint8_t disc_number;
|
||||
uint8_t disc_count;
|
||||
uint32_t savegame_id;
|
||||
} xe_xex2_execution_info_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t slot_count;
|
||||
uint32_t raw_data_address;
|
||||
uint32_t data_size;
|
||||
uint32_t raw_data_size;
|
||||
uint32_t slot_count;
|
||||
uint32_t raw_data_address;
|
||||
uint32_t data_size;
|
||||
uint32_t raw_data_size;
|
||||
} xe_xex2_tls_info_t;
|
||||
|
||||
typedef struct {
|
||||
char name[32];
|
||||
uint8_t digest[20];
|
||||
uint32_t import_id;
|
||||
xe_xex2_version_t version;
|
||||
xe_xex2_version_t min_version;
|
||||
size_t record_count;
|
||||
uint32_t *records;
|
||||
char name[32];
|
||||
uint8_t digest[20];
|
||||
uint32_t import_id;
|
||||
xe_xex2_version_t version;
|
||||
xe_xex2_version_t min_version;
|
||||
size_t record_count;
|
||||
uint32_t* records;
|
||||
} xe_xex2_import_library_t;
|
||||
|
||||
typedef enum {
|
||||
XEX_APPROVAL_UNAPPROVED = 0,
|
||||
XEX_APPROVAL_POSSIBLE = 1,
|
||||
XEX_APPROVAL_APPROVED = 2,
|
||||
XEX_APPROVAL_EXPIRED = 3,
|
||||
XEX_APPROVAL_UNAPPROVED = 0,
|
||||
XEX_APPROVAL_POSSIBLE = 1,
|
||||
XEX_APPROVAL_APPROVED = 2,
|
||||
XEX_APPROVAL_EXPIRED = 3,
|
||||
} xe_xex2_approval_type;
|
||||
|
||||
typedef struct {
|
||||
char name[9]; // 8 + 1 for \0
|
||||
uint16_t major;
|
||||
uint16_t minor;
|
||||
uint16_t build;
|
||||
uint16_t qfe;
|
||||
xe_xex2_approval_type approval;
|
||||
char name[9]; // 8 + 1 for \0
|
||||
uint16_t major;
|
||||
uint16_t minor;
|
||||
uint16_t build;
|
||||
uint16_t qfe;
|
||||
xe_xex2_approval_type approval;
|
||||
} xe_xex2_static_library_t;
|
||||
|
||||
// credits: some obscure pastebin (http://pastebin.com/ZRvr3Sgj)
|
||||
@@ -300,170 +300,171 @@ typedef struct {
|
||||
uint32_t magic[3];
|
||||
uint32_t modulenumber[2];
|
||||
uint32_t version[3];
|
||||
uint32_t imagebaseaddr; // must be <<16 to be accurate
|
||||
uint32_t imagebaseaddr; // must be <<16 to be accurate
|
||||
uint32_t count;
|
||||
uint32_t base;
|
||||
uint32_t ordOffset[1]; // ordOffset[0] + (imagebaseaddr << 16) = function offset of ordinal 1
|
||||
uint32_t ordOffset[1]; // ordOffset[0] + (imagebaseaddr << 16) = function
|
||||
// offset of ordinal 1
|
||||
} xe_xex2_export_table;
|
||||
|
||||
typedef enum {
|
||||
XEX_ENCRYPTION_NONE = 0,
|
||||
XEX_ENCRYPTION_NORMAL = 1,
|
||||
XEX_ENCRYPTION_NONE = 0,
|
||||
XEX_ENCRYPTION_NORMAL = 1,
|
||||
} xe_xex2_encryption_type;
|
||||
|
||||
typedef enum {
|
||||
XEX_COMPRESSION_NONE = 0,
|
||||
XEX_COMPRESSION_BASIC = 1,
|
||||
XEX_COMPRESSION_NORMAL = 2,
|
||||
XEX_COMPRESSION_DELTA = 3,
|
||||
XEX_COMPRESSION_NONE = 0,
|
||||
XEX_COMPRESSION_BASIC = 1,
|
||||
XEX_COMPRESSION_NORMAL = 2,
|
||||
XEX_COMPRESSION_DELTA = 3,
|
||||
} xe_xex2_compression_type;
|
||||
|
||||
typedef struct {
|
||||
uint32_t data_size;
|
||||
uint32_t zero_size;
|
||||
uint32_t data_size;
|
||||
uint32_t zero_size;
|
||||
} xe_xex2_file_basic_compression_block_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t block_count;
|
||||
xe_xex2_file_basic_compression_block_t *blocks;
|
||||
uint32_t block_count;
|
||||
xe_xex2_file_basic_compression_block_t* blocks;
|
||||
} xe_xex2_file_basic_compression_info_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t window_size;
|
||||
uint32_t window_bits;
|
||||
uint32_t block_size;
|
||||
uint8_t block_hash[20];
|
||||
uint32_t window_size;
|
||||
uint32_t window_bits;
|
||||
uint32_t block_size;
|
||||
uint8_t block_hash[20];
|
||||
} xe_xex2_file_normal_compression_info_t;
|
||||
|
||||
typedef struct {
|
||||
xe_xex2_encryption_type encryption_type;
|
||||
xe_xex2_compression_type compression_type;
|
||||
xe_xex2_encryption_type encryption_type;
|
||||
xe_xex2_compression_type compression_type;
|
||||
union {
|
||||
xe_xex2_file_basic_compression_info_t basic;
|
||||
xe_xex2_file_normal_compression_info_t normal;
|
||||
xe_xex2_file_basic_compression_info_t basic;
|
||||
xe_xex2_file_normal_compression_info_t normal;
|
||||
} compression_info;
|
||||
} xe_xex2_file_format_info_t;
|
||||
|
||||
typedef enum {
|
||||
XEX_IMAGE_MANUFACTURING_UTILITY = 0x00000002,
|
||||
XEX_IMAGE_MANUFACTURING_SUPPORT_TOOLS = 0x00000004,
|
||||
XEX_IMAGE_XGD2_MEDIA_ONLY = 0x00000008,
|
||||
XEX_IMAGE_CARDEA_KEY = 0x00000100,
|
||||
XEX_IMAGE_XEIKA_KEY = 0x00000200,
|
||||
XEX_IMAGE_USERMODE_TITLE = 0x00000400,
|
||||
XEX_IMAGE_USERMODE_SYSTEM = 0x00000800,
|
||||
XEX_IMAGE_ORANGE0 = 0x00001000,
|
||||
XEX_IMAGE_ORANGE1 = 0x00002000,
|
||||
XEX_IMAGE_ORANGE2 = 0x00004000,
|
||||
XEX_IMAGE_IPTV_SIGNUP_APPLICATION = 0x00010000,
|
||||
XEX_IMAGE_IPTV_TITLE_APPLICATION = 0x00020000,
|
||||
XEX_IMAGE_KEYVAULT_PRIVILEGES_REQUIRED = 0x04000000,
|
||||
XEX_IMAGE_ONLINE_ACTIVATION_REQUIRED = 0x08000000,
|
||||
XEX_IMAGE_PAGE_SIZE_4KB = 0x10000000, // else 64KB
|
||||
XEX_IMAGE_REGION_FREE = 0x20000000,
|
||||
XEX_IMAGE_REVOCATION_CHECK_OPTIONAL = 0x40000000,
|
||||
XEX_IMAGE_REVOCATION_CHECK_REQUIRED = 0x80000000,
|
||||
XEX_IMAGE_MANUFACTURING_UTILITY = 0x00000002,
|
||||
XEX_IMAGE_MANUFACTURING_SUPPORT_TOOLS = 0x00000004,
|
||||
XEX_IMAGE_XGD2_MEDIA_ONLY = 0x00000008,
|
||||
XEX_IMAGE_CARDEA_KEY = 0x00000100,
|
||||
XEX_IMAGE_XEIKA_KEY = 0x00000200,
|
||||
XEX_IMAGE_USERMODE_TITLE = 0x00000400,
|
||||
XEX_IMAGE_USERMODE_SYSTEM = 0x00000800,
|
||||
XEX_IMAGE_ORANGE0 = 0x00001000,
|
||||
XEX_IMAGE_ORANGE1 = 0x00002000,
|
||||
XEX_IMAGE_ORANGE2 = 0x00004000,
|
||||
XEX_IMAGE_IPTV_SIGNUP_APPLICATION = 0x00010000,
|
||||
XEX_IMAGE_IPTV_TITLE_APPLICATION = 0x00020000,
|
||||
XEX_IMAGE_KEYVAULT_PRIVILEGES_REQUIRED = 0x04000000,
|
||||
XEX_IMAGE_ONLINE_ACTIVATION_REQUIRED = 0x08000000,
|
||||
XEX_IMAGE_PAGE_SIZE_4KB = 0x10000000, // else 64KB
|
||||
XEX_IMAGE_REGION_FREE = 0x20000000,
|
||||
XEX_IMAGE_REVOCATION_CHECK_OPTIONAL = 0x40000000,
|
||||
XEX_IMAGE_REVOCATION_CHECK_REQUIRED = 0x80000000,
|
||||
} xe_xex2_image_flags;
|
||||
|
||||
typedef enum {
|
||||
XEX_MEDIA_HARDDISK = 0x00000001,
|
||||
XEX_MEDIA_DVD_X2 = 0x00000002,
|
||||
XEX_MEDIA_DVD_CD = 0x00000004,
|
||||
XEX_MEDIA_DVD_5 = 0x00000008,
|
||||
XEX_MEDIA_DVD_9 = 0x00000010,
|
||||
XEX_MEDIA_SYSTEM_FLASH = 0x00000020,
|
||||
XEX_MEDIA_MEMORY_UNIT = 0x00000080,
|
||||
XEX_MEDIA_USB_MASS_STORAGE_DEVICE = 0x00000100,
|
||||
XEX_MEDIA_NETWORK = 0x00000200,
|
||||
XEX_MEDIA_DIRECT_FROM_MEMORY = 0x00000400,
|
||||
XEX_MEDIA_RAM_DRIVE = 0x00000800,
|
||||
XEX_MEDIA_SVOD = 0x00001000,
|
||||
XEX_MEDIA_INSECURE_PACKAGE = 0x01000000,
|
||||
XEX_MEDIA_SAVEGAME_PACKAGE = 0x02000000,
|
||||
XEX_MEDIA_LOCALLY_SIGNED_PACKAGE = 0x04000000,
|
||||
XEX_MEDIA_LIVE_SIGNED_PACKAGE = 0x08000000,
|
||||
XEX_MEDIA_XBOX_PACKAGE = 0x10000000,
|
||||
XEX_MEDIA_HARDDISK = 0x00000001,
|
||||
XEX_MEDIA_DVD_X2 = 0x00000002,
|
||||
XEX_MEDIA_DVD_CD = 0x00000004,
|
||||
XEX_MEDIA_DVD_5 = 0x00000008,
|
||||
XEX_MEDIA_DVD_9 = 0x00000010,
|
||||
XEX_MEDIA_SYSTEM_FLASH = 0x00000020,
|
||||
XEX_MEDIA_MEMORY_UNIT = 0x00000080,
|
||||
XEX_MEDIA_USB_MASS_STORAGE_DEVICE = 0x00000100,
|
||||
XEX_MEDIA_NETWORK = 0x00000200,
|
||||
XEX_MEDIA_DIRECT_FROM_MEMORY = 0x00000400,
|
||||
XEX_MEDIA_RAM_DRIVE = 0x00000800,
|
||||
XEX_MEDIA_SVOD = 0x00001000,
|
||||
XEX_MEDIA_INSECURE_PACKAGE = 0x01000000,
|
||||
XEX_MEDIA_SAVEGAME_PACKAGE = 0x02000000,
|
||||
XEX_MEDIA_LOCALLY_SIGNED_PACKAGE = 0x04000000,
|
||||
XEX_MEDIA_LIVE_SIGNED_PACKAGE = 0x08000000,
|
||||
XEX_MEDIA_XBOX_PACKAGE = 0x10000000,
|
||||
} xe_xex2_media_flags;
|
||||
|
||||
typedef enum {
|
||||
XEX_REGION_NTSCU = 0x000000FF,
|
||||
XEX_REGION_NTSCJ = 0x0000FF00,
|
||||
XEX_REGION_NTSCJ_JAPAN = 0x00000100,
|
||||
XEX_REGION_NTSCJ_CHINA = 0x00000200,
|
||||
XEX_REGION_PAL = 0x00FF0000,
|
||||
XEX_REGION_PAL_AU_NZ = 0x00010000,
|
||||
XEX_REGION_OTHER = 0xFF000000,
|
||||
XEX_REGION_ALL = 0xFFFFFFFF,
|
||||
XEX_REGION_NTSCU = 0x000000FF,
|
||||
XEX_REGION_NTSCJ = 0x0000FF00,
|
||||
XEX_REGION_NTSCJ_JAPAN = 0x00000100,
|
||||
XEX_REGION_NTSCJ_CHINA = 0x00000200,
|
||||
XEX_REGION_PAL = 0x00FF0000,
|
||||
XEX_REGION_PAL_AU_NZ = 0x00010000,
|
||||
XEX_REGION_OTHER = 0xFF000000,
|
||||
XEX_REGION_ALL = 0xFFFFFFFF,
|
||||
} xe_xex2_region_flags;
|
||||
|
||||
typedef struct {
|
||||
uint32_t header_size;
|
||||
uint32_t image_size;
|
||||
uint8_t rsa_signature[256];
|
||||
uint32_t unklength;
|
||||
xe_xex2_image_flags image_flags;
|
||||
uint32_t load_address;
|
||||
uint8_t section_digest[20];
|
||||
uint32_t import_table_count;
|
||||
uint8_t import_table_digest[20];
|
||||
uint8_t media_id[16];
|
||||
uint8_t file_key[16];
|
||||
uint32_t export_table; // address of the export table
|
||||
uint8_t header_digest[20];
|
||||
xe_xex2_region_flags game_regions;
|
||||
xe_xex2_media_flags media_flags;
|
||||
uint32_t header_size;
|
||||
uint32_t image_size;
|
||||
uint8_t rsa_signature[256];
|
||||
uint32_t unklength;
|
||||
xe_xex2_image_flags image_flags;
|
||||
uint32_t load_address;
|
||||
uint8_t section_digest[20];
|
||||
uint32_t import_table_count;
|
||||
uint8_t import_table_digest[20];
|
||||
uint8_t media_id[16];
|
||||
uint8_t file_key[16];
|
||||
uint32_t export_table; // address of the export table
|
||||
uint8_t header_digest[20];
|
||||
xe_xex2_region_flags game_regions;
|
||||
xe_xex2_media_flags media_flags;
|
||||
} xe_xex2_loader_info_t;
|
||||
|
||||
typedef enum {
|
||||
XEX_SECTION_CODE = 1,
|
||||
XEX_SECTION_DATA = 2,
|
||||
XEX_SECTION_READONLY_DATA = 3,
|
||||
XEX_SECTION_CODE = 1,
|
||||
XEX_SECTION_DATA = 2,
|
||||
XEX_SECTION_READONLY_DATA = 3,
|
||||
} xe_xex2_section_type;
|
||||
|
||||
typedef struct {
|
||||
uint32_t page_size;
|
||||
union {
|
||||
struct {
|
||||
xe_xex2_section_type type : 4;
|
||||
uint32_t page_count : 28; // # of pages
|
||||
xe_xex2_section_type type : 4;
|
||||
uint32_t page_count : 28; // # of pages
|
||||
};
|
||||
uint32_t value; // To make uint8_t swapping easier
|
||||
uint32_t value; // To make uint8_t swapping easier
|
||||
} info;
|
||||
uint8_t digest[20];
|
||||
} xe_xex2_section_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t xex2;
|
||||
xe_xex2_module_flags module_flags;
|
||||
uint32_t exe_offset;
|
||||
uint32_t unknown0;
|
||||
uint32_t certificate_offset;
|
||||
uint32_t xex2;
|
||||
xe_xex2_module_flags module_flags;
|
||||
uint32_t exe_offset;
|
||||
uint32_t unknown0;
|
||||
uint32_t certificate_offset;
|
||||
|
||||
xe_xex2_system_flags system_flags;
|
||||
xe_xex2_execution_info_t execution_info;
|
||||
xe_xex2_game_ratings_t game_ratings;
|
||||
xe_xex2_tls_info_t tls_info;
|
||||
size_t import_library_count;
|
||||
xe_xex2_import_library_t import_libraries[32];
|
||||
uint32_t pe_export_table_offset; // PE Export Directory
|
||||
size_t static_library_count;
|
||||
xe_xex2_static_library_t static_libraries[32];
|
||||
xe_xex2_file_format_info_t file_format_info;
|
||||
xe_xex2_loader_info_t loader_info;
|
||||
uint8_t session_key[16];
|
||||
xe_xex2_system_flags system_flags;
|
||||
xe_xex2_execution_info_t execution_info;
|
||||
xe_xex2_game_ratings_t game_ratings;
|
||||
xe_xex2_tls_info_t tls_info;
|
||||
size_t import_library_count;
|
||||
xe_xex2_import_library_t import_libraries[32];
|
||||
uint32_t pe_export_table_offset; // PE Export Directory
|
||||
size_t static_library_count;
|
||||
xe_xex2_static_library_t static_libraries[32];
|
||||
xe_xex2_file_format_info_t file_format_info;
|
||||
xe_xex2_loader_info_t loader_info;
|
||||
uint8_t session_key[16];
|
||||
|
||||
uint32_t exe_address;
|
||||
uint32_t exe_entry_point;
|
||||
uint32_t exe_stack_size;
|
||||
uint32_t exe_heap_size;
|
||||
uint32_t exe_address;
|
||||
uint32_t exe_entry_point;
|
||||
uint32_t exe_stack_size;
|
||||
uint32_t exe_heap_size;
|
||||
|
||||
size_t header_count;
|
||||
xe_xex2_opt_header_t headers[64];
|
||||
size_t header_count;
|
||||
xe_xex2_opt_header_t headers[64];
|
||||
|
||||
size_t resource_info_count;
|
||||
xe_xex2_resource_info_t* resource_infos;
|
||||
size_t section_count;
|
||||
xe_xex2_section_t* sections;
|
||||
size_t resource_info_count;
|
||||
xe_xex2_resource_info_t* resource_infos;
|
||||
size_t section_count;
|
||||
xe_xex2_section_t* sections;
|
||||
} xe_xex2_header_t;
|
||||
|
||||
#endif // XENIA_KERNEL_XEX2_INFO_H_
|
||||
|
||||
@@ -35,11 +35,11 @@ enum {
|
||||
// https://github.com/pmrowla/hl2sdk-csgo/blob/master/common/xbox/xboxstubs.h
|
||||
typedef struct {
|
||||
// FYI: IN_ADDR should be in network-byte order.
|
||||
IN_ADDR ina; // IP address (zero if not static/DHCP)
|
||||
IN_ADDR inaOnline; // Online IP address (zero if not online)
|
||||
xe::be<uint16_t> wPortOnline; // Online port
|
||||
uint8_t abEnet[6]; // Ethernet MAC address
|
||||
uint8_t abOnline[20]; // Online identification
|
||||
IN_ADDR ina; // IP address (zero if not static/DHCP)
|
||||
IN_ADDR inaOnline; // Online IP address (zero if not online)
|
||||
xe::be<uint16_t> wPortOnline; // Online port
|
||||
uint8_t abEnet[6]; // Ethernet MAC address
|
||||
uint8_t abOnline[20]; // Online identification
|
||||
} XNADDR;
|
||||
|
||||
void LoadSockaddr(const uint8_t* ptr, sockaddr* out_addr) {
|
||||
@@ -208,23 +208,23 @@ SHIM_CALL NetDll_WSAGetLastError_shim(PPCContext* ppc_context,
|
||||
|
||||
struct XnAddrStatus {
|
||||
// Address acquisition is not yet complete
|
||||
const static uint32_t XNET_GET_XNADDR_PENDING = 0x00000000;
|
||||
const static uint32_t XNET_GET_XNADDR_PENDING = 0x00000000;
|
||||
// XNet is uninitialized or no debugger found
|
||||
const static uint32_t XNET_GET_XNADDR_NONE = 0x00000001;
|
||||
const static uint32_t XNET_GET_XNADDR_NONE = 0x00000001;
|
||||
// Host has ethernet address (no IP address)
|
||||
const static uint32_t XNET_GET_XNADDR_ETHERNET = 0x00000002;
|
||||
const static uint32_t XNET_GET_XNADDR_ETHERNET = 0x00000002;
|
||||
// Host has statically assigned IP address
|
||||
const static uint32_t XNET_GET_XNADDR_STATIC = 0x00000004;
|
||||
const static uint32_t XNET_GET_XNADDR_STATIC = 0x00000004;
|
||||
// Host has DHCP assigned IP address
|
||||
const static uint32_t XNET_GET_XNADDR_DHCP = 0x00000008;
|
||||
const static uint32_t XNET_GET_XNADDR_DHCP = 0x00000008;
|
||||
// Host has PPPoE assigned IP address
|
||||
const static uint32_t XNET_GET_XNADDR_PPPOE = 0x00000010;
|
||||
const static uint32_t XNET_GET_XNADDR_PPPOE = 0x00000010;
|
||||
// Host has one or more gateways configured
|
||||
const static uint32_t XNET_GET_XNADDR_GATEWAY = 0x00000020;
|
||||
const static uint32_t XNET_GET_XNADDR_GATEWAY = 0x00000020;
|
||||
// Host has one or more DNS servers configured
|
||||
const static uint32_t XNET_GET_XNADDR_DNS = 0x00000040;
|
||||
const static uint32_t XNET_GET_XNADDR_DNS = 0x00000040;
|
||||
// Host is currently connected to online service
|
||||
const static uint32_t XNET_GET_XNADDR_ONLINE = 0x00000080;
|
||||
const static uint32_t XNET_GET_XNADDR_ONLINE = 0x00000080;
|
||||
// Network configuration requires troubleshooting
|
||||
const static uint32_t XNET_GET_XNADDR_TROUBLESHOOT = 0x00008000;
|
||||
};
|
||||
@@ -563,8 +563,8 @@ SHIM_CALL NetDll_sendto_shim(PPCContext* ppc_context,
|
||||
uint32_t to_ptr = SHIM_GET_ARG_32(5);
|
||||
uint32_t tolen = SHIM_GET_ARG_32(6);
|
||||
|
||||
XELOGD("NetDll_sendto(%d, %.8X, %.8X, %d, %d, %.8X, %d)", caller, socket_handle,
|
||||
buf_ptr, len, flags, to_ptr, tolen);
|
||||
XELOGD("NetDll_sendto(%d, %.8X, %.8X, %d, %d, %.8X, %d)", caller,
|
||||
socket_handle, buf_ptr, len, flags, to_ptr, tolen);
|
||||
|
||||
sockaddr to;
|
||||
LoadSockaddr(SHIM_MEM_ADDR(to_ptr), &to);
|
||||
|
||||
@@ -214,7 +214,8 @@ SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_context,
|
||||
out_header->setting_count = setting_count;
|
||||
out_header->settings_ptr = buffer_ptr + 8;
|
||||
|
||||
auto out_setting = (X_USER_READ_PROFILE_SETTING*)SHIM_MEM_ADDR(out_header->settings_ptr);
|
||||
auto out_setting =
|
||||
(X_USER_READ_PROFILE_SETTING*)SHIM_MEM_ADDR(out_header->settings_ptr);
|
||||
|
||||
size_t buffer_offset = base_size_needed;
|
||||
for (uint32_t n = 0; n < setting_count; ++n) {
|
||||
@@ -227,10 +228,12 @@ SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_context,
|
||||
out_setting->setting_id = setting_id;
|
||||
|
||||
if (setting) {
|
||||
buffer_offset = setting->Append(&out_setting->setting_data[0],
|
||||
SHIM_MEM_ADDR(buffer_ptr), buffer_ptr, buffer_offset);
|
||||
buffer_offset =
|
||||
setting->Append(&out_setting->setting_data[0],
|
||||
SHIM_MEM_ADDR(buffer_ptr), buffer_ptr, buffer_offset);
|
||||
} /*else {
|
||||
std::memset(&out_setting->setting_data[0], 0, sizeof(out_setting->setting_data));
|
||||
std::memset(&out_setting->setting_data[0], 0,
|
||||
sizeof(out_setting->setting_data));
|
||||
}*/
|
||||
++out_setting;
|
||||
}
|
||||
|
||||
@@ -132,9 +132,11 @@ SHIM_CALL XMAInitializeContext_shim(PPCContext* ppc_context,
|
||||
auto context_init = (XMA_CONTEXT_INIT*)SHIM_MEM_ADDR(context_init_ptr);
|
||||
|
||||
context.input_buffer_0_ptr = context_init->input_buffer_0_ptr;
|
||||
context.input_buffer_0_packet_count = context_init->input_buffer_0_packet_count;
|
||||
context.input_buffer_0_packet_count =
|
||||
context_init->input_buffer_0_packet_count;
|
||||
context.input_buffer_1_ptr = context_init->input_buffer_1_ptr;
|
||||
context.input_buffer_1_packet_count = context_init->input_buffer_1_packet_count;
|
||||
context.input_buffer_1_packet_count =
|
||||
context_init->input_buffer_1_packet_count;
|
||||
context.input_buffer_read_offset = context_init->input_buffer_read_offset;
|
||||
context.output_buffer_ptr = context_init->output_buffer_ptr;
|
||||
context.output_buffer_block_count = context_init->output_buffer_block_count;
|
||||
|
||||
@@ -17,9 +17,9 @@ namespace xe {
|
||||
namespace kernel {
|
||||
|
||||
typedef struct {
|
||||
xe::be<DWORD> count;
|
||||
xe::be<DWORD> state[5];
|
||||
xe::be<BYTE> buffer[64];
|
||||
xe::be<DWORD> count;
|
||||
xe::be<DWORD> state[5];
|
||||
xe::be<BYTE> buffer[64];
|
||||
} XECRYPT_SHA_STATE;
|
||||
|
||||
void XeCryptShaInit(pointer_t<XECRYPT_SHA_STATE> sha_state) {
|
||||
@@ -27,20 +27,16 @@ void XeCryptShaInit(pointer_t<XECRYPT_SHA_STATE> sha_state) {
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT(XeCryptShaInit, ExportTag::kStub);
|
||||
|
||||
void XeCryptShaUpdate(pointer_t<XECRYPT_SHA_STATE> sha_state,
|
||||
lpvoid_t input, dword_t input_size) {
|
||||
|
||||
}
|
||||
void XeCryptShaUpdate(pointer_t<XECRYPT_SHA_STATE> sha_state, lpvoid_t input,
|
||||
dword_t input_size) {}
|
||||
DECLARE_XBOXKRNL_EXPORT(XeCryptShaUpdate, ExportTag::kStub);
|
||||
|
||||
void XeCryptShaFinal(pointer_t<XECRYPT_SHA_STATE> sha_state, lpvoid_t out,
|
||||
dword_t out_size) {
|
||||
|
||||
}
|
||||
dword_t out_size) {}
|
||||
DECLARE_XBOXKRNL_EXPORT(XeCryptShaFinal, ExportTag::kStub);
|
||||
|
||||
void xe::kernel::xboxkrnl::RegisterCryptExports(
|
||||
xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {}
|
||||
|
||||
} // namespace kernel
|
||||
} // namespace xe
|
||||
} // namespace kernel
|
||||
} // namespace xe
|
||||
|
||||
@@ -477,11 +477,9 @@ struct X_IO_STATUS_BLOCK {
|
||||
xe::be<uint32_t> information;
|
||||
};
|
||||
|
||||
dword_result_t NtQueryInformationFile(dword_t file_handle,
|
||||
pointer_t<X_IO_STATUS_BLOCK>
|
||||
io_status_block_ptr,
|
||||
lpvoid_t file_info_ptr, dword_t length,
|
||||
dword_t file_info_class) {
|
||||
dword_result_t NtQueryInformationFile(
|
||||
dword_t file_handle, pointer_t<X_IO_STATUS_BLOCK> io_status_block_ptr,
|
||||
lpvoid_t file_info_ptr, dword_t length, dword_t file_info_class) {
|
||||
X_STATUS result = X_STATUS_SUCCESS;
|
||||
uint32_t info = 0;
|
||||
|
||||
@@ -567,13 +565,13 @@ dword_result_t NtQueryInformationFile(dword_t file_handle,
|
||||
|
||||
if (io_status_block_ptr) {
|
||||
io_status_block_ptr->status = result;
|
||||
io_status_block_ptr->information = info; // # bytes written
|
||||
io_status_block_ptr->information = info; // # bytes written
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT(NtQueryInformationFile, ExportTag::kImplemented |
|
||||
ExportTag::kFileSystem);
|
||||
DECLARE_XBOXKRNL_EXPORT(NtQueryInformationFile,
|
||||
ExportTag::kImplemented | ExportTag::kFileSystem);
|
||||
|
||||
SHIM_CALL NtQueryFullAttributesFile_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
|
||||
@@ -549,7 +549,8 @@ SHIM_CALL KeUnlockL2_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
XELOGD("KeUnlockL2(?)");
|
||||
}
|
||||
|
||||
SHIM_CALL MmCreateKernelStack_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
SHIM_CALL MmCreateKernelStack_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
auto stack_size = SHIM_GET_ARG_32(0);
|
||||
auto unk1 = SHIM_GET_ARG_32(1);
|
||||
|
||||
@@ -562,13 +563,14 @@ SHIM_CALL MmCreateKernelStack_shim(PPCContext* ppc_context, KernelState* kernel_
|
||||
kernel_state->memory()
|
||||
->LookupHeap(0x70000000)
|
||||
->AllocRange(0x70000000, 0x7FFFFFFF, stack_size, stack_alignment,
|
||||
kMemoryAllocationReserve | kMemoryAllocationCommit,
|
||||
kMemoryProtectRead | kMemoryProtectWrite, false,
|
||||
&stack_address);
|
||||
kMemoryAllocationReserve | kMemoryAllocationCommit,
|
||||
kMemoryProtectRead | kMemoryProtectWrite, false,
|
||||
&stack_address);
|
||||
SHIM_SET_RETURN_32(stack_address + stack_size);
|
||||
}
|
||||
|
||||
SHIM_CALL MmDeleteKernelStack_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
SHIM_CALL MmDeleteKernelStack_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
auto unk0 = SHIM_GET_ARG_32(0);
|
||||
auto unk1 = SHIM_GET_ARG_32(1);
|
||||
|
||||
|
||||
@@ -486,12 +486,14 @@ SHIM_CALL NtCreateEvent_shim(PPCContext* ppc_context,
|
||||
SHIM_SET_RETURN_32(X_STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
SHIM_CALL KeInitializeEvent_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
SHIM_CALL KeInitializeEvent_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t handle_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t event_type = SHIM_GET_ARG_32(1);
|
||||
uint32_t initial_state = SHIM_GET_ARG_32(2);
|
||||
|
||||
XELOGD("KeInitializeEvent(%.8X, %.8X, %.8X)", handle_ptr, event_type, initial_state);
|
||||
XELOGD("KeInitializeEvent(%.8X, %.8X, %.8X)", handle_ptr, event_type,
|
||||
initial_state);
|
||||
|
||||
XEvent* ev = new XEvent(kernel_state);
|
||||
ev->Initialize(!event_type, !!initial_state);
|
||||
@@ -876,13 +878,12 @@ SHIM_CALL KeWaitForSingleObject_shim(PPCContext* ppc_context,
|
||||
|
||||
object_ref<XObject> object;
|
||||
if (object_ptr < 0x1000) {
|
||||
// They passed in a handle (for some reason)
|
||||
object = kernel_state->object_table()->LookupObject<XObject>(object_ptr);
|
||||
// They passed in a handle (for some reason)
|
||||
object = kernel_state->object_table()->LookupObject<XObject>(object_ptr);
|
||||
|
||||
// Log it in case this is the source of any problems in the future
|
||||
XELOGD("KeWaitForSingleObject - Interpreting object ptr as handle!");
|
||||
}
|
||||
else {
|
||||
// Log it in case this is the source of any problems in the future
|
||||
XELOGD("KeWaitForSingleObject - Interpreting object ptr as handle!");
|
||||
} else {
|
||||
object = XObject::GetNativeObject<XObject>(kernel_state,
|
||||
SHIM_MEM_ADDR(object_ptr));
|
||||
}
|
||||
|
||||
@@ -83,20 +83,22 @@ void VdGetCurrentDisplayInformation(pointer_t<X_DISPLAY_INFO> display_info) {
|
||||
display_info->unk02 = (xe::be<uint16_t>)mode.display_height;
|
||||
display_info->unk08 = 0;
|
||||
display_info->unk0C = 0;
|
||||
display_info->unk10 = mode.display_width; // backbuffer width?
|
||||
display_info->unk14 = mode.display_height; // backbuffer height?
|
||||
display_info->unk10 = mode.display_width; // backbuffer width?
|
||||
display_info->unk14 = mode.display_height; // backbuffer height?
|
||||
display_info->unk18 = mode.display_width;
|
||||
display_info->unk1C = mode.display_height;
|
||||
display_info->unk20 = 1;
|
||||
display_info->unk30 = 1;
|
||||
display_info->unk40 = 320; // display_width / 4?
|
||||
display_info->unk42 = 180; // display_height / 4?
|
||||
display_info->unk40 = 320; // display_width / 4?
|
||||
display_info->unk42 = 180; // display_height / 4?
|
||||
display_info->unk44 = 320;
|
||||
display_info->unk46 = 180;
|
||||
display_info->unk48 = (xe::be<uint16_t>)mode.display_width; // actual display size?
|
||||
display_info->unk4A = (xe::be<uint16_t>)mode.display_height; // actual display size?
|
||||
display_info->unk48 =
|
||||
(xe::be<uint16_t>)mode.display_width; // actual display size?
|
||||
display_info->unk4A =
|
||||
(xe::be<uint16_t>)mode.display_height; // actual display size?
|
||||
display_info->unk4C = mode.refresh_rate;
|
||||
display_info->unk56 = (xe::be<uint16_t>)mode.display_width; // display width
|
||||
display_info->unk56 = (xe::be<uint16_t>)mode.display_width; // display width
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT(VdGetCurrentDisplayInformation, ExportTag::kVideo);
|
||||
|
||||
@@ -324,10 +326,8 @@ void VdSwap(lpvoid_t buffer_ptr, // ptr into primary ringbuffer
|
||||
lpunknown_t unk3, // buffer from VdGetSystemCommandBuffer
|
||||
lpunknown_t unk4, // from VdGetSystemCommandBuffer (0xBEEF0001)
|
||||
lpdword_t frontbuffer_ptr, // ptr to frontbuffer address
|
||||
lpdword_t color_format_ptr,
|
||||
lpdword_t color_space_ptr,
|
||||
lpunknown_t unk8,
|
||||
unknown_t unk9) {
|
||||
lpdword_t color_format_ptr, lpdword_t color_space_ptr,
|
||||
lpunknown_t unk8, unknown_t unk9) {
|
||||
gpu::xenos::xe_gpu_texture_fetch_t fetch;
|
||||
xe::copy_and_swap_32_unaligned(
|
||||
reinterpret_cast<uint32_t*>(&fetch),
|
||||
|
||||
@@ -67,7 +67,7 @@ struct X_OBJECT_HEADER {
|
||||
uint8_t quota_info_offset;
|
||||
uint8_t flags;
|
||||
union {
|
||||
xe::be<uint32_t> object_create_info; // X_OBJECT_CREATE_INFORMATION
|
||||
xe::be<uint32_t> object_create_info; // X_OBJECT_CREATE_INFORMATION
|
||||
xe::be<uint32_t> quota_block_charged;
|
||||
};
|
||||
xe::be<uint32_t> security_descriptor;
|
||||
|
||||
Reference in New Issue
Block a user