Added calloc and free wrapped functions

This commit is contained in:
ptitSeb 2021-03-05 11:16:17 +01:00
parent 386479f408
commit 4d02ba25f1
5 changed files with 11 additions and 3 deletions

View File

@ -382,7 +382,7 @@ int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, elfheader_t* head, int cn
uint64_t *p = (uint64_t*)(rel[i].r_offset + head->delta);
uintptr_t offs = 0;
uintptr_t end = 0;
uintptr_t tmp = 0;
//uintptr_t tmp = 0;
if(bind==STB_LOCAL) {
offs = sym->st_value + head->delta;
end = offs + sym->st_size;

View File

@ -1,5 +1,6 @@
#() vFE
#() vFv
#() vFp
#() iFE
#() iFu
#() iFp
@ -12,6 +13,7 @@
#() iFip
#() iFup
#() pFEp
#() pFLL
#() vFEpu
#() iFEpp
#() iFEpV

View File

@ -71,6 +71,7 @@ void VulkanTox86(void* src, void* save);
int of_convert(int);
typedef void (*vFE_t)(x64emu_t*);
typedef void (*vFv_t)(void);
typedef void (*vFp_t)(void*);
typedef int32_t (*iFE_t)(x64emu_t*);
typedef int32_t (*iFu_t)(uint32_t);
typedef int32_t (*iFp_t)(void*);
@ -83,6 +84,7 @@ typedef int32_t (*iFEp_t)(x64emu_t*, void*);
typedef int32_t (*iFip_t)(int32_t, void*);
typedef int32_t (*iFup_t)(uint32_t, void*);
typedef void* (*pFEp_t)(x64emu_t*, void*);
typedef void* (*pFLL_t)(uintptr_t, uintptr_t);
typedef void (*vFEpu_t)(x64emu_t*, void*, uint32_t);
typedef int32_t (*iFEpp_t)(x64emu_t*, void*, void*);
typedef int32_t (*iFEpV_t)(x64emu_t*, void*, void*);
@ -101,6 +103,7 @@ typedef int32_t (*iFEpippppp_t)(x64emu_t*, void*, int32_t, void*, void*, void*,
void vFE(x64emu_t *emu, uintptr_t fcn) { vFE_t fn = (vFE_t)fcn; fn(emu); }
void vFv(x64emu_t *emu, uintptr_t fcn) { vFv_t fn = (vFv_t)fcn; fn(); }
void vFp(x64emu_t *emu, uintptr_t fcn) { vFp_t fn = (vFp_t)fcn; fn((void*)R_RDI); }
void iFE(x64emu_t *emu, uintptr_t fcn) { iFE_t fn = (iFE_t)fcn; R_RAX=fn(emu); }
void iFu(x64emu_t *emu, uintptr_t fcn) { iFu_t fn = (iFu_t)fcn; R_RAX=fn((uint32_t)R_RDI); }
void iFp(x64emu_t *emu, uintptr_t fcn) { iFp_t fn = (iFp_t)fcn; R_RAX=fn((void*)R_RDI); }
@ -113,6 +116,7 @@ void iFEp(x64emu_t *emu, uintptr_t fcn) { iFEp_t fn = (iFEp_t)fcn; R_RAX=fn(emu,
void iFip(x64emu_t *emu, uintptr_t fcn) { iFip_t fn = (iFip_t)fcn; R_RAX=fn((int32_t)R_RDI, (void*)R_RSI); }
void iFup(x64emu_t *emu, uintptr_t fcn) { iFup_t fn = (iFup_t)fcn; R_RAX=fn((uint32_t)R_RDI, (void*)R_RSI); }
void pFEp(x64emu_t *emu, uintptr_t fcn) { pFEp_t fn = (pFEp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI); }
void pFLL(x64emu_t *emu, uintptr_t fcn) { pFLL_t fn = (pFLL_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI); }
void vFEpu(x64emu_t *emu, uintptr_t fcn) { vFEpu_t fn = (vFEpu_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI); }
void iFEpp(x64emu_t *emu, uintptr_t fcn) { iFEpp_t fn = (iFEpp_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (void*)R_RSI); }
void iFEpV(x64emu_t *emu, uintptr_t fcn) { iFEpV_t fn = (iFEpV_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (void*)(R_RSP + 16)); }

View File

@ -32,6 +32,7 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
void vFE(x64emu_t *emu, uintptr_t fnc);
void vFv(x64emu_t *emu, uintptr_t fnc);
void vFp(x64emu_t *emu, uintptr_t fnc);
void iFE(x64emu_t *emu, uintptr_t fnc);
void iFu(x64emu_t *emu, uintptr_t fnc);
void iFp(x64emu_t *emu, uintptr_t fnc);
@ -44,6 +45,7 @@ void iFEp(x64emu_t *emu, uintptr_t fnc);
void iFip(x64emu_t *emu, uintptr_t fnc);
void iFup(x64emu_t *emu, uintptr_t fnc);
void pFEp(x64emu_t *emu, uintptr_t fnc);
void pFLL(x64emu_t *emu, uintptr_t fnc);
void vFEpu(x64emu_t *emu, uintptr_t fnc);
void iFEpp(x64emu_t *emu, uintptr_t fnc);
void iFEpV(x64emu_t *emu, uintptr_t fnc);

View File

@ -88,7 +88,7 @@
//GOW(bzero,
//GO(c16rtomb,
//GOW(c32rtomb,
//GOW(calloc,
GOW(calloc, pFLL)
//GO(callrpc,
//GO(__call_tls_dtors,
//GOW(canonicalize_file_name,
@ -392,7 +392,7 @@ GOM(__cxa_finalize, vFEp)
//GO(__freading,
//GOW(fread_unlocked,
//GO(__fread_unlocked_chk,
//GO(free,
GO(free, vFp)
//GO(freeaddrinfo,
//GOW(freeifaddrs,
//GO(__freelocale,