Skip to content

Commit 0687fa6

Browse files
committed
Fix 32bits Linux build.
1 parent 4bb2d0e commit 0687fa6

File tree

5 files changed

+217
-506
lines changed

5 files changed

+217
-506
lines changed

cTools/libs/binDynMod/elfDynMod/elf32DynMod.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***
22
* MIT License
33
*
4-
* Copyright (c) 2023 Konychev Valerii
4+
* Copyright (c) 2023-2026 Konychev Valerii
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -48,9 +48,9 @@ void *elf32Hook(const Elf32File *elf32, const char *func, const void *hand)
4848
* shSize - contains the size, in bytes, of the section.
4949
* relpltAmount- amount of Elf32Rel structures in .rela.ptl section.
5050
*/
51-
Elf32Shdr *relplt = elf32GetSectByName(elf32, RELAPLT);
51+
Elf32Shdr *relplt = elf32GetSectByName(elf32, RELPLT);
5252
if (relplt == NULL) {
53-
LOG_ERROR("Cannot get the section " RELAPLT);
53+
LOG_ERROR("Cannot get the section " RELPLT);
5454
return NULL;
5555
}
5656

@@ -73,8 +73,8 @@ void *elf32Hook(const Elf32File *elf32, const char *func, const void *hand)
7373
void *relAddr = NULL;
7474
uint32_t i = 0;
7575
for (i = 0; i < relpltAmount; ++i)
76-
if (ELF32_R_SYM(elf32->relaplt[i].r_info) == symbolIndex){
77-
uint32_t offset = elf32->relaplt[i].r_offset;
76+
if (ELF32_R_SYM(elf32->relplt[i].r_info) == symbolIndex){
77+
uint32_t offset = elf32->relplt[i].r_offset;
7878
uint32_t* addr = (uint32_t*)(size_t)(func_addr_diff + offset);
7979
relAddr = (void*)(size_t) *addr;
8080
*addr = (uint32_t)(size_t) hand;

cTools/libs/binDynMod/elfDynMod/elf64DynMod.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***
22
* MIT License
33
*
4-
* Copyright (c) 2023 Konychev Valerii
4+
* Copyright (c) 2023-2026 Konychev Valerii
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)