need some help with MAXMANA

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

need some help with MAXMANA

Post by EqMule » Fri May 02, 2003 12:45 pm

Code: Select all

DWORD GetMaxMana(VOID)
{
	DWORD MaxMana = 0;
	DWORD CharInfo = NULL;
	if (!EQADDR_CHAR_INFO) return 0;
	if (!*EQADDR_CHAR_INFO) return 0;
	CharInfo = (DWORD)*EQADDR_CHAR_INFO;
#if defined(_MSC_VER)
	__asm {
		push eax;
		push ecx;
		mov ecx, dword ptr [CharInfo];
		call dword ptr [EQADDR_MAXMANA];
		movsx eax, ax;
		mov [MaxMana], eax;
		pop ecx;
		pop eax;
	}
ok If I where to execute this code from an exefile not the eqlib.dll can someone post a code example, howto execute code in another process like this? What do I need to do, as it is right now I can call the GetMaxMana(); from main() but it will give me an access violation on

Code: Select all

call dword ptr [EQADDR_MAXMANA];
this line... well I have full access to the eqgame process, but dont I need to createprocessthread or something to be able to access it directly like that function is? hmm I need to be able to do this so I can debug easier, then I can help on the click thing and many other... we can do alot of fun stuff as soon as I learn howto execute code in the eqgame process...
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri May 02, 2003 2:09 pm

You can't. Eqlib.dll is loaded into the eqgame.exe process space. I can't really run as a stand alone program.

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Fri May 02, 2003 2:26 pm

hmm i was hoping for an API or something that let me inject into the process and then execute that code...
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri May 02, 2003 4:35 pm

Well, that's the way MQ works.

MacroQuest.exe injects eqlib.dll into eqgame.exe

You could make your own dll to inject as numerous other people have.