WiiUModuleSystem/include/wums/defines/module_defines.h

75 lines
2.6 KiB
C
Raw Normal View History

2020-06-06 16:46:11 +02:00
/****************************************************************************
2022-05-07 20:42:31 +02:00
* Copyright (C) 2022 Maschell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
2020-06-06 16:46:11 +02:00
#pragma once
#include "dynamic_linking_defines.h"
#include "export_defines.h"
2022-02-04 22:24:22 +01:00
#include "relocation_defines.h"
#include <stddef.h>
#include <stdint.h>
2020-06-06 16:46:11 +02:00
#ifdef __cplusplus
extern "C" {
#endif
2022-05-07 20:42:31 +02:00
// clang-format off
2020-06-06 16:46:11 +02:00
typedef struct hook_data_t {
uint32_t type;
2021-09-17 16:17:54 +02:00
uint32_t target;
2020-06-06 16:46:11 +02:00
} hook_data_t;
typedef struct module_function_symbol_data_t {
2022-05-07 20:42:31 +02:00
const char * name;
void * address;
uint32_t size;
} module_function_symbol_data_t;
2021-09-17 16:17:54 +02:00
typedef struct module_information_single_t {
2022-05-07 20:42:31 +02:00
dyn_linking_relocation_entry_t * linking_entries;
uint32_t number_linking_entries;
const char * module_export_name;
export_data_t * export_entries;
uint32_t number_export_entries;
hook_data_t * hook_entries;
uint32_t number_hook_entries;
uint32_t bssAddr;
uint32_t bssSize;
uint32_t sbssAddr;
uint32_t sbssSize;
uint32_t startAddress;
uint32_t endAddress;
uint32_t entrypoint;
uint8_t skipInitFini;
uint8_t initBeforeRelocationDoneHook;
module_function_symbol_data_t * function_symbol_entries;
uint32_t number_function_symbols;
2021-09-17 16:17:54 +02:00
} module_information_single_t;
2020-06-06 16:46:11 +02:00
2022-05-07 20:42:31 +02:00
#define MODULE_INFORMATION_VERSION 0x0000000D
2020-06-06 16:46:11 +02:00
2021-09-17 16:17:54 +02:00
typedef struct module_information_t {
uint32_t version;
2022-05-07 20:42:31 +02:00
uint32_t number_modules;
module_information_single_t * modules;
2021-09-17 16:17:54 +02:00
} module_information_t;
2022-02-04 22:24:22 +01:00
// clang-format on
2020-06-06 16:46:11 +02:00
#ifdef __cplusplus
}
#endif