Code: Select all
define(aobObjProfile, 48 89 D9 BA 72 64 70 72)
define(aobObjTooltip, 4C 89 F9 BA 6F 6E 52 44)
[ENABLE]
aobscanmodule(getObjTooltip, $process, 4C 89 F9 BA 6F 6E 52 44) // 4C89F9BAxxxxxxxxFF90xxxxxxxx488D742440
alloc(newmem,$1000,getObjTooltip)
registersymbol(getObjTooltip)
label(return)
newmem:
// rsi has selected object
fnShowTooltip:
mov rcx,r15 // Original Code
mov edx,44526E6F // Original Code
push r14 // backup and replace r14 as selected object
mov r14, r15
jmp fnSelect
fnSelect:
// r14 has selected object
push rax
push rbx
push rcx
push rdx
push r15
mov [ptrSelectedObj],r14 // put current object in select
mov rcx,[r14] // put vtable into rcx
mov rdx, vtbPlayer // Person Player
cmp rcx, rdx
je selPerson
mov rdx, vtbNonPlayer // Person Non-Player
cmp rcx, rdx
je selPerson
mov rdx, vtbPlayerStaff // Person Player/Non-Player
cmp rcx, rdx
je selPerson
mov rdx, vtbHumanNonPlayer // Human Manager
cmp rcx, rdx
je selPerson
mov rdx, vtbClub // Club
cmp rcx, rdx
je selClub
mov rdx, vtbCompetition // Competition
cmp rcx, rdx
je selComp
mov rdx, vtbContinent // Continent
cmp rcx, rdx
je selContinent
mov rdx, vtbNation // Nation
cmp rcx, rdx
je selNation
mov rdx, vtbStadium // Stadium
cmp rcx, rdx
je selStadium
mov rdx, vtbTeam // Team
cmp rcx, rdx
je selTeam
jmp doneSelect
selClub:
mov [ptrClub],r14
mov [updClub],1
mov rdx, [r14+18]
mov rdx, [rdx]
mov [ptrTeam], rdx
mov [updTeam], 1
cmp [rdx+78],0
je doneSelect
mov rdx, [rdx+78]
mov [ptrStadium],rdx
mov [updStadium],1
jmp doneSelect
selComp:
mov [ptrComp], r14
mov [updComp], 1
mov rdx,$cmpo.Cacm
cmp [r14+rdx],0
je doneSelect
mov r15,[r14+rdx]
mov rdx,$cmpo.Clge
cmp [r15+rdx],0
je doneSelect
mov r15,[r15+rdx]
mov r15,[r15]
mov [ptrLeagueStage], r15
jmp doneSelect
selContinent:
mov [ptrContinent], r14
mov [updContinent], 1
jmp doneSelect
selNation:
mov [ptrNation], r14
mov [updNation], 1
jmp doneSelect
selStadium:
mov [ptrStadium], r14
mov [updStadium], 1
jmp doneSelect
selTeam:
mov [ptrTeam], r14
mov [updTeam], 1
mov rdx, [r14+30]
mov [ptrClub],rdx
mov [updClub],1
jmp doneSelect
selPerson:
// get the person offset from the person offset area
call getContract
mov rbx, r14
mov rax, rbx
mov rcx, [rbx]
mov rcx, [rcx-8]
mov ebx, [rcx+4]
sub rax, ebx
cmp ebx, $playerOffset // offset sized used by player
je selplr
cmp ebx, $playerStaffOffset // offset sized used by player / coach
je selplrcch
cmp ebx, $staffOffset // offset sized used by staff
je selstaff
cmp ebx, $humanManagerOffset // offset sized used by manager
je selmgr
jmp doneSelect
selplr:
mov [ptrPlayer],rax
mov [ptrStaff],0
mov [ptrHumanStaff],0
mov [ptrPerson], r14
mov [updPerson], 1
jmp doneSelect
selmgr:
mov [ptrPlayer],0
mov [ptrStaff],rax
mov [ptrHumanStaff],rax
mov [ptrPerson], r14
mov [updPerson], 1
jmp doneSelect
selplrcch:
// player coach attrs are person - 0xE0 or player + 1C8 - 8
mov [ptrPlayer],rax
add rax, 268
mov [ptrStaff],rax
mov [ptrHumanStaff],0
mov [ptrPerson], r14
mov [updPerson], 1
jmp doneSelect
selstaff:
mov [ptrStaff],rax
mov [ptrPlayer],0
mov [ptrHumanStaff],0
mov [ptrPerson], r14
mov [updPerson], 1
jmp doneSelect
doneSelect:
pop r15
pop rdx
pop rcx
pop rbx
pop rax
pop r14
ret // return requires matching all
getContract:
push r15
mov [ptrFullContract], 0
mov [ptrLoanContract], 0
mov [ptrNationContract], 0
mov [ptrRevClubContract], 0
getFullContract:
cmp [r14+C8],0
je getLoanContract
mov r15,[r14+C8]
mov [ptrFullContract], r15
getLoanContract:
cmp [r14+D0],0
je retContract
mov r15,[r14+D0]
cmp [r15],0
je getRevClubContract
mov r15,[r15]
mov [ptrLoanContract], r15
mov r15,[r14+D0]
getRevClubContract:
cmp [r15+8],0
je getNationContract
mov r15,[r15+8]
mov [ptrRevClubContract], r15
mov r15,[r14+D0]
getNationContract:
cmp [r15+10],0
je retContract
mov r15,[r15+10]
mov [ptrNationContract], r15
retContract:
pop r15
ret
getObjTooltip:
call fnShowTooltip
nop 3
return:
LuaCall(updateManagerPointers())
[DISABLE]
getObjTooltip:
db aobObjTooltip
unregistersymbol(*)
dealloc(*)