0% found this document useful (0 votes)
1K views1 page

MLBB Memory Patch for li2cpp

The document provides a code snippet for modifying memory in a game, specifically for the mobile game MLBB (Mobile Legends: Bang Bang). It includes a class definition, a memory patch function, and an example usage of the function to alter specific memory addresses with hex values. Upon successful execution, an alert message is displayed to the user.

Uploaded by

frifaya1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views1 page

MLBB Memory Patch for li2cpp

The document provides a code snippet for modifying memory in a game, specifically for the mobile game MLBB (Mobile Legends: Bang Bang). It includes a class definition, a memory patch function, and an example usage of the function to alter specific memory addresses with hex values. Upon successful execution, an alert message is displayed to the user.

Uploaded by

frifaya1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

-- Example class and method for mlbb (Map Hack)

-- Public class ShowEntity


-- public virtual [Link] get_m_CanSight()

--@setLibRanges
local libcsharp_Xa=[Link]("[Link]")[1].start

--@HexPatch System
local function MemoryPatch(addr, offset, hex)
local t, total = {}, 0
for h in [Link](hex, "%S+") do
if #h == 2 and h:match("^%x+$") then
[Link](t, {
address = addr + offset + total,
flags = gg.TYPE_BYTE,
value = h .. "r"
})
total = total + 1
else
[Link]("Invalid hex byte: " .. h)
return false
end
end
local res = [Link](t)
if res == nil or type(res) == 'boolean' then
return true
else
[Link]("Error setting values: " .. tostring(res))
return false
end
end

--@Uses
MemoryPatch([Link], 0x1C7FE04, "20 00 80 D2 C0 03 5F D6")

--@alert message
[Link]("Executed Successfully")

You might also like