Page 2 of 4

work in progress...

Posted: Tue Jul 01, 2003 9:54 pm
by EqMule
Thanks for the nice tutor Sprite.

I just undecorated a few of the most useful? functions from the map file, offsets are from testeqgame ofcourse, but very easy to figure out for eqgame as needed... I will continue to work on theese and as you can see many new functions can be implemented in MQ, CalcACValue CalcATKValue for example... We can also fix mouse click and directly access things like buying and selling items from a merchant... Lets have some fun, /cheer to whoever leaked the mapfile at sony!
If anyone wants the full undecorated map in excel format with sortable fields you can Dl it here:http://medlem.spray.se/eqmule/


Code: Select all

FUNCTION                          OFFSET

unsigned char rmb	0078132d
__int64 * g_statPacketCountSent	00768350
bool g_bKeepItemsOnDeath	00766609
bool g_speedUpGamePlay	00766608
char * __cdecl GetCustomIniFilename(void)	0044a1ab
char * __cdecl GetUIIniFilename(void)	0044a194
char * exe_name	0077fc2c
char * g_next_player	006facac
char * g_szGraphicsDLLVersionString	007666a4
char * solo_zone_name	006b6afc
class CGuild Guild	006fae70
class CSpellBookWnd * g_pSpellBookWnd	005eaf80
class EQ_Equipment * CombatEQ	006b6914
class EQ_LoadingS * O_LoadingS	00766600
class EQObject * pTargetObject	00766668
class EQPlayer * * Followers	006fae54
class EQPlayer * * Groupees	006b6ae8
class EQPlayer * ActiveBanker	00766674
class EQPlayer * ActiveCorpse	00766678
class EQPlayer * ActiveGMaster	0076667c
class EQPlayer * ActiveMerchant	00766670
class EQPlayer * AltTarget	00766654
class EQPlayer * BandageTarget	0076664c
class EQPlayer * ControlledPlayer	00766658
class EQPlayer * TargetPlayer	00766664
class EQPlayer * TrackTarget	00766650
class EQPlayer * TradeTarget	00766640
class EQSwitch * GuildChest	00766684
const CAAWnd::`vftable'	00590410
const CEverQuest::`vftable'	00595ce4
const CFacePick::`vftable'	005926dc
const CHotButtonWnd::`vftable'	005931ec
const CInventoryWnd::`vftable'	005933f0
const CInvSlot::`vftable'	00593548
const CInvSlotMgr::`vftable'	0059354c
const CInvSlotWnd::`vftable'	00598718
const CItemDisplayWnd::`vftable'	00593600
const CLootWnd::`vftable'	00593b0c
const CMerchantWnd::`vftable'	00593ed0
const CQuantityWnd::`vftable'	00594708
const CSliderWnd::`vftable'	00598618
const CSoulmarkWnd::`vftable'	00594e10
const CSpellBookWnd::`vftable'	00594f10
const EQWorldData::`vftable'	00595cdc
const EQZoneInfo::`vftable'	00595ce0
CTradeWnd::DropMoneyIntoTrade(void)	0044d86a
entry point:	00576fa4
int __cdecl CalcACValue(void)	004492d3
int __cdecl CalcATKValue(void)	0044924e
int __cdecl FlushMouse(void)	005065c0
int __cdecl GetSpellCastingTime(void)	00448b97
int __cdecl mixCheckSum(int *)	004fb6a3
int __cdecl NameHasApostr(char *)	004ef62c
int __cdecl SetExpByLevel(class EQ_PC *,float)	0049c5ec
int __cdecl SetGroupMembers(class EQ_PC *,struct playersInGrp *)	0049d178
int bMouseActive	005d3e2c
int g_nEffectDuration	006b692c
int gbEnableTaskSwitch	005d4248
int KILLER_NPC	005bf030
int MouseX	00781318
int MouseY	0078131c
int num_tp_coords	0076660c
private: bool __thiscall CSpellBookWnd::CanStartMemming(int)	00447236
private: long __thiscall CInventoryWnd::GetInventoryQtyFromCoinType(int)	0042aa60
private: static bool CResolutionHandler::ms_isFullscreen	005d1c5c
private: static int CResolutionHandler::ms_width	005d1c60
private: unsigned int __thiscall EQPlayer::GetUnusedID(void)	004cb828
private: void __thiscall CInventoryWnd::ClickedMoneyButton(int,int)	0042a945
private: void __thiscall CInventoryWnd::DestroyHeld(void)	0042a6bf
private: void __thiscall CLootWnd::FinalizeLoot(void)	00433995
private: void __thiscall CLootWnd::Init(void)	004336df
private: void __thiscall CMerchantWnd::DisplayBuyOrSellPrice(bool,class EQ_Item *)	004391d8
private: void __thiscall CMerchantWnd::Init(void)	0043896b
private: void __thiscall CMerchantWnd::RequestBuyItem(int)	004393a3
private: void __thiscall CMerchantWnd::RequestSellItem(int)	00439700
private: void __thiscall CQuantityWnd::Accept	004419dc
private: void __thiscall CQuantityWnd::CheckMaxEditWnd(void)	0044180e
private: void __thiscall CQuantityWnd::UpdateEditWndFromSlider(void)	004418d1
private: void __thiscall CQuantityWnd::UpdateSliderFromEditWnd(void)	00441952
private: void __thiscall CSpellBookWnd::ContinueSetMem(void)	00446d15
private: void __thiscall CSpellBookWnd::DisplaySpellInfo(int)	00447bed
private: void __thiscall CSpellBookWnd::EndSetMem(void)	00446d96
private: void __thiscall CSpellBookWnd::HandleLeftClickOnSpell(int)	00447070
protected: bool __thiscall CStmlWnd::IsLinkActive(struct SLinkInfo)const	00534e80
protected: class CXStr __thiscall CItemDisplayWnd::CreateClassString(class EQ_Equipment *)	0042efdc
protected: class CXStr __thiscall CItemDisplayWnd::CreateRaceString(class EQ_Equipment *)	0042edee
protected: void __thiscall CSpellGemWnd::Init(void)	00552740
protected: void __thiscall CTrainWnd::Train(void)	0044e876
public: __thiscall CEverQuest::~CEverQuest(void)	004d88ba
public: __thiscall CEverQuest::CEverQuest(struct HWND__ *)	004d6a68
public: __thiscall CGiveWnd::CGiveWnd(class CXWnd *)	00421b09
public: __thiscall CInventoryWnd::CInventoryWnd(class CXWnd *)	0042a2fb
public: __thiscall CInvSlotWnd::CInvSlotWnd(class CXWnd *,unsigned __int32,class CXRect,class CTextureAnimation *,int,int,int)	00553fc0
public: __thiscall CLootWnd::CLootWnd(class CXWnd *)	0043359f
public: __thiscall CMerchantWnd::CMerchantWnd(class CXWnd *)	004387d7
public: __thiscall CQuantityWnd::CQuantityWnd(class CXWnd *)	00441522
public: __thiscall EQPlayer::~EQPlayer(void)	004b007f
public: __thiscall EQPlayer::EQPlayer(class EQPlayer *,unsigned char,unsigned int,unsigned char,char *)	004af617
public: __thiscall EQPMInfo::EQPMInfo(char *)	004d1728
public: __thiscall EQZoneInfo::EQZoneInfo(enum EQExpansion,enum EQZoneIndex,char const *,char const *,int,unsigned long,int,int)	004d5650
public: bool __thiscall CEverQuest::IsInTypingMode(void)	004edb94
public: bool __thiscall CEverQuest::IsOkToTransact(void)	004f08f4
public: bool __thiscall CInvSlot::IllegalBigBank(int)	0042bda8
public: bool __thiscall CSpellBookWnd::StartSpellMemorization(int,int,bool)	00447365
public: bool __thiscall CXWndManager::OkayToSendMouseMessage(class CXWnd *)const	00543ab0
public: bool __thiscall EQPlayer::CanChangeForm(int,unsigned char)	004cb92f
public: bool __thiscall EQPlayer::CanIFitHere(float,float,float)	004ad85f
public: bool __thiscall EQPlayer::IsInvisible(class EQPlayer *)	004d1696
public: bool __thiscall EQWorldData::IsFlagSet(enum EQZoneIndex,unsigned long)const	004d54d5
public: bool __thiscall EQWorldData::IsNewbieZone(enum EQZoneIndex)const	004d550f
public: bool __thiscall EQWorldData::IsNoAirZone(enum EQZoneIndex)const	004d552b
public: bool __thiscall EQWorldData::IsNoBindZone(enum EQZoneIndex)const	004d551d
public: char * __thiscall CEverQuest::GetClassDesc(int)	004dd3d6
public: char * __thiscall CEverQuest::GetItemClassDesc(int)	004dd6c6
public: char * __thiscall CEverQuest::GetRaceDesc(int)	004dda2b
public: char * __thiscall CEverQuest::GetTitleDesc(int,int,unsigned char)	004defe4
public: class CInvSlot * __thiscall CInvSlotMgr::FindInvSlot(int)	0042c526
public: class CParamInvSlot & __thiscall CParamInvSlot::operator=(class CParamInvSlot const &)	0055e250
public: class CXStr __thiscall CItemDisplayWnd::CreateEquipmentStatusString(class EQ_Item *)	0042f4f5
public: class CXWnd * __thiscall CXWndManager::FindWnd(class CXPoint,int *)const	00545620
public: class EQMoneyList * __thiscall EQMoneyList::get_money(long)	004acc5b
public: class EQPlayer * __thiscall CEverQuest::ClickedPlayer(int,int)	004eff7d
public: class EQSwitch * __thiscall CEverQuest::ClickedSwitch(int,int)	004efea4
public: float __thiscall EQSwitch::TopSpeed(float *)	004d22c5
public: int __thiscall CEverQuest::DoLogin(struct HWND__ *,struct HINSTANCE__ *)	004ea329
public: int __thiscall CEverQuest::LootCorpse(class EQPlayer *,int)	004f0589
public: int __thiscall CEverQuest::MoveMoney(int,int,int,int,int,bool)	004e13b2
public: int __thiscall CInvSlotMgr::MoveItem(int,int,int,int)	0042bf28
public: int __thiscall CListWnd::GetCurSel(void)const	00524a90
public: int __thiscall CSliderWnd::GetValue(void)const	00553770
public: int __thiscall CSpellBookWnd::GetSpellMemTicksLeft(void)	00447591
public: int __thiscall EQ_Character::Max_Mana(void)	00467636
public: int __thiscall EQPlayer::AimAtTarget(class EQPlayer *,class EQMissile *)	004b0eed
public: int __thiscall EQPlayer::Levitating(void)	004cb8d3
public: int __thiscall EQPlayer::MovePlayer(void)	004ad9f4
public: int __thiscall EQWorldData::GetMinLevel(enum EQZoneIndex)const	004d553c
public: static bool __cdecl CResolutionHandler::IsFullscreenAvailable(void)	004f8abe
public: static class EQItemList * EQItemList::top	00766624
public: static class EQPlayer * __cdecl EQPlayer::GetClosestPlayerFromPartialName(char *,class EQPlayer *)	004b1280
public: static class EQPlayer *__cdecl EQPlayer::GetPlayerFromName(char const *)	004b11b8
public: static int __cdecl CResolutionHandler::GetDesktopBitsPerPixel(void)	004f8a6c
public: static int __cdecl CResolutionHandler::GetDesktopHeight(void)	004f8a60
public: static int __cdecl CResolutionHandler::GetDesktopRefreshRate(void)	004f8a78
public: static int __cdecl CResolutionHandler::GetDesktopWidth(void)	004f8a54
public: static int __cdecl CResolutionHandler::GetHeight(void)	004f8aa1
public: static int __cdecl CResolutionHandler::GetWidth(void)	004f8a84
public: static int __cdecl CSpellBookWnd::GetBookSlot(int)	00446b5e
public: static void __cdecl CResolutionHandler::ChangeToResolution(int,int,int,int,int)	004f8796
public: static void __cdecl CResolutionHandler::ToggleScreenMode(void)	004f876e
public: unsigned char __thiscall EQPlayer::DoTeleport(char *,int)	004d063c
public: unsigned char __thiscall EQPlayer::DoTeleportB(int,float,float,float,float,char *,enum ZONE_REQ_REASON)	004d0969
public: unsigned int __thiscall EQPlayer::ModifyAttackSpeed(unsigned int,int)	004b329c
public: virtual __thiscall CInventoryWnd::~CInventoryWnd(void)	0042a4f4
public: virtual __thiscall CInvSlotWnd::~CInvSlotWnd(void)	005540f0
public: virtual __thiscall CLootWnd::~CLootWnd(void)	00421c59
public: virtual __thiscall CMerchantWnd::~CMerchantWnd(void)	00421c59
public: virtual class CTextureAnimation * __thiscall CXWnd::GetClickStickCursor(class CClickStickInfo *)const	005205e0
public: virtual int __thiscall CButtonWnd::HandleMouseMove(class CXPoint,unsigned __int32)	00541a70
public: virtual int __thiscall CInventoryWnd::HandleLButtonUp(class CXPoint,unsigned __int32)	0042a897
public: virtual int __thiscall CInvSlotWnd::HandleLButtonDown(class CXPoint,unsigned __int32)	005545b0
public: virtual int __thiscall CItemDisplayWnd::OnProcessFrame(void)	00421d5d
public: virtual int __thiscall CListWnd::HandleLButtonDown(class CXPoint,unsigned __int32)	00527e40
public: virtual int __thiscall CQuantityWnd::WndNotification(class CXWnd *,unsigned __int32,void *)	0044179f
public: virtual void * __thiscall CAAWnd::`vector deleting destructor'(unsigned int)	00401307
public: virtual void * __thiscall EQZoneInfo::`scalar deleting destructor'(unsigned int)	004d5706
public: virtual void * __thiscall EQZoneInfo::`vector deleting destructor'(unsigned int)	004d5706
public: virtual void __thiscall CGiveWnd::Deactivate(void)	00421c9d
public: virtual void __thiscall CItemDisplayWnd::Activate(void)	0042cb9e
public: virtual void __thiscall CLootWnd::Deactivate(void)	0043393e
public: void * __thiscall CKeyCXStrValueInt32::`vector deleting destructor'(unsigned int)	00402324
public: void __thiscall _EverQuestinfo::SetAutoAttack(bool)	004f1889
public: void __thiscall CAAWnd::ConfirmAASpend(void)	0040221d
public: void __thiscall CEverQuest::ApplyPoison(unsigned long)	004ef335
public: void __thiscall CEverQuest::Camp(void)	004e105d
public: void __thiscall CEverQuest::CancelSneakHide(void)	004e8443
public: void __thiscall CEverQuest::clr_chat_input(void)	004e8566
public: void __thiscall CEverQuest::Consider(class EQPlayer *,void *)	004dd379
public: void __thiscall CEverQuest::DeacSpellScreen(void)	004ef3db
public: void __thiscall CEverQuest::Disband(void)	004e0c1f
public: void __thiscall CEverQuest::doInspect(class EQPlayer *)	004edb9f
public: void __thiscall CEverQuest::doInvite(unsigned __int32,char *)	004e08cc
public: void __thiscall CEverQuest::DoNewCharacterCreation(void)	004e937d
public: void __thiscall CEverQuest::DoPercentConvert(char *,bool)	004e8689
public: void __thiscall CEverQuest::doUnInvite(char *)	004e05fb
public: void __thiscall CEverQuest::DropHeldItemOnGround(int)	004e115d
public: void __thiscall CEverQuest::DropHeldMoneyOnGround(int)	004e17be
public: void __thiscall CEverQuest::DropItemOrMoneyOnPlayer(class EQPlayer *)	004e1e08
public: void __thiscall CEverQuest::Follow(void)	004e0a74
public: void __thiscall CEverQuest::GuildSay(char *)	004df992
public: void __thiscall CEverQuest::Invite(void)	004e06ad
public: void __thiscall CEverQuest::InviteOk(char *)	004e05d6
public: void __thiscall CEverQuest::IssueLfgGroupQuery(struct LfgGroupQuery *)	004f04a9
public: void __thiscall CEverQuest::IssuePetCommand(enum PetCommandType,int)	004f04c6
public: void __thiscall CEverQuest::Kill(char *,char *)	004eb456
public: void __thiscall CEverQuest::LeftClickedOnPlayer(class EQPlayer *)	004e1d3c
public: void __thiscall CEverQuest::LMouseDown(int,int)	004efa8a
public: void __thiscall CEverQuest::LMouseUp(int,int)	004e1a1f
public: void __thiscall CEverQuest::LocalDeath(struct _EQPlayerDeath *,unsigned char)	004dabf6
public: void __thiscall CEverQuest::MoveToZone(char *,char *,int,enum ZONE_REQ_REASON)	004ef68a
public: void __thiscall CEverQuest::MoveToZone(enum EQZoneIndex,char *,int,enum ZONE_REQ_REASON)	004ef656
public: void __thiscall CEverQuest::procMouse(int)	004e7cc0
public: void __thiscall CEverQuest::ReportDeath(struct _EQPlayerDeath *)	004d8ddc
public: void __thiscall CEverQuest::ReportSuccessfulHit(struct _EQSuccessfulHit *,unsigned char,int)	004d9602
public: void __thiscall CEverQuest::RightClickedOnPlayer(class EQPlayer *)	004e1f95
public: void __thiscall CEverQuest::RMouseDown(int,int)	004efa9d
public: void __thiscall CEverQuest::RMouseUp(int,int)	004efad4
public: void __thiscall CEverQuest::SavePC(int,int,unsigned char)	004e55bd
public: void __thiscall CEverQuest::SavePCForce(int)	004dac62
public: void __thiscall CEverQuest::send_chat(void)	004e8b07
public: void __thiscall CEverQuest::send_social(int,char *,char *)	004e2419
public: void __thiscall CEverQuest::send_tell(char *,char *)	004e5fc1
public: void __thiscall CEverQuest::SetLfgPlayerStatus(struct LfgPlayerStatus *)	004f0432
public: void __thiscall CEverQuest::Sit(void)	004e0fc5
public: void __thiscall CEverQuest::StartCasting(void *)	004dc973
public: void __thiscall CEverQuest::Surname(char *)	004eb3f0
public: void __thiscall CEverQuest::WhatTimeIsIt(void)	004effa0
public: void __thiscall CEverQuest::Who(char *)	004dfa33
public: void __thiscall CExploreModeWnd::Activate(void)	0041c8a6
public: void __thiscall CGiveWnd::Activate(void)	00421c5e
public: void __thiscall CHotButtonWnd::DoHotButton(int,int)	00429a5a
public: void __thiscall CInventoryWnd::Activate(void)	0042a511
public: void __thiscall CInvSlot::DoDrinkEatPoison(class EQ_Item *,int)	0042b68e
public: void __thiscall CInvSlot::SetInvSlotWnd(class CInvSlotWnd *)	0042ac63
public: void __thiscall CInvSlot::SetItem(class EQ_Item *)	0042acf1
public: void __thiscall CInvSlot::SliderComplete(int)	0042adef
public: void __thiscall CInvSlotMgr::SelectSlot(class CInvSlot *)	0042c56a
public: void __thiscall CInvSlotWnd::SetInvSlot(class CInvSlot *)	00554170
public: void __thiscall CItemDisplayWnd::SetItem(class EQ_Item *,bool)	0042cbf6
public: void __thiscall CListWnd::SetCurSel(int)	005256d0
public: void __thiscall CLootWnd::Deactivate(bool)	00433978
public: void __thiscall CLootWnd::RequestLootSlot(int,bool)	00433f02
public: void __thiscall CLootWnd::SlotLooted(int)	0043404e
public: void __thiscall CMerchantWnd::Activate(class EQPlayer *,float)	004389a3
public: void __thiscall CMerchantWnd::FinishBuyingItem(struct _sell_msg *)	00439564
public: void __thiscall CMerchantWnd::SelectBuySellSlot(int,class CTextureAnimation *)	004390bd
public: void __thiscall CQuantityWnd::Activate(class CXWnd *,int,int,int,int,bool)	0044160c
public: void __thiscall CSelectorWnd::Activate(void)	004445dd
public: void __thiscall CSkillsWnd::SkillImproveOccurred(int)	00444f1e
public: void __thiscall CSliderWnd::SetValue(int)	00553660
public: void __thiscall CSoulmarkWnd::Activate(char *,char *)	00445cbf
public: void __thiscall CSoulmarkWnd::Warn(char *)	0044665e
public: void __thiscall CSpellBookWnd::Activate(void)	00446a61
public: void __thiscall CSpellBookWnd::AutoMemSpell(int,int)	00446dba
public: void __thiscall CSpellBookWnd::DeleteSpellFromBook(int,int)	00448085
public: void __thiscall CSpellBookWnd::FinishMemorizing(int,int)	00447490
public: void __thiscall CSpellBookWnd::MemorizeSet(int *,int)	00446be3
public: void __thiscall CSpellBookWnd::RequestSpellDeletion(int)	0044804d
public: void __thiscall CSpellBookWnd::TurnToPage(int)	00447c57
public: void __thiscall CTargetWnd::Activate(void)	0044a4e8
public: void __thiscall CTradeWnd::Activate(class EQPlayer *,bool)	0044cc91
public: void __thiscall CTradeWnd::ClickedTradeButton(void)	0044d041
public: void __thiscall CTradeWnd::DropItemIntoTrade(void)	0044d711
public: void __thiscall CXWnd::BringToTop(bool)	0051f660
public: void __thiscall EQPlayer::Dismount(void)	004cae8c
public: void __thiscall EQPlayer::DoClassRandomAnimation(void)	004d1335
public: void __thiscall EQPlayer::FacePlayer(class EQPlayer *)	004b10e3
public: void __thiscall EQPlayer::FollowPlayerAI(void)	004b0a72
public: void __thiscall EQPlayer::GetConscious(void)	004b481b
public: void __thiscall EQPlayer::IDied(struct _EQPlayerDeath *)	004b4911
public: void __thiscall EQPlayer::IHaveFallen(float)	004b4d18
public: void __thiscall EQPlayer::InitSneakMod(void)	004ca60f
public: void __thiscall EQPlayer::KnockedOut(void)	004b488c
public: void __thiscall EQPlayer::MakeRiderMountUp(void)	004cac36
public: void __thiscall EQPlayer::MountEQPlayer(class EQPlayer *)	004cacc4
public: void __thiscall EQPlayer::PushAlongHeading(float)	004d0607
public: void __thiscall EQPlayer::SetAfk(int)	004b2bf7
public: void __thiscall EQPlayer::SetAndReserveID(unsigned int)	004cb892
public: void __thiscall EQPlayer::SetInvited(bool)	004b54fe
public: void __thiscall EQPlayer::SetRace(int)	004cb8fc
public: void __thiscall EQPlayer::SetToRandomRace(void)	004cb05f
public: void __thiscall EQPlayer::TriggerSpellEffect(struct _EQMissileHitinfo *)	004b451f
public: void __thiscall EQPlayer::TurnOffAutoFollow(void)	004b0db8
public: void __thiscall EQWorldData::AdvanceTime(unsigned int)	004d5244
public: void __thiscall EQWorldData::CurrentGameTime(char *)	004d535b
public: void __thiscall EQWorldData::GetFullZoneName(enum EQZoneIndex,char *)	004d5422
struct _EverQuestinfo EverQuest	00703328
struct _RTL_CRITICAL_SECTION MessageProcessing	006f6b50
struct _RTL_CRITICAL_SECTION PlayerList	006fae38
struct IDirectInputDevice8A * g_pMouse	00781314
unsigned char __cdecl BadWord(char *,int)	004aeb8e
unsigned char dlmb	0078132e
unsigned char drmb	0078132f
unsigned char lmb	0078132c
unsigned int global_id	005bf034
unsigned int MClick_Delay	005d3e30
void __cdecl bazaarlog(char const *)	004d58c6
void __cdecl ConvertNameToLocal(char *)	004e819d
void __cdecl do_join(class EQPlayer *,char *)	004aadf8
void __cdecl GetEQScreenRes(int *,int *)	0044a32d
void __cdecl GetLocalPlayerName(char *)	004f18c9
void __cdecl LoadIniFileString(char *,char *,char *,char *,int,char *)	0044a1d9
void __cdecl ProcessMouseEvent(void)	004d64e3
void __thiscall CTrainWnd::Activate(void)	0044dc20
Edit: just got done undecorating all functions... you can pick it up here:

http://medlem.spray.se/eqmule/

Posted: Wed Jul 02, 2003 10:26 pm
by HanzO
This is gonna be SO crazy...

II can only imagine the things this opens up.

Posted: Thu Jul 03, 2003 3:51 pm
by HanzO
Ok, so is it a stupid question to ask if there is a eqmain.map out there? or does a section of this .map file do that for us TOO?!?

Posted: Thu Jul 03, 2003 3:57 pm
by BlueSkies
*WARNING* -- Newbie Alert:

How the hell do I use all this? :P

I want to be able to contribute, but I don't know the first thing about how to go about making use of these functions.

Posted: Thu Jul 03, 2003 5:13 pm
by Valerian
get a good understanding of assembly, and finding offsets (those offsets there are for the testeqgame), look at how others have implimented these (the dropmoney thing, and the other funcs that are already in mq) and you might have some idea how to put some others of these into use...

Posted: Thu Jul 03, 2003 6:09 pm
by BlueSkies
Figured out offset finding -- not that difficult... I've found what I think is the functions for starting and stopping trader mode in the bazaar -- but I don't know where to go from there.

And, I'm afraid, getting a "good understanding" of assembly is going to take quite a while. I understand the theory of asm, but the last time I messed with it was on the Commodore 64... :P

I looked at the dropmoney thing that Sprite did -- and I'm still pretty much baffled... I see what he does, but I don't know how he knew to do that...

I'm looking, I'm just not seeing... Is there any way I could persuade you to give me more specific help?

Posted: Fri Jul 04, 2003 2:59 am
by Valerian
I think he figured that out by looking at other calls to that func (in the disassembly, or possibly debugger), figuring out what values they were placing on the stack, and some trial and error...

Or maybe he just has a more intimate knowledge of assembly and how calling conventions really work.. *shrug*

I haven't even attempted to figure any of this out yet, been too busy playing lately.

Posted: Fri Jul 04, 2003 9:24 am
by sprite
Just use a debugger to see what values are being pushed onto stack.

Posted: Fri Jul 04, 2003 4:31 pm
by Pragma
You know the paramters from the map file. They are pushed onto the stack in reverse order (as in param1 is last value pushed on). Since for the most part these are class members you need to also firts push on the pointer to the class pointer, which is serving as a __this to allow for the access of the member function.

Posted: Fri Jul 04, 2003 8:29 pm
by BlueSkies
This is extremely confusing...

Trying to get Bazaar mode to toggle on, without having to click the button.

EqMule and I spent several hours trying to figure this out... It was a simple matter finding the function we need to call:

Code: Select all

* Referenced by a CALL at Addresses:
|:0040727D   , :004072A6   , :004072D0   , :00407310   , :0040739B   
|:004073E3   , :0040752B   , :00408322   , :00408380   
|
:00407FBB 55                      push ebp
:00407FBC 8BEC                    mov ebp, esp
:00407FBE 51                      push ecx
:00407FBF 51                      push ecx
:00407FC0 53                      push ebx
:00407FC1 56                      push esi
:00407FC2 8BF1                    mov esi, ecx
:00407FC4 57                      push edi
:00407FC5 8B0D04995D00            mov ecx, dword ptr [005D9904]
:00407FCB 6A0C                    push 0000000C
:00407FCD E8C9B70000              call 0041379B
:00407FD2 8B0D04995D00            mov ecx, dword ptr [005D9904]
:00407FD8 8BF8                    mov edi, eax
:00407FDA 6A0A                    push 0000000A
:00407FDC 897DF8                  mov dword ptr [ebp-08], edi
:00407FDF E8B7B70000              call 0041379B
:00407FE4 837D08FF                cmp dword ptr [ebp+08], FFFFFFFF
:00407FE8 8945FC                  mov dword ptr [ebp-04], eax
:00407FEB 8D9680010000            lea edx, dword ptr [esi+00000180]
:00407FF1 753D                    jne 00408030
:00407FF3 6A50                    push 00000050
:00407FF5 81C6CC020000            add esi, 000002CC
:00407FFB 5B                      pop ebx
And I found where this function is called via the click event to turn the trader mode on:

Code: Select all

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:00407088(C)
|
:004073A5 33DB                    xor ebx, ebx
:004073A7 395F04                  cmp dword ptr [edi+04], ebx
:004073AA 7466                    je 00407412
:004073AC 6A14                    push 00000014
:004073AE 8D45E8                  lea eax, dword ptr [ebp-18]
:004073B1 53                      push ebx
:004073B2 50                      push eax
:004073B3 E8888F1600              call 00570340
:004073B8 8B0DA00F7600            mov ecx, dword ptr [00760FA0]
:004073BE 83C40C                  add esp, 0000000C
:004073C1 6A0D                    push 0000000D
:004073C3 53                      push ebx
:004073C4 68561A0000              push 00001A56
:004073C9 E80D370F00              call 004FAADB
:004073CE 50                      push eax
:004073CF 8BCE                    mov ecx, esi
:004073D1 E8C6F9FFFF              call 00406D9C
:004073D6 6A01                    push 00000001
:004073D8 6AFF                    push FFFFFFFF
:004073DA 8BCE                    mov ecx, esi
:004073DC C6860008000001          mov byte ptr [esi+00000800], 01
:[b]004073E3 E8D30B0000              call 00407FBB[/b]
:004073E8 8BCE                    mov ecx, esi
:004073EA E8CA060000              call 00407AB9
:004073EF 6A01                    push 00000001
:004073F1 8D45E8                  lea eax, dword ptr [ebp-18]
:004073F4 6A14                    push 00000014
:004073F6 50                      push eax
:004073F7 6814020000              push 00000214
:004073FC 68D04E6F00              push 006F4ED0
:00407401 C745E80B000000          mov [ebp-18], 0000000B
:00407408 E85A000F00              call 004F7467
:0040740D 83C414                  add esp, 00000014
:00407410 EB1B                    jmp 0040742D
Here's what I've got right now:

Code: Select all

VOID ActivateBazaar(PSPAWNINFO pChar, PCHAR szLine)
{
    bRunNextCommand = FALSE;
    DWORD STARTTRADE = 0x00407FBB;
    DWORD BZRHWND = 0x0058e270;
    __asm {
        push ebx;
        push 0x00000001;
        push 0xffffffff;
        mov dword ptr [esi], 0058e270h;
        mov ecx, esi;
        mov byte ptr [esi+0x00000800], 01;
        call dword ptr [STARTTRADE];
    }
   return;
}
All this seems to want to do is crash eqgame to desktop... *cries*

I don't know what to do. I don't know enough about asm to fix this -- EqMule was doing most of the work there... Can anyone shed some light on this, by chance?

Posted: Fri Jul 04, 2003 10:22 pm
by dont_know_at_all
When using __asm, you must restore all the critical registers to their pre-__asm values.

What is the name of the routine that you are calling, the routine at 0x00407FBB?

Posted: Sat Jul 05, 2003 1:58 am
by EqMule
dont_know_at_all wrote:What is the name of the routine that you are calling, the routine at 0x00407FBB?
the function is

Code: Select all

?ToggleBzrItemActive@CBazaarWnd@@AAEXH_N@Z
which undecorates to

Code: Select all

private: void __thiscall CBazaarWnd::ToggleBzrItemActive(int,bool)
takes 2 parameters... a pointer ? , trader on/off ? (guessing)...

Posted: Sat Jul 05, 2003 2:39 am
by dont_know_at_all

Code: Select all

    push    ecx
    push    1
    push    0xffffffff
    mov     ecx, [BZRHWND]
    call    dword ptr [STARTTRADE]
    pop     ecx
You need to save off ecx and restore it when done.

Posted: Sat Jul 05, 2003 3:00 am
by EqMule
ok found this

Code: Select all

?g_pBazaarWnd@@3PAVCBazaarWnd@@A
it undecorates to

Code: Select all

class CBazaarWnd * g_pBazaarWnd
with offsets:

Code: Select all

live offset:005E5480

Code: Select all

test offset: 005eafa4
Do you think I should load the class offset into ecx instead ?

Code: Select all

    push    ecx 
    push    1 
    push    0xffffffff 
    mov     ecx, [[b]0x005E5480[/b]] 
    call    dword ptr [STARTTRADE] 
    pop     ecx

Posted: Sat Jul 05, 2003 4:20 am
by dont_know_at_all
I think it should be the pointer but to check set a breakpoint at the address and type "/bazaar" to see exactly what ecx should be.

Which reminds me, you can already open the bazaar window with the "/bazaar" command, right?