-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix symbols padding in linker script + slim header
the new system uses a preprocessed linker script in order to place an alias within each captured section. the following code is generated for each symbol: .text.x86_codd : { "x86_dasm" = "."; *(.text.x86_codd); } additionally, a new "slim header" has been added. it's a preprocessed variant of the current "xzre.h" which doesn't depend on external headers and can be loaded by other tools
- Loading branch information
Showing
4 changed files
with
129 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#define QUOTED(a) #a | ||
#define QUOTE(a) QUOTED(a) | ||
|
||
#define DEFSYM(name, section) \ | ||
section : { \ | ||
QUOTE(name) = QUOTE(.); \ | ||
*(section); \ | ||
} | ||
|
||
#define SECTIONS_BEGIN() SECTIONS { | ||
#define SECTIONS_END(name) } INSERT AFTER name; | ||
|
||
SECTIONS_BEGIN() | ||
DEFSYM(x86_dasm, .text.x86_codd) | ||
DEFSYM(find_call_instruction, .text.lzma_optimum_normaa) | ||
DEFSYM(find_lea_instruction, .text.lzma_raw_encodea) | ||
DEFSYM(find_instruction_with_mem_operand, .text.stream_encoder_mt_inia) | ||
DEFSYM(find_lea_instruction_with_mem_operand, .text.lzma_mt_block_siza) | ||
DEFSYM(find_instruction_with_mem_operand_ex, .text.lzma_properties_siza) | ||
DEFSYM(find_function_prologue, .text.lzma_raw_coder_memusaga) | ||
DEFSYM(find_function, .text.lzma2_encoder_inia) | ||
DEFSYM(get_lzma_allocator, .text.stream_decoder_memconfia) | ||
DEFSYM(secret_data_append_from_call_site, .text.lzma_index_iter_rewina) | ||
DEFSYM(elf_contains_vaddr, .text.parse_bcz) | ||
DEFSYM(elf_parse, .text.get_literal_prica) | ||
DEFSYM(main_elf_parse, .text.lzma_filter_decoder_is_supportea) | ||
DEFSYM(elf_symbol_get, .text.crc_inia) | ||
DEFSYM(elf_symbol_get_addr, .text.crc64_generia) | ||
DEFSYM(elf_get_code_segment, .text.lzma_check_updata) | ||
DEFSYM(elf_get_rodata_segment, .text.index_tree_appena) | ||
DEFSYM(elf_get_data_segment, .text.microlzma_decoda) | ||
DEFSYM(elf_get_plt_symbol, .text.delta_coder_ena) | ||
DEFSYM(elf_get_got_symbol, .text.delta_decoda) | ||
DEFSYM(elf_get_reloc_symbol, .text.lz_encoda) | ||
DEFSYM(elf_find_string, .text.lzip_decoda) | ||
DEFSYM(elf_find_string_reference, .text.lzma_auto_decoda) | ||
DEFSYM(secret_data_append_from_instruction, .text.lzma_lzma_encoder_inia) | ||
DEFSYM(secret_data_append_from_code, .text.lzma_memlimit_gea) | ||
DEFSYM(secret_data_append_if_flags, .text.lzma_check_inia) | ||
DEFSYM(find_reg2reg_instruction, .text.lzma_block_total_siza) | ||
DEFSYM(find_string_reference, .text.stream_encoda) | ||
DEFSYM(secret_data_append_singleton, .text.rc_read_inis) | ||
DEFSYM(backdoor_init, .text._get_cpuia) | ||
DEFSYM(backdoor_init_stage2, .text.lzma_validate_chaia) | ||
DEFSYM(backdoor_setup, .text.microlzma_encoder_inia) | ||
DEFSYM(resolve_libc_imports, .text.lzma_index_buffer_encoda) | ||
DEFSYM(process_shared_libraries, .text.lzma_index_stream_flaga) | ||
DEFSYM(process_shared_libraries_map, .text.lzma_index_encoder_inia) | ||
DEFSYM(chacha_decrypt, .text.lzma_delta_encoder_inia) | ||
DEFSYM(secret_data_get_decrypted, .text.parse_lzma10) | ||
DEFSYM(is_range_mapped, .text.hc_find_funa) | ||
DEFSYM(elf_find_string_references, .text.auto_decoder_iniz) | ||
DEFSYM(get_string_id, .text.simple_coder_updata) | ||
DEFSYM(init_hook_functions, .text.lzma_delta_decoder_inis) | ||
DEFSYM(_get_cpuid, .text._get_cpuid) | ||
DEFSYM(update_got_address, .text.lzma_stream_header_encoda) | ||
DEFSYM(backdoor_symbind64, .text.lz_encoder_prepara) | ||
DEFSYM(hook_RSA_get0_key, .text.lzma_index_inia) | ||
DEFSYM(hook_EVP_PKEY_set1_RSA, .text.lzma_index_memusaga) | ||
DEFSYM(hook_RSA_public_decrypt, .text.lzma_index_prealloa) | ||
SECTIONS_END(.text) | ||
|
||
SECTIONS_BEGIN() | ||
DEFSYM(global_ctx, .bss.lzma12_codez) | ||
DEFSYM(resolver_call_count, .bss.__intr2) | ||
DEFSYM(hooks_data_addr, .bss.filter_optionz) | ||
SECTIONS_END(.bss) | ||
|
||
SECTIONS_BEGIN() | ||
DEFSYM(fake_lzma_allocator, .data.rel.ro.decoders0) | ||
SECTIONS_END(.data.rel.ro) |