Skip to content

Commit

Permalink
Fix tbb malloc proxy on 14.30.33807 (#1478)
Browse files Browse the repository at this point in the history
In this version of the ucrtbase.dll, the assembly of the _msize
function has changed.

The first instruction of this function is a relative jump (0xE9)
followed by a 4-byte offset. This offset has changed, but we can
safely assume that 0xE9 followed by any offset value is correct,
especially since we have special handling for the 0xE9 instruction in
the InsertTrampoline() function.

The 0xCC is an INT 3 instruction, so it's a free space to use.
  • Loading branch information
lplewa authored Aug 16, 2024
1 parent 7105e0a commit 2d516c8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/tbbmalloc_proxy/proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,12 @@ void __TBB_malloc__free_base(void *ptr)
const char* known_bytecodes[] = {
#if _WIN64
// "========================================================" - 56 symbols
"E9********CCCC", // multiple - jmp(0xE9) with address followed by empty space (0xCC - INT 3)
"4883EC284885C974", // release free()
"4883EC284885C975", // release _msize()
"4885C974375348", // release free() 8.0.50727.42, 10.0
"E907000000CCCC", // release _aligned_msize(), _aligned_free() ucrtbase.dll
"C7442410000000008B", // release free() ucrtbase.dll 10.0.14393.33
"E90B000000CCCC", // release _msize() ucrtbase.dll 10.0.14393.33
"48895C24085748", // release _aligned_msize() ucrtbase.dll 10.0.14393.33
"E903000000CCCC", // release _aligned_msize() ucrtbase.dll 10.0.16299.522
"48894C24084883EC28BA", // debug prologue
"4C894424184889542410", // debug _aligned_msize() 10.0
"48894C24084883EC2848", // debug _aligned_free 10.0
Expand Down

0 comments on commit 2d516c8

Please sign in to comment.