Page 1 of 1

${Group} with 19/4 zip take 2

Posted: Tue Apr 19, 2005 6:26 pm
by gimp

Code: Select all

[MQ2]CCommandHook::Detour(/echo ${Group.Member[1].Level})
First-chance exception at 0x39d56238 (MQ2Main.dll) in eqgame.exe: 0xC0000005: Access violation reading location 0x00000247.
First-chance exception at 0x0054a61a in eqgame.exe: 0xC0000005: Access violation reading location 0x00000001.
my apology for not posting this until now, been raiding tonight
2b) Inside EverQuest - The error information #1 including the offset in eqgame.exe, copy and paste a couple lines of the disassembly if you can, AND GET THE FUNCTION CALL STACK. If we get the function call stack, it may be VERY easy to fix the problem. If not, may be very DIFFICULT to fix the problem.
VS wont show either dissasembly or function call stack from eqmain.exe, i dont know why. the windows show up but are empty

Posted: Tue Apr 19, 2005 6:35 pm
by Lax
Go into Debug->Exceptions (CTRL+ALT+E for shortcut) and under Win32 Exceptions, find c0000005 access violation. Click it. At the bottom there's 2 things that default to "Use parent setting" -- set them both to "Break into the debugger". Hit OK. Then do the same thing again and you'll get the call stack

Note: the above is in the instructions!

Posted: Tue Apr 19, 2005 6:53 pm
by gimp
i retried with VS6, and had better luck, and quite different output

crashes on:

Code: Select all

[MQ2]WriteChatColor([MQ2] )
[MQ2]CCommandHook::Detour(/echo ${Group.Member[1].Level})
program code in MQ2DataTypes.cpp (crashes on line marked with ->, line 947):

Code: Select all

	case Level:
	->	Dest.DWord=pSpawn->Level;
		Dest.Type=pIntType;
		return true;
back trace:

Code: Select all

MQ2SpawnType::GetMember(MQ2SpawnType * const 0x00000000, MQ2Internal::_MQ2VarPtr {...}, char * 0x0000000b, char * 0x001286d8, MQ2Internal::_MQ2TypeVar & {...}) line 947 + 9 bytes
MQ2GroupMemberType::GetMember(MQ2GroupMemberType * const 0x00000000, MQ2Internal::_MQ2VarPtr {...}, char * 0x00000001, char * 0x001286d8, MQ2Internal::_MQ2TypeVar & {...}) line 4840 + 23 bytes
ParseMQ2DataPortion(char * 0x30e93860, MQ2Internal::_MQ2TypeVar & {...}) line 231 + 16 bytes
ParseMacroData(char * 0x30eb8fd6) line 557 + 15 bytes
ParseMacroParameter(EQData::_SPAWNINFO * 0x1358b968, char * 0x0012af1c) line 125
CCommandHook::Detour(CCommandHook * const 0x00000000, EQData::_SPAWNINFO * 0x00427f79, char * 0x1358b968) line 251 + 14 bytes
EQGAME! 00427f79()
EQGRAPHICSDX9! 1019ffab()
EQGAME! 005e7484()
EQGAME! 005d2d90()
EQGAME! 005ec7f9()
EQGAME! 005d2d90()
KERNEL32! 7c5c1f44()

Posted: Tue Apr 19, 2005 7:10 pm
by DreamKing
I was using a old UI with the format still ${Group and it was working fine (other than the spam in the mq2 window). I finally got around to updating it to ${Group.Member and that's when I started to crash as well. Works fine until you join a group then it's CTD. Structure issue perhaps?

Posted: Tue Apr 19, 2005 7:17 pm
by mystikule
I am also having the same issue and will do my best to post all the debug info needed. (prolly more than what is needed, but more is better rite? sometimes?) :roll:

Debug spew

Code: Select all


[MQ2]Next - End of loop 0 to 4
First-chance exception at 0x03016ccb (MQ2Main.dll) in eqgame.exe: 0xC0000005: Access violation reading location 0x0000002f.

MQ2DataTypes.cpp
error at ===> line 1231

Code: Select all


	case Ducking:
		Dest.DWord=pSpawn->StandState==STANDSTATE_DUCK;
		Dest.Type=pBoolType;
		return true;
	case Feigning:
		Dest.DWord=pSpawn->StandState==STANDSTATE_FEIGN;
		Dest.Type=pBoolType;
		return true;
	case Binding:
		Dest.DWord=pSpawn->StandState==STANDSTATE_BIND;
		Dest.Type=pBoolType;
		return true;
	case Deity:
		Dest.DWord=pSpawn->Deity;
		Dest.Type=pDeityType;
		return true;
	case Distance:
===>		Dest.Float=GetDistance(pSpawn->X,pSpawn->Y);
		Dest.Type=pFloatType;
		return true;
	case Distance3D:
		Dest.Float=DistanceToSpawn3D((PSPAWNINFO)pCharSpawn,pSpawn);
		Dest.Type=pFloatType;
		return true;
	case DistancePredict:
		Dest.Float=EstimatedDistanceToSpawn((PSPAWNINFO)pCharSpawn,pSpawn);
		Dest.Type=pFloatType;
		return true;
	case DistanceW:
	case DistanceX:
		Dest.Float=(FLOAT)fabs(((PSPAWNINFO)pCharSpawn)->X-pSpawn->X);
		Dest.Type=pFloatType;
		return true;
	case DistanceN:

Call stack :

Code: Select all


>	MQ2Main.dll!MQ2SpawnType::GetMember(MQ2Internal::_MQ2VarPtr VarPtr={...}, char * Member=0xffffffff, char * Index=0x0013b740, MQ2Internal::_MQ2TypeVar & Dest={...})  Line 1231	C++
 	MQ2Main.dll!MQ2SpawnType::GetMember(MQ2Internal::_MQ2VarPtr VarPtr={...}, char * Member=0x08bdd950, char * Index=0x1dc5c0b8, MQ2Internal::_MQ2TypeVar & Dest={...})  Line 935 + 0xa	C++
 	MQ2Main.dll!DoNextCommand()  Line 58	C++
 	MQ2Main.dll!Detour_ProcessGameEvents()  Line 324	C++
 	MQ2Main.dll!MQ2GroupMemberType::GetMember(MQ2Internal::_MQ2VarPtr VarPtr={...}, char * Member=0x0013b740, char * Index=0x0013af00, MQ2Internal::_MQ2TypeVar & Dest={...})  Line 4840 + 0x17	C++
 	MQ2Main.dll!ParseMQ2DataPortion(char * szOriginal=, MQ2Internal::_MQ2TypeVar & Result=)  Line 231 + 0x13	C++
 	MQ2Main.dll!ParseMacroData(char * szOriginal=)  Line 557 + 0xf	C++
 	MQ2Main.dll!ParseMacroParameter(EQData::_SPAWNINFO * pChar=0x08bdd950, char * szOriginal=0x0013cf68)  Line 125	C++
 	MQ2Main.dll!HideDoCommand(EQData::_SPAWNINFO * pChar=, char * szLine=, int delayed=)  Line 121 + 0x11	C++
 	MQ2Main.dll!DoNextCommand()  Line 58	C++
 	MQ2Main.dll!Heartbeat()  Line 283 + 0xb	C++
 	MQ2Main.dll!Detour_ProcessGameEvents()  Line 324	C++
 	eqgame.exe!004d22e6() 	
 	eqgame.exe!00607510() 	

Disassembly:

address:

Code: Select all


MQ2SpawnType::GetMember(MQ2Internal::_MQ2VarPtr, char *, char *, MQ2Internal::_MQ2TypeVar &)

code:
error at ===>

Code: Select all

03016CB5  mov         edx,dword ptr [_pDeityType (307F1C8h)] 
03016CBB  pop         edi  
03016CBC  pop         ebp  
		Dest.Type=pBoolType;
03016CBD  mov         dword ptr [eax],edx 
03016CBF  mov         al,1 
03016CC1  pop         esi  
}
03016CC2  add         esp,28A8h 
03016CC8  ret         10h  
		return true;
	case Distance:
		Dest.Float=GetDistance(pSpawn->X,pSpawn->Y);
===>03016CCB  mov         eax,dword ptr [esi+30h] 
03016CCE  mov         ecx,dword ptr [esi+34h] 
03016CD1  push        eax  
03016CD2  push        ecx  
03016CD3  call        GetDistance (30143F0h) 
03016CD8  add         esp,8 
03016CDB  mov         eax,dword ptr [esp+28C4h] 
03016CE2  fstp        dword ptr [eax+4] 
		Dest.Type=pFloatType;
03016CE5  mov         edx,dword ptr [_pFloatType (307F158h)] 
03016CEB  pop         edi  
03016CEC  pop         ebp  
		Dest.Type=pBoolType;
03016CED  mov         dword ptr [eax],edx 
03016CEF  mov         al,1 
03016CF1  pop         esi  
}
03016CF2  add         esp,28A8h 
03016CF8  ret         10h  
		return true;

note this was using afcleric mac....if needed I can post that as well

Posted: Tue Apr 19, 2005 7:23 pm
by mystikule
If more info is needed Lax, please holler. Have raid in about half an hour so will be watching this thread till then.

Posted: Tue Apr 19, 2005 7:27 pm
by Lax
Give this a shot.

MQ2DataTypes.cpp

Code: Select all

bool MQ2GroupMemberType::GETMEMBER()
{
	//DWORD nGroupMember=VarPtr.DWord-1;
	char *MemberName=0;
	PSPAWNINFO pGroupMember=0;
	if (unsigned long N=VarPtr.DWord)
	{
		if (N>5)
			return false;
		for (unsigned long i=0; i<5 ; i++)
		{
			if (pGroup->MemberExists[i])
			{
				N--;
				if (N==0)
				{
					pGroupMember=pGroup->pMember[i];
					MemberName=pGroup->MemberName[i];
					break;
				}
			}
		}
		if (!MemberName)
			return false;
	}
	else
	{
		pGroupMember=GetCharInfo()->pSpawn;
		MemberName=pGroupMember->Name;
	}
	PMQ2TYPEMEMBER pMember=MQ2GroupMemberType::FindMember(Member);
	if (!pMember)
	{
[color=red]		if (!pGroupMember)
			return false;[/color]
#ifndef ISXEQ
		return pSpawnType->GetMember(*(MQ2VARPTR*)&pGroupMember,Member,Index,Dest);
#else
		return pSpawnType->GetMember(*(LSVARPTR*)&pGroupMember,Member,argc,argv,Dest);
#endif
	}

	switch((GroupMemberMembers)pMember->ID)
	{
	case Name:
		Dest.Ptr=MemberName;
		Dest.Type=pStringType;
		return true;
	case Leader:
		Dest.DWord=((VarPtr.DWord==0 && !pGroup->LeaderName[0]) || !stricmp(MemberName,pGroup->LeaderName));
		Dest.Type=pBoolType;
		return true;
	case Spawn:
[color=red]
		if (Dest.Ptr=pGroupMember)
		{
			Dest.Type=pSpawnType;
			return true;
		}
		break;
[/color]
	}
	return false;
}

Posted: Tue Apr 19, 2005 7:41 pm
by gimp
eqgame.h:

Code: Select all

#define instGroup                                          0x909D90
bug is gone for me, all group data works as it should :)
oh, and i learned more tonight by fiddling with this than i have had in a long time.. damn this is fun stuff

Posted: Tue Apr 19, 2005 7:48 pm
by mq2user77
gimp wrote:eqgame.h:

Code: Select all

#define instGroup                                          0x909D90
bug is gone for me, all group data works as it should :)
oh, and i learned more tonight by fiddling with this than i have had in a long time.. damn this is fun stuff
Is that in addition to, or instead of the changes Lax suggested above?

Posted: Tue Apr 19, 2005 7:49 pm
by gimp
mq2user77 wrote:Is that in addition to, or instead of the changes Lax suggested above?
i saw his post after i solved the problem i was having, so i never tried it

Posted: Tue Apr 19, 2005 7:49 pm
by mystikule
I CTD again with only making the changes Lax suggested. Am currently loading up eq again with the offset change...

Posted: Tue Apr 19, 2005 7:56 pm
by mq2user77
gimp's change above by itself has solved all CTD issues I'm having.

Bring out the gimp!

Posted: Tue Apr 19, 2005 7:57 pm
by mystikule
all seems well now...thx for help lax and gimp

Posted: Tue Apr 19, 2005 8:02 pm
by DreamKing
I applied them both and all seems good since wasnt sure which one to use. I even have mq2fps working with my hud!

Thanks for the quick fixes.

Posted: Tue Apr 19, 2005 8:03 pm
by Bretttido
Offset change by itself fixes the bug, but Lax's changes certainly can't hurt as they add extra error protection.