dccloader/dcc/pic.c
2026-03-22 11:47:18 +07:00

14 lines
No EOL
385 B
C

#include <stdint.h>
typedef struct {
uint32_t offset;
uint32_t type;
} RELOC;
void pic_relocate(uint32_t base, RELOC *reloc_cur, RELOC *reloc_end, uint32_t data_end_offset) {
while (reloc_cur < reloc_end) {
RELOC *rel = reloc_cur++;
if (rel->type == 0x17 && rel->offset >= data_end_offset)
*((uint32_t *)(base + rel->offset)) += base;
}
}