Skip to content

Commit

Permalink
xzre_code: add init_elf_entry_ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
smx-smx committed Aug 3, 2024
1 parent 504a052 commit 1df38c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions xzre_code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library(xzre_code
elf_symbol_get_addr.c
get_lzma_allocator.c
is_endbr64_instruction.c
init_elf_entry_ctx.c
fake_lzma_alloc.c
fake_lzma_free.c
find_function.c
Expand Down
12 changes: 12 additions & 0 deletions xzre_code/init_elf_entry_ctx.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (C) 2024 Stefano Moioli <[email protected]>
**/
#include "xzre.h"

void init_elf_entry_ctx(elf_entry_ctx_t *ctx){
ctx->symbol_ptr = (void *)&cpuid_random_symbol;
ctx->got_ctx.return_address = (void *)ctx->frame_address[3];
get_got_offset(ctx);
get_cpuid_got_index(ctx);
ctx->got_ctx.got_ptr = NULL;
}

0 comments on commit 1df38c7

Please sign in to comment.