-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I get GMalloc using x64dbg? #665
Comments
I have to agree, the 6.1 Section of the Guide is extremely hard to follow. It seems like it expects you to know a lot of things to even understand what you need to do. |
It requires reverse engineering knowledge. It's not something for which we can just make an encompassing guide. There are docs for 64dbg. |
That's obvious now, but not stated there:
I'm a software engineer and familiar with modding (just not this specific type) and the listed "general steps" are quite unfortunate in my humble opinion. But I won't be another annoying user that only complaining about a tool made voluntarily and open-source for the community. So here goes my best try at helping out:
Some context and definitions: In this context, a Signature refers to a unique sequence or pattern of bytes used to identify a function or piece of code within a binary, such as specific instructions or constants that are unlikely to appear elsewhere. It serves as a recognizable "fingerprint" to locate a particular routine during reverse engineering or patching. In contrast, a Block of Bytes is simply a contiguous sequence of raw data or instructions without any specific identification purpose. A block of bytes may or may not represent anything meaningful or unique, whereas a signature is carefully chosen to reliably distinguish a particular function or code segment. RIP (Instruction Pointer Register) is a register in x86-64 architecture that holds the address of the next instruction to be executed. It plays a key role in managing program flow, enabling the CPU to keep track of where it is in the program code.
In my case GMalloc.lua: function Register()
return "48 8B D9 48 8B 0D ?? ?? ?? ?? 48 85 C9 75 0C E8 ?? ?? ?? ??"
end
function OnMatchFound(MatchAddress)
-- Address of the first mov instruction that loads GMalloc
local MovInstr = MatchAddress + 0x03 -- Offset to the mov instruction with GMalloc
-- Offset value is encoded after the instruction opcode (3 bytes after the start of the mov)
local Offset = DerefToInt32(MovInstr + 0x3)
-- Calculate the address of GMalloc using RIP-relative addressing
local RIP = MovInstr + 0x7 -- Address of the next instruction
local GMallocAddress = RIP + Offset
return GMallocAddress
end I even did an extra step as debug to go back to running the blank project and attaching x64dbg and calculating manually the Address wanted from the signature used in Lua for the game to mod. (Calculated manually the GMalloc address from the Free function) Then setting the address in GMalloc.lua for the blank project and checking that the Address found is the same as the one auto-detected from UE4SS when running it in the blank project. And it was a match! Note: It's my first time using x64dbg, reverse engineering the game attached and first time using lua. |
Branch or Release
zDEV-UE4SS v3.0.1
Game and Engine Version
UE4SSTestDemo- UE v5.3.2
Describe the bug
How do I get GMalloc using x64dbg? I don't know how to search for it, better have a screenshot demo. please
Mods directory
To Reproduce
Expected behavior
Screenshots, UE4SS Log, and .dmp file
UE4SS.log
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: