Skip to content

Commit

Permalink
Refactor elf64Prase.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vipon committed Mar 15, 2024
1 parent e0e84e7 commit 99a30bc
Show file tree
Hide file tree
Showing 8 changed files with 420 additions and 616 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
"charconv": "cpp",
"__locale": "c",
"bindynmod.h": "c",
"windows.h": "c"
"windows.h": "c",
"stdint.h": "c"
},
"C_Cpp.errorSquiggles": "enabled",

Expand Down
8 changes: 4 additions & 4 deletions cTools/include/sys/elf64.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ typedef struct {

/* Relocations that need an addend field. */
typedef struct {
Elf64_Addr r_offset; /* Location to be relocated. */
Elf64_Xword r_info; /* Relocation type and symbol index. */
Elf64_Sxword r_addend; /* Addend. */
Elf64_Addr r_offset; /* Location to be relocated. */
Elf64_Xword r_info; /* Relocation type and symbol index. */
Elf64_Sxword r_addend; /* Addend. */
} Elf64_Rela;

/* Macros for accessing the fields of r_info. */
Expand All @@ -176,7 +176,7 @@ typedef Elf_Note Elf64_Nhdr;
*/
typedef struct {
Elf64_Lword m_value; /* symbol value */
Elf64_Xword m_info; /* size + index */
Elf64_Xword m_info; /* size + index */
Elf64_Xword m_poffset; /* symbol offset */
Elf64_Half m_repeat; /* repeat count */
Elf64_Half m_stride; /* stride info */
Expand Down
3 changes: 1 addition & 2 deletions cTools/libs/arch/aarch64/test/aarch64_code_move.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ void call_func6(uint32_t *n)
}

extern
void test_move_and_exec(void *func, const char *fn, void *arg);// __attribute__((section("__TEXT,__my_sect")));

void test_move_and_exec(void *func, const char *fn, void *arg);
void test_move_and_exec(void *func, const char *fn, void *arg)
{
BinSymPtr sym = binParser.getSymByName(binParser.bin, fn);
Expand Down
2 changes: 1 addition & 1 deletion cTools/libs/binDynMod/test/binDynModTest.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***
* MIT License
*
* Copyright (c) 2021-2023 Konychev Valerii
* Copyright (c) 2021-2024 Konychev Valerii
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 99a30bc

Please sign in to comment.