${Group} with 19/4 zip take 2

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

User avatar
gimp
a grimling bloodguard
a grimling bloodguard
Posts: 584
Joined: Fri Oct 29, 2004 9:28 am
Location: internet

${Group} with 19/4 zip take 2

Post by gimp » Tue Apr 19, 2005 6:26 pm

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

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Tue Apr 19, 2005 6:35 pm

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!
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

User avatar
gimp
a grimling bloodguard
a grimling bloodguard
Posts: 584
Joined: Fri Oct 29, 2004 9:28 am
Location: internet

Post by gimp » Tue Apr 19, 2005 6:53 pm

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()

DreamKing
a lesser mummy
a lesser mummy
Posts: 79
Joined: Tue Jun 10, 2003 12:29 am

Post by DreamKing » Tue Apr 19, 2005 7:10 pm

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?

mystikule
a snow griffon
a snow griffon
Posts: 353
Joined: Sat Jul 17, 2004 9:23 pm

Post by mystikule » Tue Apr 19, 2005 7:17 pm

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
Last edited by mystikule on Tue Apr 19, 2005 7:25 pm, edited 2 times in total.

mystikule
a snow griffon
a snow griffon
Posts: 353
Joined: Sat Jul 17, 2004 9:23 pm

Post by mystikule » Tue Apr 19, 2005 7:23 pm

If more info is needed Lax, please holler. Have raid in about half an hour so will be watching this thread till then.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Tue Apr 19, 2005 7:27 pm

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;
}
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

User avatar
gimp
a grimling bloodguard
a grimling bloodguard
Posts: 584
Joined: Fri Oct 29, 2004 9:28 am
Location: internet

Post by gimp » Tue Apr 19, 2005 7:41 pm

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

mq2user77
a hill giant
a hill giant
Posts: 160
Joined: Thu Dec 16, 2004 11:31 am
Contact:

Post by mq2user77 » Tue Apr 19, 2005 7:48 pm

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?

User avatar
gimp
a grimling bloodguard
a grimling bloodguard
Posts: 584
Joined: Fri Oct 29, 2004 9:28 am
Location: internet

Post by gimp » Tue Apr 19, 2005 7:49 pm

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

mystikule
a snow griffon
a snow griffon
Posts: 353
Joined: Sat Jul 17, 2004 9:23 pm

Post by mystikule » Tue Apr 19, 2005 7:49 pm

I CTD again with only making the changes Lax suggested. Am currently loading up eq again with the offset change...

mq2user77
a hill giant
a hill giant
Posts: 160
Joined: Thu Dec 16, 2004 11:31 am
Contact:

Post by mq2user77 » Tue Apr 19, 2005 7:56 pm

gimp's change above by itself has solved all CTD issues I'm having.

Bring out the gimp!

mystikule
a snow griffon
a snow griffon
Posts: 353
Joined: Sat Jul 17, 2004 9:23 pm

Post by mystikule » Tue Apr 19, 2005 7:57 pm

all seems well now...thx for help lax and gimp

DreamKing
a lesser mummy
a lesser mummy
Posts: 79
Joined: Tue Jun 10, 2003 12:29 am

Post by DreamKing » Tue Apr 19, 2005 8:02 pm

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.

Bretttido
a lesser mummy
a lesser mummy
Posts: 38
Joined: Wed Jun 23, 2004 1:57 am

Post by Bretttido » Tue Apr 19, 2005 8:03 pm

Offset change by itself fixes the bug, but Lax's changes certainly can't hurt as they add extra error protection.