Moderator: MacroQuest Developers
Code: Select all
.text:00401DE9 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
.text:00401DE9
.text:00401DE9
.text:00401DE9 CBuffWindow__Activate proc near ; CODE XREF: ExecuteCmd+2031p
.text:00401DE9 mov eax, __pctype
.text:00401DEE test eax, eax
.text:00401DF0 jz short locret_401E22
.text:00401DF2 cmp byte ptr [eax+138h], 0
.text:00401DF9 jz short loc_401E07
.text:00401DFB mov edx, [eax]
.text:00401DFD mov ecx, eax
.text:00401DFF call dword ptr [edx+84h]
.text:00401E05 jmp short loc_401E17
.text:00401E07 ; --------------------------------------------------------
.text:00401E07
.text:00401E07 loc_401E07: ; CODE XREF: CBuffWindow__Activate+10j
.text:00401E07 call CStoryWnd__ShowAuto
.text:00401E0C mov ecx, __pctype
.text:00401E12 call CChatManager__Activate
.text:00401E17
.text:00401E17 loc_401E17: ; CODE XREF: CBuffWindow__Activate+1Cj
.text:00401E17 mov ecx, __pctype
.text:00401E1D jmp CSidlScreenWnd__StoreIniVis
.text:00401E22 ; --------------------------------------------------------
.text:00401E22
.text:00401E22 locret_401E22: ; CODE XREF: CBuffWindow__Activate+7j
.text:00401E22 retn
.text:00401E22 CBuffWindow__Activate endp
Code: Select all
.text:0045F87A ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
.text:0045F87A
.text:0045F87A
.text:0045F87A EQPlayer__Levitating proc near ; CODE XREF: EQ_Character__RemovePCAffectex+26Ep
.text:0045F87A cmp byte ptr [ecx+16Ch], 0
.text:0045F881 jnz short loc_45F8A0
.text:0045F883 mov ecx, [ecx+120h]
.text:0045F889 test ecx, ecx
.text:0045F88B jz short loc_45F8A0
.text:0045F88D push 0
.text:0045F88F push 1
.text:0045F891 push 39h
.text:0045F893 call EQ_Character__TotalSpellAffects
.text:0045F898 test eax, eax
.text:0045F89A jz short loc_45F8A0
.text:0045F89C xor eax, eax
.text:0045F89E inc eax
.text:0045F89F retn
.text:0045F8A0 ; -----------------------------------------------------------
.text:0045F8A0
.text:0045F8A0 loc_45F8A0: ; CODE XREF: EQPlayer__Levitating+7j
.text:0045F8A0 ; EQPlayer__Levitating+11j ...
.text:0045F8A0 xor eax, eax
.text:0045F8A2 retn
.text:0045F8A2 EQPlayer__Levitating endp
.text:0045F8A2
.text:0045F8A3
Code: Select all
VOID CoinStuff(PSPAWNINFO pChar, PCHAR szLine)
{
DWORD DROPCOIN = 0x004DEE5E;
__asm {
push 0x0000000; // Always 0
push 0x0000064; // Amount
push 0x0000001; // Destination Coin Type: 0 = Platinum, 1 = Gold, 2 = Silver, 3 = Copper
push 0x0000000; // Source Coin Type: 0 = Platinum, 1 = Gold, 2 = Silver, 3 = Copper
push 0x0000000; // Coin Destination? 0 = cursor, 1 = inventory, 2 = bank
mov ecx, dword ptr 0x0077b858;
push 0x0000001; // Coin Source? 0 = cursor, 1 = inventory, 2 = bank
call dword ptr [DROPCOIN];
}
}
Amadeus,Amadeus wrote:I suppose it's just hopeless if you don't know assembly very well to make any sense of it...I was hoping to find some function that was fairly simple and learn to manipulate it and figure out how it works.
I have an old thread of sprite's that talks about MoveMoney(), and I found that in the IDA ...but I have no idea how he came up with this:Based upon what I'm seeing in the IDA....first of all, it's a hell of a lot longer and more complicated looking to me....Code: Select all
VOID CoinStuff(PSPAWNINFO pChar, PCHAR szLine) { DWORD DROPCOIN = 0x004DEE5E; __asm { push 0x0000000; // Always 0 push 0x0000064; // Amount push 0x0000001; // Destination Coin Type: 0 = Platinum, 1 = Gold, 2 = Silver, 3 = Copper push 0x0000000; // Source Coin Type: 0 = Platinum, 1 = Gold, 2 = Silver, 3 = Copper push 0x0000000; // Coin Destination? 0 = cursor, 1 = inventory, 2 = bank mov ecx, dword ptr 0x0077b858; push 0x0000001; // Coin Source? 0 = cursor, 1 = inventory, 2 = bank call dword ptr [DROPCOIN]; } }
Code: Select all
.text:0045F87A ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
.text:0045F87A
.text:0045F87A
.text:0045F87A EQPlayer__Levitating proc near ; CODE XREF: EQ_Character__RemovePCAffectex+26Ep
.text:0045F87A cmp byte ptr [ecx+16Ch], 0
.text:0045F881 jnz short loc_45F8A0
.text:0045F883 mov ecx, [ecx+120h]
.text:0045F889 test ecx, ecx
.text:0045F88B jz short loc_45F8A0
.text:0045F88D push 0
.text:0045F88F push 1
.text:0045F891 push 39h
.text:0045F893 call EQ_Character__TotalSpellAffects
.text:0045F898 test eax, eax
.text:0045F89A jz short loc_45F8A0
.text:0045F89C xor eax, eax
.text:0045F89E inc eax
.text:0045F89F retn
.text:0045F8A0 ; -----------------------------------------------------------
.text:0045F8A0
.text:0045F8A0 loc_45F8A0: ; CODE XREF: EQPlayer__Levitating+7j
.text:0045F8A0 ; EQPlayer__Levitating+11j ...
.text:0045F8A0 xor eax, eax
.text:0045F8A2 retn
.text:0045F8A2 EQPlayer__Levitating endp
.text:0045F8A2
.text:0045F8A3
Code: Select all
bool
EQPlayer::Levitating(void)
{
.........
}
Code: Select all
cmp byte ptr [ecx+16Ch], 0
jnz short loc_45F8A0
Code: Select all
if (this->someDataMember != 0) {
goto exit;
}
Code: Select all
mov ecx, [ecx+120h]
test ecx, ecx
jz short loc_45F8A0
push 0
push 1
push 39h
call EQ_Character__TotalSpellAffects
Code: Select all
if (this->EQ_Character == 0) {
goto exit;
}
int result = this->EQ_Character->TotalSpellEffects(0x39, 1, 0);
Code: Select all
test eax, eax
jz short loc_45F8A0
xor eax, eax
inc eax
retn
Code: Select all
if (result == 0) {
goto exit;
}
return 1;
exit :
return 0;
Code: Select all
bool
EQPlayer::Levitating(void)
{
if (this->someDataMember != 0) {
goto exit;
}
if (this->EQ_Character == 0) {
goto exit;
}
int result = this->EQ_Character->TotalSpellEffects(0x39, 1, 0);
if (result == 0) {
goto exit;
}
return 1;
exit :
return 0;
}
This is because there are no args given and because at the end it just says 'retn' with nothing afterwards, correct? So, in assembly, if a function has arguments it looks like:ok first of all this is a member function of the class EQPlayer, called Levitating which takes no arguments and returns an int (or maybe bool)
Code: Select all
.text:0045F545 arg_0 = dword ptr 4
.text:0045F545 arg_4 = dword ptr 8
Code: Select all
mov ecx, [ecx+120h]
test ecx, ecx
jz short loc_45F8A0
Code: Select all
if (this->EQ_Character == 0) {
goto exit;
}
Code: Select all
push 0
push 1
push 39h
call EQ_Character__TotalSpellAffects
Code: Select all
int result = this->EQ_Character->TotalSpellEffects(0x39, 1, 0);
Code: Select all
xor eax, eax
inc eax

Code: Select all
arg_0 = dword ptr 4
arg_4 = dword ptr 8
Code: Select all
.text:00426C71 var_4C = dword ptr -4Ch
.text:00426C71 var_48 = dword ptr -48h
.text:00426C71 var_44 = dword ptr -44h
.text:00426C71 var_40 = dword ptr -40h
.text:00426C71 var_3C = dword ptr -3Ch
.text:00426C71 var_38 = dword ptr -38h
.text:00426C71 var_34 = dword ptr -34h
.text:00426C71 var_30 = dword ptr -30h
.text:00426C71 var_2C = dword ptr -2Ch
.text:00426C71 var_28 = dword ptr -28h
.text:00426C71 var_24 = dword ptr -24h
.text:00426C71 var_20 = dword ptr -20h
.text:00426C71 var_1C = dword ptr -1Ch
.text:00426C71 var_18 = dword ptr -18h
.text:00426C71 var_14 = dword ptr -14h
.text:00426C71 var_10 = dword ptr -10h
.text:00426C71 var_C = dword ptr -0Ch
.text:00426C71 var_8 = dword ptr -8
.text:00426C71 var_4 = dword ptr -4
.text:00426C71 arg_0 = dword ptr 8
.text:00426C71 arg_4 = byte ptr 0Ch