You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question:libmem.alloc_memory_ex When allocating virtual memory in a 64-bit program, the Windows system will automatically allocate it to a farther place, causing the jmp instruction to be too long. Can this be optimized? Programming language: Python
👆The problem is that the jmp command uses 14 bytes to complete: FF25 00000000 00004DF8D0010000
Extended description:
The alloc function in CE can specify an AllocateNearThisAddress parameter. If specified, memory space will be allocated near this address.
At this time, since the address distance is very close, the jmp instruction only needs 5 bytes: E9 6EFFFEFF
As shown below:
//////////////////// Before hook
notepad++.exe+8D -30 EC - xor ah,ch
notepad++.exe+8F - 5E - pop rsi
notepad++.exe+90-66 8E 4A E6 - mov cs,[rdx-1A]
//////////////////// After hook
notepad++.exe+8D - E9 6EFFFEFF - jmp 7FF7B8D90000
notepad++.exe+92-90- nop
So is there any way, when applying for memory, to apply for memory near the specified memory, just like CE's alloc function?
Thank you
The text was updated successfully, but these errors were encountered:
Jai-wei
changed the title
64-bit targets where the jump distance bigger than 2GB otherwise
64-bit targets where the jump distance bigger than 2GB
Sep 13, 2024
Question:
libmem.alloc_memory_ex
When allocating virtual memory in a 64-bit program, the Windows system will automatically allocate it to a farther place, causing thejmp
instruction to be too long. Can this be optimized? Programming language:Python
Problem description:
alloc_memory_ex
function is:0x1d0f84c0000
hook_code_ex
function to hook,The assembly instructions become:jmp
command uses 14 bytes to complete:FF25 00000000 00004DF8D0010000
Extended description:
alloc
function in CE can specify anAllocateNearThisAddress
parameter. If specified, memory space will be allocated near this address.jmp
instruction only needs 5 bytes:E9 6EFFFEFF
So is there any way, when applying for memory, to apply for memory near the specified memory, just like CE's alloc function?
Thank you
The text was updated successfully, but these errors were encountered: