Create an account


Check for new replies
mana bar (for mages / mana shield)

#1
here is a Cheat Engine script ( https://cheatengine.org/ ) that replaces your avatar's HP bar with a mana bar, useful when playing on my Mage, imo:

Code:
{ Game   : Tibia.exe 7.6
  Version: 1
  Date   : 2019-03-30
  Author : hans
  This script replaces your above-avatar health bar with a mana bar (useful for mages with mana shield)
}
{
uint *player_id = 004A1244
// THIS IS WRONG: Creature *our_avatar = (*(004194D8)) + 178;
uint *mana_max= 004A1220;
uint *mana_now= 004A1224;
}
[ENABLE]

aobscanmodule(INJECT_COLOR,Tibia.exe,8B 81 84 00 00 00 33 C9 3B C1 7C 18 83 F8)
aobscanmodule(INJECT_HEALTH,Tibia.exe, 8B 82 84 00 00 00 8B 4C 24 38)
alloc(newmem_COLOR,$1000)
alloc(newmem_HEALTH,$1000)
define(mana_max,004A1220)
define(mana_now,004A1224)
define(player_id,004A1244)
label(original_COLOR)
label(return_COLOR)
label(original_HEALTH)
label(return_HEALTH)
//<color>
newmem_COLOR:
mov eax,[player_id]
cmp eax,[ecx]
jne original_COLOR // it's someone else
// it's me
// <mana_max_zero>
// special case for max mana 0 to avoid "division by zero crash" (rookguard level 1 with 0 mana?)
cmp [mana_max],(int)0
jne not_zero_max_mana_COLOR
// ... our max mana is 0, not sure what to do
mov eax,(int)50
jmp return_COLOR
not_zero_max_mana_COLOR:
//</mana_max_zero>
mov eax,[mana_now]
push edx
mov edx,(int)100
imul edx
idiv [mana_max]
pop edx
// result is now in eax where it's supposed to be.
jmp return_COLOR
original_COLOR:
  mov eax,[ecx+00000084]
  jmp return_COLOR

INJECT_COLOR:
  jmp newmem_COLOR
  nop
return_COLOR:
registersymbol(INJECT_COLOR)
//</color>
//<health>

newmem_HEALTH:
mov eax,[player_id]
cmp eax,[edx]
jne original_HEALTH // it's someone else
// it's me
// <mana_max_zero>
// special case for max mana 0 to avoid "division by zero crash" (rookguard level 1 with 0 mana?)
cmp [mana_max],(int)0
jne not_zero_max_mana_HEALTH
// ... our max mana is 0, not sure what to do
mov eax,(int)50
jmp return_HEALTH
not_zero_max_mana_HEALTH:
//</mana_max_zero>
mov eax,[mana_now]
push edx
mov edx,(int)100
imul edx
idiv [mana_max]
pop edx
// result is now in eax where it's supposed to be.
jmp return_HEALTH
original_HEALTH:
mov eax,[edx+00000084]
jmp return_HEALTH

INJECT_HEALTH:
  jmp newmem_HEALTH
  nop
return_HEALTH:
registersymbol(INJECT_HEALTH)

//</health>

[DISABLE]

//<color>
INJECT_COLOR:
  db 8B 81 84 00 00 00

unregistersymbol(INJECT_COLOR)
dealloc(newmem_COLOR)
//</color>
//<health>
INJECT_HEALTH:
db 8B 82 84 00 00 00 8B 4C 24 38
unregistersymbol(INJECT_HEALTH)
dealloc(newmem_HEALTH)
//</health>

{
// COLOR ORIGINAL CODE - INJECTION POINT: "Tibia.exe"+18BB0

"Tibia.exe"+18B94: 56                    -  push esi
"Tibia.exe"+18B95: 8B F1                 -  mov esi,ecx
"Tibia.exe"+18B97: 89 46 7C              -  mov [esi+7C],eax
"Tibia.exe"+18B9A: E8 B1 10 04 00        -  call Tibia.exe+59C50
"Tibia.exe"+18B9F: 05 E8 03 00 00        -  add eax,000003E8
"Tibia.exe"+18BA4: 89 86 80 00 00 00     -  mov [esi+00000080],eax
"Tibia.exe"+18BAA: 5E                    -  pop esi
"Tibia.exe"+18BAB: C2 04 00              -  ret 0004
"Tibia.exe"+18BAE: CC                    -  int 3
"Tibia.exe"+18BAF: CC                    -  int 3
// ---------- INJECTING HERE ----------
"Tibia.exe"+18BB0: 8B 81 84 00 00 00     -  mov eax,[ecx+00000084]
// ---------- DONE INJECTING  ----------
"Tibia.exe"+18BB6: 33 C9                 -  xor ecx,ecx
"Tibia.exe"+18BB8: 3B C1                 -  cmp eax,ecx
"Tibia.exe"+18BBA: 7C 18                 -  jl Tibia.exe+18BD4
"Tibia.exe"+18BBC: 83 F8 03              -  cmp eax,03
"Tibia.exe"+18BBF: 7F 13                 -  jg Tibia.exe+18BD4
"Tibia.exe"+18BC1: 8B 44 24 04           -  mov eax,[esp+04]
"Tibia.exe"+18BC5: C7 00 60 00 00 00     -  mov [eax],00000060
"Tibia.exe"+18BCB: 89 48 04              -  mov [eax+04],ecx
"Tibia.exe"+18BCE: 89 48 08              -  mov [eax+08],ecx
"Tibia.exe"+18BD1: C2 04 00              -  ret 0004
}

{
// HEALTH ORIGINAL CODE - INJECTION POINT: "Tibia.exe"+49F42
"Tibia.exe"+49F1C: 89 0A                    -  mov [edx],ecx
"Tibia.exe"+49F1E: 8B 8C 24 20 48 00 00     -  mov ecx,[esp+00004820]
"Tibia.exe"+49F25: 89 42 04                 -  mov [edx+04],eax
"Tibia.exe"+49F28: B8 1B 00 00 00           -  mov eax,0000001B
"Tibia.exe"+49F2D: 89 42 08                 -  mov [edx+08],eax
"Tibia.exe"+49F30: B8 04 00 00 00           -  mov eax,00000004
"Tibia.exe"+49F35: 51                       -  push ecx
"Tibia.exe"+49F36: 89 42 0C                 -  mov [edx+0C],eax
"Tibia.exe"+49F39: E8 D2 CC 00 00           -  call Tibia.exe+56C10
"Tibia.exe"+49F3E: 8B 54 24 48              -  mov edx,[esp+48]
// ---------- INJECTING HERE ----------
"Tibia.exe"+49F42: 8B 82 84 00 00 00        -  mov eax,[edx+00000084]
// ---------- DONE INJECTING  ----------
"Tibia.exe"+49F48: 8B 4C 24 38              -  mov ecx,[esp+38]
"Tibia.exe"+49F4C: 99                       -  cdq
"Tibia.exe"+49F4D: 83 E2 03                 -  and edx,03
"Tibia.exe"+49F50: 03 C2                    -  add eax,edx
"Tibia.exe"+49F52: 8B 94 24 2C 48 00 00     -  mov edx,[esp+0000482C]
"Tibia.exe"+49F59: 8D 4C 11 01              -  lea ecx,[ecx+edx+01]
"Tibia.exe"+49F5D: 8B 54 24 44              -  mov edx,[esp+44]
"Tibia.exe"+49F61: 89 4C 24 60              -  mov [esp+60],ecx
"Tibia.exe"+49F65: 8B 8C 24 28 48 00 00     -  mov ecx,[esp+00004828]
"Tibia.exe"+49F6C: 8D 4C 0A 01              -  lea ecx,[edx+ecx+01]
}


Attached Files
.zip   mana_bar_7.6.CT.zip (Size: 1.84 KB / Downloads: 33)
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016
Powered By