2022-05-19 23:15:40 +02:00
|
|
|
; FXF routines
|
|
|
|
|
|
|
|
; parse and relocate an FXF binary loaded in memory
|
|
|
|
; inputs:
|
|
|
|
; r0: pointer to memory buffer containing an FXF binary
|
|
|
|
; outputs:
|
2023-01-30 13:53:44 +01:00
|
|
|
; r0: relocation address or 0 on error
|
2022-05-22 01:55:56 +02:00
|
|
|
parse_fxf_binary:
|
2023-01-30 13:53:44 +01:00
|
|
|
push r1
|
|
|
|
mov r1, [r0]
|
|
|
|
cmp r1, [fxf_magic]
|
|
|
|
ifnz pop r1
|
|
|
|
ifnz mov r0, 0
|
|
|
|
ifnz ret
|
|
|
|
pop r1
|
2022-05-19 23:15:40 +02:00
|
|
|
|
|
|
|
call fxf_reloc
|
|
|
|
|
2022-05-22 01:55:56 +02:00
|
|
|
ret
|
2022-05-19 23:15:40 +02:00
|
|
|
|
2023-02-02 00:08:22 +01:00
|
|
|
fxf_magic: data.strz "FXF"
|
2023-01-30 13:53:44 +01:00
|
|
|
|
2023-03-23 06:18:33 +01:00
|
|
|
#include "fxf/launch.asm"
|
2022-05-19 23:15:40 +02:00
|
|
|
#include "fxf/reloc.asm"
|
|
|
|
|
|
|
|
const FXF_CODE_SIZE: 0x00000004
|
|
|
|
const FXF_CODE_PTR: 0x00000008
|
2022-06-22 04:05:34 +02:00
|
|
|
const FXF_RELOC_SIZE: 0x0000000C
|
|
|
|
const FXF_RELOC_PTR: 0x00000010
|