Major injector refactoring

This commit is contained in:
mkrsym1
2023-06-25 12:32:19 +03:00
parent 55fd21feef
commit a0e79dcea0
11 changed files with 60 additions and 55 deletions

View File

@ -1,27 +1,48 @@
include_dir = include_directories('include')
str_include_dir = join_paths(meson.current_source_dir(), 'include')
# Assemble the payload that will be injected into the launcher
inj_payload_bin = asm_gen.process(
'src/payload.asm',
extra_args: [ str_include_dir ]
# Assemble the payloads
launcher_payload_bin = asm_gen.process(
'src/launcher_p.asm',
extra_args: [ '-i', str_include_dir ]
)
# Embed it into the library
inj_res_files = custom_target(
'ipayload.[oh]',
output: [ 'ipayload.o', 'ipayload.h' ],
input: [ inj_payload_bin ],
game_payload_bin = asm_gen.process(
'src/game_p.asm',
extra_args: [ '-i', str_include_dir ]
)
# Embed them into .o files
exe_res_files = custom_target(
'launcher_p.[oh]',
output: [ 'launcher_p.o', 'launcher_p.h' ],
input: [ launcher_payload_bin ],
command: [ gen_res, './injector', '@OUTPUT0@', '@OUTPUT1@', '@INPUT@' ]
)
dll_res_files = custom_target(
'game_p.[oh]',
output: [ 'game_p.o', 'game_p.h' ],
input: [ game_payload_bin ],
command: [ gen_res, './injector', '@OUTPUT0@', '@OUTPUT1@', '@INPUT@' ]
)
# Main injector exe
executable(
'jadeite',
'src/injector.c',
inj_res_files,
'src/exe.c',
'src/inject.c',
exe_res_files,
include_directories: include_dir,
name_prefix: ''
)
subdir('launcher_payload')
# Dll that will be injected into the launcher
shared_library(
'launcher_payload',
'src/dll.c',
'src/inject.c',
dll_res_files,
include_directories: include_dir,
name_prefix: ''
)