Help! I'm Learning to Hook. (HELP)

GODOFMLBB

Platinian
Original poster
Aug 20, 2022
16
1
3
28
tr
Hello friends. What Can I Use To Hook This Offset? No Update Function.


Offset: 0x2A35C20
public static CmdHeroSkin GetHeroSkin(List<CmdHeroSkin> m_heroskins, uint skinid) { }
1668458767977.png

1668458813144.png
 
Last edited:
  • Like
Reactions: BlackJackerrrr

liami302

Approved Modder
Approved Modder
Mar 19, 2022
57
3,956
183
24
Somewhere far away
bool(*oldIsForbidSkin)(void* obj);
bool IsForbidSkin(void* obj){
if(obj != nullptr && UnlockForbidSkin){
return true;
}
oldIsForbidSkin(obj);
}

HOOK("0x2A35C20", IsForbidSkin, oldIsForbidSkin);

Use the newest LGL version.
 
  • Like
Reactions: GODOFMLBB

GODOFMLBB

Platinian
Original poster
Aug 20, 2022
16
1
3
28
tr
bool(*oldIsForbidSkin)(void* obj);
bool IsForbidSkin(void* obj){
if(obj != nullptr && UnlockForbidSkin){
return true;
}
oldIsForbidSkin(obj);
}

HOOK("0x2A35C20", IsForbidSkin, oldIsForbidSkin);

Use the newest LGL version.
no. i already did that. the code in the picture is already correct and working. I know the code for true false. I wanted to say. How can I hook the arm code to be mov r0, r1 / bx lr.
 

Raebydett

Awesome Active Platinian
Jan 20, 2020
177
62
28
G
How can I hook the arm code to be mov r0, r1 / bx lr
What u say its literally called hex patching


C++:
case 0:
toggle_1
    if (toggle_1)
    {
        PATCH("0x123456", "01 00 A0 E1 1E FF 2F E1");
    } else {
        PATCH("0x123456", "XX XX XX XX"); <--- original value
    }
break:
 
  • Like
Reactions: GODOFMLBB

GODOFMLBB

Platinian
Original poster
Aug 20, 2022
16
1
3
28
tr
What u say its literally called hex patching


C++:
case 0:
toggle_1
    if (toggle_1)
    {
        PATCH("0x123456", "01 00 A0 E1 1E FF 2F E1");
    } else {
        PATCH("0x123456", "XX XX XX XX"); <--- original value
    }
break:
no. i already did that. the code in the picture is already correct and working. I know the code for true false. I wanted to say. How can I hook the arm code to be mov r0, r1 / bx lr.
 

Raebydett

Awesome Active Platinian
Jan 20, 2020
177
62
28
G
Whats the goal to do that ? Its literally the same, not quite sure if able to do what u mention or write your own library then
 
  • Like
Reactions: GODOFMLBB

GODOFMLBB

Platinian
Original poster
Aug 20, 2022
16
1
3
28
tr
Whats the goal to do that ? Its literally the same, not quite sure if able to do what u mention or write your own library then
dude i did the hex patch method and it worked. like i said i need to do this with hook method. In short, I need to put fields or other things to open the get hero skin offset. yes it is more difficult but i want to learn this method.
 

Raebydett

Awesome Active Platinian
Jan 20, 2020
177
62
28
G
LOL now i understand what u mean, u keep saying mov r0, r1 / bx lr make me confused.

if u want access from that param use array and logs those skinid
 
  • Like
Reactions: GODOFMLBB

GODOFMLBB

Platinian
Original poster
Aug 20, 2022
16
1
3
28
tr
LOL şimdi ne demek istediğini anlıyorum, mov r0, r1 / bx lr deyip duruyorsun kafamı karıştırıyor.

bu paramdan erişmek istiyorsanız diziyi kullanın ve bu skinid'i günlüğe kaydeder
[/ALINTI]


Is there an Instagram or an address where I can reach you?
 

liami302

Approved Modder
Approved Modder
Mar 19, 2022
57
3,956
183
24
Somewhere far away
no. i already did that. the code in the picture is already correct and working. I know the code for true false. I wanted to say. How can I hook the arm code to be mov r0, r1 / bx lr.
You patch using assembly.

True = mov r0, #1
False = mov r0, #0

Arm64:
True = mov x0, #1
False = mov x0, #0
 
  • Like
Reactions: GODOFMLBB

GODOFMLBB

Platinian
Original poster
Aug 20, 2022
16
1
3
28
tr
You patch using assembly.

True = mov r0, #1
False = mov r0, #0

Arm64:
True = mov x0, #1
False = mov x0, #0
dude i did the hex patch method and it worked. like i said i need to do this with hook method. In short, I need to put fields or other things to open the get hero skin offset. yes it is more difficult but i want to learn this method.
 

CHEATS GAMES

Solid & Active Platinian
Aug 9, 2019
64
18
8
39
Brazil
C++:
void(*orig_Update)(void *instance);
void Update(void* instance) {

if (instance != nullptr)
     {
        if (hack2)
          return true;
        } else { 
          return false;
        }

     }

     orig_Update(instance); // dont use return on void function
}