Jump to content
Moopler
Sign in to follow this  
Fameguy

Release GMS v178.4 HP/MP Stat Hook

Recommended Posts

I didnt want to post in old script thread due to it probably getting lost..

As you all know recently, ms changed their UI, thus having HP and MP be in its own class.. because of that, the "old" way of getting Hp and Mp with

GUIBase->HpOffset or GUIBase->MpOffset no longer works. However, there are different ways of getting those values.

The way it works its a multi level pointer.

we start with our CwvsContext structure.

inside that structure we have ZRef<CharacterData>. and inside that, we have GW_CharacterStats.

Finally, inside that structure we got _ZtlSecureTear_nHP[2] and _ZtlSecureTear_nMP[2], now if you look at the pdb source, these values are encrypted.

The script below pretty much decrypts those values for you.

NOTE: make sure your HP and MP alert is on 100%...

 

[Enable]
Alloc(Hook, 124)
Alloc(HP, 4)
Alloc(MP, 4)
Label(Return)
RegisterSymbol(HP)
RegisterSymbol(MP)

000B26CA0: //CField::Update
jmp Hook
db 90 90
Return:

Hook:
////// HP /////
mov eax,[029D415C] // CWvsContext
mov eax,[eax+223C] // ZRef<CharacterData>
push esi
mov esi,[eax+58] // _ZtlSecureTear_nHP[1]
rol esi,05
xor esi,[eax+54] // _ZtlSecureTear_nHP[0]
mov [HP], esi
////// MP /////
mov esi,[eax+70] // _ZtlSecureTear_nMP[1]
rol esi, 05
xor esi,[eax+6C] // _ZtlSecureTear_nMP[0]
mov [MP], esi
pop esi
push -01
push 020E6420
jmp Return

[Disable]
DeAlloc(Hook)
DeAlloc(HP)
DeAlloc(MP)
UnRegisterSymbol(HP)
UnRegisterSymbol(MP)

000B26CA0:
push -01
push 020E6420

 

  • Like 2

Share this post


Link to post
22 minutes ago, Fameguy said:

I didnt want to post in old script thread due to it probably getting lost..

As you all know recently, ms changed their UI, thus having HP and MP be in its own class.. because of that, the "old" way of getting Hp and Mp with

GUIBase->HpOffset or GUIBase->MpOffset no longer works. However, there are different ways of getting those values.

The way it works its a multi level pointer.

we start with our CwvsContext structure.

inside that structure we have ZRef<CharacterData>. and inside that, we have GW_CharacterStats.

Finally, inside that structure we got _ZtlSecureTear_nHP[2] and _ZtlSecureTear_nMP[2], now if you look at the pdb source, these values are encrypted.

The script below pretty much decrypts those values for you.

NOTE: make sure your HP and MP alert is on 100%...

 


[Enable]
Alloc(Hook, 124)
Alloc(HP, 4)
Alloc(MP, 4)
Label(Return)
RegisterSymbol(HP)
RegisterSymbol(MP)

000B26CA0: //CField::Update
jmp Hook
db 90 90
Return:

Hook:
////// HP /////
mov eax,[029D415C] // CWvsContext
mov eax,[eax+223C] // ZRef<CharacterData>
push esi
mov esi,[eax+58] // _ZtlSecureTear_nHP[1]
rol esi,05
xor esi,[eax+54] // _ZtlSecureTear_nHP[0]
mov [HP], esi
////// MP /////
mov esi,[eax+70] // _ZtlSecureTear_nMP[1]
rol esi, 05
xor esi,[eax+6C] // _ZtlSecureTear_nMP[0]
mov [MP], esi
pop esi
push -01
push 020E6420
jmp Return

[Disable]
DeAlloc(Hook)
DeAlloc(HP)
DeAlloc(MP)
UnRegisterSymbol(HP)
UnRegisterSymbol(MP)

000B26CA0:
push -01
push 020E6420

 

Are you sure the mhp and mmp values are correct? Nexon stores the max value with all the % and + added in BasicStat..

Edit: Just woke up and I am dumb. There is no mhp and mmp in this... search it in the kmst leak through nMHP and nMMP though

Edited by kevintjuh93

Share this post


Link to post
21 minutes ago, kevintjuh93 said:

Are you sure the mhp and mmp values are correct? Nexon stores the max value with all the % and + added in BasicStat..

Edit: Just woke up and I am dumb. There is no mhp and mmp in this... search it in the kmst leak through nMHP and nMMP though

Dont see how i would need the max hp and max mp though, i tested the script and it works

Share this post


Link to post
2 hours ago, Fameguy said:

Dont see how i would need the max hp and max mp though, i tested the script and it works

I use it for fancy stuff... like % calculations.

Share this post


Link to post

Why hook in CField, then you need to update the  CWvsContext pointer. Hook and CWvsContext func and use the ecx.

Share this post


Link to post

Yea u are right, at the moment i used that because i was debugginh :P but ill release a simpler version

4 hours ago, kevintjuh93 said:

I use it for fancy stuff... like % calculations.

Well feel free to do that lol, wasnt the point of the script

Share this post


Link to post
1 hour ago, Fameguy said:

Yea u are right, at the moment i used that because i was debugginh :P but ill release a simpler version

Well feel free to do that lol, wasnt the point of the script

You think I haven't gotten these already? lel

Share this post


Link to post
1 hour ago, kevintjuh93 said:

You think I haven't gotten these already? lel

I never stated you didnt, its simple to get, dont know if you are trying to start an argument or if that you are too cocky, anyways i was simply sharing for those that dont have the knowledge to do so.

Share this post


Link to post
1 minute ago, Fameguy said:

I never stated you didnt, its simple to get, dont know if you are trying to start an argument or if that you are too cocky, anyways i was simply sharing for those that dont have the knowledge to do so.

Non of the above, sorry if it sounded like that. And yeah, I think it's a good release. However I do think there is some code somewhere for the hp/mp like before. But they just seperated it from the exp.

Share this post


Link to post
1 minute ago, kevintjuh93 said:

Non of the above, sorry if it sounded like that. And yeah, I think it's a good release. However I do think there is some code somewhere for the hp/mp like before. But they just seperated it from the exp.

You mean like a pointer? What i did is a pointer to hp and mp its just a multi level pointer and its encrypted

Share this post


Link to post
Just now, Fameguy said:

You mean like a pointer? What i did is a pointer to hp and mp its just a multi level pointer and its encrypted

I know. But I mean the SetStatusValue hook... where it used to set hp/mp/exp values...

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
×