mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-06 12:11:43 +00:00
13 lines
407 B
C
13 lines
407 B
C
|
#include "chainloader.h"
|
||
|
|
||
|
uint8_t g_payload_arg_data[PAYLOAD_ARG_DATA_MAX_SIZE] = {1};
|
||
|
|
||
|
#pragma GCC optimize (3)
|
||
|
void relocate_and_chainload_main(uintptr_t load_address, uintptr_t src_address, size_t size, int argc) {
|
||
|
for(size_t i = 0; i < size; i++) {
|
||
|
*(uint8_t *)(load_address + i) = *(uint8_t *)(src_address + i);
|
||
|
}
|
||
|
|
||
|
((void (*)(int, void *))load_address)(argc, g_payload_arg_data);
|
||
|
}
|