Czesc, mianowicie mam problem gdy daje POPAD - Dane Push wchodza ale chyba nie tak jak powinny, gdy nie dam POPAD, to leci crash i petli ten kod "az do crasha"
C++/ASM
SOACS_Intercept PartyLupineSkillFix() { // 0046BCCE
//ExecuteType9ExecuteType9(UserID, UserID, pMagicInfo->iNum);
_sosm{ // ASM START -> Jest to zdefinowane z __asm do _sosm jakby co
//mov eax, dword ptr ss : [ebp - 0x8]
//push dword ptr ds : [ebx]
//mov ecx, dword ptr ds : [eax + 0x4]
//add ecx,0x1470
MOV AX,WORD PTR DS : [ESI + 0x8058]
MOV PartyLupine_Hook_UserID,AX
}
SendLupineToParty(PartyLupine_Hook_UserID);
_sosm{
POPFD
POPAD
JMP PartyLupineReturn;
}
}
void SendLupineToParty(int UserID) {
char text[1024]; memset(text, NULL, 1024);
if (IsUserConnected(UserID)) {
sprintf(text, "UserID: %i", UserID);
ConsoleOutput(text, LightRed);
_USER_DATA* pUserData;
pUserData = reinterpret_cast<_USER_DATA*>(GetUserPointer(UserID));
ConsoleOutput("Debug 1", LightGreen);
_PARTY_GROUP* PartyInfo = reinterpret_cast<_PARTY_GROUP*>(GetPartyArray(GetPartyID(UserID))); // GET PARTY INFO
if (PartyInfo != nullptr) {
ConsoleOutput("Debug 2", LightGreen);
if (IsRealPartyMember(UserID) && (GetPartyID(UserID) != -1)) {
int PartyID = GetPartyID(UserID);
sprintf(text, "PartyID: %i", PartyID);
ConsoleOutput(text, LightBlue);
ConsoleOutput("Debug 3", LightGreen);
//for (int x = 0; x < 8; x++) {
if (IsUserConnected(PartyInfo->uid[0]) && IsRealPartyMember(PartyInfo->uid[0])) {
//Checking users is connected to the game && really member of the party
ConsoleOutput("Debug 4", LightGreen);
ExecuteType9(PartyInfo->uid[0], PartyInfo->uid[0], 107735); I tu wlasnie mi crashuje ->
ConsoleOutput("Debug 5", LightGreen);
}
//}
return;
}
}
return;
}
return;
}
Executetype9 funkcja - rowniez zawiera kod ASM [Jesli nie dam w nim POPAD -> to petli sie az do crasha, a jesli dam to nie daje pushuje tak jakbym chcial zeby bylo]
bool ExecuteType9(int UserID, int TargetID, int SkillID) {
char text[1024]; memset(text, NULL, 1024);
if (!IsUserConnected(UserID)) {
return false;
}
sprintf(text, "DEBUG function");
ConsoleOutput(text, LightRed);
unsigned long pMagicPoint = GetMagicInfoPointer(UserID);
sprintf(text, "DEBUG function 1 ");
ConsoleOutput(text, LightRed);
_sosm{
popad
PUSH 0x0
PUSH 0x0
PUSH 0x0
//LEA ECX,DWORD PTR DS:[ECX+0x874C]
PUSH TargetID
PUSH UserID
PUSH SkillID
MOV ECX,pMagicPoint
CALL g_ExecuteType9
//JMP g_ParserExit
}
sprintf(text, "DEBUG function 3");
ConsoleOutput(text, LightRed);
return true;
}
Tak powinno byc w ollydbg
a jest cos takiego i nie wiem dlaczego jestem poczatkujacy