├── common ├── pch.cpp ├── CRTTI.h ├── UInt128.h ├── CPartySearchRemoCon.h ├── ConfigJoypad.h ├── ZInetAddr.h ├── framework.h ├── detours.lib ├── IGObj.h ├── WebCookie.h ├── IsMsg.h ├── CMacroSysMan.h ├── CBattleRecordMan.h ├── GW_MonsterBookCard.h ├── ZPair.h ├── ZSocketBase.h ├── INetMsgHandler.h ├── CAnimationDisplayer.h ├── CQuickslotKeyMappedMan.h ├── CanvasAlphaType.h ├── CWndMan.h ├── GW_WildHunterInfo.h ├── GW_MiniGameRecord.h ├── EquippedSetItem.h ├── LayerBlendType.h ├── GW_ItemSlotBase.h ├── CSimpleStrMap.h ├── CUITitle.cpp ├── CRadioManager.h ├── Gr2DAniType.h ├── CLogin.cpp ├── CWvsContext.cpp ├── GW_Friend.h ├── CanvasPixelFormat.h ├── PartySearchSetting.h ├── ZSocketBase.cpp ├── CDialog.h ├── CMacroSysMan.cpp ├── TemporaryStatBase.h ├── ZSocketBuffer.h ├── GW_CoupleRecord.h ├── GuildMember.h ├── ZSocketBuffer.cpp ├── CMonsterBookMan.h ├── CBattleRecordMan.cpp ├── CanvasDitherType.h ├── CActionMan.h ├── CQuickslotKeyMappedMan.cpp ├── CAnimationDisplayer.cpp ├── PartyMember.h ├── GW_FriendRecord.h ├── ZFatalSection.h ├── CConnectionNoticeDlg.h ├── CanvasLevelMap.h ├── CQuestMan.h ├── CInPacket.h ├── CRand32.h ├── CalcDamage.h ├── CWndMan.cpp ├── GW_MarriageRecord.h ├── ExtendSP.h ├── AllianceData.h ├── ZRefCountedAccessor.h ├── CMapleTVMan.h ├── Additional.h ├── AvatarData.h ├── RecommendWorldMsg.h ├── CSystemInfo.h ├── DiDeviceInstanceA.h ├── FunckeyMapped.h ├── CCtrlWnd.h ├── TSingleton.h ├── CRadioManager.cpp ├── CSecurityClient.cpp ├── CCtrlComboBoxSelect.h ├── CStage.cpp ├── CFuncKeyMappedMan.cpp ├── GW_NewYearCardRecord.h ├── IDirectInputDevice8A.h ├── CIOBufferManipulator.h ├── COutPacket.h ├── CCtrlCheckBox.h ├── CCtrlScrollBar.h ├── PartyData.h ├── ZAllocEx.cpp ├── CStage.h ├── CSecurityClient.h ├── ConfigSysOpt.h ├── IWzSerialize.h ├── ZRecyclableStatic.h ├── CInputSystem.h ├── SPSet.h ├── ZRefCounted.h ├── CTemporaryStatView.h ├── IWzRawCanvasAllocator.h ├── CMonsterBookMan.cpp ├── CUIWnd.h ├── AvatarLook.h ├── CCtrlTab.h ├── CActionMan.cpp ├── CUILoginStart.h ├── ConfigGameOpt.h ├── CWvsPhysicalSpace2D.h ├── CSystemInfo.cpp ├── asserts.h ├── CUIBattleRecord.h ├── ZRefCountedDummy.h ├── ZRecyclable.h ├── IDraggable.h ├── ZAllocAnonSelector.h ├── BasicStat.h ├── GuildData.h ├── logger.h ├── CFadeWnd.h ├── CMapleTVMan.cpp ├── IWzRawCanvas.h ├── CFuncKeyMappedMan.h ├── CUITitle.h ├── logger.cpp ├── IWzArchive.h ├── IWzProperty.h ├── CQuestMan.cpp ├── ZAllocStrSelector.h ├── CCtrlEdit.h ├── ForcedStat.h ├── CCtrlButton.h ├── CConfig.cpp ├── CClientSocket.h ├── IUIMsgHandler.h ├── IDirectInput8A.h ├── IWzFont.h ├── CCtrlComboBox.h ├── COutPacket.cpp ├── CWnd.h ├── CIOBufferManipulator.cpp ├── winhook_types.cpp ├── IWzShape2D.h ├── ZRecyclableAvBuffer.h ├── CInputSystem.cpp ├── CClientSocket.cpp ├── FakeModule.cpp ├── winhooks.h ├── CConfig.h ├── ZAllocBase.h ├── CLogo.h ├── CWvsApp.h ├── hooker.h ├── IWzGr2D.h ├── hooker.cpp ├── CharacterData.h ├── Common.cpp ├── CLogo.cpp ├── IWzCanvas.h ├── IWzVector2D.h ├── Common.h ├── ZMap.h ├── memedit.h ├── CWvsApp.cpp ├── FontType.h ├── GW_CharacterStat.h ├── pch.h ├── memedit.cpp ├── TSecType.h ├── IWzGr2DLayer.h └── ZRef.h ├── renovate.json ├── redirect ├── redirect.ini └── CMakeLists.txt ├── .gitignore ├── no-patcher ├── CMakeLists.txt └── dllmain.cpp ├── window-mode ├── CMakeLists.txt └── dllmain.cpp ├── no-ad-balloon ├── CMakeLists.txt └── dllmain.cpp ├── enable-minimize ├── CMakeLists.txt └── dllmain.cpp ├── no-beginner-party-block ├── CMakeLists.txt └── dllmain.cpp ├── no-enter-mts-map-restriction ├── CMakeLists.txt └── dllmain.cpp ├── proxy ├── CMakeLists.txt ├── framework.h ├── dllmain.cpp └── ijl15.cpp ├── skip-logo ├── CMakeLists.txt └── dllmain.cpp ├── .github └── workflows │ ├── pull-request.yml │ ├── build-snapshot.yml │ └── release.yml ├── bypass └── CMakeLists.txt ├── CMakeLists.txt └── memory_maps └── GMS ├── v111_1.cmake └── v95_1.cmake /common/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" -------------------------------------------------------------------------------- /common/CRTTI.h: -------------------------------------------------------------------------------- 1 | struct CRTTI { 2 | const CRTTI *m_pPrev; 3 | }; 4 | -------------------------------------------------------------------------------- /common/UInt128.h: -------------------------------------------------------------------------------- 1 | struct UINT128 { 2 | unsigned int m_data[4]; 3 | }; 4 | -------------------------------------------------------------------------------- /common/CPartySearchRemoCon.h: -------------------------------------------------------------------------------- 1 | 2 | struct CPartySearch_RemoCon : CWnd 3 | { 4 | }; 5 | -------------------------------------------------------------------------------- /common/ConfigJoypad.h: -------------------------------------------------------------------------------- 1 | class CONFIG_JOYPAD 2 | { 3 | int nJoyPad_Btn[12]; 4 | }; 5 | -------------------------------------------------------------------------------- /common/ZInetAddr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ZInetAddr : sockaddr_in { 4 | }; 5 | -------------------------------------------------------------------------------- /common/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN 4 | #include -------------------------------------------------------------------------------- /common/detours.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chronicle20/gms-83-dll/HEAD/common/detours.lib -------------------------------------------------------------------------------- /common/IGObj.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | interface IGObj { 4 | public: 5 | virtual void Update() = 0; 6 | }; 7 | -------------------------------------------------------------------------------- /common/WebCookie.h: -------------------------------------------------------------------------------- 1 | struct WEBCOOKIE 2 | { 3 | char szCookie[4096]; 4 | char szReserved[4096]; 5 | }; 6 | -------------------------------------------------------------------------------- /common/IsMsg.h: -------------------------------------------------------------------------------- 1 | struct ISMSG 2 | { 3 | unsigned int message; 4 | unsigned int wParam; 5 | int lParam; 6 | }; 7 | -------------------------------------------------------------------------------- /common/CMacroSysMan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CMacroSysMan { 4 | public: 5 | static void CreateInstance(); 6 | }; 7 | -------------------------------------------------------------------------------- /common/CBattleRecordMan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CBattleRecordMan { 4 | public: 5 | static void CreateInstance(); 6 | }; 7 | -------------------------------------------------------------------------------- /common/GW_MonsterBookCard.h: -------------------------------------------------------------------------------- 1 | struct GW_MonsterBookCard { 2 | unsigned __int16 usCardID; 3 | unsigned __int8 nCardCount; 4 | }; 5 | -------------------------------------------------------------------------------- /common/ZPair.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | template 4 | class ZPair { 5 | F first; 6 | S second; 7 | }; 8 | -------------------------------------------------------------------------------- /common/ZSocketBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ZSocketBase { 4 | unsigned int _m_hSocket; 5 | 6 | void CloseSocket(); 7 | }; -------------------------------------------------------------------------------- /common/INetMsgHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class INetMsgHandler { 4 | public: 5 | virtual void OnPacket(int, CInPacket *) = 0; 6 | }; -------------------------------------------------------------------------------- /common/CAnimationDisplayer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CAnimationDisplayer { 4 | 5 | public: 6 | static void CreateInstance(); 7 | }; 8 | -------------------------------------------------------------------------------- /common/CQuickslotKeyMappedMan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CQuickslotKeyMappedMan { 4 | public: 5 | static void CreateInstance(); 6 | }; 7 | -------------------------------------------------------------------------------- /common/CanvasAlphaType.h: -------------------------------------------------------------------------------- 1 | enum CANVAS_ALPHATYPE : uint32_t 2 | { 3 | CA_OVERWRITE = 0xFFFFFFFF, 4 | CA_REMOVEALPHA = 0xFFFFFFFE, 5 | }; 6 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /common/CWndMan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CWndMan { 4 | public: 5 | static CWnd **s_Update(); 6 | 7 | static void RedrawInvalidatedWindows(); 8 | }; -------------------------------------------------------------------------------- /common/GW_WildHunterInfo.h: -------------------------------------------------------------------------------- 1 | struct GW_WildHunterInfo { 2 | unsigned __int8 nRidingType; 3 | unsigned int adwCapturedMob[5]; 4 | int nIdx; 5 | }; 6 | -------------------------------------------------------------------------------- /redirect/redirect.ini: -------------------------------------------------------------------------------- 1 | [Main] 2 | OriginalIP1=63.251.217.2 3 | OriginalIP2=63.251.217.3 4 | OriginalIP3=63.251.217.4 5 | RedirectIP=127.0.0.1 6 | RedirectPort=8484 -------------------------------------------------------------------------------- /common/GW_MiniGameRecord.h: -------------------------------------------------------------------------------- 1 | struct GW_MiniGameRecord 2 | { 3 | int nGameID; 4 | int nWin; 5 | int nDraw; 6 | int nLose; 7 | int nScore; 8 | }; 9 | -------------------------------------------------------------------------------- /common/EquippedSetItem.h: -------------------------------------------------------------------------------- 1 | #include "ZArray.h" 2 | 3 | struct EQUIPPED_SETITEM { 4 | int nSetItemID; 5 | int nPartsCount; 6 | ZArray nItemID; 7 | }; 8 | -------------------------------------------------------------------------------- /common/LayerBlendType.h: -------------------------------------------------------------------------------- 1 | enum LAYER_BLENDTYPE : __int32 2 | { 3 | LB_NORMAL = 0x0, 4 | LB_ADD = 0x1, 5 | LB_INVERSE = 0x2, 6 | LB_ISOLATED = 0x4, 7 | }; 8 | -------------------------------------------------------------------------------- /common/GW_ItemSlotBase.h: -------------------------------------------------------------------------------- 1 | 2 | struct GW_ItemSlotBase : ZRefCounted { 3 | TSecType nItemID; 4 | _LARGE_INTEGER liCashItemSN; 5 | _FILETIME dateExpire; 6 | }; 7 | -------------------------------------------------------------------------------- /common/CSimpleStrMap.h: -------------------------------------------------------------------------------- 1 | #include "ZMap.h" 2 | #include "ZXString.h" 3 | 4 | struct CSimpleStrMap { 5 | ZMap, ZXString, ZXString > m_mValues; 6 | }; 7 | -------------------------------------------------------------------------------- /common/CUITitle.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | CUITitle *CUITitle::GetInstance() { 4 | return reinterpret_cast(*reinterpret_cast(C_UI_TITLE_INSTANCE_ADDR)); 5 | } -------------------------------------------------------------------------------- /common/CRadioManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CRadioManager { 4 | 5 | public: 6 | static void CreateInstance(); 7 | 8 | static CRadioManager *GetInstance(); 9 | }; 10 | -------------------------------------------------------------------------------- /common/Gr2DAniType.h: -------------------------------------------------------------------------------- 1 | enum GR2D_ANITYPE : __int32 2 | { 3 | GA_STOP = 0x0, 4 | GA_WAIT = 0x100, 5 | GA_NORMAL = 0x0, 6 | GA_FIRST = 0x10, 7 | GA_REPEAT = 0x20, 8 | }; 9 | -------------------------------------------------------------------------------- /common/CLogin.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "CLogin.h" 3 | 4 | void CLogin::Update() { 5 | reinterpret_cast(C_LOGIN_UPDATE)(this, nullptr); 6 | } 7 | -------------------------------------------------------------------------------- /common/CWvsContext.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | CWvsContext *CWvsContext::GetInstance() { 4 | return reinterpret_cast(*reinterpret_cast(C_WVS_CONTEXT_INSTANCE_ADDR)); 5 | } -------------------------------------------------------------------------------- /common/GW_Friend.h: -------------------------------------------------------------------------------- 1 | struct GW_Friend { 2 | unsigned int dwFriendID; 3 | char sFriendName[13]; 4 | unsigned __int8 nFlag; 5 | int nChannelID; 6 | char sFriendGroup[17]; 7 | }; 8 | -------------------------------------------------------------------------------- /common/CanvasPixelFormat.h: -------------------------------------------------------------------------------- 1 | enum CANVAS_PIXFORMAT : __int32 2 | { 3 | CP_UNKNOWN = 0x0, 4 | CP_A4R4G4B4 = 0x1, 5 | CP_A8R8G8B8 = 0x2, 6 | CP_R5G6B5 = 0x201, 7 | CP_DXT3 = 0x402, 8 | }; 9 | -------------------------------------------------------------------------------- /common/PartySearchSetting.h: -------------------------------------------------------------------------------- 1 | struct PARTYSERACH_SETTING { 2 | int bCleared; 3 | int nMin_Level; 4 | int nMax_Level; 5 | int nNumOf_PartyMember; 6 | unsigned int dwSearchingJob; 7 | }; 8 | -------------------------------------------------------------------------------- /common/ZSocketBase.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void ZSocketBase::CloseSocket() { 4 | reinterpret_cast( 5 | Z_SOCKET_BASE_CLOSE_SOCKET)(this, nullptr); 6 | } -------------------------------------------------------------------------------- /common/CDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CDialog : public CWnd 4 | { 5 | int m_nRet; 6 | bool m_bTerminate; 7 | ZRef m_pChildModal; 8 | 9 | void SetRet(CDialog*, int nRet); 10 | }; -------------------------------------------------------------------------------- /common/CMacroSysMan.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CMacroSysMan::CreateInstance() { 4 | Log("CMacroSysMan::CreateInstance"); 5 | reinterpret_cast(C_MACRO_SYS_MAN_CREATE_INSTANCE)(); 6 | } -------------------------------------------------------------------------------- /common/TemporaryStatBase.h: -------------------------------------------------------------------------------- 1 | 2 | template 3 | class TemporaryStatBase : ZRefCounted { 4 | int m_value; 5 | int m_reason; 6 | unsigned int m_tLastUpdated; 7 | ZFatalSection m_lock; 8 | }; 9 | -------------------------------------------------------------------------------- /common/ZSocketBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ZSocketBuffer : ZRefCounted, _WSABUF, ZRefCountedAccessorBase { 4 | ZRef _m_pParent; 5 | 6 | static ZSocketBuffer* Alloc(unsigned int u); 7 | }; -------------------------------------------------------------------------------- /common/GW_CoupleRecord.h: -------------------------------------------------------------------------------- 1 | #include "ZArray.h" 2 | 3 | class GW_CoupleRecord { 4 | unsigned int dwPairCharacterID; 5 | char sPairCharacterName[13]; 6 | _LARGE_INTEGER liSN; 7 | _LARGE_INTEGER liPairSN; 8 | }; 9 | -------------------------------------------------------------------------------- /common/GuildMember.h: -------------------------------------------------------------------------------- 1 | struct GUILDMEMBER { 2 | char sCharacterName[13]; 3 | int nJob; 4 | int nLevel; 5 | int nGrade; 6 | int bOnLine; 7 | int nCommitment; 8 | int nAllianceGrade; 9 | }; 10 | -------------------------------------------------------------------------------- /common/ZSocketBuffer.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | ZSocketBuffer *ZSocketBuffer::Alloc(unsigned int u) { 4 | return reinterpret_cast( 5 | Z_SOCKET_BUFFER_ALLOC)(u); 6 | } -------------------------------------------------------------------------------- /common/CMonsterBookMan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CMonsterBookMan { 4 | 5 | public: 6 | static void CreateInstance(); 7 | 8 | static CMonsterBookMan *GetInstance(); 9 | 10 | bool LoadBook(); 11 | }; 12 | -------------------------------------------------------------------------------- /common/CBattleRecordMan.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CBattleRecordMan::CreateInstance() { 4 | Log("CBattleRecordMan::CreateInstance"); 5 | reinterpret_cast(C_BATTLE_RECORD_MAN_CREATE_INSTANCE)(); 6 | } -------------------------------------------------------------------------------- /common/CanvasDitherType.h: -------------------------------------------------------------------------------- 1 | enum CANVAS_DITHERTYPE : __int32 2 | { 3 | CD_NONE = 0x0, 4 | CD_FS0 = 0x1, 5 | CD_FS1 = 0x2, 6 | CD_FS = 0x3, 7 | CD_FD0 = 0x11, 8 | CD_FD1 = 0x12, 9 | CD_FD = 0x13, 10 | }; -------------------------------------------------------------------------------- /common/CActionMan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CActionMan { 4 | 5 | public: 6 | static void CreateInstance(); 7 | 8 | static CActionMan *GetInstance(); 9 | 10 | void Init(); 11 | 12 | void SweepCache(); 13 | }; -------------------------------------------------------------------------------- /common/CQuickslotKeyMappedMan.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CQuickslotKeyMappedMan::CreateInstance() { 4 | Log("CQuickslotKeyMappedMan::CreateInstance"); 5 | reinterpret_cast(C_QUICKSLOT_KEY_MAPPED_MAN)(); 6 | } -------------------------------------------------------------------------------- /common/CAnimationDisplayer.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CAnimationDisplayer::CreateInstance() { 4 | Log("CAnimationDisplayer::CreateInstance"); 5 | reinterpret_cast(C_ANIMATION_DISPLAYER_CREATE_INSTANCE)(); 6 | } -------------------------------------------------------------------------------- /common/PartyMember.h: -------------------------------------------------------------------------------- 1 | struct PARTYMEMBER { 2 | unsigned int adwCharacterID[6]; 3 | char asCharacterName[6][13]; 4 | int anJob[6]; 5 | int anLevel[6]; 6 | int anChannelID[6]; 7 | unsigned int dwPartyBossCharacterID; 8 | }; 9 | -------------------------------------------------------------------------------- /common/GW_FriendRecord.h: -------------------------------------------------------------------------------- 1 | #include "ZArray.h" 2 | 3 | struct GW_FriendRecord { 4 | unsigned int dwPairCharacterID; 5 | char sPairCharacterName[13]; 6 | _LARGE_INTEGER liSN; 7 | _LARGE_INTEGER liPairSN; 8 | unsigned int dwFriendItemID; 9 | }; 10 | -------------------------------------------------------------------------------- /common/ZFatalSection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ZFatalSectionData 4 | { 5 | void* _m_pTIB; 6 | int _m_nRef; 7 | }; 8 | 9 | struct ZFatalSection : ZFatalSectionData 10 | { 11 | /* TODO emulate this class */ 12 | }; 13 | 14 | assert_size(sizeof(ZFatalSection), 0x8) -------------------------------------------------------------------------------- /common/CConnectionNoticeDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CConnectionNoticeDlg : CDialog 4 | { 5 | public: 6 | char gap90; 7 | CLogin* m_pLogin; 8 | ZRef m_pBtCancel; 9 | _com_ptr_t<_com_IIID> m_pLayerAnimationBar; 10 | }; -------------------------------------------------------------------------------- /common/CanvasLevelMap.h: -------------------------------------------------------------------------------- 1 | enum CANVAS_LEVELMAP : __int32 2 | { 3 | CL_ALL16 = 0x1, 4 | CL_ALL32 = 0x2, 5 | CL_ALL56 = 0x201, 6 | CL_USE32OVER1 = 0x10002, 7 | CL_USE32OVER2 = 0x20002, 8 | CL_USE56OVER1 = 0x10201, 9 | CL_USE56OVER2 = 0x20201, 10 | }; 11 | -------------------------------------------------------------------------------- /common/CQuestMan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CQuestMan { 4 | 5 | public: 6 | static void CreateInstance(); 7 | 8 | static CQuestMan *GetInstance(); 9 | 10 | int LoadDemand(); 11 | 12 | void LoadPartyQuestInfo(); 13 | 14 | void LoadExclusive(); 15 | }; 16 | -------------------------------------------------------------------------------- /common/CInPacket.h: -------------------------------------------------------------------------------- 1 | 2 | struct CInPacket { 3 | int m_bLoopback; 4 | int m_nState; 5 | ZArray m_aRecvBuff; 6 | unsigned __int16 m_uLength; 7 | unsigned __int16 m_uRawSeq; 8 | unsigned __int16 m_uDataLen; 9 | unsigned int m_uOffset; 10 | }; 11 | -------------------------------------------------------------------------------- /common/CRand32.h: -------------------------------------------------------------------------------- 1 | #include "ZFatalSection.h" 2 | 3 | struct CRand32 { 4 | unsigned int m_s1; 5 | unsigned int m_s2; 6 | unsigned int m_s3; 7 | unsigned int m_past_s1; 8 | unsigned int m_past_s2; 9 | unsigned int m_past_s3; 10 | ZFatalSection m_lock; 11 | }; 12 | -------------------------------------------------------------------------------- /common/CalcDamage.h: -------------------------------------------------------------------------------- 1 | #include "CRand32.h" 2 | 3 | struct CalcDamage { 4 | CRand32 m_RndGenForCharacter; 5 | CRand32 m_RndForCheckDamageMiss; 6 | CRand32 m_RndForMortalBlow; 7 | CRand32 m_RndForSummoned; 8 | CRand32 m_RndForMob; 9 | CRand32 m_RndGenForMob; 10 | }; 11 | -------------------------------------------------------------------------------- /common/CWndMan.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | CWnd **CWndMan::s_Update() { 4 | return reinterpret_cast(C_WND_MAN_S_UPDATE)(); 5 | } 6 | 7 | void CWndMan::RedrawInvalidatedWindows() { 8 | reinterpret_cast(C_WND_MAN_REDRAW_INVALIDATED_WINDOWS)(); 9 | } -------------------------------------------------------------------------------- /common/GW_MarriageRecord.h: -------------------------------------------------------------------------------- 1 | struct GW_MarriageRecord { 2 | unsigned int dwMarriageNo; 3 | unsigned int dwGroomID; 4 | unsigned int dwBrideID; 5 | unsigned __int16 usStatus; 6 | int nGroomItemID; 7 | int nBrideItemID; 8 | char sGroomName[13]; 9 | char sBrideName[13]; 10 | }; 11 | -------------------------------------------------------------------------------- /common/ExtendSP.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ZList.h" 3 | #include "SPSet.h" 4 | 5 | /* 6 | 00000000 ExtendSP struc; (sizeof = 0x14, align = 0x4, copyof_1763) 7 | 00000000 lSPSet ZList ? 8 | 00000014 ExtendSP ends 9 | */ 10 | struct ExtendSP 11 | { 12 | ZList lSPSet; 13 | }; -------------------------------------------------------------------------------- /common/AllianceData.h: -------------------------------------------------------------------------------- 1 | #include "ZXString.h" 2 | #include "ZArray.h" 3 | 4 | struct ALLIANCEDATA { 5 | int nAllianceID; 6 | ZXString sAllianceName; 7 | ZArray> asGradeName; 8 | ZArray adwGuildID; 9 | int nMaxMemberNum; 10 | ZXString sNotice; 11 | }; 12 | -------------------------------------------------------------------------------- /common/ZRefCountedAccessor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ZRefCountedAccessorBase 4 | { 5 | }; 6 | 7 | 8 | template 9 | class ZRefCountedAccessor : ZRefCountedAccessorBase 10 | { 11 | 12 | }; 13 | 14 | assert_size(sizeof(ZRefCountedAccessor), 0x01); 15 | assert_size(sizeof(ZRefCountedAccessorBase), 0x01); -------------------------------------------------------------------------------- /common/CMapleTVMan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CMapleTVMan { 4 | 5 | public: 6 | static void CreateInstance(); 7 | 8 | static CMapleTVMan *GetInstance(); 9 | 10 | #if defined(REGION_GMS) 11 | void Init(); 12 | #elif defined(REGION_JMS) 13 | void Init(int something, int somethingElse); 14 | #endif 15 | }; 16 | -------------------------------------------------------------------------------- /common/Additional.h: -------------------------------------------------------------------------------- 1 | struct Additional { 2 | struct SKILL { 3 | int nSkillID; 4 | int nSLV; 5 | }; 6 | 7 | struct CRITICAL 8 | { 9 | int nProb; 10 | int nDamage; 11 | }; 12 | 13 | struct BOSS 14 | { 15 | int nProb; 16 | int nDamage; 17 | }; 18 | 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /common/AvatarData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | 00000000 AvatarData struc ; (sizeof=0x2FE, copyof_4916) 5 | 00000000 characterStat GW_CharacterStat ? 6 | 000000F9 avatarLook AvatarLook ? 7 | 000002FE AvatarData ends 8 | */ 9 | struct AvatarData 10 | { 11 | GW_CharacterStat characterStat; 12 | AvatarLook avatarLook; 13 | }; -------------------------------------------------------------------------------- /common/RecommendWorldMsg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /*/ 4 | 00000000 RECOMMENDWORLDMSG struc; (sizeof = 0x8, align = 0x4, copyof_4932) 5 | 00000000 nWorldID dd ? 6 | 00000004 sMessage ZXString ? 7 | 00000008 RECOMMENDWORLDMSG ends 8 | */ 9 | struct RecommendWorldMsg 10 | { 11 | int nWorldID; 12 | ZXString sMessage; 13 | }; -------------------------------------------------------------------------------- /common/CSystemInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CSystemInfo { 4 | public: 5 | virtual ~CSystemInfo() = default; 6 | 7 | unsigned __int8 SupportId[16]; 8 | unsigned __int8 MachineId[16]; 9 | 10 | explicit CSystemInfo(); 11 | unsigned char Init(); 12 | int GetGameRoomClient(); 13 | unsigned __int8 *GetMachineId(); 14 | }; 15 | -------------------------------------------------------------------------------- /common/DiDeviceInstanceA.h: -------------------------------------------------------------------------------- 1 | struct DIDEVICEINSTANCEA 2 | { 3 | unsigned int dwSize; 4 | _GUID guidInstance; 5 | _GUID guidProduct; 6 | unsigned int dwDevType; 7 | char tszInstanceName[260]; 8 | char tszProductName[260]; 9 | _GUID guidFFDriver; 10 | unsigned __int16 wUsagePage; 11 | unsigned __int16 wUsage; 12 | }; 13 | -------------------------------------------------------------------------------- /common/FunckeyMapped.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | 00000000 FUNCKEY_MAPPED struc; (sizeof = 0x5, copyof_1423) 5 | 00000000 nType db ? 6 | 00000001 nID dd ? 7 | 00000005 FUNCKEY_MAPPED ends 8 | */ 9 | #pragma pack(push, 1) 10 | class FUNCKEY_MAPPED 11 | { 12 | unsigned __int8 nType; 13 | int nID; 14 | }; 15 | #pragma pack(pop) -------------------------------------------------------------------------------- /common/CCtrlWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CWnd; 4 | 5 | class CCtrlWnd : IGObj, IUIMsgHandler, ZRefCounted { 6 | int m_nCtrlId; 7 | _com_ptr_t<_com_IIID> m_pLTCtrl; 8 | int m_width; 9 | int m_height; 10 | CWnd *m_pParent; 11 | bool m_bAcceptFocus; 12 | bool m_bEnabled; 13 | bool m_bShown; 14 | }; -------------------------------------------------------------------------------- /common/TSingleton.h: -------------------------------------------------------------------------------- 1 | template 2 | class TSingleton { 3 | public: 4 | static T &GetInstance() { 5 | static T ms_pInstance; 6 | return ms_pInstance; 7 | } 8 | 9 | private: 10 | TSingleton() {} 11 | 12 | TSingleton(const TSingleton &); 13 | TSingleton &operator=(const TSingleton &); 14 | 15 | protected: 16 | ~TSingleton() {} 17 | }; -------------------------------------------------------------------------------- /common/CRadioManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CRadioManager::CreateInstance() { 4 | Log("CRadioManager::CreateInstance"); 5 | reinterpret_cast(C_RADIO_MANAGER_CREATE_INSTANCE)(); 6 | } 7 | 8 | CRadioManager *CRadioManager::GetInstance() { 9 | return reinterpret_cast(*reinterpret_cast(C_RADIO_MANAGER_INSTANCE_ADDR)); 10 | } -------------------------------------------------------------------------------- /common/CSecurityClient.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CSecurityClient::CreateInstance() { 4 | Log("CSecurityClient::CreateInstance"); 5 | reinterpret_cast(C_SECURITY_CLIENT_CREATE_INSTANCE)(); 6 | } 7 | 8 | CSecurityClient *CSecurityClient::GetInstance() { 9 | return reinterpret_cast(*reinterpret_cast(C_SECURITY_CLIENT_INSTANCE_ADDR)); 10 | } -------------------------------------------------------------------------------- /common/CCtrlComboBoxSelect.h: -------------------------------------------------------------------------------- 1 | #include "CCtrlWnd.h" 2 | #include "FontType.h" 3 | #include "CCtrlComboBox.h" 4 | 5 | struct CCtrlComboBoxSelect : CCtrlWnd { 6 | int m_nSelect; 7 | int m_nSelectMax; 8 | int m_bDeleteEnable; 9 | FONT_TYPE m_fTypeSelect; 10 | FONT_TYPE m_fTypeSelectFocused; 11 | IWzGr2DLayer *m_pLayer; 12 | int m_nTextOffset_Y; 13 | CCtrlComboBox *m_pComboBox; 14 | }; 15 | -------------------------------------------------------------------------------- /common/CStage.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CStage::OnMouseEnter(int bEnter) { 4 | reinterpret_cast( 5 | C_STAGE_ON_MOUSE_ENTER)(this, nullptr, bEnter); 6 | } 7 | 8 | void CStage::OnPacket(int nType, CInPacket *iPacket) { 9 | reinterpret_cast( 10 | C_STAGE_ON_PACKET)(this, nullptr, nType, iPacket); 11 | } 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | 28 | # Executables 29 | *.exe 30 | *.out 31 | *.app 32 | .idea 33 | Testing 34 | cmake-* 35 | build 36 | -------------------------------------------------------------------------------- /common/CFuncKeyMappedMan.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | CFuncKeyMappedMan::CFuncKeyMappedMan() { 4 | Log("CFuncKeyMappedMan::CFuncKeyMappedMan"); 5 | reinterpret_cast(C_FUNC_KEY_MAPPED_MAN)(this, nullptr); 6 | }; 7 | 8 | void CFuncKeyMappedMan::CreateInstance() { 9 | Log("CFuncKeyMappedMan::CreateInstance"); 10 | reinterpret_cast(C_FUNC_KEY_MAPPED_MAN_CREATE_INSTANCE)(); 11 | } 12 | -------------------------------------------------------------------------------- /common/GW_NewYearCardRecord.h: -------------------------------------------------------------------------------- 1 | #include "ZArray.h" 2 | 3 | struct GW_NewYearCardRecord { 4 | unsigned int m_dwSN; 5 | unsigned int m_dwSenderID; 6 | char m_sSenderName[13]; 7 | int m_bSenderDiscardCard; 8 | _FILETIME m_dateSent; 9 | unsigned int m_dwReceiverID; 10 | char m_sReceiverName[13]; 11 | int m_bReceiverDiscardCard; 12 | int m_bReceiverReceivedCard; 13 | _FILETIME m_dateReceived; 14 | char m_sContent[121]; 15 | }; 16 | -------------------------------------------------------------------------------- /common/IDirectInputDevice8A.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IDirectInputDevice8A 3 | 4 | DECLARE_INTERFACE_(IDirectInputDevice8A, IUnknown) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IUnknown methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | // ** IDirectInputDevice8A methods *** 15 | END_INTERFACE 16 | }; -------------------------------------------------------------------------------- /common/CIOBufferManipulator.h: -------------------------------------------------------------------------------- 1 | class CIOBufferManipulator { 2 | public: 3 | static unsigned int Decode2(unsigned short *n, const char *pSrc, unsigned int uRemain); 4 | 5 | static unsigned int DecodeStr(ZXString *s, const char *pSrc, unsigned int uRemain); 6 | 7 | static unsigned int Decode4(unsigned int *n, const char *pSrc, unsigned int uRemain); 8 | 9 | static unsigned int Decode1(unsigned char *n, const char *pSrc, unsigned int uRemain); 10 | }; -------------------------------------------------------------------------------- /common/COutPacket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class COutPacket { 4 | public: 5 | bool m_bLoopback; 6 | ZArray m_aSendBuff; 7 | unsigned int m_uOffset; 8 | bool m_bIsEncryptedByShanda; 9 | 10 | explicit COutPacket(INT nType); 11 | ~COutPacket(); 12 | 13 | VOID Encode1(unsigned __int8 n); 14 | VOID Encode2(unsigned short n); 15 | VOID Encode4(UINT n); 16 | VOID EncodeStr(ZXString s); 17 | VOID EncodeBuffer(const void *p, unsigned int uSize); 18 | }; -------------------------------------------------------------------------------- /common/CCtrlCheckBox.h: -------------------------------------------------------------------------------- 1 | 2 | class CCtrlCheckBox : CCtrlWnd { 3 | public: 4 | int m_nCheckBoxState; 5 | int m_nArrange; 6 | int m_nBackColor; 7 | int m_nFontColor; 8 | ZXString m_sText; 9 | int m_bChecked; 10 | IWzFont *m_pFont; 11 | IWzFont *m_pFontDisabled; 12 | int m_nFontHeight; 13 | int m_bDrawLineAtFocus; 14 | IWzCanvas *m_apCanvasCheckBox[4]; 15 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) 16 | int m_nTextOffsetX; 17 | int m_nTextOffsetY; 18 | #endif 19 | }; 20 | -------------------------------------------------------------------------------- /common/CCtrlScrollBar.h: -------------------------------------------------------------------------------- 1 | #include "CCtrlWnd.h" 2 | #include "ZXString.h" 3 | 4 | struct CCtrlScrollBar : CCtrlWnd { 5 | int m_nWheelRange; 6 | int m_nCurPos; 7 | int m_nScrollRange; 8 | int m_nLastHT; 9 | unsigned int m_dwLastHT; 10 | int m_bCapture; 11 | int m_grid; 12 | int m_length; 13 | int m_hv; 14 | int m_type; 15 | int m_thumbPos; 16 | int m_thumbX; 17 | int m_thumbY; 18 | int m_bHideThumb; 19 | int m_bTranslucent; 20 | ZXString m_sUOL; 21 | }; 22 | -------------------------------------------------------------------------------- /common/PartyData.h: -------------------------------------------------------------------------------- 1 | #include "ZXString.h" 2 | #include "PartyMember.h" 3 | 4 | struct PARTYDATA { 5 | struct TOWNPORTAL 6 | { 7 | unsigned int m_dwTownID; 8 | unsigned int m_dwFieldID; 9 | int m_nSKillID; 10 | tagPOINT m_ptFieldPortal; 11 | }; 12 | 13 | PARTYMEMBER party; 14 | unsigned int adwFieldID[6]; 15 | PARTYDATA::TOWNPORTAL aTownPortal[6]; 16 | int aPQReward[6]; 17 | int aPQRewardType[6]; 18 | unsigned int dwPQRewardMobTemplateID; 19 | int bPQReward; 20 | }; 21 | -------------------------------------------------------------------------------- /common/ZAllocEx.cpp: -------------------------------------------------------------------------------- 1 | #include "ZAllocEx.h" 2 | 3 | void* operator new(size_t uSize) 4 | { 5 | return ZAllocEx::GetInstance()->Alloc(uSize); 6 | } 7 | 8 | void* operator new[](size_t uSize) 9 | { 10 | return ZAllocEx::GetInstance()->Alloc(uSize); 11 | } 12 | 13 | void operator delete(void* p) 14 | { 15 | ZAllocEx::GetInstance()->Free((void**)p); 16 | } 17 | 18 | void operator delete[](void* p) 19 | { 20 | ZAllocEx::GetInstance()->Free((void**)p); 21 | } 22 | -------------------------------------------------------------------------------- /common/CStage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | 00000000 CStage struc; (sizeof = 0x18, align = 0x4, copyof_3252) 5 | 00000000 baseclass_0 IGObj ? 6 | 00000004 baseclass_4 IUIMsgHandler ? 7 | 00000008 baseclass_8 INetMsgHandler ? 8 | 0000000C baseclass_c ZRefCounted ? 9 | 00000018 CStage ends 10 | */ 11 | class CStage : public IGObj, public IUIMsgHandler, public INetMsgHandler, public ZRefCounted { 12 | public: 13 | void OnMouseEnter(int) override; 14 | 15 | void OnPacket(int, CInPacket *) override; 16 | }; -------------------------------------------------------------------------------- /common/CSecurityClient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct CSecurityClient { 4 | public: 5 | 6 | #if defined(REGION_GMS) 7 | TSecType m_bInitModule; 8 | TSecType m_bStartModule; 9 | #endif 10 | int m_nThreatCode; 11 | #if defined(REGION_GMS) 12 | TSecType m_nThreatParamSize; 13 | void *m_pThreatParam; 14 | unsigned int m_dwCallbackTime; 15 | char m_szHShieldPath[260]; 16 | #endif 17 | HWND__ *m_hMainWnd; 18 | 19 | static void CreateInstance(); 20 | 21 | static CSecurityClient *GetInstance(); 22 | }; -------------------------------------------------------------------------------- /common/ConfigSysOpt.h: -------------------------------------------------------------------------------- 1 | class CONFIG_SYSOPT 2 | { 3 | int nSysOpt_Video; 4 | int nSysOpt_BGMVol; 5 | int bSysOpt_BGMMute; 6 | int nSysOpt_SEVol; 7 | int bSysOpt_SEMute; 8 | int nSysOpt_ScreenShot; 9 | int nSysOpt_MouseSpeed; 10 | int nSysOpt_HPFlash; 11 | int nSysOpt_MPFlash; 12 | int bSysOpt_Tremble; 13 | int nSysOpt_MobInfo; 14 | #if defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95 15 | int bSysOpt_LargeScreen; 16 | int bSysOpt_WindowedMode; 17 | #endif 18 | int bSysOpt_Minimap_Normal; 19 | }; 20 | -------------------------------------------------------------------------------- /common/IWzSerialize.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IWzSerialize 3 | 4 | DECLARE_INTERFACE_(IWzSerialize, IUnknown) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IUnknown methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | // ** IWzSerialize methods *** 15 | 16 | STDMETHOD(GetpersistentUOL)(THIS_ wchar_t **) PURE; 17 | 18 | STDMETHOD(Serialize)(THIS_ IWzArchive *) PURE; 19 | 20 | END_INTERFACE 21 | }; -------------------------------------------------------------------------------- /common/ZRecyclableStatic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class ZFakeStatAvBuff { }; 4 | 5 | class ZRecyclableStatic 6 | { 7 | public: 8 | struct CallBack 9 | { 10 | public: 11 | ZRecyclableStatic::CallBack* m_pNext; 12 | 13 | protected: 14 | CallBack() 15 | { 16 | m_pNext = nullptr; 17 | } 18 | 19 | virtual ~CallBack() = default; 20 | }; 21 | 22 | protected: 23 | ZRecyclableStatic::CallBack* m_pHead; 24 | }; 25 | 26 | assert_size(sizeof(ZFakeStatAvBuff), 0x1) 27 | assert_size(sizeof(ZRecyclableStatic::CallBack), 0x8) 28 | assert_size(sizeof(ZRecyclableStatic), 0x4) -------------------------------------------------------------------------------- /common/CInputSystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "memory_map.h" 3 | 4 | class CInputSystem { 5 | 6 | public: 7 | static void CreateInstance(); 8 | 9 | static CInputSystem *GetInstance(); 10 | 11 | 12 | CInputSystem() { 13 | ((VOID(_fastcall * )(CInputSystem * , PVOID)) 14 | C_INPUT_SYSTEM)(this, NULL); 15 | } 16 | 17 | void Init(HWND__ *, void **); 18 | 19 | void UpdateDevice(int nDeviceIndex); 20 | 21 | int GetISMessage(ISMSG *pISMsg); 22 | 23 | int GenerateAutoKeyDown(ISMSG *pISMsg); 24 | 25 | void ShowCursor(int bShow); 26 | }; -------------------------------------------------------------------------------- /common/SPSet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | 00000000 SPSet struc; (sizeof = 0xC, align = 0x4, copyof_1762) 5 | 00000000 _ZtlSecureTear_nJobLevel db 2 dup(? ) 6 | 00000002 _ZtlSecureTear_nJobLevel_CS dd ? 7 | 00000006 _ZtlSecureTear_nSP db 2 dup(? ) 8 | 00000008 _ZtlSecureTear_nSP_CS dd ? 9 | 0000000C SPSet ends 10 | */ 11 | struct SPSet 12 | { 13 | unsigned __int8 _ZtlSecureTear_nJobLevel[2]; 14 | __unaligned __declspec(align(1)) unsigned int _ZtlSecureTear_nJobLevel_CS; 15 | unsigned __int8 _ZtlSecureTear_nSP[2]; 16 | unsigned int _ZtlSecureTear_nSP_CS; 17 | }; -------------------------------------------------------------------------------- /common/ZRefCounted.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class ZRefCounted 4 | { 5 | public: 6 | ZRefCounted() 7 | { 8 | this->m_nRef = 0; 9 | this->m_pPrev = nullptr; 10 | this->m_pNext = nullptr; 11 | } 12 | 13 | virtual ~ZRefCounted() = default; 14 | 15 | union 16 | { 17 | volatile long m_nRef; 18 | ZRefCounted* m_pNext; 19 | }; 20 | 21 | ZRefCounted* m_pPrev; 22 | }; 23 | 24 | /* not really sure why nexon has this class but this is all it does o__o */ 25 | template 26 | T* ZRefCounted_Alloc() 27 | { 28 | T* pAlloc = new T(); 29 | 30 | return pAlloc; 31 | } 32 | 33 | assert_size(sizeof(ZRefCounted), 0x0C); -------------------------------------------------------------------------------- /common/CTemporaryStatView.h: -------------------------------------------------------------------------------- 1 | #include "UInt128.h" 2 | 3 | class CTemporaryStatView { 4 | public: 5 | ~CTemporaryStatView() = default; 6 | 7 | struct TEMPORARY_STAT : ZRefCounted { 8 | UINT128 uFlagTemp; 9 | int nType; 10 | int nID; 11 | int nSubID; 12 | ZXString sToolTip; 13 | IWzGr2DLayer *pLayer; 14 | IWzGr2DLayer *pLayerShadow; 15 | int nIndexShadow; 16 | int tHideTime; 17 | int bNoShadow; 18 | int tLeft; 19 | int tLeftUnit; 20 | }; 21 | 22 | ZList> m_lTemporaryStat; 23 | }; 24 | -------------------------------------------------------------------------------- /common/IWzRawCanvasAllocator.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IWzRawCanvasAllocator 3 | 4 | DECLARE_INTERFACE_(IWzRawCanvasAllocator, IUnknown) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IUnknown methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | // ** IWzRawCanvasAllocator methods *** 15 | 16 | STDMETHOD(AllocCanvas)(THIS_ IWzCanvas *, CANVAS_PIXFORMAT, int) PURE; 17 | 18 | STDMETHOD(ConvertIfNotAvailable)(THIS_ IWzCanvas *, int *) PURE; 19 | 20 | END_INTERFACE 21 | }; -------------------------------------------------------------------------------- /common/CMonsterBookMan.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CMonsterBookMan::CreateInstance() { 4 | Log("CMonsterBookMan::CreateInstance"); 5 | reinterpret_cast(C_MONSTER_BOOK_MAN_CREATE_INSTANCE)(); 6 | } 7 | 8 | CMonsterBookMan *CMonsterBookMan::GetInstance() { 9 | return reinterpret_cast(*reinterpret_cast(C_MONSTER_BOOK_MAN_INSTANCE_ADDR)); 10 | } 11 | 12 | bool CMonsterBookMan::LoadBook() { 13 | Log("CMonsterBookMan::LoadBook"); 14 | return reinterpret_cast( 15 | C_MONSTER_BOOK_MAN_LOAD_BOOK)(this, nullptr); 16 | } -------------------------------------------------------------------------------- /no-patcher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(no-patcher VERSION 1.0.0) 3 | 4 | add_library(no-patcher SHARED 5 | dllmain.cpp 6 | ${CMAKE_SOURCE_DIR}/common/memedit.cpp 7 | ) 8 | 9 | # Set additional include directories if needed 10 | target_include_directories(no-patcher PRIVATE ${CMAKE_SOURCE_DIR}/common) 11 | target_link_libraries(no-patcher PRIVATE ${CMAKE_SOURCE_DIR}/common/detours.lib) 12 | target_link_libraries(no-patcher PRIVATE build_config) 13 | 14 | set_target_properties(no-patcher PROPERTIES OUTPUT_NAME "no-patcher-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 15 | -------------------------------------------------------------------------------- /common/CUIWnd.h: -------------------------------------------------------------------------------- 1 | struct CUIWnd : CWnd { 2 | ZRef m_pBtClose; 3 | CUIToolTip m_uiToolTip; 4 | int m_nUIType; 5 | int m_nBtCloseType; 6 | int m_nBtCloseX; 7 | int m_nBtCloseY; 8 | int m_nBackgrndX; 9 | int m_nBackgrndY; 10 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) 11 | int m_nSmallScreenX; 12 | int m_nSmallScreenY; 13 | int m_nLargeScreenX; 14 | int m_nLargeScreenY; 15 | bool m_bIsLargeMode; 16 | #endif 17 | bool m_bPosSave; 18 | bool m_bBackgrnd; 19 | int m_nOption; 20 | ZArray m_abOption; 21 | ZXString m_sBackgrndUOL; 22 | }; 23 | -------------------------------------------------------------------------------- /window-mode/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(window-mode VERSION 1.0.0) 3 | 4 | add_library(window-mode SHARED 5 | dllmain.cpp 6 | ${CMAKE_SOURCE_DIR}/common/memedit.cpp 7 | ) 8 | 9 | # Set additional include directories if needed 10 | target_include_directories(window-mode PRIVATE ${CMAKE_SOURCE_DIR}/common) 11 | target_link_libraries(window-mode PRIVATE ${CMAKE_SOURCE_DIR}/common/detours.lib) 12 | target_link_libraries(window-mode PRIVATE build_config) 13 | 14 | set_target_properties(window-mode PROPERTIES OUTPUT_NAME "window-mode-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 15 | -------------------------------------------------------------------------------- /no-ad-balloon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(no-ad-balloon VERSION 1.0.0) 3 | 4 | add_library(no-ad-balloon SHARED 5 | dllmain.cpp 6 | ${CMAKE_SOURCE_DIR}/common/memedit.cpp 7 | ) 8 | 9 | # Set additional include directories if needed 10 | target_include_directories(no-ad-balloon PRIVATE ${CMAKE_SOURCE_DIR}/common) 11 | target_link_libraries(no-ad-balloon PRIVATE ${CMAKE_SOURCE_DIR}/common/detours.lib) 12 | target_link_libraries(no-ad-balloon PRIVATE build_config) 13 | 14 | set_target_properties(no-ad-balloon PROPERTIES OUTPUT_NAME "no-ad-balloon-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") -------------------------------------------------------------------------------- /common/AvatarLook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | 00000000 AvatarLook struc ; (sizeof=0x205, copyof_1995) 5 | 00000000 baseclass_0 ZRefCounted ? 6 | 0000000C nGender db ? 7 | 0000000D nSkin dd ? 8 | 00000011 nFace dd ? 9 | 00000015 nWeaponStickerID dd ? 10 | 00000019 anHairEquip dd 60 dup(?) 11 | 00000109 anUnseenEquip dd 60 dup(?) 12 | 000001F9 anPetID dd 3 dup(?) 13 | 00000205 AvatarLook ends 14 | */ 15 | struct AvatarLook : ZRefCounted 16 | { 17 | unsigned __int8 nGender; 18 | int nSkin; 19 | int nFace; 20 | int nWeaponStickerID; 21 | int anHairEquip[60]; 22 | int anUnseenEquip[60]; 23 | int nPetID[3]; 24 | }; -------------------------------------------------------------------------------- /common/CCtrlTab.h: -------------------------------------------------------------------------------- 1 | struct CCtrlTab : CCtrlWnd { 2 | struct TABINFO { 3 | int bCanvas; 4 | int nStart; 5 | int nEnd; 6 | ZXString sTabNameNormal; 7 | ZXString sTabNameSelected; 8 | IWzCanvas *pCanvasNormal; 9 | IWzCanvas *pCanvasSelected; 10 | int bEnabled; 11 | }; 12 | 13 | int m_bSameWidth; 14 | int m_nTabWidth; 15 | int m_bDrawBaseImage; 16 | int m_nTabSpace; 17 | int m_nCurTab; 18 | ZList m_lTabInfo; 19 | IWzFont *m_pFontNormal; 20 | IWzFont *m_pFontSelected; 21 | int m_nInsertPos; 22 | int m_nType; 23 | int m_nHeight; 24 | }; 25 | -------------------------------------------------------------------------------- /common/CActionMan.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CActionMan::CreateInstance() { 4 | Log("CActionMan::CreateInstance"); 5 | reinterpret_cast(C_ACTION_MAN_CREATE_INSTANCE_ADDR)(); 6 | } 7 | 8 | CActionMan *CActionMan::GetInstance() { 9 | return reinterpret_cast(*(void **) C_ACTION_MAN_INSTANCE_ADDR); 10 | } 11 | 12 | void CActionMan::Init() { 13 | Log("CActionMan::Init"); 14 | reinterpret_cast(C_ACTION_MAN_INIT)(this, nullptr); 15 | } 16 | 17 | void CActionMan::SweepCache() { 18 | // High volume call 19 | reinterpret_cast(C_ACTION_MAN_SWEEP_CACHE)(this, nullptr); 20 | } -------------------------------------------------------------------------------- /common/CUILoginStart.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CLogin; 4 | 5 | class CUILoginStart : CDialog 6 | { 7 | CLogin* m_pLogin; 8 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) || defined(REGION_JMS) 9 | _com_ptr_t<_com_IIID> m_pFont; 10 | _com_ptr_t<_com_IIID> m_pCanvasChannelName; 11 | #endif 12 | #if defined(REGION_GMS) 13 | CCtrlButton::CREATEPARAM m_aBtParam[5]; 14 | ZRef m_apButton[5]; 15 | #else 16 | CCtrlButton::CREATEPARAM m_aBtParam[8]; 17 | ZRef m_apButton[8]; 18 | #endif 19 | int m_nViewWorldButtonType; 20 | bool m_bRequestSent; 21 | 22 | void EnableLoginStartCtrl(CUILoginStart*, int); 23 | }; -------------------------------------------------------------------------------- /enable-minimize/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(enable-minimize VERSION 1.0.0) 3 | 4 | add_library(enable-minimize SHARED 5 | dllmain.cpp 6 | ${CMAKE_SOURCE_DIR}/common/hooker.cpp 7 | ${CMAKE_SOURCE_DIR}/common/logger.cpp 8 | ) 9 | 10 | # Set additional include directories if needed 11 | target_include_directories(enable-minimize PRIVATE ${CMAKE_SOURCE_DIR}/common) 12 | target_link_libraries(enable-minimize PRIVATE ${CMAKE_SOURCE_DIR}/common/detours.lib) 13 | target_link_libraries(enable-minimize PRIVATE build_config) 14 | 15 | set_target_properties(enable-minimize PROPERTIES OUTPUT_NAME "enable-minimize-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") -------------------------------------------------------------------------------- /common/ConfigGameOpt.h: -------------------------------------------------------------------------------- 1 | class CONFIG_GAMEOPT 2 | { 3 | int bGameOpt_Whisper; 4 | int bGameOpt_Friend; 5 | int bGameOpt_Messenger; 6 | int bGameOpt_Exchange; 7 | int bGameOpt_Party; 8 | int bGameOpt_PartySearch; 9 | int bGameOpt_AllowExpeditionInvite; 10 | int bGameOpt_Game; 11 | int bGameOpt_GuildInvite; 12 | int bGameOpt_GuildTalk; 13 | int bGameOpt_AllianceInvite; 14 | int bGameOpt_AllianceTalk; 15 | int bGameOpt_Family; 16 | int bGameOpt_KeyConfig; 17 | int nGameOpt_ChatType; 18 | int bGameOpt_QuickType; 19 | int nGameOpt_ChatWndHeight; 20 | int nGameOpt_OpBoardIndex; 21 | int bGameOpt_FollowRequest; 22 | #if defined(REGION_GMS) 23 | int dummy1; 24 | #endif 25 | }; -------------------------------------------------------------------------------- /common/CWvsPhysicalSpace2D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CWvsPhysicalSpace2D { 4 | // ZRef m_constants; 5 | // Geometry::InclusionChecker m_icSwimArea; 6 | // tagRECT m_rcMBR; 7 | // ZArray m_aMassRange; 8 | // ZArray m_aIndexZMass; 9 | // ZArray > m_aaMassFootholdList; 10 | // int m_nBaseZMass; 11 | // TRSTree, 2, 4, 2> m_rtFoothold; 12 | // ZList > m_lFoothold; 13 | // ZMap, unsigned long> m_mFoothold; 14 | // ZList > m_lDynamicObjPos; 15 | // ZArray m_aLadderOrRope; 16 | // CAttrField *m_pAttrField; 17 | // unsigned int m_dwCRC; 18 | }; -------------------------------------------------------------------------------- /no-beginner-party-block/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(no-beginner-party-block VERSION 1.0.0) 3 | 4 | add_library(no-beginner-party-block SHARED 5 | dllmain.cpp 6 | ${CMAKE_SOURCE_DIR}/common/memedit.cpp 7 | ) 8 | 9 | # Set additional include directories if needed 10 | target_include_directories(no-beginner-party-block PRIVATE ${CMAKE_SOURCE_DIR}/common) 11 | target_link_libraries(no-beginner-party-block PRIVATE ${CMAKE_SOURCE_DIR}/common/detours.lib) 12 | target_link_libraries(no-beginner-party-block PRIVATE build_config) 13 | 14 | set_target_properties(no-beginner-party-block PROPERTIES OUTPUT_NAME "no-beginner-party-block-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 15 | -------------------------------------------------------------------------------- /common/CSystemInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | CSystemInfo::CSystemInfo() { 4 | reinterpret_cast( 5 | C_SYSTEM_INFO)(this, nullptr); 6 | } 7 | 8 | unsigned char CSystemInfo::Init() { 9 | return reinterpret_cast( 10 | C_SYSTEM_INFO_INIT)(this, nullptr); 11 | } 12 | 13 | int CSystemInfo::GetGameRoomClient() { 14 | return reinterpret_cast( 15 | C_SYSTEM_INFO_GET_GAME_ROOM_CLIENT)(this, nullptr); 16 | } 17 | 18 | unsigned __int8 *CSystemInfo::GetMachineId() { 19 | return reinterpret_cast( 20 | C_SYSTEM_INFO_GET_MACHINE_ID)(this, nullptr); 21 | } -------------------------------------------------------------------------------- /common/asserts.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #pragma once 12 | 13 | #define assert_size(x, y) static_assert(x == y, "Static size assert failed."); -------------------------------------------------------------------------------- /no-enter-mts-map-restriction/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(no-enter-mts-map-restriction VERSION 1.0.0) 3 | 4 | add_library(no-enter-mts-map-restriction SHARED 5 | dllmain.cpp 6 | ${CMAKE_SOURCE_DIR}/common/memedit.cpp 7 | ) 8 | 9 | # Set additional include directories if needed 10 | target_include_directories(no-enter-mts-map-restriction PRIVATE ${CMAKE_SOURCE_DIR}/common) 11 | target_link_libraries(no-enter-mts-map-restriction PRIVATE ${CMAKE_SOURCE_DIR}/common/detours.lib) 12 | target_link_libraries(no-enter-mts-map-restriction PRIVATE build_config) 13 | 14 | set_target_properties(no-enter-mts-map-restriction PROPERTIES OUTPUT_NAME "no-enter-mts-map-restriction-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 15 | -------------------------------------------------------------------------------- /common/CUIBattleRecord.h: -------------------------------------------------------------------------------- 1 | #include "CUIWnd.h" 2 | #include "CCtrlTab.h" 3 | #include "CCtrlCheckBox.h" 4 | 5 | struct CUIBattleRecord : CUIWnd 6 | { 7 | unsigned int m_tNextUpdate; 8 | int m_bExtended; 9 | ZRef m_pTab; 10 | ZRef m_pBtTabClear; 11 | ZRef m_pBtAllClear; 12 | ZRef m_pBtTimerSet; 13 | ZRef m_pBtSave; 14 | ZRef m_pBtRecentSaveView; 15 | ZRef m_pBtRecentSaveSel; 16 | ZRef m_pBtFold; 17 | ZRef m_pBtOnOff; 18 | ZRef m_pBtTimerStop; 19 | ZRef m_pCBIncludeDot; 20 | ZRef m_pCBIncludeSummon; 21 | CUIToolTip m_uiBtToolTip; 22 | int m_nCurSelRecentSave; 23 | unsigned int m_tSetTime; 24 | unsigned int m_tStopRemainTime; 25 | int m_bToggle; 26 | }; 27 | -------------------------------------------------------------------------------- /common/ZRefCountedDummy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | template 4 | class ZRefCountedDummy : public ZRefCounted, public ZRecyclable, 16, T> 5 | { 6 | public: 7 | T t; 8 | 9 | void* operator new(unsigned int uSize) 10 | { 11 | return ZRecyclableAvBuffer>::GetInstance()->raw_new(); 12 | } 13 | 14 | void* operator new[](unsigned int uSize) 15 | { 16 | return ZRecyclableAvBuffer>::GetInstance()->raw_new(); 17 | } 18 | void operator delete[](void* p) 19 | { 20 | ZRecyclableAvBuffer>::GetInstance()->raw_delete(p); 21 | } 22 | 23 | void operator delete(void* p) 24 | { 25 | ZRecyclableAvBuffer>::GetInstance()->raw_delete(p); 26 | } 27 | }; 28 | 29 | assert_size(sizeof(ZRefCountedDummy), 0x14); -------------------------------------------------------------------------------- /common/ZRecyclable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | template 4 | class ZRecyclable : protected ZAllocBase 5 | { 6 | protected: 7 | virtual ~ZRecyclable() = default; 8 | 9 | /* uses ZRecycleAvBuffer for memory management */ 10 | 11 | void* operator new(unsigned int uSize) 12 | { 13 | return ZRecyclableAvBuffer::GetInstance()->raw_new(); 14 | } 15 | 16 | void* operator new[](unsigned int uSize) 17 | { 18 | return ZRecyclableAvBuffer::GetInstance()->raw_new(); 19 | } 20 | 21 | void operator delete(void* p) 22 | { 23 | ZRecyclableAvBuffer::GetInstance()->raw_delete(p); 24 | } 25 | 26 | void operator delete[](void* p) 27 | { 28 | ZRecyclableAvBuffer::GetInstance()->raw_delete(p); 29 | } 30 | }; 31 | 32 | assert_size(sizeof(ZRecyclable), 0x4); -------------------------------------------------------------------------------- /common/IDraggable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | 00000000 IDraggable struc; (sizeof = 0x18, align = 0x4, copyof_1424) 5 | 00000000 baseclass_0 ZRefCounted ? 6 | 0000000C m_pLayer _com_ptr_t<_com_IIID > ? 7 | 00000010 m_OldIcon FUNCKEY_MAPPED ? 8 | 00000015 db ? ; undefined 9 | 00000016 db ? ; undefined 10 | 00000017 db ? ; undefined 11 | 00000018 IDraggable ends 12 | */ 13 | class IDraggable : public ZRefCounted 14 | { 15 | //m_pLayer 16 | FUNCKEY_MAPPED m_OldIcon; 17 | int Unknown1; 18 | int Unknown2; 19 | int Unknown3; 20 | 21 | virtual int OnDoubleClicked(IDraggable*) = 0; 22 | virtual int OnDropped(IDraggable*, IUIMsgHandler* pFrom, IUIMsgHandler* pTo, int rx, int ry) = 0; 23 | }; -------------------------------------------------------------------------------- /proxy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(proxy) 3 | 4 | add_library(proxy SHARED 5 | ijl15.cpp 6 | dllmain.cpp 7 | ${CMAKE_SOURCE_DIR}/common/Common.cpp 8 | ${CMAKE_SOURCE_DIR}/common/logger.cpp 9 | ${CMAKE_SOURCE_DIR}/common/memedit.cpp 10 | ${CMAKE_SOURCE_DIR}/common/winhooks.cpp 11 | ${CMAKE_SOURCE_DIR}/common/winhook_types.cpp 12 | ${CMAKE_SOURCE_DIR}/common/hooker.cpp 13 | ${CMAKE_SOURCE_DIR}/common/FakeModule.cpp 14 | ) 15 | 16 | # Set additional include directories if needed 17 | target_include_directories(proxy PRIVATE ${CMAKE_SOURCE_DIR}/common) 18 | target_link_libraries(proxy PRIVATE ${CMAKE_SOURCE_DIR}/common/detours.lib) 19 | target_link_libraries(proxy PRIVATE build_config) 20 | 21 | set_target_properties(proxy PROPERTIES OUTPUT_NAME "ijl15") -------------------------------------------------------------------------------- /common/ZAllocAnonSelector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ZAllocAnonSelector 4 | { 5 | protected: 6 | unsigned int GetBlockSize(ZAllocBase::BLOCK_SIZE nIndex, int* nAllocBlocks) 7 | { 8 | switch (nIndex) 9 | { 10 | case ZAllocBase::BLOCK_SIZE::BLOCK16: 11 | *nAllocBlocks = 64; 12 | return 16; 13 | case ZAllocBase::BLOCK_SIZE::BLOCK32: 14 | *nAllocBlocks = 32; 15 | return 32; 16 | case ZAllocBase::BLOCK_SIZE::BLOCK64: 17 | *nAllocBlocks = 16; 18 | return 64; 19 | case ZAllocBase::BLOCK_SIZE::BLOCK128: 20 | *nAllocBlocks = 8; 21 | return 128; 22 | default: 23 | *nAllocBlocks = 0; 24 | return 0; 25 | } 26 | } 27 | }; -------------------------------------------------------------------------------- /common/BasicStat.h: -------------------------------------------------------------------------------- 1 | struct BasicStat { 2 | int _ZtlSecureTear_nGender[2]; 3 | unsigned int _ZtlSecureTear_nGender_CS; 4 | int _ZtlSecureTear_nLevel[2]; 5 | unsigned int _ZtlSecureTear_nLevel_CS; 6 | int _ZtlSecureTear_nJob[2]; 7 | unsigned int _ZtlSecureTear_nJob_CS; 8 | int _ZtlSecureTear_nSTR[2]; 9 | unsigned int _ZtlSecureTear_nSTR_CS; 10 | int _ZtlSecureTear_nDEX[2]; 11 | unsigned int _ZtlSecureTear_nDEX_CS; 12 | int _ZtlSecureTear_nINT[2]; 13 | unsigned int _ZtlSecureTear_nINT_CS; 14 | int _ZtlSecureTear_nLUK[2]; 15 | unsigned int _ZtlSecureTear_nLUK_CS; 16 | int _ZtlSecureTear_nPOP[2]; 17 | unsigned int _ZtlSecureTear_nPOP_CS; 18 | int _ZtlSecureTear_nMHP[2]; 19 | unsigned int _ZtlSecureTear_nMHP_CS; 20 | int _ZtlSecureTear_nMMP[2]; 21 | unsigned int _ZtlSecureTear_nMMP_CS; 22 | }; 23 | -------------------------------------------------------------------------------- /common/GuildData.h: -------------------------------------------------------------------------------- 1 | #include "ZXString.h" 2 | #include "ZArray.h" 3 | #include "ZMap.h" 4 | #include "GuildMember.h" 5 | 6 | struct GUILDDATA { 7 | struct SKILLENTRY { 8 | __int16 nLevel; 9 | _FILETIME dateExpire; 10 | ZXString strBuyCharacterName; 11 | }; 12 | 13 | int nGuildID; 14 | ZXString sGuildName; 15 | ZArray> asGradeName; 16 | ZArray adwCharacterID; 17 | ZArray aMemberData; 18 | int nMaxMemberNum; 19 | unsigned __int16 nMarkBg; 20 | unsigned __int8 nMarkBgColor; 21 | unsigned __int16 nMark; 22 | unsigned __int8 nMarkColor; 23 | ZXString sNotice; 24 | int nPoint; 25 | int nAllianceID; 26 | int nLevel; 27 | ZMap mSkillRecord; 28 | ZArray aSkillRecordOnlyID; 29 | }; 30 | -------------------------------------------------------------------------------- /proxy/framework.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #pragma once 12 | 13 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 14 | // Windows Header Files 15 | #include 16 | -------------------------------------------------------------------------------- /common/logger.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #pragma once 12 | #include 13 | #include 14 | 15 | /// 16 | /// Prints to windows debug output. 17 | /// 18 | extern void Log(const char* format, ...); -------------------------------------------------------------------------------- /common/CFadeWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CFadeWnd : public CDialog 4 | { 5 | int m_a0; 6 | int m_a; 7 | int m_a1; 8 | int m_t0; 9 | int m_t; 10 | int m_t1; 11 | POINT m_pt0; 12 | POINT m_pt; 13 | POINT m_pt1; 14 | int m_nPhase; 15 | int m_tPhase; 16 | int m_tTimeOver; 17 | bool m_bClose; 18 | #if defined(REGION_GMS) 19 | bool m_bUserAlarm; 20 | #endif 21 | bool m_bOK; 22 | int m_nType; 23 | ZXString m_sInviter; 24 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 87) || defined(REGION_JMS) 25 | int m_nLevel; 26 | int m_nJobCode; 27 | int m_nExpQuestID; 28 | #endif 29 | unsigned long m_dwSN; 30 | unsigned long m_dwFriendID; 31 | 32 | void SetOption(CFadeWnd*, int a0, int a, int a1, POINT pt0, POINT pt, POINT pt1, int t0, int t, int t1); 33 | void Close(CFadeWnd*, int bOK); 34 | }; -------------------------------------------------------------------------------- /common/CMapleTVMan.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CMapleTVMan::CreateInstance() { 4 | Log("CMapleTVMan::CreateInstance"); 5 | reinterpret_cast(C_MAPLE_TV_MAN_CREATE_INSTANCE)(); 6 | } 7 | 8 | CMapleTVMan *CMapleTVMan::GetInstance() { 9 | return reinterpret_cast(*reinterpret_cast(C_MAPLE_TV_MAN_INSTANCE_ADDR)); 10 | } 11 | 12 | 13 | #if defined(REGION_GMS) 14 | 15 | void CMapleTVMan::Init() { 16 | Log("CMapleTVMan::Init"); 17 | reinterpret_cast(C_MAPLE_TV_MAN_INIT)(this, nullptr); 18 | } 19 | 20 | #elif defined(REGION_JMS) 21 | void CMapleTVMan::Init(int something, int somethingElse) { 22 | Log("CMapleTVMan::Init"); 23 | reinterpret_cast( 24 | C_MAPLE_TV_MAN_INIT)(this, nullptr, something, somethingElse); 25 | } 26 | #endif -------------------------------------------------------------------------------- /common/IWzRawCanvas.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IWzRawCanvas 3 | 4 | DECLARE_INTERFACE_(IWzRawCanvas, IUnknown) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IUnknown methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | // ** IWzRawCanvas methods *** 15 | 16 | STDMETHOD(GetpixelFormat)(THIS_ CANVAS_PIXFORMAT *) PURE; 17 | 18 | STDMETHOD(GetmagLevel)(THIS_ int *) PURE; 19 | 20 | STDMETHOD(Getwidth)(THIS_ unsigned int *) PURE; 21 | 22 | STDMETHOD(Getheight)(THIS_ unsigned int *) PURE; 23 | 24 | STDMETHOD(LockAddress)(THIS_ int *, tagVARIANT *) PURE; 25 | 26 | STDMETHOD(UnlockAddress)(THIS_ tagRECT *) PURE; 27 | 28 | STDMETHOD(SetTexture)(THIS_ unsigned int *) PURE; 29 | 30 | STDMETHOD(GetTextureSize)(THIS_ tagRECT *) PURE; 31 | 32 | END_INTERFACE 33 | }; -------------------------------------------------------------------------------- /common/CFuncKeyMappedMan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CFuncKeyMappedMan { 4 | public: 5 | virtual ~CFuncKeyMappedMan() = default; 6 | 7 | #if defined(REGION_GMS) 8 | FUNCKEY_MAPPED m_aFuncKeyMapped[89]; 9 | FUNCKEY_MAPPED m_aFuncKeyMapped_Old[89]; 10 | #elif defined(REGION_JMS) 11 | FUNCKEY_MAPPED m_aFuncKeyMapped[94]; 12 | FUNCKEY_MAPPED m_aFuncKeyMapped_Old[94]; 13 | #endif 14 | int m_aQuickslotKeyMapped[8]; 15 | int m_aQuickslotKeyMapped_Old[8]; 16 | int m_nPetConsumeItemID; 17 | int m_nPetConsumeMPItemID; 18 | #if defined(REGION_GMS) && MAJOR_VERSION >= 111 || defined(REGION_JMS) 19 | int dummy1; 20 | #endif 21 | #if defined(REGION_JMS) 22 | int dummy2; 23 | #endif 24 | #if defined(REGION_GMS) && MAJOR_VERSION >= 95 25 | int m_nNormalAttackCode; 26 | #endif 27 | 28 | CFuncKeyMappedMan(); 29 | 30 | static void CreateInstance(); 31 | }; 32 | -------------------------------------------------------------------------------- /common/CUITitle.h: -------------------------------------------------------------------------------- 1 | 2 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) || defined(REGION_JMS) 3 | class CUITitle : public CFadeWnd { 4 | #else 5 | 6 | class CUITitle : public CDialog { 7 | #endif 8 | CLogin *m_pLogin; 9 | int m_bRememberMailAddr; 10 | IWzCanvas *m_pCanvasRMA[2]; 11 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) || defined(REGION_JMS) 12 | tagRECT m_rcRMA; 13 | #endif 14 | ZRef m_pBtLogin; 15 | ZRef m_pBtEmailSave; 16 | ZRef m_pBtEmailLost; 17 | ZRef m_pBtPasswdLost; 18 | ZRef m_pBtNew; 19 | ZRef m_pBtHomePage; 20 | ZRef m_pBtQuit; 21 | #if defined(REGION_JMS) 22 | ZRef m_unk; 23 | #endif 24 | ZRef m_pEditID; 25 | ZRef m_pEditPasswd; 26 | CUIToolTip m_uiToolTipTitle; 27 | 28 | public: 29 | static CUITitle *GetInstance(); 30 | }; 31 | -------------------------------------------------------------------------------- /common/logger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include "logger.h" 12 | 13 | void Log(const char* format, ...) 14 | { 15 | char buf[1024] = { 0 }; 16 | 17 | va_list args; 18 | va_start(args, format); 19 | vsprintf_s(buf, format, args); 20 | 21 | OutputDebugString(buf); 22 | 23 | va_end(args); 24 | } -------------------------------------------------------------------------------- /skip-logo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(skip-logo VERSION 1.0.0) 3 | 4 | add_library(skip-logo SHARED 5 | dllmain.cpp 6 | ${CMAKE_SOURCE_DIR}/common/memedit.cpp 7 | ${CMAKE_SOURCE_DIR}/common/hooker.cpp 8 | ${CMAKE_SOURCE_DIR}/common/logger.cpp 9 | ${CMAKE_SOURCE_DIR}/common/CWvsApp.cpp 10 | ${CMAKE_SOURCE_DIR}/common/CInputSystem.cpp 11 | ${CMAKE_SOURCE_DIR}/common/CStage.cpp 12 | ${CMAKE_SOURCE_DIR}/common/CLogo.cpp 13 | ) 14 | 15 | # Set additional include directories if needed 16 | target_include_directories(skip-logo PRIVATE ${CMAKE_SOURCE_DIR}/common) 17 | target_link_libraries(skip-logo PRIVATE ${CMAKE_SOURCE_DIR}/common/detours.lib) 18 | target_link_libraries(skip-logo PRIVATE build_config) 19 | 20 | set_target_properties(skip-logo PROPERTIES OUTPUT_NAME "skip-logo-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 21 | -------------------------------------------------------------------------------- /common/IWzArchive.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IWzArchive 3 | 4 | DECLARE_INTERFACE_(IWzArchive, IUnknown) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IUnknown methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | // ** IWzArchive methods *** 15 | 16 | STDMETHOD(Getloading)(THIS_ int *) PURE; 17 | 18 | STDMETHOD(Read)(THIS_ unsigned __int8 *, unsigned int, unsigned int *) PURE; 19 | 20 | STDMETHOD(Write)(THIS_ unsigned __int8 *, unsigned int, unsigned int *) PURE; 21 | 22 | STDMETHOD(GetabsoluteUOL)(THIS_ wchar_t **) PURE; 23 | 24 | STDMETHOD(PutabsoluteUOL)(THIS_ wchar_t *) PURE; 25 | 26 | STDMETHOD(Getposition)(THIS_ unsigned int *) PURE; 27 | 28 | STDMETHOD(Getcontext)(THIS_ tagVARIANT *) PURE; 29 | 30 | STDMETHOD(Putcontext)(THIS_ tagVARIANT) PURE; 31 | 32 | END_INTERFACE 33 | }; -------------------------------------------------------------------------------- /common/IWzProperty.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IWzProperty 3 | 4 | DECLARE_INTERFACE_(IWzProperty, IWzSerialize) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IWzSerialize methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | STDMETHOD(GetpersistentUOL)(THIS_ wchar_t **) PURE; 15 | 16 | STDMETHOD(Serialize)(THIS_ IWzArchive *) PURE; 17 | 18 | // ** IWzProperty methods *** 19 | 20 | STDMETHOD(Getitem)(THIS_ wchar_t *, tagVARIANT *) PURE; 21 | 22 | STDMETHOD(Putitem)(THIS_ wchar_t *, tagVARIANT) PURE; 23 | 24 | STDMETHOD(GetNewEnum)(THIS_ IUnknown **) PURE; 25 | 26 | STDMETHOD(Getcount)(THIS_ unsigned int *) PURE; 27 | 28 | STDMETHOD(Add)(THIS_ wchar_t *, tagVARIANT, tagVARIANT) PURE; 29 | 30 | STDMETHOD(Remove)(THIS_ wchar_t *) PURE; 31 | 32 | STDMETHOD(Import)(THIS_ wchar_t *) PURE; 33 | 34 | END_INTERFACE 35 | }; -------------------------------------------------------------------------------- /common/CQuestMan.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CQuestMan::CreateInstance() { 4 | Log("CQuestMan::CreateInstance"); 5 | reinterpret_cast(C_QUEST_MAN_CREATE_INSTANCE)(); 6 | } 7 | 8 | CQuestMan *CQuestMan::GetInstance() { 9 | return reinterpret_cast(*reinterpret_cast(C_QUEST_MAN_INSTANCE_ADDR)); 10 | } 11 | 12 | int CQuestMan::LoadDemand() { 13 | Log("CQuestMan::LoadDemand"); 14 | return reinterpret_cast( 15 | C_QUEST_MAN_LOAD_DEMAND)(this, nullptr); 16 | } 17 | 18 | void CQuestMan::LoadPartyQuestInfo() { 19 | Log("CQuestMan::LoadPartyQuestInfo"); 20 | reinterpret_cast( 21 | C_QUEST_MAN_LOAD_PARTY_QUEST_INFO)(this, nullptr); 22 | } 23 | 24 | void CQuestMan::LoadExclusive() { 25 | Log("CQuestMan::LoadExclusive"); 26 | reinterpret_cast( 27 | C_QUEST_MAN_LOAD_EXCLUSIVE)(this, nullptr); 28 | } -------------------------------------------------------------------------------- /common/ZAllocStrSelector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* forward declare zxstring for compiler happiness */ 4 | template class ZXString; 5 | 6 | template 7 | struct ZAllocStrSelector 8 | { 9 | protected: 10 | unsigned int GetBlockSize(ZAllocBase::BLOCK_SIZE nIndex, int* nAllocBlocks) 11 | { 12 | switch (nIndex) 13 | { 14 | case ZAllocBase::BLOCK_SIZE::BLOCK16: 15 | *nAllocBlocks = 64; 16 | return (sizeof(T) * 16) + sizeof(ZXString::_ZXStringData) + sizeof(T); 17 | case ZAllocBase::BLOCK_SIZE::BLOCK32: 18 | *nAllocBlocks = 32; 19 | return (sizeof(T) * 32) + sizeof(ZXString::_ZXStringData) + sizeof(T); 20 | case ZAllocBase::BLOCK_SIZE::BLOCK64: 21 | *nAllocBlocks = 16; 22 | return (sizeof(T) * 64) + sizeof(ZXString::_ZXStringData) + sizeof(T); 23 | case ZAllocBase::BLOCK_SIZE::BLOCK128: 24 | *nAllocBlocks = 8; 25 | return (sizeof(T) * 128) + sizeof(ZXString::_ZXStringData) + sizeof(T); 26 | default: 27 | *nAllocBlocks = 0; 28 | return 0; 29 | } 30 | } 31 | }; -------------------------------------------------------------------------------- /redirect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(redirect VERSION 1.0.0) 3 | 4 | add_library(redirect SHARED 5 | dllmain.cpp 6 | ${CMAKE_SOURCE_DIR}/common/Common.cpp 7 | ${CMAKE_SOURCE_DIR}/common/logger.cpp 8 | ${CMAKE_SOURCE_DIR}/common/winhooks.cpp 9 | ${CMAKE_SOURCE_DIR}/common/winhook_types.cpp 10 | ${CMAKE_SOURCE_DIR}/common/hooker.cpp 11 | ${CMAKE_SOURCE_DIR}/common/FakeModule.cpp 12 | ) 13 | 14 | # Set additional include directories if needed 15 | target_include_directories(redirect PRIVATE ${CMAKE_SOURCE_DIR}/common) 16 | target_link_libraries(redirect PRIVATE ${CMAKE_SOURCE_DIR}/common/detours.lib) 17 | target_link_libraries(redirect PRIVATE build_config) 18 | 19 | set_target_properties(redirect PROPERTIES OUTPUT_NAME "redirect-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 20 | 21 | # Copy INI file to build directory 22 | file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/redirect.ini DESTINATION ${CMAKE_BINARY_DIR}/redirect) -------------------------------------------------------------------------------- /common/CCtrlEdit.h: -------------------------------------------------------------------------------- 1 | class CCtrlComboBox{}; 2 | 3 | struct CCtrlEdit : CCtrlWnd { 4 | struct CEditCaret { 5 | int m_l; 6 | int m_t; 7 | unsigned int m_dwLastSet; 8 | int m_bInit; 9 | int m_height; 10 | IWzGr2DLayer *m_pLayerCaret; 11 | }; 12 | 13 | ZXString m_sText; 14 | tagPOINT m_ptText; 15 | tagPOINT m_ptCaret; 16 | int m_col; 17 | int m_ext; 18 | ZArray m_adwIMECompClause; 19 | int m_nCurClause; 20 | int m_nCaretX; 21 | int m_selCol; 22 | int m_nViewportX; 23 | int m_nViewportWidth; 24 | IWzFont *m_pFont; 25 | IWzFont *m_pFontDisabled; 26 | IWzFont *m_pFontSel; 27 | IWzFont *m_pFontCand; 28 | IWzFont *m_pFontCandSel; 29 | int m_nFontHeight; 30 | int m_nBackColor; 31 | int m_bPasswd; 32 | int m_bReadOnly; 33 | int m_nHorzMax; 34 | int m_bNumber; 35 | IWzCanvas *m_pCanvasEmptyText; 36 | CCtrlEdit::CEditCaret m_editCaret; 37 | ZRef m_pIMECandWnd; 38 | CCtrlComboBox *m_pParentComboBox; 39 | }; 40 | -------------------------------------------------------------------------------- /common/ForcedStat.h: -------------------------------------------------------------------------------- 1 | struct ForcedStat { 2 | int _ZtlSecureTear_nSTR[2]; 3 | unsigned int _ZtlSecureTear_nSTR_CS; 4 | int _ZtlSecureTear_nDEX[2]; 5 | unsigned int _ZtlSecureTear_nDEX_CS; 6 | int _ZtlSecureTear_nINT[2]; 7 | unsigned int _ZtlSecureTear_nINT_CS; 8 | int _ZtlSecureTear_nLUK[2]; 9 | unsigned int _ZtlSecureTear_nLUK_CS; 10 | int _ZtlSecureTear_nPAD[2]; 11 | unsigned int _ZtlSecureTear_nPAD_CS; 12 | int _ZtlSecureTear_nPDD[2]; 13 | unsigned int _ZtlSecureTear_nPDD_CS; 14 | int _ZtlSecureTear_nMAD[2]; 15 | unsigned int _ZtlSecureTear_nMAD_CS; 16 | int _ZtlSecureTear_nMDD[2]; 17 | unsigned int _ZtlSecureTear_nMDD_CS; 18 | int _ZtlSecureTear_nACC[2]; 19 | unsigned int _ZtlSecureTear_nACC_CS; 20 | int _ZtlSecureTear_nEVA[2]; 21 | unsigned int _ZtlSecureTear_nEVA_CS; 22 | int _ZtlSecureTear_nSpeed[2]; 23 | unsigned int _ZtlSecureTear_nSpeed_CS; 24 | int _ZtlSecureTear_nJump[2]; 25 | unsigned int _ZtlSecureTear_nJump_CS; 26 | int _ZtlSecureTear_nSpeedMax[2]; 27 | unsigned int _ZtlSecureTear_nSpeedMax_CS; 28 | }; 29 | -------------------------------------------------------------------------------- /common/CCtrlButton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CCtrlButton : CCtrlWnd { 4 | public: 5 | struct CREATEPARAM { 6 | bool bAcceptFocus; 7 | bool bDrawBack; 8 | bool bAnimateOnce; 9 | ZXString sUOL; 10 | }; 11 | 12 | int m_nDisplayState; 13 | int m_nDisplayFrame; 14 | int m_nAniCount; 15 | int m_nAniDelay; 16 | unsigned int m_dwDisplayStarted; 17 | int m_bMouseEnter; 18 | int m_nDecClickArea; 19 | int m_bPressed; 20 | int m_bPressedByKey; 21 | int m_bKeyFocused; 22 | int m_bDrawBack; 23 | int m_bAnimateOnce; 24 | _com_ptr_t<_com_IIID> m_pPropFocusFrame; 25 | _com_ptr_t<_com_IIID> m_pLayerFocusFrame; 26 | _com_ptr_t<_com_IIID> m_apPropButton[4]; 27 | int m_bToolTip; 28 | int m_bToolTipUpDir; 29 | ZXString m_sToolTipTitle; 30 | ZXString m_sToolTipDesc; 31 | CUIToolTip m_uiToolTip; 32 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) 33 | ZXString m_sToolTipFromData; 34 | #endif 35 | int m_bSelfDisable; 36 | }; -------------------------------------------------------------------------------- /common/CConfig.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "memory_map.h" 3 | 4 | CConfig::CConfig() { 5 | Log("CConfig::CConfig"); 6 | reinterpret_cast(C_CONFIG)(this, nullptr); 7 | }; 8 | 9 | CConfig *CConfig::GetInstance() { 10 | Log("CConfig::GetInstance"); 11 | return reinterpret_cast(*reinterpret_cast(C_CONFIG_INSTANCE_ADDR)); 12 | } 13 | 14 | INT CConfig::GetPartnerCode() { 15 | Log("CConfig::GetPartnerCode"); 16 | return reinterpret_cast(C_CONFIG_GET_PARTNER_CODE)(this, nullptr); 17 | } 18 | 19 | void CConfig::ApplySysOpt(CONFIG_SYSOPT *pSysOpt, int bApplyVideo) { 20 | Log("CConfig::ApplySysOpt"); 21 | reinterpret_cast( 22 | C_CONFIG_APPLY_SYS_OPT)(this, nullptr, pSysOpt, bApplyVideo); 23 | } 24 | 25 | void CConfig::CheckExecPathReg(ZXString sModulePath) { 26 | Log("CConfig::CheckExecPathReg"); 27 | reinterpret_cast)>( 28 | C_CONFIG_CHECK_EXEC_PATH_REG)(this, nullptr, sModulePath); 29 | } -------------------------------------------------------------------------------- /common/CClientSocket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct __POSITION { 4 | }; 5 | 6 | class CClientSocket { 7 | public: 8 | 9 | struct CONNECTCONTEXT { 10 | ZList lAddr; 11 | __POSITION *posList; 12 | int bLogin; 13 | }; 14 | 15 | #if defined(REGION_JMS) 16 | char dummy1; 17 | #endif 18 | HWND__ *m_hWnd; 19 | ZSocketBase m_sock; 20 | CClientSocket::CONNECTCONTEXT m_ctxConnect; 21 | ZInetAddr m_addr; 22 | #if (defined(REGION_GMS) && MAJOR_VERSION >= 111) 23 | int dummy1; 24 | #endif 25 | int m_tTimeout; 26 | ZList> m_lpRecvBuff; 27 | ZList> m_lpSendBuff; 28 | CInPacket m_packetRecv; 29 | ZFatalSection m_lockSend; 30 | unsigned int m_uSeqSnd; 31 | unsigned int m_uSeqRcv; 32 | ZXString m_URLGuestIDRegistration; 33 | int m_bIsGuestID; 34 | 35 | virtual ~CClientSocket() = default; 36 | 37 | static CClientSocket *GetInstance(); 38 | 39 | static void CreateInstance(); 40 | 41 | void SendPacket(COutPacket *oPacket); 42 | 43 | void ManipulatePacket(); 44 | 45 | void Close(); 46 | 47 | void ClearSendReceiveCtx(); 48 | 49 | void ConnectLogin(); 50 | }; 51 | -------------------------------------------------------------------------------- /common/IUIMsgHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CRTTI.h" 4 | 5 | class IUIMsgHandler { 6 | public: 7 | virtual void OnKey(unsigned int, unsigned int) = 0; 8 | 9 | virtual int OnSetFocus(int) = 0; 10 | 11 | virtual void OnMouseButton(unsigned int, unsigned int, int, int) = 0; 12 | 13 | virtual int OnMouseMove(int, int) = 0; 14 | 15 | virtual int OnMouseWheel(int, int, int) = 0; 16 | 17 | virtual void OnMouseEnter(int) = 0; 18 | 19 | virtual void OnDraggableMove(int, int *, int, int) = 0; 20 | 21 | virtual void SetEnable(int) = 0; 22 | 23 | virtual int IsEnabled() = 0; 24 | 25 | virtual void SetShow(int) = 0; 26 | 27 | virtual int IsShown() = 0; 28 | 29 | virtual int GetAbsLeft() = 0; 30 | 31 | virtual int GetAbsTop() = 0; 32 | 33 | virtual void ClearToolTip() = 0; 34 | 35 | virtual void OnIMEModeChange(char) = 0; 36 | 37 | virtual void OnIMEResult(const char *) = 0; 38 | 39 | virtual void OnIMEComp(const char *, ZArray *, unsigned int, int, 40 | ZList > *, int, int, int) = 0; 41 | 42 | virtual const CRTTI *GetRTTI() = 0; 43 | 44 | virtual int IsKindOf(const CRTTI *) = 0; 45 | }; -------------------------------------------------------------------------------- /common/IDirectInput8A.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IDirectInput8A 3 | 4 | DECLARE_INTERFACE_(IDirectInput8A, IUnknown) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IUnknown methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | // ** IDirectInput8A methods *** 15 | STDMETHOD(CreateDevice)(THIS_ const _GUID *, IDirectInputDevice8A **, IUnknown *) PURE; 16 | STDMETHOD(EnumDevices)(THIS_ unsigned int, int (__stdcall *)(const DIDEVICEINSTANCEA *, void *), void *, unsigned int) PURE; 17 | STDMETHOD(GetDeviceStatus)(THIS_ const _GUID *) PURE; 18 | STDMETHOD(RunControlPanel)(THIS_ HWND__ *, unsigned int) PURE; 19 | STDMETHOD(Initialize)(THIS_ HINSTANCE__ *, unsigned int) PURE; 20 | STDMETHOD(FindDevice)(THIS_ const _GUID *, const char *, _GUID *) PURE; 21 | STDMETHOD(EnumDevicesBySemantics)(THIS_ const char *, int *, int (__stdcall *)(const DIDEVICEINSTANCEA *, IDirectInputDevice8A *, unsigned int, unsigned int, void *), void *, unsigned int) PURE; 22 | STDMETHOD(ConfigureDevices)(THIS_ int (__stdcall *)(IUnknown *, void *), int *, unsigned int, void *) PURE; 23 | END_INTERFACE 24 | }; -------------------------------------------------------------------------------- /common/IWzFont.h: -------------------------------------------------------------------------------- 1 | interface IWzCanvas; 2 | 3 | #undef INTERFACE 4 | #define INTERFACE IWzFont 5 | 6 | DECLARE_INTERFACE_(IWzFont, IUnknown) { 7 | BEGIN_INTERFACE 8 | 9 | // *** IUnknown methods *** 10 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 11 | 12 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 13 | 14 | STDMETHOD_(ULONG, Release)(THIS) PURE; 15 | 16 | // ** IWzFont methods *** 17 | 18 | STDMETHOD(Create)(THIS_ wchar_t *, unsigned int, unsigned int, tagVARIANT) PURE; 19 | 20 | STDMETHOD(Getcolor)(THIS_ int *) PURE; 21 | 22 | STDMETHOD(Getheight)(THIS_ int *) PURE; 23 | 24 | STDMETHOD(GetfullHeight)(THIS_ int *) PURE; 25 | 26 | STDMETHOD(CalcTextWidth)(THIS_ wchar_t *, tagVARIANT, unsigned int *) PURE; 27 | 28 | STDMETHOD(CalcLongestText)(THIS_ wchar_t *, int, tagVARIANT, int *) PURE; 29 | 30 | STDMETHOD(CalcLongestTextForGlobal)(THIS_ wchar_t *, int, tagVARIANT, int *) PURE; 31 | 32 | STDMETHOD(CalcLongestTextForGlobalEx)(THIS_ wchar_t *, int, int *, tagVARIANT, int *) PURE; 33 | 34 | STDMETHOD(CalcLineCountForGlobal)(THIS_ wchar_t *, int, tagVARIANT, int *) PURE; 35 | 36 | STDMETHOD(DrawText)(THIS_ int, int, wchar_t *, IWzCanvas *, tagVARIANT, tagVARIANT, unsigned int *) PURE; 37 | 38 | END_INTERFACE 39 | }; -------------------------------------------------------------------------------- /common/CCtrlComboBox.h: -------------------------------------------------------------------------------- 1 | struct CCtrlComboBox : CCtrlWnd { 2 | struct ITEM_INFO { 3 | ZXString sItemName; 4 | unsigned int dwParam; 5 | }; 6 | 7 | ZList m_lItemInfo; 8 | ZRef m_pCtrlCBS; 9 | ZRef m_pCtrlEdit; 10 | ZRef m_pCtrlScrollBar; 11 | int m_nType; 12 | int m_nComboBoxState; 13 | int m_nSelect; 14 | int m_nPrevSelect; 15 | int m_tBtClicked; 16 | int m_nBackColor; 17 | int m_nBackFocusedColor; 18 | int m_nBorderColor; 19 | FONT_TYPE m_fType; 20 | FONT_TYPE m_fTypeFocused; 21 | FONT_TYPE m_fTypeSelect; 22 | FONT_TYPE m_fTypeSelectFocused; 23 | int m_nBoxPosX; 24 | int m_nBoxPosY; 25 | int m_nBoxWidth; 26 | int m_nBoxHeight; 27 | int m_nBoxTextLeftOffset; 28 | int m_nTextOffset_Y; 29 | int m_nDesign; 30 | int m_nMaxItem_Shown; 31 | int m_nType_ScrollBar; 32 | unsigned int m_Id_ScrollBar; 33 | int m_bButtonOnLeft; 34 | int m_bAlwaysFocusOnText; 35 | int m_bDeleteEnable; 36 | _bstr_t m_sUOL; 37 | int m_ItemListPos; 38 | IWzCanvas *m_pCanvasButton[5]; 39 | IWzCanvas *m_pCanvasCbStart[5]; 40 | IWzCanvas *m_pCanvasCbLine[5]; 41 | IWzFont *m_pFont; 42 | IWzFont *m_pFontFocused; 43 | }; 44 | -------------------------------------------------------------------------------- /common/COutPacket.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | COutPacket::COutPacket(INT nType) { 4 | reinterpret_cast( 5 | C_OUT_PACKET)(this, nullptr, nType); 6 | } 7 | 8 | void COutPacket::Encode1(unsigned char n) { 9 | reinterpret_cast( 10 | C_OUT_PACKET_ENCODE_1)(this, nullptr, n); 11 | } 12 | 13 | void COutPacket::Encode2(unsigned short n) { 14 | reinterpret_cast( 15 | C_OUT_PACKET_ENCODE_2)(this, nullptr, n); 16 | } 17 | 18 | void COutPacket::Encode4(UINT n) { 19 | reinterpret_cast( 20 | C_OUT_PACKET_ENCODE_4)(this, nullptr, n); 21 | } 22 | 23 | void COutPacket::EncodeStr(ZXString s) { 24 | reinterpret_cast)>( 25 | C_OUT_PACKET_ENCODE_STR)(this, nullptr, s); 26 | } 27 | 28 | void COutPacket::EncodeBuffer(const void *p, unsigned int uSize) { 29 | reinterpret_cast( 30 | C_OUT_PACKET_ENCODE_BUFFER)(this, nullptr, p, uSize); 31 | } 32 | 33 | COutPacket::~COutPacket() { 34 | this->m_aSendBuff.RemoveAll(); 35 | } 36 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request 2 | 3 | on: 4 | pull_request: 5 | branches: [ "main" ] 6 | env: 7 | BUILD_TYPE: Debug 8 | jobs: 9 | build: 10 | runs-on: windows-latest 11 | strategy: 12 | matrix: 13 | config: 14 | - { region: GMS, major: 83, minor: 1 } 15 | - { region: GMS, major: 87, minor: 1 } 16 | - { region: GMS, major: 95, minor: 1 } 17 | - { region: GMS, major: 111, minor: 1 } 18 | - { region: JMS, major: 185, minor: 1 } 19 | name: Build ${{ matrix.config.region }} ${{ matrix.config.major }}.${{ matrix.config.minor }} 20 | steps: 21 | - uses: actions/checkout@v4 22 | - name: Set up MSVC 23 | uses: microsoft/setup-msbuild@v2.0.0 24 | - name: Set up CMake 25 | run: | 26 | choco install cmake 27 | shell: pwsh 28 | - name: Configure CMake 29 | run: cmake -B build ` 30 | -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ` 31 | -G "Visual Studio 17" -A Win32 ` 32 | -DBUILD_REGION=${{ matrix.config.region }} ` 33 | -DBUILD_MAJOR_VERSION=${{ matrix.config.major }} ` 34 | -DBUILD_MINOR_VERSION=${{ matrix.config.minor }} 35 | shell: pwsh 36 | - name: Build 37 | run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -------------------------------------------------------------------------------- /common/CWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CWnd : public IGObj, public IUIMsgHandler, public ZRefCounted { 4 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) || defined(REGION_JMS) 5 | enum UIOrigin { 6 | Origin_LT = 0, 7 | Origin_CT = 1, 8 | Origin_RT = 2, 9 | Origin_LC = 3, 10 | Origin_CC = 4, 11 | Origin_RC = 5, 12 | Origin_LB = 6, 13 | Origin_CB = 7, 14 | Origin_RB = 8, 15 | Origin_NUM = 9 16 | }; 17 | #endif 18 | 19 | unsigned int m_dwWndKey; 20 | _com_ptr_t<_com_IIID> m_pLayer; 21 | _com_ptr_t<_com_IIID> m_pAnimationLayer; 22 | _com_ptr_t<_com_IIID> m_pOverlabLayer; 23 | int m_width; 24 | int m_height; 25 | tagRECT m_rcInvalidated; 26 | int m_bScreenCoord; 27 | int m_nBackgrndX; 28 | int m_nBackgrndY; 29 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 87) || defined(REGION_JMS) 30 | SECPOINT m_ptCursorRel; 31 | #else 32 | int m_ptCursorRel_x; 33 | int m_ptCursorRel_y; 34 | #endif 35 | ZList> m_lpChildren; 36 | CCtrlWnd *m_pFocusChild; 37 | _com_ptr_t<_com_IIID> m_pBackgrnd; 38 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) 39 | UIOrigin m_origin; 40 | #endif 41 | }; -------------------------------------------------------------------------------- /common/CIOBufferManipulator.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | 4 | unsigned int CIOBufferManipulator::Decode2(unsigned short *n, const char *pSrc, unsigned int uRemain) { 5 | unsigned int result = 2; 6 | if (uRemain < 2) { 7 | throw std::invalid_argument("uRemain"); 8 | } 9 | *n = *(unsigned short *)pSrc; 10 | return result; 11 | } 12 | 13 | unsigned int CIOBufferManipulator::DecodeStr(ZXString *s, const char *pSrc, unsigned int uRemain) { 14 | int v3; 15 | int result; 16 | if (uRemain < 2) { 17 | throw std::invalid_argument("uRemain"); 18 | } 19 | v3 = *pSrc; 20 | result = v3 + 2; 21 | if (uRemain < v3 + 2) { 22 | throw std::invalid_argument("uRemain"); 23 | } 24 | s->Assign(pSrc + 2, v3); 25 | return result; 26 | } 27 | 28 | unsigned int CIOBufferManipulator::Decode4(unsigned int *n, const char *pSrc, unsigned int uRemain) { 29 | unsigned int result = 4; 30 | if (uRemain < 4) { 31 | throw std::invalid_argument("uRemain"); 32 | } 33 | *n = *(unsigned int *)pSrc; 34 | return result; 35 | } 36 | 37 | unsigned int CIOBufferManipulator::Decode1(unsigned char *n, const char *pSrc, unsigned int uRemain) { 38 | unsigned int result = 1; 39 | if (!uRemain) { 40 | throw std::invalid_argument("uRemain"); 41 | } 42 | *n = *pSrc; 43 | return result; 44 | } -------------------------------------------------------------------------------- /no-ad-balloon/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include 12 | #include 13 | #include "memory_map.h" 14 | 15 | // main thread 16 | DWORD WINAPI MainProc(LPVOID lpParam) { 17 | // Noop Ad Balloon 18 | MemEdit::WriteBytes(WIN_MAIN + WIN_MAIN_AD_BALLOON_CONDITIONAL, new BYTE[1]{0xEB}, 1); 19 | return 0; 20 | } 21 | 22 | // dll entry point 23 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { 24 | switch (ul_reason_for_call) { 25 | case DLL_PROCESS_ATTACH: { 26 | DisableThreadLibraryCalls(hModule); 27 | CreateThread(nullptr, 0, &MainProc, nullptr, 0, nullptr); 28 | break; 29 | } 30 | } 31 | return TRUE; 32 | } -------------------------------------------------------------------------------- /no-enter-mts-map-restriction/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include 12 | #include 13 | #include "memory_map.h" 14 | 15 | // main thread 16 | DWORD WINAPI MainProc(LPVOID lpParam) { 17 | MemEdit::WriteBytes(C_WVS_CONTEXT_SEND_MIGRATE_TO_ITC_REQUEST + C_WVS_CONTEXT_SEND_MIGRATE_TO_ITC_REQUEST_OFFSET, new BYTE[1]{0xEB}, 1); 18 | return 0; 19 | } 20 | 21 | // dll entry point 22 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { 23 | switch (ul_reason_for_call) { 24 | case DLL_PROCESS_ATTACH: { 25 | DisableThreadLibraryCalls(hModule); 26 | CreateThread(nullptr, 0, &MainProc, nullptr, 0, nullptr); 27 | break; 28 | } 29 | } 30 | return TRUE; 31 | } -------------------------------------------------------------------------------- /common/winhook_types.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include "winhook_types.h" 12 | 13 | CreateFileA_t CreateFileA_Original; 14 | WinExec_t WinExec_Original; 15 | GetProcAddress_t GetProcAddress_Original; 16 | CreateMutexA_t CreateMutexA_Original; 17 | GetStartupInfoA_t GetStartupInfoA_Original; 18 | GetModuleHandleA_t GetModuleHandleA_Original; 19 | OpenMutexA_t OpenMutexA_Original; 20 | WSPStartup_t WSPStartup_Original; 21 | RegisterClassExA_t RegisterClassExA_Original; 22 | CreateProcessW_t CreateProcessW_Original; 23 | CreateProcessA_t CreateProcessA_Original; 24 | OpenProcess_t OpenProcess_Original; 25 | CreateThread_t CreateThread_Original; 26 | GetACP_t GetACP_Original; 27 | CreateWindowExA_t CreateWindowExA_Original; 28 | NtTerminateProcess_t NtTerminateProcess_Original; 29 | RegCreateKeyExA_t RegCreateKeyExA_Original; -------------------------------------------------------------------------------- /common/IWzShape2D.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IWzShape2D 3 | 4 | DECLARE_INTERFACE_(IWzShape2D, IWzSerialize) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IWzSerialize methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | STDMETHOD(GetpersistentUOL)(THIS_ wchar_t **) PURE; 15 | 16 | STDMETHOD(Serialize)(THIS_ IWzArchive *) PURE; 17 | 18 | // ** IWzShape2D methods *** 19 | 20 | STDMETHOD(Getitem)(THIS_ tagVARIANT, tagVARIANT *) PURE; 21 | 22 | STDMETHOD(GetNewEnum)(THIS_ IUnknown **) PURE; 23 | 24 | STDMETHOD(Getcount)(THIS_ unsigned int *) PURE; 25 | 26 | STDMETHOD(Getx)(THIS_ int *) PURE; 27 | 28 | STDMETHOD(Putx)(THIS_ int) PURE; 29 | 30 | STDMETHOD(Gety)(THIS_ int *) PURE; 31 | 32 | STDMETHOD(Puty)(THIS_ int) PURE; 33 | 34 | STDMETHOD(Getx2)(THIS_ int *) PURE; 35 | 36 | STDMETHOD(Putx2)(THIS_ int) PURE; 37 | 38 | STDMETHOD(Gety2)(THIS_ int *) PURE; 39 | 40 | STDMETHOD(Puty2)(THIS_ int) PURE; 41 | 42 | STDMETHOD(Move)(THIS_ int, int) PURE; 43 | 44 | STDMETHOD(Offset)(THIS_ int, int) PURE; 45 | 46 | STDMETHOD(Scale)(THIS_ int, int, int, int, int, int) PURE; 47 | 48 | STDMETHOD(Insert)(THIS_ tagVARIANT, tagVARIANT) PURE; 49 | 50 | STDMETHOD(Remove)(THIS_ tagVARIANT, tagVARIANT *) PURE; 51 | 52 | STDMETHOD(Init)(THIS_ int, int) PURE; 53 | 54 | END_INTERFACE 55 | }; 56 | -------------------------------------------------------------------------------- /no-beginner-party-block/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include 12 | #include 13 | #include "memory_map.h" 14 | 15 | // main thread 16 | DWORD WINAPI MainProc(LPVOID lpParam) { 17 | MemEdit::WriteBytes(C_FIELD_SEND_JOIN_PARTY_MSG + C_FIELD_SEND_JOIN_PARTY_MSG_OFFSET, new BYTE[1]{0xEB}, 1); 18 | MemEdit::WriteBytes(C_FIELD_SEND_CREATE_NEW_PARTY_MSG + C_FIELD_SEND_CREATE_NEW_PARTY_MSG_OFFSET, new BYTE[1]{0xEB}, 1); 19 | return 0; 20 | } 21 | 22 | // dll entry point 23 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { 24 | switch (ul_reason_for_call) { 25 | case DLL_PROCESS_ATTACH: { 26 | DisableThreadLibraryCalls(hModule); 27 | CreateThread(nullptr, 0, &MainProc, nullptr, 0, nullptr); 28 | break; 29 | } 30 | } 31 | return TRUE; 32 | } -------------------------------------------------------------------------------- /common/ZRecyclableAvBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ZRecyclableStatic.h" 3 | #include "ZFatalSection.h" 4 | #include "ZAllocEx.h" 5 | #include 6 | 7 | #define ZRECYCLABLE_RAW_BLOCK_SIZE 0x10 8 | 9 | template 10 | class ZRecyclableAvBuffer : ZRecyclableStatic::CallBack 11 | { 12 | private: 13 | ZFakeStatAvBuff* m_pStat; 14 | ZFatalSection m_l; // TODO maybe emulate this one day 15 | void* m_pAv; 16 | 17 | ZRecyclableAvBuffer() 18 | { 19 | this->m_pAv = nullptr; 20 | this->m_pStat = nullptr; 21 | ZeroMemory(&this->m_l, sizeof(ZFatalSection)); 22 | } 23 | 24 | static std::mutex* GetMutex() // instead of ZFatalSection 25 | { 26 | static std::mutex mtx; 27 | return &mtx; 28 | } 29 | 30 | public: 31 | static ZRecyclableAvBuffer* GetInstance() 32 | { 33 | static ZRecyclableAvBuffer s_pInstance = ZRecyclableAvBuffer(); 34 | 35 | return &s_pInstance; 36 | } 37 | 38 | void** raw_new() 39 | { 40 | void** pAlloc; 41 | 42 | this->GetMutex()->lock(); 43 | 44 | if (!this->m_pAv) 45 | { 46 | this->m_pAv = ZAllocBase::AllocRawBlocks(sizeof(T), ZRECYCLABLE_RAW_BLOCK_SIZE); 47 | } 48 | 49 | pAlloc = (void**)this->m_pAv; 50 | this->m_pAv = *pAlloc; 51 | 52 | this->GetMutex()->unlock(); 53 | 54 | return pAlloc; 55 | } 56 | 57 | void raw_delete(void* p) 58 | { 59 | this->GetMutex()->lock(); 60 | 61 | *(void**)p = this->m_pAv; 62 | this->m_pAv = p; 63 | 64 | this->GetMutex()->unlock(); 65 | } 66 | }; 67 | 68 | assert_size(sizeof(ZRecyclableAvBuffer), 0x18) -------------------------------------------------------------------------------- /no-patcher/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include 12 | #include 13 | #include "memory_map.h" 14 | 15 | // main thread 16 | const DWORD dwLauncher = 0x007F3CE0; 17 | DWORD WINAPI MainProc(LPVOID lpParam) { 18 | // Noop Patcher 19 | if (strcmp(BUILD_REGION, "GMS") == 0) { 20 | MemEdit::PatchNop(WIN_MAIN + WIN_MAIN_PATCHER_OFFSET, 5); 21 | } else if (strcmp(BUILD_REGION, "JMS") == 0) { 22 | MemEdit::WriteBytes(dwLauncher, new BYTE[6]{0xB8, 0x01, 0x00, 0x00, 0x00, 0xC3}, 6); 23 | } 24 | return 0; 25 | } 26 | 27 | // dll entry point 28 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { 29 | switch (ul_reason_for_call) { 30 | case DLL_PROCESS_ATTACH: { 31 | DisableThreadLibraryCalls(hModule); 32 | CreateThread(nullptr, 0, &MainProc, nullptr, 0, nullptr); 33 | break; 34 | } 35 | } 36 | return TRUE; 37 | } -------------------------------------------------------------------------------- /window-mode/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include 12 | #include 13 | #include "memory_map.h" 14 | 15 | // main thread 16 | DWORD WINAPI MainProc(LPVOID lpParam) { 17 | if (strcmp(BUILD_REGION, "GMS") == 0) { 18 | auto *instance = reinterpret_cast(C_CONFIG_SYS_OPT_WINDOWED_MODE); 19 | *instance = 0; 20 | } else if (strcmp(BUILD_REGION, "JMS") == 0) { 21 | MemEdit::WriteBytes(0x00ADA8D7+0x94, new BYTE[7]{0xC7, 0x45, 0xDC, 0x00, 0x00, 0x00, 0x00}, 7); 22 | } 23 | return 0; 24 | } 25 | 26 | // dll entry point 27 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { 28 | switch (ul_reason_for_call) { 29 | case DLL_PROCESS_ATTACH: { 30 | DisableThreadLibraryCalls(hModule); 31 | CreateThread(nullptr, 0, &MainProc, nullptr, 0, nullptr); 32 | break; 33 | } 34 | } 35 | return TRUE; 36 | } -------------------------------------------------------------------------------- /common/CInputSystem.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | void CInputSystem::CreateInstance() { 4 | reinterpret_cast(C_INPUT_SYSTEM_CREATE_INSTANCE)(); 5 | } 6 | 7 | CInputSystem *CInputSystem::GetInstance() { 8 | // High volume call 9 | return reinterpret_cast(*reinterpret_cast(C_INPUT_SYSTEM_INSTANCE_ADDR)); 10 | } 11 | 12 | void CInputSystem::Init(HWND__ *hWnd, void **ahEvent) { 13 | Log("CInputSystem::Init"); 14 | reinterpret_cast( 15 | C_INPUT_SYSTEM_INIT)(this, nullptr, hWnd, ahEvent); 16 | } 17 | 18 | void CInputSystem::UpdateDevice(int nDeviceIndex) { 19 | Log("CInputSystem::UpdateDevice"); 20 | reinterpret_cast( 21 | C_INPUT_SYSTEM_UPDATE_DEVICE)(this, nullptr, nDeviceIndex); 22 | } 23 | 24 | int CInputSystem::GetISMessage(ISMSG *pISMsg) { 25 | Log("CInputSystem::GetISMessage"); 26 | return reinterpret_cast( 27 | C_INPUT_SYSTEM_GET_IS_MESSAGE)(this, nullptr, pISMsg); 28 | } 29 | 30 | int CInputSystem::GenerateAutoKeyDown(ISMSG *pISMsg) { 31 | // High volume call 32 | return reinterpret_cast( 33 | C_INPUT_SYSTEM_GENERATE_AUTO_KEY_DOWN)(this, nullptr, pISMsg); 34 | } 35 | 36 | void CInputSystem::ShowCursor(int bShow) { 37 | Log("CInputSystem::ShowCursor"); 38 | reinterpret_cast( 39 | C_INPUT_SYSTEM_SHOW_CURSOR)(this, nullptr, bShow); 40 | } -------------------------------------------------------------------------------- /common/CClientSocket.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | CClientSocket *CClientSocket::GetInstance() { 4 | Log("CClientSocket::GetInstance"); 5 | return reinterpret_cast(*reinterpret_cast( 6 | C_CLIENT_SOCKET_INSTANCE_ADDR)); 7 | } 8 | 9 | void CClientSocket::CreateInstance() { 10 | Log("CClientSocket::CreateInstance"); 11 | reinterpret_cast( 12 | C_CLIENT_SOCKET_CREATE_INSTANCE)(); 13 | } 14 | 15 | void CClientSocket::SendPacket(COutPacket *oPacket) { 16 | Log("CClientSocket::SendPacket"); 17 | reinterpret_cast( 18 | C_CLIENT_SOCKET_SEND_PACKET)(this, nullptr, oPacket); 19 | } 20 | 21 | void CClientSocket::ManipulatePacket() { 22 | Log("CClientSocket::ManipulatePacket"); 23 | reinterpret_cast( 24 | C_CLIENT_SOCKET_MANIPULATE_PACKET)(this, nullptr); 25 | } 26 | 27 | void CClientSocket::Close() { 28 | Log("CClientSocket::Close"); 29 | reinterpret_cast( 30 | C_CLIENT_SOCKET_CLOSE)(this, nullptr); 31 | Log("CClientSocket::After Close"); 32 | } 33 | 34 | void CClientSocket::ClearSendReceiveCtx() { 35 | Log("CClientSocket::ClearSendReceiveCtx"); 36 | reinterpret_cast( 37 | C_CLIENT_SOCKET_CLEAR_SEND_RECEIVE_CTX)(this, nullptr); 38 | } 39 | 40 | void CClientSocket::ConnectLogin() { 41 | Log("CClientSocket::ConnectLogin"); 42 | reinterpret_cast( 43 | C_CLIENT_SOCKET_CONNECT_LOGIN)(this, nullptr); 44 | } -------------------------------------------------------------------------------- /.github/workflows/build-snapshot.yml: -------------------------------------------------------------------------------- 1 | name: Build Snapshot 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | env: 8 | BUILD_TYPE: Release 9 | jobs: 10 | build: 11 | runs-on: windows-latest 12 | strategy: 13 | matrix: 14 | config: 15 | - { region: GMS, major: 83, minor: 1 } 16 | - { region: GMS, major: 87, minor: 1 } 17 | - { region: GMS, major: 95, minor: 1 } 18 | - { region: GMS, major: 111, minor: 1 } 19 | - { region: JMS, major: 185, minor: 1 } 20 | name: Build ${{ matrix.config.region }} ${{ matrix.config.major }}.${{ matrix.config.minor }} 21 | steps: 22 | - name: Checkout sources 23 | uses: actions/checkout@v4 24 | - name: Set up MSVC 25 | uses: microsoft/setup-msbuild@v2.0.0 26 | - name: Set up CMake 27 | run: | 28 | choco install cmake 29 | shell: pwsh 30 | - name: Configure CMake 31 | run: cmake -B build ` 32 | -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ` 33 | -G "Visual Studio 17" -A Win32 ` 34 | -DBUILD_REGION=${{ matrix.config.region }} ` 35 | -DBUILD_MAJOR_VERSION=${{ matrix.config.major }} ` 36 | -DBUILD_MINOR_VERSION=${{ matrix.config.minor }} 37 | shell: pwsh 38 | - name: Build 39 | run: cmake --build build --config ${{env.BUILD_TYPE}} 40 | - name: Artifact Build 41 | run: cmake --build build --config ${{env.BUILD_TYPE}} --target package_dlls 42 | - name: Upload 43 | uses: actions/upload-artifact@v4 44 | with: 45 | path: build/artifacts/ 46 | name: snapshot-${{ matrix.config.region }}-${{ matrix.config.major }}.${{ matrix.config.minor }} 47 | -------------------------------------------------------------------------------- /common/FakeModule.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include "FakeModule.h" 12 | 13 | BOOL FakeModule::CreateModule(const char* szModuleName) 14 | { 15 | this->szModuleName = szModuleName; 16 | 17 | HANDLE hWrite = CreateFile( 18 | szModuleName, 19 | (GENERIC_READ | GENERIC_WRITE), 20 | NULL, 21 | NULL, 22 | CREATE_ALWAYS, 23 | NULL, 24 | NULL 25 | ); 26 | 27 | if (hWrite != INVALID_HANDLE_VALUE) 28 | { 29 | if (!WriteFile(hWrite, this->s_abFakeModuleBinary, sizeof(this->s_abFakeModuleBinary), NULL, NULL)) 30 | { 31 | CloseHandle(hWrite); 32 | return FALSE; 33 | } 34 | 35 | CloseHandle(hWrite); 36 | } 37 | else 38 | { 39 | return FALSE; 40 | } 41 | 42 | this->hFakeModule = LoadLibrary(szModuleName); 43 | 44 | if (!this->hFakeModule) 45 | { 46 | return FALSE; 47 | } 48 | 49 | return TRUE; 50 | } 51 | 52 | BOOL FakeModule::DeleteModule() 53 | { 54 | if (!szModuleName || !hFakeModule) return FALSE; 55 | 56 | BOOL bRet = TRUE; 57 | 58 | bRet &= FreeLibrary(hFakeModule); 59 | bRet &= DeleteFile(TEXT(szModuleName)); 60 | 61 | return bRet; 62 | } 63 | -------------------------------------------------------------------------------- /common/winhooks.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | namespace WinHooks { 18 | /// 19 | /// CreateMutexA is the first Windows library call after the executable unpacks itself. 20 | /// We hook this function to do all our memory edits and hooks when it's called. 21 | /// 22 | HANDLE WINAPI CreateMutexA_Hook( 23 | LPSECURITY_ATTRIBUTES lpMutexAttributes, 24 | BOOL bInitialOwner, 25 | LPCSTR lpName 26 | ); 27 | 28 | VOID WINAPI GetStartupInfoA_Hook( 29 | LPSTARTUPINFOA lpStartupInfo 30 | ); 31 | 32 | HMODULE WINAPI GetModuleHandleA_Hook( 33 | LPCSTR lpModuleName 34 | ); 35 | 36 | /// 37 | /// This library call is used by nexon to determine the locale of the connecting clients PC. We spoof it. 38 | /// 39 | /// 40 | UINT WINAPI GetACP_Hook(); // AOB: FF 15 ?? ?? ?? ?? 3D ?? ?? ?? 00 00 74 <- library call inside winmain func 41 | } -------------------------------------------------------------------------------- /common/CConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CConfig { 4 | public: 5 | virtual ~CConfig() = default; 6 | 7 | int m_bRememberMailAddr; 8 | ZXString m_sLastMailAddr; 9 | ZXString m_sLastConnectWorldName; 10 | #if defined(REGION_JMS) 11 | int dummy5; 12 | int dummy1; 13 | #endif 14 | int m_nScr_RRate; 15 | int m_bScr_FirstRun; 16 | int m_nPetConsumeItemID; 17 | int m_nPetConsumeMPItemID; 18 | CONFIG_GAMEOPT m_gameOpt; 19 | CONFIG_SYSOPT m_sysOpt; 20 | CONFIG_JOYPAD m_joyPad; 21 | ZArray m_aListenBlockedFriend; 22 | ZArray m_aTalkBlockedFriend; 23 | ZMap, unsigned char, ZXString > m_aFriendGroup; 24 | int m_bShowOnlineOnly; 25 | ZArray > m_asBlackList; 26 | ZArray m_aQuestAlarm; 27 | HKEY__ *m_hKeyGlobal; 28 | HKEY__ *m_hKeyLastConnected; 29 | HKEY__ *m_hKeyCharacter; 30 | #if defined(REGION_GMS) 31 | int m_nUIWnd_X[43]; 32 | int m_nUIWnd_Y[43]; 33 | int m_nUIWnd_LargeX[43]; 34 | int m_nUIWnd_LargeY[43]; 35 | int m_nUIWnd_Option[43]; 36 | #elif defined(REGION_JMS) 37 | int m_nUIWnd_X[35]; 38 | int m_nUIWnd_Y[35]; 39 | int m_nUIWnd_Option[35]; 40 | #endif 41 | ZArray m_abQuestInfoOption; 42 | #if defined(REGION_GMS) 43 | FUNCKEY_MAPPED m_aFuncKeyMapped_Reg[89]; 44 | #elif defined(REGION_JMS) 45 | FUNCKEY_MAPPED m_aFuncKeyMapped_Reg[94]; 46 | #endif 47 | int m_aDialogVisible[1]; 48 | int m_nLastConnectedVersion; 49 | int m_tStartTime; 50 | 51 | CConfig(); 52 | 53 | static CConfig *GetInstance(); 54 | 55 | INT GetPartnerCode(); 56 | 57 | void ApplySysOpt(CONFIG_SYSOPT *pSysOpt, int bApplyVideo); 58 | 59 | void CheckExecPathReg(ZXString sModulePath); 60 | }; 61 | -------------------------------------------------------------------------------- /common/ZAllocBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class ZAllocBase 4 | { 5 | public: 6 | enum BLOCK_SIZE 7 | { 8 | BLOCK16 = 0, 9 | BLOCK32 = 1, 10 | BLOCK64 = 2, 11 | BLOCK128 = 3, 12 | }; 13 | 14 | static PVOID* AllocRawBlocks(UINT uBlockSize, UINT uNumberOfBlocks) 15 | { 16 | /* TODO make this more legible */ 17 | 18 | unsigned int uEnlargedBlockSize = uBlockSize + 4; 19 | unsigned int uTotalAllocationSize = (uNumberOfBlocks * uEnlargedBlockSize) + 8; 20 | 21 | HANDLE hHeap = GetProcessHeap(); 22 | PVOID* pAlloc = reinterpret_cast(HeapAlloc(hHeap, NULL, uTotalAllocationSize)); 23 | 24 | /* if we deallocate the entire block collection, this first address is where we start */ 25 | *(pAlloc) = reinterpret_cast((uNumberOfBlocks * uEnlargedBlockSize) + 4); 26 | 27 | /* block collection header */ 28 | *(pAlloc + 1) = 0; 29 | 30 | /* size of first block */ 31 | *(pAlloc + 2) = reinterpret_cast(uBlockSize); 32 | 33 | PVOID* pRet = pAlloc + 3; 34 | DWORD* pdwRet = (DWORD*)(pAlloc + 3); 35 | 36 | for (UINT i = 0; i < uNumberOfBlocks - 1; i++) 37 | { 38 | /* initialize each block with a pointer to the next block */ 39 | *pRet = reinterpret_cast(pRet) + uEnlargedBlockSize; 40 | 41 | /* increase pointer by block size (we divide because the compiler tries to multiply) */ 42 | pRet = reinterpret_cast(reinterpret_cast(pRet) + uEnlargedBlockSize); 43 | 44 | /* set the preceding address to equal the size of the block */ 45 | *(pRet - 1) = reinterpret_cast(uBlockSize); 46 | } 47 | 48 | /* nullptr indicates last block in the linked list */ 49 | *pRet = nullptr; 50 | 51 | /* return address of the first block in the linked list */ 52 | return pAlloc + 3; 53 | } 54 | }; -------------------------------------------------------------------------------- /skip-logo/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | #include "pch.h" 11 | 12 | #include "logger.h" 13 | #include "hooker.h" 14 | 15 | // void __thiscall CLogo::Init(CLogo *this) 16 | typedef VOID(__thiscall *_CLogo_Init_t)(CLogo *pThis, void *unused); 17 | 18 | VOID __fastcall CLogo_Init_Hook(CLogo *pThis, PVOID edx, void *unused) { 19 | Log("CLogo::Init"); 20 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 111) 21 | pThis->InitNXLogo(); 22 | #endif 23 | CInputSystem::GetInstance()->ShowCursor(0); 24 | auto m_nGameStartMode = CWvsApp::GetInstance()->m_nGameStartMode; 25 | 26 | ZXString cmdLine = ZXString(); 27 | if (m_nGameStartMode == 1) { 28 | CWvsApp::GetInstance()->GetCmdLine(&cmdLine, 5); 29 | } else { 30 | CWvsApp::GetInstance()->GetCmdLine(&cmdLine, 3); 31 | } 32 | if (cmdLine && *cmdLine && CWvsApp::GetInstance()->m_bAutoConnect) { 33 | pThis->LogoEnd(); 34 | } 35 | cmdLine.Empty(); 36 | pThis->LogoEnd(); 37 | } 38 | 39 | DWORD WINAPI MainProc(LPVOID lpParam) { 40 | HOOKTYPEDEF_C(CLogo_Init); 41 | INITMAPLEHOOK(_CLogo_Init, _CLogo_Init_t, CLogo_Init_Hook, C_LOGO_INIT); 42 | return 0; 43 | } 44 | 45 | // dll entry point 46 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { 47 | switch (ul_reason_for_call) { 48 | case DLL_PROCESS_ATTACH: { 49 | DisableThreadLibraryCalls(hModule); 50 | CreateThread(nullptr, 0, &MainProc, nullptr, 0, nullptr); 51 | break; 52 | } 53 | } 54 | return TRUE; 55 | } -------------------------------------------------------------------------------- /bypass/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(bypass VERSION 1.0.0) 3 | 4 | add_library(bypass SHARED 5 | dllmain.cpp 6 | ${CMAKE_SOURCE_DIR}/common/memedit.cpp 7 | ${CMAKE_SOURCE_DIR}/common/hooker.cpp 8 | ${CMAKE_SOURCE_DIR}/common/logger.cpp 9 | ${CMAKE_SOURCE_DIR}/common/CClientSocket.cpp 10 | ${CMAKE_SOURCE_DIR}/common/CConfig.cpp 11 | ${CMAKE_SOURCE_DIR}/common/COutPacket.cpp 12 | ${CMAKE_SOURCE_DIR}/common/CSystemInfo.cpp 13 | ${CMAKE_SOURCE_DIR}/common/CWndMan.cpp 14 | ${CMAKE_SOURCE_DIR}/common/CWvsApp.cpp 15 | ${CMAKE_SOURCE_DIR}/common/CWvsContext.cpp 16 | ${CMAKE_SOURCE_DIR}/common/CActionMan.cpp 17 | ${CMAKE_SOURCE_DIR}/common/CInputSystem.cpp 18 | ${CMAKE_SOURCE_DIR}/common/CSecurityClient.cpp 19 | ${CMAKE_SOURCE_DIR}/common/CFuncKeyMappedMan.cpp 20 | ${CMAKE_SOURCE_DIR}/common/CQuickslotKeyMappedMan.cpp 21 | ${CMAKE_SOURCE_DIR}/common/CAnimationDisplayer.cpp 22 | ${CMAKE_SOURCE_DIR}/common/CMacroSysMan.cpp 23 | ${CMAKE_SOURCE_DIR}/common/CBattleRecordMan.cpp 24 | ${CMAKE_SOURCE_DIR}/common/CMapleTVMan.cpp 25 | ${CMAKE_SOURCE_DIR}/common/CQuestMan.cpp 26 | ${CMAKE_SOURCE_DIR}/common/CMonsterBookMan.cpp 27 | ${CMAKE_SOURCE_DIR}/common/CRadioManager.cpp 28 | ${CMAKE_SOURCE_DIR}/common/CStage.cpp 29 | ${CMAKE_SOURCE_DIR}/common/CLogin.cpp 30 | ${CMAKE_SOURCE_DIR}/common/CLogo.cpp 31 | ${CMAKE_SOURCE_DIR}/common/CUITitle.cpp 32 | ${CMAKE_SOURCE_DIR}/common/ZSocketBuffer.cpp 33 | ${CMAKE_SOURCE_DIR}/common/CIOBufferManipulator.cpp 34 | ${CMAKE_SOURCE_DIR}/common/ZSocketBase.cpp 35 | ) 36 | 37 | # Set additional include directories if needed 38 | target_include_directories(bypass PRIVATE ${CMAKE_SOURCE_DIR}/common) 39 | target_link_libraries(bypass PRIVATE ${CMAKE_SOURCE_DIR}/common/detours.lib) 40 | target_link_libraries(bypass PRIVATE build_config) 41 | 42 | # Link against Ws2_32.lib 43 | if (WIN32) 44 | target_link_libraries(bypass PRIVATE Ws2_32.lib) 45 | target_link_libraries(bypass PRIVATE winmm.lib) 46 | target_link_libraries(bypass PRIVATE comsuppw.lib) 47 | endif() 48 | 49 | set_target_properties(bypass PROPERTIES OUTPUT_NAME "bypass-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") -------------------------------------------------------------------------------- /common/CLogo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CLogo : public CStage { 4 | public: 5 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) 6 | enum class VIDEO_STATE : int32_t { 7 | VIDEO_STATE_UNAVAILABLE = 0x0, 8 | VIDEO_STATE_OPENING = 0x1, 9 | VIDEO_STATE_READY = 0x2, 10 | VIDEO_STATE_PLAYING = 0x3, 11 | VIDEO_STATE_FADEOUT = 0x4, 12 | VIDEO_STATE_END = 0x5, 13 | }; 14 | #endif 15 | 16 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) 17 | _com_ptr_t<_com_IIID> m_pLayerBackground; 18 | #endif 19 | _com_ptr_t<_com_IIID> m_pLayerMain; 20 | _com_ptr_t<_com_IIID> m_pLogoProp; 21 | int m_nLogoCount; 22 | unsigned int m_dwTickInitial; 23 | unsigned int m_dwClick; 24 | int m_bLogoSoundPlayed; 25 | int m_bWZInit; 26 | int m_bNXFadeIn; 27 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) || defined(REGION_JMS) 28 | int m_bNXFadeOut; 29 | #endif 30 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) 31 | int m_bVideoMode; 32 | CLogo::VIDEO_STATE m_videoState; 33 | #endif 34 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 111) 35 | int dummy1; 36 | #endif 37 | 38 | CLogo(); 39 | 40 | void Init(); 41 | 42 | void InitNXLogo(); 43 | 44 | void LogoEnd(); 45 | 46 | void ForcedEnd(); 47 | 48 | void Update() override; 49 | 50 | void OnKey(unsigned int, unsigned int) override; 51 | 52 | int OnSetFocus(int) override; 53 | 54 | void OnMouseButton(unsigned int, unsigned int, int, int) override; 55 | 56 | int OnMouseMove(int, int) override; 57 | 58 | int OnMouseWheel(int, int, int) override; 59 | 60 | void OnDraggableMove(int, int *, int, int) override; 61 | 62 | void SetEnable(int) override; 63 | 64 | int IsEnabled() override; 65 | 66 | void SetShow(int) override; 67 | 68 | int IsShown() override; 69 | 70 | int GetAbsLeft() override; 71 | 72 | int GetAbsTop() override; 73 | 74 | void ClearToolTip() override; 75 | 76 | void OnIMEModeChange(char) override; 77 | 78 | void OnIMEResult(const char *) override; 79 | 80 | void OnIMEComp(const char *, ZArray *, unsigned int, int, 81 | ZList > *, int, int, int) override; 82 | 83 | const CRTTI *GetRTTI() override; 84 | 85 | int IsKindOf(const CRTTI *) override; 86 | }; 87 | 88 | -------------------------------------------------------------------------------- /common/CWvsApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CWvsApp { 4 | public: 5 | virtual ~CWvsApp() = default; 6 | 7 | HWND__ *m_hWnd; 8 | int m_bPCOMInitialized; 9 | unsigned int m_dwMainThreadId; 10 | HHOOK__ *m_hHook; 11 | int m_bWin9x; 12 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) 13 | int m_nOSVersion; 14 | int m_nOSMinorVersion; 15 | int m_nOSBuildNumber; 16 | ZXString m_sCSDVersion; 17 | int m_b64BitInfo; 18 | #endif 19 | int m_tUpdateTime; 20 | int m_bFirstUpdate; 21 | ZXString m_sCmdLine; 22 | int m_nGameStartMode; 23 | int m_bAutoConnect; 24 | #if defined(REGION_JMS) 25 | int unk1[2]; 26 | ZXString unk2[2]; 27 | #endif 28 | int m_bShowAdBalloon; 29 | int m_bExitByTitleEscape; 30 | HRESULT m_hrZExceptionCode; 31 | HRESULT m_hrComErrorCode; 32 | unsigned int m_dwSecurityErrorCode; 33 | int m_nTargetVersion; 34 | #if defined(REGION_GMS) 35 | int m_tLastServerIPCheck; 36 | int m_tLastServerIPCheck2; 37 | int m_tLastGGHookingAPICheck; 38 | #endif 39 | int m_tLastSecurityCheck; 40 | void *m_ahInput[3]; 41 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 87) 42 | int m_tNextSecurityCheck; 43 | #endif 44 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) 45 | bool m_bEnabledDX9; 46 | #endif 47 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 87) 48 | ZArray m_pBackupBuffer; 49 | unsigned int m_dwBackupBufferSize; 50 | #endif 51 | #if (defined(REGION_GMS) && BUILD_MAJOR_VERSION >= 95) 52 | unsigned int m_dwClearStackLog; 53 | int m_bWindowActive; 54 | #endif 55 | 56 | static CWvsApp* GetInstance(); 57 | 58 | void ISMsgProc(unsigned int message, unsigned int wParam, int lParam); 59 | 60 | void InitializeAuth(); 61 | 62 | void InitializePCOM(); 63 | 64 | void CreateMainWindow(); 65 | 66 | void ConnectLogin(); 67 | 68 | void InitializeResMan(); 69 | 70 | void InitializeGr2D(); 71 | 72 | void InitializeInput(); 73 | 74 | void InitializeSound(); 75 | 76 | void InitializeGameData(); 77 | 78 | void CreateWndManager(); 79 | 80 | ZXString * GetCmdLine(ZXString *result, int nArg); 81 | 82 | static void Dir_BackSlashToSlash(char string[260]); 83 | 84 | static void Dir_upDir(char string[260]); 85 | 86 | static void Dir_SlashToBackSlash(char string[260]); 87 | 88 | static char * GetExceptionFileName(); 89 | }; 90 | -------------------------------------------------------------------------------- /common/hooker.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #pragma once 12 | #include 13 | #include "detours.h" 14 | 15 | #pragma comment(lib, "detours.lib") 16 | 17 | #pragma region Macros 18 | 19 | /// Sets hook and outputs result to debug window (pass/fail) 20 | #define INITWINHOOK(sModName, sFuncName, pOrigFunc, Func_t, pNewFunc) \ 21 | pOrigFunc = (Func_t)GetFuncAddress(sModName, sFuncName); \ 22 | if (SetHook(TRUE, reinterpret_cast(&pOrigFunc), pNewFunc)) \ 23 | { Log("Hooked %s", sFuncName); } \ 24 | else \ 25 | { Log("Failed to hook %s", sFuncName); } // end macro 26 | 27 | #define INITMAPLEHOOK(pOrigFunc, Func_t, pNewFunc, dwAddress) \ 28 | pOrigFunc = reinterpret_cast(dwAddress); \ 29 | if (!SetHook(TRUE, reinterpret_cast(&pOrigFunc), pNewFunc)) \ 30 | { Log("Failed to hook maple func at address %d", dwAddress); } // end macro 31 | 32 | #define HOOKTYPEDEF_FUNCTYPE(functionName) _##functionName##_t 33 | 34 | // Use this macro in MapleAPI.h to define function types to use for hooks 35 | // functionName expands to _functionName_t for the type name and _functionName for the reference name. 36 | #define HOOKTYPEDEF_H(returnType, callingConvention, functionName, ...) \ 37 | typedef returnType (callingConvention* HOOKTYPEDEF_FUNCTYPE(functionName))(__VA_ARGS__); \ 38 | extern HOOKTYPEDEF_FUNCTYPE(functionName) _##functionName 39 | 40 | // Use this macro in MapleAPI.cpp to complete the function types for hooks 41 | #define HOOKTYPEDEF_C(functionName) HOOKTYPEDEF_FUNCTYPE(functionName) _##functionName 42 | 43 | #pragma endregion 44 | 45 | extern BOOL SetHook(bool bInstall, void** ppvTarget, void* pvDetour); 46 | extern DWORD GetFuncAddress(const char* lpModule, const char* lpFunc); 47 | extern PVOID HookVTableFunction(void* pVTable, void* fnHookFunc, int nOffset); -------------------------------------------------------------------------------- /proxy/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include "Common.h" 12 | #include 13 | #include 14 | 15 | extern "C" __declspec(dllexport) 16 | void LoadDLLsFromDirectory(const std::string &directory) { 17 | WIN32_FIND_DATA findFileData; 18 | HANDLE hFind = FindFirstFile((directory + "\\*.dll").c_str(), &findFileData); 19 | 20 | if (hFind != INVALID_HANDLE_VALUE) { 21 | do { 22 | HMODULE hModule = LoadLibrary((directory + findFileData.cFileName).c_str()); 23 | if (hModule) { 24 | Log("Loaded: %s", (directory + findFileData.cFileName).c_str()); 25 | } else { 26 | Log("Failed to load: %s", (directory + findFileData.cFileName).c_str()); 27 | } 28 | } while (FindNextFile(hFind, &findFileData) != 0); 29 | FindClose(hFind); 30 | } 31 | } 32 | 33 | // executed after the client is unpacked 34 | VOID MainFunc() { 35 | LoadDLLsFromDirectory("edits/"); 36 | } 37 | 38 | DWORD WINAPI MainProc(LPVOID lpParam) { 39 | Log(__FUNCTION__); 40 | 41 | Common::CreateInstance 42 | ( 43 | TRUE, // true if you want to hook windows libraries (besides mutex) set this to false if you already edited your IP into the client (eg v83 localhosts) 44 | MainFunc // function to be executed after client is unpacked 45 | ); 46 | return 0; 47 | } 48 | 49 | // dll entry point 50 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { 51 | switch (ul_reason_for_call) { 52 | case DLL_PROCESS_ATTACH: { 53 | DisableThreadLibraryCalls(hModule); 54 | CreateThread(nullptr, 0, &MainProc, nullptr, 0, nullptr); 55 | break; 56 | } 57 | } 58 | 59 | return TRUE; 60 | } 61 | -------------------------------------------------------------------------------- /common/IWzGr2D.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IWzGr2D 3 | 4 | DECLARE_INTERFACE_(IWzGr2D, IUnknown) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IUnknown methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | // ** IWzGr2D methods *** 15 | STDMETHOD(Initialize)(THIS_ unsigned int, unsigned int, tagVARIANT, tagVARIANT, tagVARIANT) PURE; 16 | 17 | STDMETHOD(Uninitialize)(THIS) PURE; 18 | 19 | STDMETHOD(GetnextRenderTime)(THIS_ int *) PURE; 20 | 21 | STDMETHOD(UpdateCurrentTime)(THIS_ int) PURE; 22 | 23 | STDMETHOD(RenderFrame)(THIS) PURE; 24 | 25 | STDMETHOD(SetFrameSkip)(THIS) PURE; 26 | 27 | STDMETHOD(ToggleFpsPanel)(THIS) PURE; 28 | 29 | STDMETHOD(DisableFpsPanel)(THIS) PURE; 30 | 31 | STDMETHOD(Getwidth)(THIS_ unsigned int *) PURE; 32 | 33 | STDMETHOD(Getheight)(THIS_ unsigned int *) PURE; 34 | 35 | STDMETHOD(PutscreenResolution)(THIS_ unsigned int, unsigned int) PURE; 36 | 37 | STDMETHOD(Getbpp)(THIS_ unsigned int *) PURE; 38 | 39 | STDMETHOD(GetrefreshRate)(THIS_ unsigned int *) PURE; 40 | 41 | STDMETHOD(Getfps100)(THIS_ unsigned int *) PURE; 42 | 43 | STDMETHOD(GetcurrentTime)(THIS_ int *) PURE; 44 | 45 | STDMETHOD(GetfullScreen)(THIS_ int *) PURE; 46 | 47 | STDMETHOD(PutfullScreen)(THIS_ int) PURE; 48 | 49 | STDMETHOD(GetbackColor)(THIS_ unsigned int *) PURE; 50 | 51 | STDMETHOD(PutbackColor)(THIS_ unsigned int) PURE; 52 | 53 | STDMETHOD(GetredTone)(THIS_ IWzVector2D **) PURE; 54 | 55 | STDMETHOD(GetgreenBlueTone)(THIS_ IWzVector2D **) PURE; 56 | 57 | STDMETHOD(Getcenter)(THIS_ IWzVector2D **) PURE; 58 | 59 | STDMETHOD(GetSnapshot)(THIS_ tagVARIANT, unsigned int, int, int) PURE; 60 | 61 | STDMETHOD(CreateLayer)(THIS_ int, int, unsigned int, unsigned int, int, tagVARIANT, tagVARIANT, 62 | IWzGr2DLayer **) PURE; 63 | 64 | STDMETHOD(AdjustCenter)(THIS_ int, int) PURE; 65 | 66 | STDMETHOD(TakeScreenShot)(THIS_ wchar_t *, int) PURE; 67 | 68 | STDMETHOD(SetVideoMode)(THIS_ int) PURE; 69 | 70 | STDMETHOD(SetVideoPath)(THIS_ wchar_t *, int, int) PURE; 71 | 72 | STDMETHOD(PlayVideo)(THIS) PURE; 73 | 74 | STDMETHOD(PauseVideo)(THIS_ int) PURE; 75 | 76 | STDMETHOD(StopVideo)(THIS) PURE; 77 | 78 | STDMETHOD(GetvideoStatus)(THIS_ int *) PURE; 79 | 80 | STDMETHOD(PutvideoVolume)(THIS_ int) PURE; 81 | 82 | END_INTERFACE 83 | }; -------------------------------------------------------------------------------- /common/hooker.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include "hooker.h" 12 | 13 | BOOL SetHook(bool bInstall, void** ppvTarget, void* pvDetour) 14 | { 15 | if (DetourTransactionBegin() != NO_ERROR) 16 | { 17 | return FALSE; 18 | } 19 | 20 | HANDLE pCurThread = GetCurrentThread(); 21 | 22 | if (DetourUpdateThread(pCurThread) == NO_ERROR) 23 | { 24 | auto pDetourFunc = bInstall ? DetourAttach : DetourDetach; 25 | 26 | if (pDetourFunc(ppvTarget, pvDetour) == NO_ERROR) 27 | { 28 | if (DetourTransactionCommit() == NO_ERROR) 29 | { 30 | return TRUE; 31 | } 32 | } 33 | } 34 | 35 | DetourTransactionAbort(); 36 | return FALSE; 37 | } 38 | 39 | DWORD GetFuncAddress(const char* lpModule, const char* lpFunc) 40 | { 41 | HMODULE hMod = LoadLibraryA(lpModule); 42 | 43 | return !hMod ? 0 : (DWORD)GetProcAddress(hMod, lpFunc); 44 | } 45 | 46 | // Credits: https://guidedhacking.com/threads/hook-vtable.13096/post-76763 47 | PVOID HookVTableFunction(void* pVTable, void* fnHookFunc, int nOffset) { 48 | intptr_t ptrVtable = *((intptr_t*)pVTable); // Pointer to our chosen vtable 49 | intptr_t ptrFunction = ptrVtable + sizeof(intptr_t) * nOffset; // The offset to the function (remember it's a zero indexed array with a size of four bytes) 50 | intptr_t ptrOriginal = *((intptr_t*)ptrFunction); // Save original address 51 | 52 | // Edit the memory protection so we can modify it 53 | MEMORY_BASIC_INFORMATION mbi; 54 | VirtualQuery((LPCVOID)ptrFunction, &mbi, sizeof(mbi)); 55 | VirtualProtect(mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &mbi.Protect); 56 | 57 | // Overwrite the old function with our new one 58 | *((intptr_t*)ptrFunction) = (intptr_t)fnHookFunc; 59 | 60 | // Restore the protection 61 | VirtualProtect(mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &mbi.Protect); 62 | 63 | // Return the original function address incase we want to call it 64 | return (void*)ptrOriginal; 65 | } 66 | -------------------------------------------------------------------------------- /common/CharacterData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GW_CharacterStat.h" 4 | #include "GW_ItemSlotBase.h" 5 | #include "GW_MiniGameRecord.h" 6 | #include "GW_CoupleRecord.h" 7 | #include "GW_FriendRecord.h" 8 | #include "GW_NewYearCardRecord.h" 9 | #include "GW_MarriageRecord.h" 10 | #include "GW_WildHunterInfo.h" 11 | #include "GW_MonsterBookCard.h" 12 | #include "EquippedSetItem.h" 13 | #include "CSimpleStrMap.h" 14 | #include "Additional.h" 15 | #include "ZMap.h" 16 | #include "ZList.h" 17 | #include "ZRef.h" 18 | #include "ZArray.h" 19 | #include "ZPair.h" 20 | 21 | struct CharacterData { 22 | GW_CharacterStat characterStat; 23 | ZRef aEquipped[60]; 24 | ZRef aEquipped2[60]; 25 | ZRef aDragonEquipped[4]; 26 | ZRef aMechanicEquipped[5]; 27 | ZArray > aaItemSlot[6]; 28 | _FILETIME aEquipExtExpire[1]; 29 | ZMap m_mEquippedSetItem; 30 | int nCombatOrders; 31 | ZMap mSkillRecord; 32 | ZMap mSkillRecordEx; 33 | ZMap mSkillMasterLev; 34 | ZMap mSkillExpired; 35 | ZMap mSkillCooltime; 36 | ZMap mQuestComplete; 37 | ZMap mQuestCompleteOld; 38 | ZMap, long> mMiniGameRecord; 39 | int nFriendMax; 40 | ZList lCoupleRecord; 41 | ZList lFriendRecord; 42 | ZList lNewYearCardRecord; 43 | ZList lMarriageRecord; 44 | unsigned int adwMapTransfer[5]; 45 | unsigned int adwMapTransferEx[10]; 46 | int bReachMaxLevel; 47 | _FILETIME ftReachMaxLevelTime; 48 | int nItemTotalNumber[5]; 49 | ZMap mAdminShopCommodityCount; 50 | ZXString sLinkedCharacter; 51 | ZRef pWildHunterInfo; 52 | ZMap, long> mpMonsterBookCard; 53 | int nMonsterBookCoverID; 54 | int nMonsterCardNormal; 55 | int nMonsterCardSpecial; 56 | ZMap, unsigned short> mQuestRecord; 57 | ZMap mQuestRecordEx; 58 | ZArray aSkill; 59 | int aMobCategoryDamage[9]; 60 | int aElemBoost[8]; 61 | Additional::CRITICAL critical; 62 | Additional::BOSS boss; 63 | ZMap , ZPair, ZXString> aUpgradeCountByDamageTheme; 64 | ZMap m_mVisitorQuestLog; 65 | }; 66 | -------------------------------------------------------------------------------- /proxy/ijl15.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include "framework.h" 12 | #include "ijl15.h" 13 | 14 | #define LIB_NAME "ijl15.dll.bak" 15 | #define LIB_EXPORT extern "C" __declspec(dllexport) 16 | 17 | DWORD ijlErrorStr_Proc; 18 | DWORD ijlFree_Proc; 19 | DWORD ijlGetLibVersion_Proc; 20 | DWORD ijlInit_Proc; 21 | DWORD ijlRead_Proc; 22 | DWORD ijlWrite_Proc; 23 | 24 | BOOL InitializeIjl15() 25 | { 26 | DWORD dw; 27 | HANDLE hOrg = CreateFileA(LIB_NAME, (GENERIC_READ | GENERIC_WRITE), NULL, NULL, CREATE_ALWAYS, NULL, NULL); 28 | 29 | if (hOrg) 30 | { 31 | WriteFile(hOrg, g_Ijl15_Raw, sizeof(g_Ijl15_Raw), &dw, NULL); 32 | CloseHandle(hOrg); 33 | } 34 | else 35 | { 36 | OutputDebugStringA("ijl15: Unable to write " LIB_NAME " to disk"); 37 | } 38 | 39 | HMODULE SeData_Base = LoadLibraryA(LIB_NAME); 40 | 41 | if (SeData_Base) 42 | { 43 | ijlErrorStr_Proc = (DWORD)GetProcAddress(SeData_Base, "ijlErrorStr"); 44 | ijlFree_Proc = (DWORD)GetProcAddress(SeData_Base, "ijlFree"); 45 | ijlGetLibVersion_Proc = (DWORD)GetProcAddress(SeData_Base, "ijlGetLibVersion"); 46 | ijlInit_Proc = (DWORD)GetProcAddress(SeData_Base, "ijlInit"); 47 | ijlRead_Proc = (DWORD)GetProcAddress(SeData_Base, "ijlRead"); 48 | ijlWrite_Proc = (DWORD)GetProcAddress(SeData_Base, "ijlWrite"); 49 | 50 | return TRUE; 51 | } 52 | 53 | return FALSE; 54 | } 55 | 56 | BOOL g_InitIjl15 = InitializeIjl15(); //This is the static initializer !!! 57 | 58 | LIB_EXPORT void ijlGetLibVersion() 59 | { 60 | __asm jmp dword ptr[ijlGetLibVersion_Proc] // make sure you're compiling in x86 61 | } 62 | 63 | LIB_EXPORT void ijlInit() 64 | { 65 | __asm jmp dword ptr[ijlInit_Proc] 66 | } 67 | 68 | LIB_EXPORT void ijlFree() 69 | { 70 | __asm jmp dword ptr[ijlFree_Proc] 71 | } 72 | 73 | LIB_EXPORT void ijlRead() 74 | { 75 | __asm jmp dword ptr[ijlRead_Proc] 76 | } 77 | 78 | LIB_EXPORT void ijlWrite() 79 | { 80 | __asm jmp dword ptr[ijlWrite_Proc] 81 | } 82 | 83 | LIB_EXPORT void ijlErrorStr() 84 | { 85 | __asm jmp dword ptr[ijlErrorStr_Proc] 86 | } 87 | -------------------------------------------------------------------------------- /common/Common.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include "Common.h" 12 | 13 | Common* Common::_s_pInstance; 14 | Common::Config* Common::_s_pConfig; 15 | 16 | Common::Common(BOOL bHookWinLibs, std::function pPostMutexFunc) 17 | { 18 | this->m_bThemidaUnpacked = FALSE; 19 | 20 | if (!pPostMutexFunc) 21 | { 22 | #if _DEBUG 23 | Log("Invalid function pointer passed to Common constructor."); 24 | #endif 25 | return; 26 | } 27 | 28 | this->m_PostMutexFunc = pPostMutexFunc; 29 | 30 | // required for proper injection 31 | INITWINHOOK("KERNEL32", "CreateMutexA", CreateMutexA_Original, CreateMutexA_t, WinHooks::CreateMutexA_Hook); 32 | // INITWINHOOK("USER32", "CreateWindowExA", CreateWindowExA_Original, CreateWindowExA_t, WinHooks::CreateWindowExA_Hook); 33 | INITWINHOOK("KERNEL32", "GetStartupInfoA", GetStartupInfoA_Original, GetStartupInfoA_t, WinHooks::GetStartupInfoA_Hook); 34 | INITWINHOOK("KERNEL32", "GetModuleHandleA", GetModuleHandleA_Original, GetModuleHandleA_t, WinHooks::GetModuleHandleA_Hook); 35 | 36 | if (Common::GetConfig()->LocaleSpoofValue) 37 | { 38 | INITWINHOOK("KERNEL32", "GetACP", GetACP_Original, GetACP_t, WinHooks::GetACP_Hook); 39 | } 40 | 41 | if (!bHookWinLibs) return; 42 | } 43 | 44 | Common::~Common() 45 | { 46 | #if _DEBUG 47 | Log("Cleaning up common.."); 48 | #endif 49 | 50 | if (this->m_pFakeHsModule) 51 | { 52 | // TODO figure out some common library call to put this instead of in dll detach 53 | // CLogo constructor is pretty good but its not a library call so idk 54 | this->m_pFakeHsModule->DeleteModule(); 55 | } 56 | } 57 | 58 | void Common::OnThemidaUnpack() 59 | { 60 | if (this->m_bThemidaUnpacked) return; 61 | 62 | this->m_bThemidaUnpacked = TRUE; 63 | 64 | if (Common::GetConfig()->SleepAfterUnpackDuration) 65 | { 66 | Log("Themida unpacked => sleeping for %d milliseconds.", Common::GetConfig()->SleepAfterUnpackDuration); 67 | Sleep(Common::GetConfig()->SleepAfterUnpackDuration); 68 | } 69 | 70 | #if _DEBUG 71 | Log("Themida unpacked, editing memory.."); 72 | #endif 73 | 74 | this->m_PostMutexFunc(); 75 | } 76 | -------------------------------------------------------------------------------- /common/CLogo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | CLogo::CLogo() { 4 | Log("CLogo::CLogo"); 5 | reinterpret_cast(C_LOGO)(this, nullptr); 6 | } 7 | 8 | const CRTTI *CLogo::GetRTTI() { 9 | return reinterpret_cast(C_LOGO_GET_RTTI)(this, nullptr); 10 | } 11 | 12 | int CLogo::IsKindOf(const CRTTI *pRTTI) { 13 | return reinterpret_cast(C_LOGO_IS_KIND_OF)(this, nullptr, 14 | pRTTI); 15 | } 16 | 17 | void CLogo::Init() { 18 | Log("CLogo::Init"); 19 | reinterpret_cast(C_LOGO_INIT)(this, nullptr); 20 | } 21 | 22 | void CLogo::InitNXLogo() { 23 | reinterpret_cast(C_LOGO_INIT_NX_LOGO)(this); 24 | } 25 | 26 | void CLogo::Update() { 27 | reinterpret_cast(C_LOGO_UPDATE)(this, nullptr); 28 | } 29 | 30 | void CLogo::LogoEnd() { 31 | Log("CLogo::ForcedEnd"); 32 | reinterpret_cast(C_LOGO_LOGO_END)(this, nullptr); 33 | } 34 | 35 | void CLogo::ForcedEnd() { 36 | Log("CLogo::ForcedEnd"); 37 | reinterpret_cast(C_LOGO_FORCED_END)(this, nullptr); 38 | } 39 | 40 | void CLogo::OnIMEComp(const char *, ZArray *, unsigned int, int, 41 | ZList> *, int, int, int) { 42 | } 43 | 44 | void CLogo::OnIMEResult(const char *) { 45 | } 46 | 47 | void CLogo::OnIMEModeChange(char) { 48 | } 49 | 50 | void CLogo::ClearToolTip() { 51 | } 52 | 53 | int CLogo::GetAbsTop() { 54 | return 0; 55 | } 56 | 57 | int CLogo::GetAbsLeft() { 58 | return 0; 59 | } 60 | 61 | int CLogo::IsShown() { 62 | return 1; 63 | } 64 | 65 | void CLogo::SetShow(int) { 66 | } 67 | 68 | int CLogo::IsEnabled() { 69 | return 1; 70 | } 71 | 72 | void CLogo::SetEnable(int) { 73 | } 74 | 75 | void CLogo::OnDraggableMove(int, int *, int, int) { 76 | } 77 | 78 | int CLogo::OnMouseWheel(int, int, int) { 79 | return 0; 80 | } 81 | 82 | int CLogo::OnMouseMove(int, int) { 83 | return 0; 84 | } 85 | 86 | void CLogo::OnMouseButton(unsigned int msg, unsigned int wParam, int rx, int ry) { 87 | reinterpret_cast( 88 | C_LOGO_ON_MOUSE_BUTTON)(this, nullptr, msg, wParam, rx, ry); 89 | } 90 | 91 | int CLogo::OnSetFocus(int bFocus) { 92 | return reinterpret_cast( 93 | C_LOGO_ON_SET_FOCUS)(this, nullptr, bFocus); 94 | } 95 | 96 | void CLogo::OnKey(unsigned int wParam, unsigned int lParam) { 97 | reinterpret_cast( 98 | C_LOGO_ON_KEY)(this, nullptr, wParam, lParam); 99 | } -------------------------------------------------------------------------------- /common/IWzCanvas.h: -------------------------------------------------------------------------------- 1 | interface IWzRawCanvasAllocator; 2 | 3 | #undef INTERFACE 4 | #define INTERFACE IWzCanvas 5 | 6 | DECLARE_INTERFACE_(IWzCanvas, IWzSerialize) { 7 | BEGIN_INTERFACE 8 | 9 | // *** IUnknown methods *** 10 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 11 | 12 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 13 | 14 | STDMETHOD_(ULONG, Release)(THIS) PURE; 15 | 16 | // ** IWzCanvas methods *** 17 | 18 | STDMETHOD(GetdefaultDither)(THIS_ CANVAS_DITHERTYPE *) PURE; 19 | 20 | STDMETHOD(PutdefaultDither)(THIS_ CANVAS_DITHERTYPE) PURE; 21 | 22 | STDMETHOD(GetdefaultLevelMap)(THIS_ CANVAS_LEVELMAP *) PURE; 23 | 24 | STDMETHOD(PutdefaultLevelMap)(THIS_ CANVAS_LEVELMAP) PURE; 25 | 26 | STDMETHOD(GetdefaultAllocator)(THIS_ IWzRawCanvasAllocator **) PURE; 27 | 28 | STDMETHOD(PutdefaultAllocator)(THIS_ IWzRawCanvasAllocator *) PURE; 29 | 30 | STDMETHOD(Create)(THIS_ unsigned int, unsigned int, tagVARIANT, tagVARIANT) PURE; 31 | 32 | STDMETHOD(AddRawCanvas)(THIS_ int, int, IWzRawCanvas *) PURE; 33 | 34 | STDMETHOD(GetrawCanvas)(THIS_ int, int, IWzRawCanvas **) PURE; 35 | 36 | STDMETHOD(GettileWidth)(THIS_ unsigned int *) PURE; 37 | 38 | STDMETHOD(GettileHeight)(THIS_ unsigned int *) PURE; 39 | 40 | STDMETHOD(Getwidth)(THIS_ unsigned int *) PURE; 41 | 42 | STDMETHOD(Putwidth)(THIS_ unsigned int) PURE; 43 | 44 | STDMETHOD(Getheight)(THIS_ unsigned int *) PURE; 45 | 46 | STDMETHOD(Putheight)(THIS_ unsigned int) PURE; 47 | 48 | STDMETHOD(GetpixelFormat)(THIS_ CANVAS_PIXFORMAT *) PURE; 49 | 50 | STDMETHOD(PutpixelFormat)(THIS_ CANVAS_PIXFORMAT) PURE; 51 | 52 | STDMETHOD(GetmagLevel)(THIS_ int *) PURE; 53 | 54 | STDMETHOD(PutmagLevel)(THIS_ int) PURE; 55 | 56 | STDMETHOD(GetSnapshotU)(THIS_ unsigned int *, unsigned int *, unsigned int *, unsigned int *, CANVAS_PIXFORMAT *, int *) PURE; 57 | 58 | STDMETHOD(GetSnapshot)(THIS_ int *, int *, int *, int *, CANVAS_PIXFORMAT *, int *) PURE; 59 | 60 | STDMETHOD(Getproperty)(THIS_ IWzProperty **) PURE; 61 | 62 | STDMETHOD(Getcx)(THIS_ int *) PURE; 63 | 64 | STDMETHOD(Putcx)(THIS_ int) PURE; 65 | 66 | STDMETHOD(Getcy)(THIS_ int *) PURE; 67 | 68 | STDMETHOD(Putcy)(THIS_ int) PURE; 69 | 70 | STDMETHOD(SetClipRect)(THIS_ int, int, int, int, tagVARIANT, tagVARIANT *) PURE; 71 | 72 | STDMETHOD(Copy)(THIS_ int, int, IWzCanvas *, tagVARIANT) PURE; 73 | 74 | STDMETHOD(CopyEx)(THIS_ int, int, IWzCanvas *, CANVAS_ALPHATYPE, int, int, int, int, int, int, tagVARIANT) PURE; 75 | 76 | STDMETHOD(Getpixel)(THIS_ int, int, unsigned int *) PURE; 77 | 78 | STDMETHOD(DrawRectangle)(THIS_ int, int, unsigned int, unsigned int, unsigned int) PURE; 79 | 80 | STDMETHOD(DrawLine)(THIS_ int, int, int, int, unsigned int, tagVARIANT) PURE; 81 | 82 | STDMETHOD(DrawPolygon)(THIS) PURE; 83 | 84 | STDMETHOD(DrawText)(THIS_ int, int, wchar_t *, IWzFont *, tagVARIANT, tagVARIANT, unsigned int *) PURE; 85 | 86 | END_INTERFACE 87 | }; -------------------------------------------------------------------------------- /common/IWzVector2D.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IWzVector2D 3 | 4 | DECLARE_INTERFACE_(IWzVector2D, IWzShape2D) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IWzShape2D methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | STDMETHOD(GetpersistentUOL)(THIS_ wchar_t **) PURE; 15 | 16 | STDMETHOD(Serialize)(THIS_ IWzArchive *) PURE; 17 | 18 | STDMETHOD(Getitem)(THIS_ tagVARIANT, tagVARIANT *) PURE; 19 | 20 | STDMETHOD(GetNewEnum)(THIS_ IUnknown **) PURE; 21 | 22 | STDMETHOD(Getcount)(THIS_ unsigned int *) PURE; 23 | 24 | STDMETHOD(Getx)(THIS_ int *) PURE; 25 | 26 | STDMETHOD(Putx)(THIS_ int) PURE; 27 | 28 | STDMETHOD(Gety)(THIS_ int *) PURE; 29 | 30 | STDMETHOD(Puty)(THIS_ int) PURE; 31 | 32 | STDMETHOD(Getx2)(THIS_ int *) PURE; 33 | 34 | STDMETHOD(Putx2)(THIS_ int) PURE; 35 | 36 | STDMETHOD(Gety2)(THIS_ int *) PURE; 37 | 38 | STDMETHOD(Puty2)(THIS_ int) PURE; 39 | 40 | STDMETHOD(Move)(THIS_ int, int) PURE; 41 | 42 | STDMETHOD(Offset)(THIS_ int, int) PURE; 43 | 44 | STDMETHOD(Scale)(THIS_ int, int, int, int, int, int) PURE; 45 | 46 | STDMETHOD(Insert)(THIS_ tagVARIANT, tagVARIANT) PURE; 47 | 48 | STDMETHOD(Remove)(THIS_ tagVARIANT, tagVARIANT *) PURE; 49 | 50 | STDMETHOD(Init)(THIS_ int, int) PURE; 51 | 52 | // ** IWzVector2D methods *** 53 | 54 | STDMETHOD(GetcurrentTime)(THIS_ int *) PURE; 55 | 56 | STDMETHOD(PutcurrentTime)(THIS_ int) PURE; 57 | 58 | STDMETHOD(Getorigin)(THIS_ tagVARIANT *) PURE; 59 | 60 | STDMETHOD(Putorigin)(THIS_ tagVARIANT) PURE; 61 | 62 | STDMETHOD(Getrx)(THIS_ int *) PURE; 63 | 64 | STDMETHOD(Putrx)(THIS_ int) PURE; 65 | 66 | STDMETHOD(Getry)(THIS_ int *) PURE; 67 | 68 | STDMETHOD(Putry)(THIS_ int) PURE; 69 | 70 | STDMETHOD(Geta)(THIS_ long double *) PURE; 71 | 72 | STDMETHOD(Getra)(THIS_ long double *) PURE; 73 | 74 | STDMETHOD(Putra)(THIS_ long double) PURE; 75 | 76 | STDMETHOD(GetflipX)(THIS_ int *) PURE; 77 | 78 | STDMETHOD(put_flipX)(THIS_ int) PURE; 79 | 80 | STDMETHOD(GetSnapshot)(THIS_ int *, int *, int *, int *, int *, int *, long double *, long double *, tagVARIANT) PURE; 81 | 82 | STDMETHOD(RelMove)(THIS_ int, int, tagVARIANT, tagVARIANT) PURE; 83 | 84 | STDMETHOD(RelOffset)(THIS_ int, int, tagVARIANT, tagVARIANT) PURE; 85 | 86 | STDMETHOD(Ratio)(THIS_ IWzVector2D *, int, int, int, int) PURE; 87 | 88 | STDMETHOD(WrapClip)(THIS_ tagVARIANT, int, int, unsigned int, unsigned int, tagVARIANT) PURE; 89 | 90 | STDMETHOD(Rotate)(THIS_ long double, tagVARIANT) PURE; 91 | 92 | STDMETHOD(GetlooseLevel)(THIS_ unsigned int *) PURE; 93 | 94 | STDMETHOD(PutlooseLevel)(THIS_ unsigned int) PURE; 95 | 96 | STDMETHOD(Fly)(THIS_ tagVARIANT *, int) PURE; 97 | 98 | END_INTERFACE 99 | }; 100 | -------------------------------------------------------------------------------- /enable-minimize/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | // Exclude rarely-used stuff from Windows headers 12 | // Important to define this before Windows.h is included in a project because of linker issues with the WinSock2 lib 13 | #define WIN32_LEAN_AND_MEAN 14 | 15 | #include 16 | #include "logger.h" 17 | #include "hooker.h" 18 | 19 | /// 20 | /// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createwindowexa 21 | /// 22 | typedef HWND(WINAPI* CreateWindowExA_t)( 23 | DWORD dwExStyle, 24 | LPCSTR lpClassName, 25 | LPCSTR lpWindowName, 26 | DWORD dwStyle, 27 | int X, 28 | int Y, 29 | int nWidth, 30 | int nHeight, 31 | HWND hWndParent, 32 | HMENU hMenu, 33 | HINSTANCE hInstance, 34 | LPVOID lpParam 35 | ); 36 | extern CreateWindowExA_t CreateWindowExA_Original; 37 | 38 | CreateWindowExA_t CreateWindowExA_Original; 39 | 40 | /// 41 | /// Blocks the startup patcher "Play!" window and forces the login screen to be minimized 42 | /// 43 | HWND WINAPI CreateWindowExA_Hook( 44 | DWORD dwExStyle, 45 | LPCSTR lpClassName, 46 | LPCSTR lpWindowName, 47 | DWORD dwStyle, 48 | int X, 49 | int Y, 50 | int nWidth, 51 | int nHeight, 52 | HWND hWndParent, 53 | HMENU hMenu, 54 | HINSTANCE hInstance, 55 | LPVOID lpParam 56 | ) { 57 | Log("[CreateWindowExA] => %s - %s", lpClassName, lpWindowName); 58 | dwExStyle = 0; 59 | dwStyle |= WS_MINIMIZEBOX; // enable minimize button 60 | return CreateWindowExA_Original(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); 61 | } 62 | 63 | // main thread 64 | DWORD WINAPI MainProc(LPVOID lpParam) { 65 | INITWINHOOK("USER32", "CreateWindowExA", CreateWindowExA_Original, CreateWindowExA_t, CreateWindowExA_Hook); 66 | return 0; 67 | } 68 | 69 | // dll entry point 70 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { 71 | switch (ul_reason_for_call) { 72 | case DLL_PROCESS_ATTACH: { 73 | DisableThreadLibraryCalls(hModule); 74 | CreateThread(nullptr, 0, &MainProc, nullptr, 0, nullptr); 75 | break; 76 | } 77 | } 78 | return TRUE; 79 | } -------------------------------------------------------------------------------- /common/Common.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #pragma once 12 | 13 | // Exclude rarely-used stuff from Windows headers 14 | // Important to define this before Windows.h is included in a project because of linker issues with the WinSock2 lib 15 | #define WIN32_LEAN_AND_MEAN 16 | 17 | #include 18 | #include 19 | #include "hooker.h" 20 | #include "logger.h" 21 | #include "winhooks.h" 22 | #include "winhook_types.h" 23 | #include "FakeModule.h" 24 | 25 | #define MAPLE_MULTICLIENT TRUE 26 | 27 | /// 28 | /// 29 | /// 30 | class Common { 31 | private: 32 | struct Config { 33 | public: 34 | const char *MapleMutex = "WvsClientMtx"; 35 | 36 | DWORD LocaleSpoofValue; 37 | DWORD SleepAfterUnpackDuration; 38 | 39 | Config() { 40 | LocaleSpoofValue = 0; 41 | SleepAfterUnpackDuration = 0; 42 | } 43 | }; 44 | 45 | private: 46 | static Common *_s_pInstance; 47 | static Common::Config *_s_pConfig; 48 | 49 | public: // public because all the C-style hooks have to access these members 50 | BOOL m_bThemidaUnpacked; 51 | FakeModule *m_pFakeHsModule; 52 | 53 | /// 54 | /// Gets called when mutex hook is triggered. 55 | /// 56 | std::function m_PostMutexFunc; 57 | 58 | private: // forcing the class to only have one instance, created through CreateInstance 59 | Common(BOOL bHookWinLibs, std::function pPostMutexFunc); 60 | 61 | Common() = delete; 62 | 63 | Common(const Common &) = delete; 64 | 65 | Common &operator=(const Common &) = delete; 66 | 67 | public: 68 | ~Common(); 69 | 70 | /// 71 | /// Function called from library hooks. 72 | /// Most of the time this should be triggered by the Mutex hook, however, in the case that 73 | /// the Mutex hook does not get triggered then this will be executed by CreateWindowExA 74 | /// for redundancy. The contents of this function will only be executed once, even if both 75 | /// Mutex and CreateWindow hooks are called properly. 76 | /// 77 | void OnThemidaUnpack(); 78 | 79 | public: 80 | static void CreateInstance(BOOL bHookWinLibs, std::function pMutexFunc) { 81 | if (_s_pInstance) return; 82 | 83 | _s_pInstance = new Common(bHookWinLibs, pMutexFunc); 84 | } 85 | 86 | static Common *GetInstance() { 87 | return _s_pInstance; 88 | } 89 | 90 | static Config *GetConfig() { 91 | if (!_s_pConfig) _s_pConfig = new Config(); 92 | 93 | return _s_pConfig; 94 | } 95 | }; 96 | 97 | -------------------------------------------------------------------------------- /common/ZMap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ZRecyclable.h" 3 | 4 | template 5 | class ZMap 6 | { 7 | public: 8 | struct _PAIR // ZMap::_PAIR 9 | { 10 | unsigned char gap0[4]; 11 | _PAIR* pNext; 12 | T key; 13 | V value; 14 | } ** m_apTable; 15 | 16 | private: 17 | size_t m_uTableSize; 18 | size_t m_uCount; 19 | size_t m_uAutoGrowEvery128; 20 | size_t m_uAutoGrowLimit; 21 | 22 | public: 23 | ZMap() 24 | { 25 | this->m_apTable = nullptr; 26 | this->m_uTableSize = 0; 27 | this->m_uCount = 0; 28 | this->m_uAutoGrowEvery128 = 0; 29 | this->m_uAutoGrowLimit = 0; 30 | } 31 | 32 | ZMap(size_t uHashTableSize, size_t uAutoGrowEvery128) 33 | { 34 | this->m_apTable = nullptr; 35 | this->m_uTableSize = uHashTableSize; 36 | this->m_uCount = 0; 37 | 38 | this->CalcAutoGrow(uAutoGrowEvery128); 39 | } 40 | 41 | virtual ~ZMap() 42 | { 43 | this->RemoveAll(); 44 | } 45 | 46 | _PAIR* GetHeadPosition() 47 | { 48 | _PAIR** apTable = this->m_apTable; 49 | 50 | if (!apTable) return nullptr; 51 | 52 | _PAIR** pTableEnd = &apTable[this->m_uTableSize]; 53 | 54 | if (apTable >= pTableEnd) return nullptr; 55 | 56 | while (!*apTable) 57 | { 58 | apTable += 1; 59 | if (apTable >= pTableEnd) return nullptr; 60 | } 61 | return *apTable; 62 | } 63 | 64 | _PAIR* GetPos() 65 | { 66 | 67 | } 68 | 69 | U* GetAt(const T* key) 70 | { 71 | ZMap::_PAIR** v3; // esi 72 | ZMap::_PAIR* v5; // esi 73 | 74 | v3 = this->m_apTable; 75 | 76 | if (!v3) return 0; 77 | 78 | v5 = v3[_rotr(*key, 5) % this->m_uTableSize]; 79 | 80 | if (!v5) return 0; 81 | 82 | while (v5->key != *key) 83 | { 84 | v5 = v5->pNext; 85 | 86 | if (!v5) return 0; 87 | } 88 | 89 | // we are gonna skip the copying for now 90 | //if (value) ZRef::operator=(value, &v5->value); 91 | 92 | return &v5->value; 93 | } 94 | 95 | _PAIR* GetNext() 96 | { 97 | 98 | } 99 | 100 | _PAIR* Insert() 101 | { 102 | 103 | } 104 | 105 | void RemoveAll() 106 | { 107 | 108 | } 109 | 110 | BOOL RemoveKey() 111 | { 112 | 113 | } 114 | 115 | private: 116 | void ResizeHashTable(size_t uHashTableSize, size_t uAutoGrowEvery128) 117 | { 118 | 119 | } 120 | 121 | void CalcAutoGrow(size_t uAutoGrowEvery128) 122 | { 123 | if (uAutoGrowEvery128) 124 | { 125 | this->m_uAutoGrowEvery128 = uAutoGrowEvery128; 126 | } 127 | if (this->m_uAutoGrowEvery128 == -1) 128 | { 129 | this->m_uAutoGrowLimit = -1; 130 | } 131 | else 132 | { 133 | this->m_uAutoGrowLimit = this->m_uAutoGrowEvery128 * this->m_uTableSize >> 7; 134 | } 135 | } 136 | }; 137 | 138 | assert_size(sizeof(ZMap::_PAIR), 0x10) 139 | assert_size(sizeof(ZMap), 0x18) -------------------------------------------------------------------------------- /common/memedit.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #pragma once 12 | #include 13 | #include 14 | 15 | #include "asserts.h" 16 | 17 | // thanks raj for some of these 18 | 19 | #define x86CMPEAX 0x3D 20 | #define x86XOR 0x33 21 | #define x86EAXEAX 0xC0 22 | #define x86RET 0xC3 23 | #define x86JMP 0xE9 24 | #define x86CALL 0xE8 25 | #define x86NOP 0x90 26 | 27 | 28 | class MemEdit { 29 | private: 30 | 31 | // need to pack this so it doesnt auto-align to 8 bytes 32 | #pragma pack(1) 33 | typedef struct patch_call 34 | { 35 | BYTE nPatchType; 36 | DWORD dwAddress; 37 | } patch_far_jmp; 38 | #pragma pack() 39 | assert_size(sizeof(patch_call), 0x5); 40 | 41 | public: 42 | static BOOL PatchRetZero(DWORD dwAddress); 43 | static BOOL PatchJmp(DWORD dwAddress, PVOID pDestination); 44 | static BOOL PatchCall(DWORD dwAddress, PVOID pDestination); 45 | static BOOL PatchNop(DWORD dwAddress, UINT nCount); 46 | static BOOL WriteBytes(DWORD dwAddress, LPCVOID pData, UINT nCount); 47 | 48 | static void FillBytes(DWORD dwOriginAddress, unsigned char ucValue, int nCount); 49 | static void WriteByte(DWORD dwOriginAddress, unsigned char ucValue); 50 | static void WriteInt(DWORD dwOriginAddress, unsigned int dwValue); 51 | static void CodeCave(void* ptrCodeCave, DWORD dwOriginAddress, int nNOPCount); 52 | 53 | /// 54 | /// Attempts to (over)write a value to the specified location in memory. 55 | /// 56 | /// Type that will be written 57 | /// Address to write to 58 | /// Pointer to the value to be written 59 | /// True if write operation was successful, otherwise false. 60 | template 61 | static BOOL WriteValue(DWORD dwAddress, TType* pValue) 62 | { 63 | // https://stackoverflow.com/a/13026295/14784253 64 | DWORD dwOldValue, dwTemp; 65 | 66 | VirtualProtect((LPVOID)dwAddress, sizeof(TType), PAGE_EXECUTE_READWRITE, &dwOldValue); 67 | BOOL bSuccess = WriteProcessMemory(GetCurrentProcess(), (LPVOID)dwAddress, (void*)pValue, sizeof(TType), NULL); 68 | VirtualProtect((LPVOID)dwAddress, sizeof(TType), dwOldValue, &dwTemp); 69 | return bSuccess; 70 | } 71 | 72 | /// 73 | /// Reads the value at the given memory location and returns a pointer to it. 74 | /// 75 | /// Type that will be read 76 | /// 77 | /// Pointer to the value at the given location 78 | template 79 | static TType* ReadValue(DWORD dwAddr) 80 | { 81 | return reinterpret_cast(dwAddr); 82 | } 83 | }; -------------------------------------------------------------------------------- /common/CWvsApp.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | CWvsApp *CWvsApp::GetInstance() { 4 | return reinterpret_cast(*reinterpret_cast(C_WVS_APP_INSTANCE_ADDR)); 5 | } 6 | 7 | void CWvsApp::ISMsgProc(unsigned int message, unsigned int wParam, int lParam) { 8 | reinterpret_cast( 9 | C_WVS_APP_IS_MSG_PROC)(this, nullptr, message, wParam, lParam); 10 | } 11 | 12 | void CWvsApp::InitializeAuth() { 13 | Log("CWvsApp::InitializeAuth"); 14 | reinterpret_cast( 15 | C_WVS_APP_INITIALIZE_AUTH)(this, nullptr); 16 | } 17 | 18 | void CWvsApp::InitializePCOM() { 19 | Log("CWvsApp::InitializePCOM"); 20 | reinterpret_cast( 21 | C_WVS_APP_INITIALIZE_PCOM)(this, nullptr); 22 | } 23 | 24 | void CWvsApp::CreateMainWindow() { 25 | Log("CWvsApp::CreateMainWindow"); 26 | reinterpret_cast( 27 | C_WVS_APP_CREATE_MAIN_WINDOW)(this, nullptr); 28 | } 29 | 30 | void CWvsApp::ConnectLogin() { 31 | Log("CWvsApp::ConnectLogin"); 32 | reinterpret_cast( 33 | C_WVS_APP_CONNECT_LOGIN)(this, nullptr); 34 | } 35 | 36 | void CWvsApp::InitializeResMan() { 37 | Log("CWvsApp::InitializeResMan"); 38 | reinterpret_cast( 39 | C_WVS_APP_INITIALIZE_RES_MAN)(this, nullptr); 40 | } 41 | 42 | void CWvsApp::InitializeGr2D() { 43 | Log("CWvsApp::InitializeGr2D"); 44 | reinterpret_cast( 45 | C_WVS_APP_INITIALIZE_GR2D)(this, nullptr); 46 | } 47 | 48 | void CWvsApp::InitializeInput() { 49 | Log("CWvsApp::InitializeInput"); 50 | reinterpret_cast( 51 | C_WVS_APP_INITIALIZE_INPUT)(this, nullptr); 52 | } 53 | 54 | void CWvsApp::InitializeSound() { 55 | Log("CWvsApp::InitializeSound"); 56 | reinterpret_cast( 57 | C_WVS_APP_INITIALIZE_SOUND)(this, nullptr); 58 | } 59 | 60 | void CWvsApp::InitializeGameData() { 61 | Log("CWvsApp::InitializeGameData"); 62 | reinterpret_cast( 63 | C_WVS_APP_INITIALIZE_GAME_DATA)(this, nullptr); 64 | } 65 | 66 | void CWvsApp::CreateWndManager() { 67 | Log("CWvsApp::CreateWndManager"); 68 | reinterpret_cast( 69 | C_WVS_APP_CREATE_WND_MANAGER)(this, nullptr); 70 | } 71 | 72 | ZXString *CWvsApp::GetCmdLine(ZXString *result, int nArg) { 73 | return reinterpret_cast *(__fastcall *)(CWvsApp *, void *, ZXString *, int)>( 74 | C_WVS_APP_GET_CMD_LINE)(this, nullptr, result, nArg); 75 | } 76 | 77 | void CWvsApp::Dir_BackSlashToSlash(char *string) { 78 | reinterpret_cast( 79 | C_WVS_APP_DIR_BACK_SLASH_TO_SLASH)(string); 80 | } 81 | 82 | void CWvsApp::Dir_upDir(char *string) { 83 | reinterpret_cast( 84 | C_WVS_APP_DIR_UP_DIR)(string); 85 | } 86 | 87 | void CWvsApp::Dir_SlashToBackSlash(char *string) { 88 | reinterpret_cast( 89 | C_WVS_APP_DIR_SLASH_TO_BACK_SLASH)(string); 90 | } 91 | 92 | char *CWvsApp::GetExceptionFileName() { 93 | return reinterpret_cast(C_WVS_APP_GET_EXCEPTION_FILE_NAME)(); 94 | } 95 | -------------------------------------------------------------------------------- /common/FontType.h: -------------------------------------------------------------------------------- 1 | enum FONT_TYPE : __int32 2 | { 3 | FONT_BASIC_WHITE = 0x0, 4 | FONT_BASIC_BLACK = 0x1, 5 | FONT_BASIC_GRAY = 0x2, 6 | FONT_BASIC_YELLOW = 0x3, 7 | FONT_BASIC_BLUE = 0x4, 8 | FONT_BASIC_SKYBLUE = 0x5, 9 | FONT_BASIC_RED = 0x6, 10 | FONT_BASIC_LIGHTGREEN = 0x7, 11 | FONT_BASIC_PINK = 0x8, 12 | FONT_BASIC_ORANGE = 0x9, 13 | FONT_BASIC_REDVIOLET = 0xA, 14 | FONT_BASIC_DIMBLUE = 0xB, 15 | FONT_BASIC_DIMRED = 0xC, 16 | FONT_BASIC_DIMGREEN = 0xD, 17 | FONT_BASIC_BROWN = 0xE, 18 | FONT_BASIC_LIGHTVIOLET = 0xF, 19 | FONT_BASIC_CYAN = 0x10, 20 | FONT_BASIC_LIGHTGRAY = 0x11, 21 | FONT_BASIC_DARKGRAY = 0x12, 22 | FONT_BASIC_DIMGRAY = 0x13, 23 | FONT_SMALL_BLACK = 0x14, 24 | FONT_SMALL_BLACK_B = 0x15, 25 | FONT_SMALL_WHITE = 0x16, 26 | FONT_SMALL_WHITE_B = 0x17, 27 | FONT_SMALL_GRAY = 0x18, 28 | FONT_SMALL_GRAY_B = 0x19, 29 | FONT_SMALL_WHITEGRAY = 0x1A, 30 | FONT_SMALL_WHITEGRAY_B = 0x1B, 31 | FONT_SMALL_BLUE = 0x1C, 32 | FONT_SMALL_BLUE_B = 0x1D, 33 | FONT_SMALL_SKYBLUE = 0x1E, 34 | FONT_SMALL_SKYBLUE_B = 0x1F, 35 | FONT_SMALL_DIMBLUE = 0x20, 36 | FONT_SMALL_DIMBLUE_B = 0x21, 37 | FONT_SMALL_RED = 0x22, 38 | FONT_SMALL_RED_B = 0x23, 39 | FONT_SMALL_DIMRED = 0x24, 40 | FONT_SMALL_DIMRED_B = 0x25, 41 | FONT_SMALL_REDVIOLET = 0x26, 42 | FONT_SMALL_REDVIOLET_B = 0x27, 43 | FONT_SMALL_ORANGE = 0x28, 44 | FONT_SMALL_ORANGE_B = 0x29, 45 | FONT_SMALL_DIMGREEN = 0x2A, 46 | FONT_SMALL_DIMGREEN_B = 0x2B, 47 | FONT_SMALL_YELLOW = 0x2C, 48 | FONT_SMALL_YELLOW_B = 0x2D, 49 | FONT_SMALL_LIGHTGREEN = 0x2E, 50 | FONT_SMALL_LIGHTGREEN_B = 0x2F, 51 | FONT_SMALL_DARKGRAY = 0x30, 52 | FONT_DLG_NORMAL = 0x31, 53 | FONT_DLG_BACK = 0x32, 54 | FONT_DLG_OUTLINE = 0x33, 55 | FONT_DLG_NORMAL_FIXED_W = 0x34, 56 | FONT_DLG_BACK_FIXED_W = 0x35, 57 | FONT_DLG_OUTLINE_FIXED_W = 0x36, 58 | FONT_NO_WHITE = 0x37, 59 | FONT_NO_BLACK = 0x38, 60 | FONT_NO_BLACK_SMALL = 0x39, 61 | FONT_NO_GRAY = 0x3A, 62 | FONT_NO_YELLOW = 0x3B, 63 | FONT_NO_WHITE_BA = 0x3C, 64 | FONT_NO_BLACK_BA = 0x3D, 65 | FONT_NO_BLUE = 0x3E, 66 | FONT_NO_RED = 0x3F, 67 | FONT_NO_BLUE_B = 0x40, 68 | FONT_NO_RED_B = 0x41, 69 | FONT_BIG_WHITE = 0x42, 70 | FONT_DISABLED_GRAY = 0x43, 71 | FONT_SMALL_DISABLED_GRAY = 0x44, 72 | FONT_BASIC_BLACK_B = 0x45, 73 | FONT_BASIC_BLUE_B = 0x46, 74 | FONT_BASIC_RED_B = 0x47, 75 | FONT_BASIC_BROWN_B = 0x48, 76 | FONT_SALE_RED = 0x49, 77 | FONT_SALE_DARKRED = 0x4A, 78 | FONT_STAN_WHITE = 0x4B, 79 | FONT_STAN_BLACK = 0x4C, 80 | FONT_STAN_BLUE = 0x4D, 81 | FONT_STAN_RED = 0x4E, 82 | FONT_STAN_ORANGE = 0x4F, 83 | FONT_STAN_WHITE_BA = 0x50, 84 | FONT_STAN_BLACK_BA = 0x51, 85 | FONT_PERSONALSHOP_1 = 0x52, 86 | FONT_PERSONALSHOP_2 = 0x53, 87 | FONT_PERSONALSHOP_3 = 0x54, 88 | FONT_PERSONALSHOP_4 = 0x55, 89 | FONT_PERSONALSHOP_5 = 0x56, 90 | FONT_PERSONALSHOP_6 = 0x57, 91 | FONT_PERSONALSHOP_1_s = 0x58, 92 | FONT_PERSONALSHOP_2_s = 0x59, 93 | FONT_PERSONALSHOP_3_s = 0x5A, 94 | FONT_PERSONALSHOP_4_s = 0x5B, 95 | FONT_PERSONALSHOP_5_s = 0x5C, 96 | FONT_PERSONALSHOP_6_s = 0x5D, 97 | FONT_DODOOMCHE_11_WHITE = 0x5E, 98 | FONT_DODOOMCHE_11_BLACK = 0x5F, 99 | FONT_DODOOMCHE_11_GRAY90 = 0x60, 100 | FONT_BASIC_BLACK_BIG = 0x61, 101 | FONT_NO = 0x62, 102 | }; 103 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release Workflow 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | tag: 7 | description: 'Tag for the release (e.g. 1.2.3)' 8 | required: true 9 | env: 10 | BUILD_TYPE: Release 11 | jobs: 12 | # 🏷️ Create the GitHub Release (run once) 13 | create_release: 14 | runs-on: ubuntu-latest 15 | outputs: 16 | upload_url: ${{ steps.create.outputs.upload_url }} 17 | steps: 18 | - name: Create GitHub Release 19 | id: create 20 | uses: actions/create-release@v1 21 | env: 22 | GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} 23 | with: 24 | tag_name: v${{ github.event.inputs.tag }} 25 | release_name: Release v${{ github.event.inputs.tag }} 26 | draft: false 27 | prerelease: false 28 | body: | 29 | Multi-region release for version v${{ github.event.inputs.tag }} 30 | # ⚙️ Matrix Build + Artifact Packaging 31 | build: 32 | needs: create_release 33 | runs-on: windows-latest 34 | strategy: 35 | matrix: 36 | config: 37 | - { region: GMS, major: 83, minor: 1 } 38 | - { region: GMS, major: 87, minor: 1 } 39 | - { region: GMS, major: 95, minor: 1 } 40 | - { region: GMS, major: 111, minor: 1 } 41 | - { region: JMS, major: 185, minor: 1 } 42 | name: Build ${{ matrix.config.region }} ${{ matrix.config.major }}.${{ matrix.config.minor }} 43 | steps: 44 | - name: Checkout 45 | uses: actions/checkout@v4 46 | - name: Set up MSVC 47 | uses: microsoft/setup-msbuild@v2.0.0 48 | - name: Set up CMake 49 | run: choco install cmake 50 | shell: pwsh 51 | - name: Configure CMake 52 | run: cmake -B build ` 53 | -G "Visual Studio 17" -A Win32 ` 54 | -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` 55 | -DBUILD_REGION=${{ matrix.config.region }} ` 56 | -DBUILD_MAJOR_VERSION=${{ matrix.config.major }} ` 57 | -DBUILD_MINOR_VERSION=${{ matrix.config.minor }} 58 | shell: pwsh 59 | - name: Build 60 | run: cmake --build build --config ${{ env.BUILD_TYPE }} 61 | - name: Package Artifacts 62 | run: cmake --build build --config ${{ env.BUILD_TYPE }} --target package_dlls 63 | - name: Upload Artifact 64 | uses: actions/upload-artifact@v4 65 | with: 66 | name: artifacts-${{ matrix.config.region }}-${{ matrix.config.major }}.${{ matrix.config.minor }} 67 | path: build/artifacts/ 68 | # 📦 Upload artifacts to the release 69 | upload: 70 | needs: [create_release, build] 71 | runs-on: ubuntu-latest 72 | strategy: 73 | matrix: 74 | config: 75 | - { region: GMS, major: 83, minor: 1 } 76 | - { region: GMS, major: 87, minor: 1 } 77 | - { region: GMS, major: 95, minor: 1 } 78 | - { region: GMS, major: 111, minor: 1 } 79 | - { region: JMS, major: 185, minor: 1 } 80 | name: Upload ${{ matrix.config.region }} ${{ matrix.config.major }}.${{ matrix.config.minor }} 81 | steps: 82 | - name: Download artifact 83 | uses: actions/download-artifact@v4 84 | with: 85 | name: artifacts-${{ matrix.config.region }}-${{ matrix.config.major }}.${{ matrix.config.minor }} 86 | path: release_build 87 | - name: Zip artifact 88 | run: zip -r artifact.zip ./release_build 89 | - name: Upload to GitHub Release 90 | uses: actions/upload-release-asset@v1 91 | env: 92 | GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} 93 | with: 94 | upload_url: ${{ needs.create_release.outputs.upload_url }} 95 | asset_path: ./artifact.zip 96 | asset_name: artifacts-${{ matrix.config.region }}-${{ matrix.config.major }}.${{ matrix.config.minor }}.zip 97 | asset_content_type: application/zip 98 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | project(gms_83_dll) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | # Required build flags 7 | set(BUILD_REGION "" CACHE STRING "Game region (e.g., GMS, JMS)") 8 | set(BUILD_MAJOR_VERSION "" CACHE STRING "Game version (e.g., 83, 185)") 9 | set(BUILD_MINOR_VERSION "" CACHE STRING "Game version (e.g., 1, 2)") 10 | 11 | # Validate 12 | if (NOT BUILD_REGION OR NOT BUILD_MAJOR_VERSION OR NOT BUILD_MINOR_VERSION) 13 | message(FATAL_ERROR "You must set all BUILD_REGION, BUILD_MAJOR_VERSION, BUILD_MINOR_VERSION") 14 | endif() 15 | 16 | # Include region+version-specific memory map 17 | set(MEMORY_MAP_FILE "${CMAKE_SOURCE_DIR}/memory_maps/${BUILD_REGION}/v${BUILD_MAJOR_VERSION}_${BUILD_MINOR_VERSION}.cmake") 18 | if (EXISTS ${MEMORY_MAP_FILE}) 19 | message(STATUS "Using memory map: ${MEMORY_MAP_FILE}") 20 | include(${MEMORY_MAP_FILE}) 21 | else() 22 | message(FATAL_ERROR "Memory map not found at: ${MEMORY_MAP_FILE}") 23 | endif() 24 | 25 | # Generate memory_map.h 26 | configure_file( 27 | ${CMAKE_SOURCE_DIR}/include/memory_map.h.in 28 | ${CMAKE_BINARY_DIR}/generated/memory_map.h 29 | ) 30 | 31 | # Define shared INTERFACE config for all subprojects 32 | add_library(build_config INTERFACE) 33 | 34 | # Set include path 35 | target_include_directories(build_config INTERFACE 36 | ${CMAKE_BINARY_DIR}/generated 37 | ) 38 | 39 | # Global compile definitions 40 | target_compile_definitions(build_config INTERFACE 41 | BUILD_REGION="${BUILD_REGION}" 42 | BUILD_MAJOR_VERSION=${BUILD_MAJOR_VERSION} 43 | BUILD_MINOR_VERSION=${BUILD_MINOR_VERSION} 44 | ) 45 | 46 | # Region macro for conditional compilation 47 | if (BUILD_REGION STREQUAL "GMS") 48 | target_compile_definitions(build_config INTERFACE REGION_GMS) 49 | elseif (BUILD_REGION STREQUAL "JMS") 50 | target_compile_definitions(build_config INTERFACE REGION_JMS) 51 | else() 52 | message(FATAL_ERROR "Unsupported region: ${BUILD_REGION}") 53 | endif() 54 | 55 | # Add subdirectories for each project 56 | add_subdirectory(bypass) 57 | add_subdirectory(enable-minimize) 58 | add_subdirectory(no-patcher) 59 | add_subdirectory(no-beginner-party-block) 60 | add_subdirectory(no-enter-mts-map-restriction) 61 | add_subdirectory(no-ad-balloon) 62 | add_subdirectory(proxy) 63 | add_subdirectory(redirect) 64 | add_subdirectory(skip-logo) 65 | add_subdirectory(window-mode) 66 | 67 | # Custom target to package DLLs into a tar archive 68 | add_custom_target(package_dlls 69 | COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/artifacts" 70 | COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/artifacts/edits" 71 | COMMAND ${CMAKE_COMMAND} -E copy "$" "${CMAKE_BINARY_DIR}/artifacts/edits/" 72 | COMMAND ${CMAKE_COMMAND} -E copy "$" "${CMAKE_BINARY_DIR}/artifacts/edits/" 73 | COMMAND ${CMAKE_COMMAND} -E copy "$" "${CMAKE_BINARY_DIR}/artifacts/edits/" 74 | COMMAND ${CMAKE_COMMAND} -E copy "$" "${CMAKE_BINARY_DIR}/artifacts/edits/" 75 | COMMAND ${CMAKE_COMMAND} -E copy "$" "${CMAKE_BINARY_DIR}/artifacts/edits/" 76 | COMMAND ${CMAKE_COMMAND} -E copy "$" "${CMAKE_BINARY_DIR}/artifacts/edits/" 77 | COMMAND ${CMAKE_COMMAND} -E copy "$" "${CMAKE_BINARY_DIR}/artifacts/" 78 | COMMAND ${CMAKE_COMMAND} -E copy "$" "${CMAKE_BINARY_DIR}/artifacts/edits/" 79 | COMMAND ${CMAKE_COMMAND} -E copy "$" "${CMAKE_BINARY_DIR}/artifacts/edits/" 80 | COMMAND ${CMAKE_COMMAND} -E copy "$" "${CMAKE_BINARY_DIR}/artifacts/edits/" 81 | COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/redirect/redirect.ini" "${CMAKE_BINARY_DIR}/artifacts/edits/" 82 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" 83 | COMMENT "Creating tar archive of DLL artifacts" 84 | ) -------------------------------------------------------------------------------- /common/GW_CharacterStat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | /* 5 | 00000000 GW_CharacterStat struc; (sizeof = 0xF9, copyof_1764) 6 | 00000000 dwCharacterID dd ? 7 | 00000004 sCharacterName db 13 dup(? ) 8 | 00000011 nGender db ? 9 | 00000012 nSkin db ? 10 | 00000013 nFace dd ? 11 | 00000017 nHair dd ? 12 | 0000001B aliPetLockerSN _LARGE_INTEGER 3 dup(? ) 13 | 00000033 _ZtlSecureTear_nLevel db 2 dup(? ) 14 | 00000035 _ZtlSecureTear_nLevel_CS dd ? 15 | 00000039 _ZtlSecureTear_nJob dw 2 dup(? ) 16 | 0000003D _ZtlSecureTear_nJob_CS dd ? 17 | 00000041 _ZtlSecureTear_nSTR dw 2 dup(? ) 18 | 00000045 _ZtlSecureTear_nSTR_CS dd ? 19 | 00000049 _ZtlSecureTear_nDEX dw 2 dup(? ) 20 | 0000004D _ZtlSecureTear_nDEX_CS dd ? 21 | 00000051 _ZtlSecureTear_nINT dw 2 dup(? ) 22 | 00000055 _ZtlSecureTear_nINT_CS dd ? 23 | 00000059 _ZtlSecureTear_nLUK dw 2 dup(? ) 24 | 0000005D _ZtlSecureTear_nLUK_CS dd ? 25 | 00000061 _ZtlSecureTear_nHP dd 2 dup(? ) 26 | 00000069 _ZtlSecureTear_nHP_CS dd ? 27 | 0000006D _ZtlSecureTear_nMHP dd 2 dup(? ) 28 | 00000075 _ZtlSecureTear_nMHP_CS dd ? 29 | 00000079 _ZtlSecureTear_nMP dd 2 dup(? ) 30 | 00000081 _ZtlSecureTear_nMP_CS dd ? 31 | 00000085 _ZtlSecureTear_nMMP dd 2 dup(? ) 32 | 0000008D _ZtlSecureTear_nMMP_CS dd ? 33 | 00000091 _ZtlSecureTear_nAP dw 2 dup(? ) 34 | 00000095 _ZtlSecureTear_nAP_CS dd ? 35 | 00000099 _ZtlSecureTear_nSP dw 2 dup(? ) 36 | 0000009D _ZtlSecureTear_nSP_CS dd ? 37 | 000000A1 _ZtlSecureTear_nEXP dd 2 dup(? ) 38 | 000000A9 _ZtlSecureTear_nEXP_CS dd ? 39 | 000000AD _ZtlSecureTear_nPOP dw 2 dup(? ) 40 | 000000B1 _ZtlSecureTear_nPOP_CS dd ? 41 | 000000B5 _ZtlSecureTear_nMoney dd 2 dup(? ) 42 | 000000BD _ZtlSecureTear_nMoney_CS dd ? 43 | 000000C1 _ZtlSecureTear_nTempEXP dd 2 dup(? ) 44 | 000000C9 _ZtlSecureTear_nTempEXP_CS dd ? 45 | 000000CD extendSP ExtendSP ? 46 | 000000E1 _ZtlSecureTear_dwPosMap dd 2 dup(? ) 47 | 000000E9 _ZtlSecureTear_dwPosMap_CS dd ? 48 | 000000ED nPortal db ? 49 | 000000EE nCheckSum dd ? 50 | 000000F2 nItemCountCheckSum db ? 51 | 000000F3 nPlaytime dd ? 52 | 000000F7 nSubJob dw ? 53 | 000000F9 GW_CharacterStat ends 54 | */ 55 | struct GW_CharacterStat { 56 | unsigned int dwCharacterID; 57 | char sCharacterName[13]; 58 | unsigned __int8 nGender; 59 | unsigned __int8 nSkin; 60 | int nFace; 61 | int nHair; 62 | _LARGE_INTEGER liPetLockerSN[3]; 63 | unsigned __int8 _ZtlSecureTear_nLevel[2]; 64 | unsigned int _ZtlSecureTear_nLevel_CS; 65 | __int16 _ZtlSecureTear_nJob[2]; 66 | unsigned int _ZtlSecureTear_nJob_CS; 67 | __int16 _ZtlSecureTear_nSTR[2]; 68 | unsigned int _ZtlSecureTear_nSTR_CS; 69 | __int16 _ZtlSecureTear_nDEX[2]; 70 | unsigned int _ZtlSecureTear_nDEX_CS; 71 | __int16 _ZtlSecureTear_nINT[2]; 72 | unsigned int _ZtlSecureTear_nINT_CS; 73 | __int16 _ZtlSecureTear_nLUK[2]; 74 | unsigned int _ZtlSecureTear_nLUK_CS; 75 | int _ZtlSecureTear_nHP[2]; 76 | unsigned int _ZtlSecureTear_nHP_CS; 77 | int _ZtlSecureTear_nMHP[2]; 78 | unsigned int _ZtlSecureTear_nMHP_CS; 79 | int _ZtlSecureTear_nMP[2]; 80 | unsigned int _ZtlSecureTear_nMP_CS; 81 | int _ZtlSecureTear_nMMP[2]; 82 | unsigned int _ZtlSecureTear_nMMP_CS; 83 | __int16 _ZtlSecureTear_nAP[2]; 84 | unsigned int _ZtlSecureTear_nAP_CS; 85 | __int16 _ZtlSecureTear_nSP[2]; 86 | unsigned int _ZtlSecureTear_nSP_CS; 87 | int _ZtlSecureTear_nEXP[2]; 88 | unsigned int _ZtlSecureTear_nEXP_CS; 89 | __int16 _ZtlSecureTear_nPOP[2]; 90 | unsigned int _ZtlSecureTear_nPOP_CS; 91 | int _ZtlSecureTear_nMoney[2]; 92 | unsigned int _ZtlSecureTear_nMoney_CS; 93 | int _ZtlSecureTear_nTempEXP[2]; 94 | unsigned int _ZtlSecureTear_nTempEXP_CS; 95 | ExtendSP extendSP; 96 | unsigned int _ZtlSecureTear_dwPosMap[2]; 97 | unsigned int _ZtlSecureTear_dwPosMap_CS; 98 | unsigned __int8 nPortal; 99 | int nCheckSum; 100 | unsigned __int8 nItemCountCheckSum; 101 | int nPlaytime; 102 | __int16 nSubJob; 103 | }; -------------------------------------------------------------------------------- /common/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: This is a precompiled header file. 2 | // Files listed below are compiled only once, improving build performance for future builds. 3 | // This also affects IntelliSense performance, including code completion and many code browsing features. 4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds. 5 | // Do not add files here that you will be updating frequently as this negates the performance advantage. 6 | 7 | //#ifndef PCH_H 8 | //#define PCH_H 9 | 10 | #include "framework.h" 11 | 12 | #include 13 | #include "unknwn.h" 14 | 15 | #include "comip.h" 16 | #include "comdef.h" 17 | #include "asserts.h" 18 | #include "logger.h" 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include "memory_map.h" 25 | 26 | #include "ZPair.h" 27 | #include "ZXString.h" 28 | #include "ZAllocBase.h" 29 | #include "ZAllocAnonSelector.h" 30 | #include "ZAllocStrSelector.h" 31 | #include "ZFatalSection.h" 32 | #include "ZAllocEx.h" 33 | #include "ZArray.h" 34 | #include "ZRefCounted.h" 35 | #include "ZRefCountedAccessor.h" 36 | #include "ZRecyclableAvBuffer.h" 37 | #include "ZRecyclable.h" 38 | #include "ZRefCountedDummy.h" 39 | #include "ZRef.h" 40 | #include "ZMap.h" 41 | #include "ZList.h" 42 | 43 | #include "IGObj.h" 44 | #include "IUIMsgHandler.h" 45 | 46 | #include "CInPacket.h" 47 | #include "INetMsgHandler.h" 48 | 49 | #include "DiDeviceInstanceA.h" 50 | #include "IDirectInputDevice8A.h" 51 | #include "IDirectInput8A.h" 52 | 53 | #include "FunckeyMapped.h" 54 | #include "IDraggable.h" 55 | 56 | #include "IWzArchive.h" 57 | #include "IWzSerialize.h" 58 | #include "CanvasDitherType.h" 59 | #include "CanvasLevelMap.h" 60 | #include "CanvasPixelFormat.h" 61 | #include "IWzRawCanvas.h" 62 | #include "IWzProperty.h" 63 | #include "CanvasAlphaType.h" 64 | #include "IWzFont.h" 65 | #include "IWzCanvas.h" 66 | #include "IWzRawCanvasAllocator.h" 67 | #include "IWzShape2D.h" 68 | #include "IWzVector2D.h" 69 | #include "LayerBlendType.h" 70 | #include "Gr2DAniType.h" 71 | #include "IWzGr2DLayer.h" 72 | #include "IWzGr2D.h" 73 | 74 | #include "CActionMan.h" 75 | 76 | #include "ZInetAddr.h" 77 | #include "ZSocketBuffer.h" 78 | #include "ZSocketBase.h" 79 | #include "CIOBufferManipulator.h" 80 | #include "COutPacket.h" 81 | #include "CClientSocket.h" 82 | 83 | #include "ConfigJoypad.h" 84 | #include "ConfigSysOpt.h" 85 | #include "ConfigGameOpt.h" 86 | #include "CConfig.h" 87 | 88 | #include "CRadioManager.h" 89 | #include "CMonsterBookMan.h" 90 | #include "CQuestMan.h" 91 | #include "CMapleTVMan.h" 92 | #include "CAnimationDisplayer.h" 93 | #include "CMacroSysMan.h" 94 | #include "CBattleRecordMan.h" 95 | #include "CFuncKeyMappedMan.h" 96 | #include "CQuickslotKeyMappedMan.h" 97 | #include "CStage.h" 98 | #include "CWvsPhysicalSpace2D.h" 99 | #include "CMapLoadable.h" 100 | 101 | #include "TSecType.h" 102 | 103 | #include "ExtendSP.h" 104 | #include "GW_CharacterStat.h" 105 | #include "AvatarLook.h" 106 | #include "AvatarData.h" 107 | #include "CAvatar.h" 108 | #include "CCtrlWnd.h" 109 | #include "CWnd.h" 110 | #include "CDialog.h" 111 | #include "CUIToolTip.h" 112 | #include "CCtrlButton.h" 113 | #include "CCtrlEdit.h" 114 | #include "CUILoginStart.h" 115 | #include "RecommendWorldMsg.h" 116 | #include "CFadeWnd.h" 117 | #include "CLogin.h" 118 | #include "CConnectionNoticeDlg.h" 119 | 120 | #include "CLogo.h" 121 | 122 | #include "IsMsg.h" 123 | #include "CInputSystem.h" 124 | 125 | #include "CSecurityClient.h" 126 | #include "CSystemInfo.h" 127 | #include "CUITitle.h" 128 | #include "CWndMan.h" 129 | #include "CWvsApp.h" 130 | 131 | #include "WebCookie.h" 132 | #include "CharacterData.h" 133 | #include "BasicStat.h" 134 | #include "SecondaryStat.h" 135 | #include "CTemporaryStatView.h" 136 | #include "ForcedStat.h" 137 | #include "PartyData.h" 138 | #include "GW_Friend.h" 139 | #include "PartySearchSetting.h" 140 | #include "CPartySearchRemoCon.h" 141 | #include "GuildData.h" 142 | #include "AllianceData.h" 143 | #include "CalcDamage.h" 144 | #include "CUIBattleRecord.h" 145 | #include "CWvsContext.h" 146 | 147 | 148 | #include "TSingleton.h" -------------------------------------------------------------------------------- /common/memedit.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of GMS-83-DLL. 3 | 4 | GMS-83-DLL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 5 | 6 | GMS-83-DLL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with Foobar. If not, see . 9 | */ 10 | 11 | #include "memedit.h" 12 | 13 | BOOL MemEdit::PatchRetZero(DWORD dwAddress) 14 | { 15 | BYTE bArr[3]; 16 | bArr[0] = x86XOR; 17 | bArr[1] = x86EAXEAX; 18 | bArr[2] = x86RET; 19 | 20 | // https://stackoverflow.com/a/13026295/14784253 21 | DWORD dwOldValue, dwTemp; 22 | 23 | VirtualProtect((LPVOID)dwAddress, sizeof(bArr), PAGE_EXECUTE_READWRITE, &dwOldValue); 24 | BOOL bSuccess = WriteProcessMemory(GetCurrentProcess(), (LPVOID)dwAddress, &bArr, sizeof(bArr), nullptr); 25 | VirtualProtect((LPVOID)dwAddress, sizeof(bArr), dwOldValue, &dwTemp); 26 | return bSuccess; 27 | } 28 | 29 | BOOL MemEdit::PatchJmp(DWORD dwAddress, PVOID pDestination) 30 | { 31 | patch_far_jmp pWrite = 32 | { 33 | x86JMP, 34 | (DWORD)pDestination - (dwAddress + sizeof(DWORD) + sizeof(BYTE)) 35 | }; 36 | 37 | // https://stackoverflow.com/a/13026295/14784253 38 | DWORD dwOldValue, dwTemp; 39 | 40 | VirtualProtect((LPVOID)dwAddress, sizeof(pWrite), PAGE_EXECUTE_READWRITE, &dwOldValue); 41 | BOOL bSuccess = WriteProcessMemory(GetCurrentProcess(), (LPVOID)dwAddress, &pWrite, sizeof(pWrite), nullptr); 42 | VirtualProtect((LPVOID)dwAddress, sizeof(pWrite), dwOldValue, &dwTemp); 43 | return bSuccess; 44 | } 45 | 46 | BOOL MemEdit::PatchCall(DWORD dwAddress, PVOID pDestination) 47 | { 48 | patch_call pWrite = 49 | { 50 | x86CALL, 51 | (DWORD)pDestination - (dwAddress + sizeof(DWORD) + sizeof(BYTE)) 52 | }; 53 | 54 | // https://stackoverflow.com/a/13026295/14784253 55 | DWORD dwOldValue, dwTemp; 56 | 57 | VirtualProtect((LPVOID)dwAddress, sizeof(pWrite), PAGE_EXECUTE_READWRITE, &dwOldValue); 58 | BOOL bSuccess = WriteProcessMemory(GetCurrentProcess(), (LPVOID)dwAddress, &pWrite, sizeof(pWrite), nullptr); 59 | VirtualProtect((LPVOID)dwAddress, sizeof(pWrite), dwOldValue, &dwTemp); 60 | return bSuccess; 61 | } 62 | 63 | BOOL MemEdit::PatchNop(DWORD dwAddress, UINT nCount) 64 | { 65 | BYTE* bArr = new BYTE[nCount]; 66 | 67 | for (UINT i = 0; i < nCount; i++) 68 | bArr[i] = x86NOP; 69 | 70 | // https://stackoverflow.com/a/13026295/14784253 71 | DWORD dwOldValue, dwTemp; 72 | 73 | VirtualProtect((LPVOID)dwAddress, nCount, PAGE_EXECUTE_READWRITE, &dwOldValue); 74 | BOOL bSuccess = WriteProcessMemory(GetCurrentProcess(), (LPVOID)dwAddress, bArr, nCount, nullptr); 75 | VirtualProtect((LPVOID)dwAddress, nCount, dwOldValue, &dwTemp); 76 | return bSuccess; 77 | } 78 | 79 | void MemEdit::FillBytes(const DWORD dwOriginAddress, const unsigned char ucValue, const int nCount) { 80 | memset((void*)dwOriginAddress, ucValue, nCount); 81 | } 82 | 83 | void MemEdit::WriteByte(const DWORD dwOriginAddress, const unsigned char ucValue) { 84 | *(unsigned char*)dwOriginAddress = ucValue; 85 | } 86 | 87 | void MemEdit::WriteInt(const DWORD dwOriginAddress, const unsigned int dwValue) { 88 | *(unsigned int*)dwOriginAddress = dwValue; 89 | } 90 | 91 | void MemEdit::CodeCave(void* ptrCodeCave, const DWORD dwOriginAddress, const int nNOPCount) { 92 | __try { 93 | if (nNOPCount) PatchNop(dwOriginAddress, nNOPCount); 94 | BYTE jmp = x86JMP; 95 | WriteValue(dwOriginAddress, &jmp); 96 | INT ret = (int)(((int)ptrCodeCave - (int)dwOriginAddress) - 5); 97 | WriteValue(dwOriginAddress + 1, &ret); 98 | } 99 | __except (EXCEPTION_EXECUTE_HANDLER) {} 100 | } 101 | 102 | BOOL MemEdit::WriteBytes(DWORD dwAddress, LPCVOID pData, UINT nCount) 103 | { 104 | // https://stackoverflow.com/a/13026295/14784253 105 | DWORD dwOldValue, dwTemp; 106 | 107 | VirtualProtect((LPVOID)dwAddress, nCount, PAGE_EXECUTE_READWRITE, &dwOldValue); 108 | BOOL bSuccess = WriteProcessMemory(GetCurrentProcess(), (LPVOID)dwAddress, pData, nCount, nullptr); 109 | VirtualProtect((LPVOID)dwAddress, nCount, dwOldValue, &dwTemp); 110 | return bSuccess; 111 | } -------------------------------------------------------------------------------- /common/TSecType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | template 4 | struct TSecData 5 | { 6 | T data; 7 | unsigned char bKey; 8 | unsigned char FakePtr1; 9 | unsigned char FakePtr2; 10 | unsigned short wChecksum; 11 | }; 12 | 13 | template 14 | class TSecType 15 | { 16 | public: 17 | TSecType() 18 | { 19 | /* this->m_secdata = ZAllocEx(0x017E3E1C)->Alloc(12); */ 20 | this->m_secdata = reinterpret_cast*>(malloc(12)); 21 | 22 | this->FakePtr1 = static_cast(reinterpret_cast(&this[-0x00003FF8]) + rand()); 23 | this->FakePtr2 = static_cast(reinterpret_cast(&this[-0x00003FF8]) + rand()); 24 | 25 | this->m_secdata->FakePtr1 = static_cast(LOBYTE(this->FakePtr1)); 26 | this->m_secdata->FakePtr2 = static_cast(LOBYTE(this->FakePtr2)); 27 | 28 | this->SetData(0); 29 | } 30 | 31 | TSecType(T data) 32 | { 33 | /* this->m_secdata = ZAllocEx(0x017E3E1C)->Alloc(12); */ 34 | this->m_secdata = reinterpret_cast*>(malloc(12)); 35 | 36 | this->FakePtr1 = static_cast(reinterpret_cast(&this[-0x00003FF8]) + rand()); 37 | this->FakePtr2 = static_cast(reinterpret_cast(&this[-0x00003FF8]) + rand()); 38 | 39 | this->m_secdata->FakePtr1 = static_cast(LOBYTE(this->FakePtr1)); 40 | this->m_secdata->FakePtr2 = static_cast(LOBYTE(this->FakePtr2)); 41 | 42 | this->SetData(data); 43 | } 44 | 45 | ~TSecType() 46 | { 47 | if (this->m_secdata) 48 | { 49 | /* ZAllocEx(0x017E3E1C)->Free(this->m_secdata); */ 50 | free(this->m_secdata); 51 | } 52 | } 53 | 54 | T GetData() 55 | { 56 | T decrypted_data = 0; 57 | unsigned short checksum = 0; 58 | 59 | for (unsigned char i = 0, key = 0; i < (sizeof(T) + 1); i++) 60 | { 61 | key = (i == 0 ? this->m_secdata->bKey : reinterpret_cast(&this->m_secdata->data)[i - 1] + key + 42); 62 | 63 | if (i > 0) 64 | { 65 | checksum = (i > 1 ? ((8 * checksum) | (key + (checksum >> 13))) : ((key + 4) | 0xD328)); 66 | } 67 | 68 | if (i < sizeof(T)) 69 | { 70 | if (!key) 71 | { 72 | key = 42; 73 | } 74 | 75 | reinterpret_cast(&decrypted_data)[i] = reinterpret_cast(&this->m_secdata->data)[i] ^ key; 76 | } 77 | } 78 | 79 | if ((this->m_secdata->wChecksum != checksum) || (LOBYTE(this->FakePtr1) != this->m_secdata->FakePtr1) || (LOBYTE(this->FakePtr2) != this->m_secdata->FakePtr2)) 80 | { 81 | return 0; 82 | } 83 | 84 | return decrypted_data; 85 | } 86 | 87 | operator T() { return GetData(); } 88 | 89 | unsigned short SetData(T data) 90 | { 91 | this->m_secdata->bKey = static_cast(rand()); 92 | this->m_secdata->wChecksum = static_cast(39525); 93 | 94 | for (unsigned char i = 0, key = 0; i < (sizeof(T) + 1); i++) 95 | { 96 | key = (i == 0 ? this->m_secdata->bKey : (key ^ reinterpret_cast(&data)[i - 1]) + key + 42); 97 | 98 | if (i > 0) 99 | { 100 | this->m_secdata->wChecksum = ((8 * this->m_secdata->wChecksum) | (key + (this->m_secdata->wChecksum >> 13))); 101 | } 102 | 103 | if (i < sizeof(T)) 104 | { 105 | if (!key) 106 | { 107 | key = 42; 108 | } 109 | 110 | reinterpret_cast(&this->m_secdata->data)[i] = reinterpret_cast(&data)[i] ^ key; 111 | } 112 | } 113 | 114 | return this->m_secdata->wChecksum; 115 | } 116 | 117 | void TSecType::operator=(T rhs) { SetData(rhs); } 118 | 119 | private: 120 | unsigned int FakePtr1; 121 | unsigned int FakePtr2; 122 | TSecData* m_secdata; 123 | }; 124 | 125 | struct SECPOINT 126 | { 127 | TSecType y; 128 | TSecType x; 129 | 130 | operator POINT() { return{ x, y }; } 131 | }; -------------------------------------------------------------------------------- /common/IWzGr2DLayer.h: -------------------------------------------------------------------------------- 1 | #undef INTERFACE 2 | #define INTERFACE IWzGr2DLayer 3 | 4 | DECLARE_INTERFACE_(IWzGr2DLayer, IWzVector2D) { 5 | BEGIN_INTERFACE 6 | 7 | // *** IWzShape2D methods *** 8 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; 9 | 10 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; 11 | 12 | STDMETHOD_(ULONG, Release)(THIS) PURE; 13 | 14 | STDMETHOD(GetpersistentUOL)(THIS_ wchar_t **) PURE; 15 | 16 | STDMETHOD(Serialize)(THIS_ IWzArchive *) PURE; 17 | 18 | STDMETHOD(Getitem)(THIS_ tagVARIANT, tagVARIANT *) PURE; 19 | 20 | STDMETHOD(GetNewEnum)(THIS_ IUnknown **) PURE; 21 | 22 | STDMETHOD(Getcount)(THIS_ unsigned int *) PURE; 23 | 24 | STDMETHOD(Getx)(THIS_ int *) PURE; 25 | 26 | STDMETHOD(Putx)(THIS_ int) PURE; 27 | 28 | STDMETHOD(Gety)(THIS_ int *) PURE; 29 | 30 | STDMETHOD(Puty)(THIS_ int) PURE; 31 | 32 | STDMETHOD(Getx2)(THIS_ int *) PURE; 33 | 34 | STDMETHOD(Putx2)(THIS_ int) PURE; 35 | 36 | STDMETHOD(Gety2)(THIS_ int *) PURE; 37 | 38 | STDMETHOD(Puty2)(THIS_ int) PURE; 39 | 40 | STDMETHOD(Move)(THIS_ int, int) PURE; 41 | 42 | STDMETHOD(Offset)(THIS_ int, int) PURE; 43 | 44 | STDMETHOD(Scale)(THIS_ int, int, int, int, int, int) PURE; 45 | 46 | STDMETHOD(Insert)(THIS_ tagVARIANT, tagVARIANT) PURE; 47 | 48 | STDMETHOD(Remove)(THIS_ tagVARIANT, tagVARIANT *) PURE; 49 | 50 | STDMETHOD(Init)(THIS_ int, int) PURE; 51 | 52 | STDMETHOD(GetcurrentTime)(THIS_ int *) PURE; 53 | 54 | STDMETHOD(PutcurrentTime)(THIS_ int) PURE; 55 | 56 | STDMETHOD(Getorigin)(THIS_ tagVARIANT *) PURE; 57 | 58 | STDMETHOD(Putorigin)(THIS_ tagVARIANT) PURE; 59 | 60 | STDMETHOD(Getrx)(THIS_ int *) PURE; 61 | 62 | STDMETHOD(Putrx)(THIS_ int) PURE; 63 | 64 | STDMETHOD(Getry)(THIS_ int *) PURE; 65 | 66 | STDMETHOD(Putry)(THIS_ int) PURE; 67 | 68 | STDMETHOD(Geta)(THIS_ long double *) PURE; 69 | 70 | STDMETHOD(Getra)(THIS_ long double *) PURE; 71 | 72 | STDMETHOD(Putra)(THIS_ long double) PURE; 73 | 74 | STDMETHOD(GetflipX)(THIS_ int *) PURE; 75 | 76 | STDMETHOD(put_flipX)(THIS_ int) PURE; 77 | 78 | STDMETHOD(GetSnapshot)(THIS_ int *, int *, int *, int *, int *, int *, long double *, long double *, tagVARIANT) PURE; 79 | 80 | STDMETHOD(RelMove)(THIS_ int, int, tagVARIANT, tagVARIANT) PURE; 81 | 82 | STDMETHOD(RelOffset)(THIS_ int, int, tagVARIANT, tagVARIANT) PURE; 83 | 84 | STDMETHOD(Ratio)(THIS_ IWzVector2D *, int, int, int, int) PURE; 85 | 86 | STDMETHOD(WrapClip)(THIS_ tagVARIANT, int, int, unsigned int, unsigned int, tagVARIANT) PURE; 87 | 88 | STDMETHOD(Rotate)(THIS_ long double, tagVARIANT) PURE; 89 | 90 | STDMETHOD(GetlooseLevel)(THIS_ unsigned int *) PURE; 91 | 92 | STDMETHOD(PutlooseLevel)(THIS_ unsigned int) PURE; 93 | 94 | STDMETHOD(Fly)(THIS_ tagVARIANT *, int) PURE; 95 | 96 | // ** IWzGr2DLayer methods *** 97 | 98 | STDMETHOD(Getz)(THIS_ int *) PURE; 99 | 100 | STDMETHOD(Putz)(THIS_ int) PURE; 101 | 102 | STDMETHOD(Getwidth)(THIS_ int *) PURE; 103 | 104 | STDMETHOD(Putwidth)(THIS_ int) PURE; 105 | 106 | STDMETHOD(Getheight)(THIS_ int *) PURE; 107 | 108 | STDMETHOD(Putheight)(THIS_ int) PURE; 109 | 110 | STDMETHOD(Getlt)(THIS_ IWzVector2D **) PURE; 111 | 112 | STDMETHOD(Getrb)(THIS_ IWzVector2D **) PURE; 113 | 114 | STDMETHOD(InterlockedOffset)(THIS_ int, int, int, int) PURE; 115 | 116 | STDMETHOD(Getflip)(THIS_ int *) PURE; 117 | 118 | STDMETHOD(Putflip)(THIS_ int) PURE; 119 | 120 | STDMETHOD(Getcolor)(THIS_ unsigned int *) PURE; 121 | 122 | STDMETHOD(Putcolor)(THIS_ unsigned int) PURE; 123 | 124 | STDMETHOD(Getalpha)(THIS_ IWzVector2D **) PURE; 125 | 126 | STDMETHOD(GetredTone)(THIS_ IWzVector2D **) PURE; 127 | 128 | STDMETHOD(GetgreenBlueTone)(THIS_ IWzVector2D **) PURE; 129 | 130 | STDMETHOD(Getblend)(THIS_ LAYER_BLENDTYPE *) PURE; 131 | 132 | STDMETHOD(Putblend)(THIS_ LAYER_BLENDTYPE) PURE; 133 | 134 | STDMETHOD(Getoverlay)(THIS_ tagVARIANT *) PURE; 135 | 136 | STDMETHOD(Putoverlay)(THIS_ tagVARIANT) PURE; 137 | 138 | STDMETHOD(Getcanvas)(THIS_ tagVARIANT, IWzCanvas **) PURE; 139 | 140 | STDMETHOD(InsertCanvas)(THIS_ IWzCanvas *, tagVARIANT, tagVARIANT, tagVARIANT, tagVARIANT, tagVARIANT, tagVARIANT *) PURE; 141 | 142 | STDMETHOD(RemoveCanvas)(THIS_ tagVARIANT, IWzCanvas **) PURE; 143 | 144 | STDMETHOD(ShiftCanvas)(THIS_ tagVARIANT) PURE; 145 | 146 | STDMETHOD(Animate)(THIS_ GR2D_ANITYPE, tagVARIANT, tagVARIANT) PURE; 147 | 148 | STDMETHOD(GetanimationState)(THIS_ int *) PURE; 149 | 150 | STDMETHOD(Getvisible)(THIS_ int *) PURE; 151 | 152 | STDMETHOD(Putvisible)(THIS_ int) PURE; 153 | 154 | END_INTERFACE 155 | }; 156 | -------------------------------------------------------------------------------- /common/ZRef.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // ZRef is a smart pointer wrapper class that MapleStory uses to manage memory. 4 | // If the object passed to the ZRef template is a ZRefCounted object, it will treat it normally, 5 | // otherwise it will add ZRefCountedDummy as an additional wrapper level to simulate a 6 | // ZRefCounted derived class. 7 | 8 | template 9 | class ZRef : protected ZRefCountedAccessor, protected ZRefCountedAccessor> 10 | { 11 | private: 12 | BYTE gap0[1]; 13 | 14 | public: 15 | T* p; // TODO uhh maybe reconsider exposing this as public 16 | 17 | ZRef() 18 | { 19 | this->gap0[0] = NULL; 20 | this->p = nullptr; 21 | } 22 | 23 | ZRef(ZRefCounted* pT, BOOL bAddRef = TRUE) 24 | { 25 | this->gap0[0] = NULL; 26 | 27 | if (!pT) 28 | { 29 | this->p = nullptr; 30 | } 31 | else 32 | { 33 | this->p = reinterpret_cast(pT); 34 | 35 | if (bAddRef) 36 | { 37 | InterlockedIncrement(&pT->m_nRef); // (this->p - 12) 38 | } 39 | } 40 | } 41 | 42 | ZRef(ZRef* r) 43 | { 44 | ZRefCounted* pBase; 45 | this->gap0[0] = NULL; 46 | 47 | this->p = r->p; 48 | 49 | if (r->p) 50 | { 51 | pBase = r->GetBase(); 52 | 53 | InterlockedIncrement(&pBase->m_nRef); // (this->p - 12) 54 | } 55 | } 56 | 57 | ~ZRef() 58 | { 59 | this->ReleaseRaw(); 60 | } 61 | 62 | /// 63 | /// Allocate resources for encapsulated pointer and initialize type. 64 | /// 65 | void Alloc() 66 | { 67 | this->ReleaseRaw(); 68 | 69 | /* is_base_of was released in c++11, so maple did this some other way */ 70 | if (std::is_base_of()) 71 | { 72 | ZRefCounted* pAlloc = reinterpret_cast(new T()); 73 | 74 | pAlloc->m_nRef = 1; 75 | this->p = reinterpret_cast(pAlloc); 76 | } 77 | else 78 | { 79 | ZRefCountedDummy* pAlloc = new ZRefCountedDummy();// ZRefCounted_Alloc>(); 80 | 81 | pAlloc->m_nRef = 1; 82 | this->p = &pAlloc->t; 83 | } 84 | } 85 | 86 | /// 87 | /// Set this ZRef pointer equal to the given pointer. Only works for ZRefCounted types. 88 | /// 89 | ZRef* operator=(ZRefCounted* pT) 90 | { 91 | ZRef r; 92 | if (pT) 93 | { 94 | InterlockedIncrement(&pT->m_nRef); 95 | } 96 | 97 | T* old = this->p; 98 | this->p = reinterpret_cast(pT); 99 | r.p = old; // resources are automatically freed by compiler-generated destructor 100 | 101 | return this; 102 | } 103 | 104 | /// 105 | /// Set this ZRef equal to the given ZRef 106 | /// 107 | ZRef* operator=(ZRef* r) 108 | { 109 | ZRefCounted* pBase; 110 | 111 | if (r->p) 112 | { 113 | pBase = r->GetBase(); 114 | InterlockedIncrement(&pBase->m_nRef); 115 | } 116 | 117 | this->ReleaseRaw(); 118 | 119 | this->p = r->p; 120 | 121 | return this; 122 | } 123 | 124 | /// 125 | /// Release pointer resources. 126 | /// 127 | ZRef* operator=(int zero) 128 | { 129 | this->ReleaseRaw(); 130 | return this; 131 | } 132 | 133 | /// 134 | /// Fetch pointer to encapsulated object. 135 | /// 136 | operator T* () 137 | { 138 | return this->p; 139 | } 140 | 141 | /// 142 | /// Fetch pointer to encapsulated object. 143 | /// 144 | T* operator->() 145 | { 146 | return this->p; 147 | } 148 | 149 | /// 150 | /// Determine if encapsulated pointer is null. 151 | /// 152 | BOOL operator!() 153 | { 154 | return this->p == nullptr; 155 | } 156 | 157 | private: 158 | /// 159 | /// Decrement pointer reference count and release resources if references are zero. 160 | /// 161 | void ReleaseRaw() 162 | { 163 | if (!this->p) return; 164 | 165 | ZRefCounted* pBase = this->GetBase(); 166 | 167 | if (InterlockedDecrement(&pBase->m_nRef) <= 0) 168 | { 169 | InterlockedIncrement(&pBase->m_nRef); 170 | 171 | delete pBase; // if (v3) (**v3)(v3, 1); 172 | } 173 | 174 | this->p = nullptr; 175 | } 176 | 177 | /// 178 | /// Returns the associated ZRefCounted object pointer. 179 | /// 180 | ZRefCounted* GetBase() 181 | { 182 | ZRefCounted* pBase; 183 | 184 | /* is_base_of was released in c++11, so maple did this some other way */ 185 | if (std::is_base_of() || typeid(ZRefCounted) == typeid(T)) 186 | { 187 | pBase = reinterpret_cast(this->p); 188 | } 189 | else 190 | { 191 | pBase = reinterpret_cast(((char*)this->p) - (sizeof(ZRefCountedDummy) - sizeof(T))); 192 | 193 | static_assert(sizeof(ZRefCountedDummy) - sizeof(T) == 16, "Size is not expected value"); 194 | } 195 | 196 | return pBase; 197 | } 198 | }; 199 | 200 | assert_size(sizeof(ZRef), 0x08); -------------------------------------------------------------------------------- /memory_maps/GMS/v111_1.cmake: -------------------------------------------------------------------------------- 1 | set(VERSION_HEADER 8) 2 | 3 | set(PLAYER_LOGGED_IN 0x28) 4 | set(CLIENT_START_ERROR 0x2F) 5 | 6 | set(GET_SE_PRIVILEGE 0x0047BED0) 7 | 8 | set(C_ACTION_MAN_CREATE_INSTANCE_ADDR 0x00C04DC0) 9 | set(C_ACTION_MAN_INSTANCE_ADDR 0x0100227C) 10 | set(C_ACTION_MAN_INIT 0x0041F7E0) 11 | set(C_ACTION_MAN_SWEEP_CACHE 0x00419490) 12 | 13 | set(C_ANIMATION_DISPLAYER_CREATE_INSTANCE 0x00C04E40) 14 | 15 | set(C_CLIENT_SOCKET_INSTANCE_ADDR 0x01002624) 16 | set(C_CLIENT_SOCKET_CREATE_INSTANCE 0x00C04EC0) 17 | set(C_CLIENT_SOCKET_SEND_PACKET 0x004DB160) 18 | set(C_CLIENT_SOCKET_MANIPULATE_PACKET 0x004DB860) 19 | set(C_CLIENT_SOCKET_PROCESS_PACKET 0x004DB630) 20 | set(C_CLIENT_SOCKET_CLOSE 0x004D9FC0) 21 | set(C_CLIENT_SOCKET_CLEAR_SEND_RECEIVE_CTX 0x004D9860) 22 | set(C_CLIENT_SOCKET_ON_CONNECT 0x004DA820) 23 | set(C_CLIENT_SOCKET_CONNECT_LOGIN 0x004DB980) 24 | set(C_CLIENT_SOCKET_CONNECT_CTX 0x004DB7B0) 25 | set(C_CLIENT_SOCKET_CONNECT_ADR 0x004D9DE0) 26 | 27 | set(Z_SOCKET_BASE_CLOSE_SOCKET 0x004D8500) 28 | 29 | set(Z_SOCKET_BUFFER_ALLOC 0x004DA3D0) 30 | 31 | set(C_CONFIG 0x004E1F50) 32 | set(C_CONFIG_INSTANCE_ADDR 0x01006D74) 33 | set(C_CONFIG_GET_PARTNER_CODE 0x0066ADE0) 34 | set(C_CONFIG_APPLY_SYS_OPT 0x004DD9E0) 35 | set(C_CONFIG_CHECK_EXEC_PATH_REG 0x004E1030) 36 | set(C_CONFIG_SYS_OPT_WINDOWED_MODE 0x1006D8B) # TODO VERIFY 37 | 38 | set(C_FUNC_KEY_MAPPED_MAN 0x005DC110) 39 | set(C_FUNC_KEY_MAPPED_MAN_VFTABLE 0x00E903EC) 40 | set(C_FUNC_KEY_MAPPED_MAN_INSTANCE_ADDR 0x0100A1A0) 41 | set(C_FUNC_KEY_MAPPED_MAN_CREATE_INSTANCE 0x00C05030) 42 | 43 | set(DEFAULT_FKM_INSTANCE_ADDR 0x00FF2290) 44 | set(DEFAULT_QKM_INSTANCE_ADDR 0x00FF2450) 45 | 46 | set(C_INPUT_SYSTEM 0x00C071C0) 47 | set(C_INPUT_SYSTEM_CREATE_INSTANCE 0x00C09B30) 48 | set(C_INPUT_SYSTEM_INSTANCE_ADDR 0x010072E8) 49 | set(C_INPUT_SYSTEM_INIT 0x005E78B0) 50 | set(C_INPUT_SYSTEM_UPDATE_DEVICE 0x005E7460) 51 | set(C_INPUT_SYSTEM_GET_IS_MESSAGE 0x005E67E0) 52 | set(C_INPUT_SYSTEM_GENERATE_AUTO_KEY_DOWN 0x005E57E0) 53 | set(C_INPUT_SYSTEM_SHOW_CURSOR 0x005E5BB0) 54 | 55 | set(C_LOGIN_UPDATE 0x00675D20) 56 | set(C_LOGIN_SEND_CHECK_PASSWORD_PACKET 0x00672370) 57 | 58 | set(C_LOGO 0x006A7A70) 59 | set(C_LOGO_GET_RTTI 0x006A7AE0) 60 | set(C_LOGO_IS_KIND_OF 0x006A7B00) 61 | set(C_LOGO_UPDATE 0x006A9DB0) 62 | set(C_LOGO_ON_MOUSE_BUTTON 0x006A9C90) 63 | set(C_LOGO_ON_SET_FOCUS 0x006A7AD0) 64 | set(C_LOGO_ON_KEY 0x006A9C50) 65 | set(C_LOGO_LOGO_END 0x006A7BB0) 66 | set(C_LOGO_FORCED_END 0x006A9C10) 67 | set(C_LOGO_INIT 0x006A9B20) 68 | set(C_LOGO_INIT_NX_LOGO 0x000000) 69 | 70 | set(C_MACRO_SYS_MAN_CREATE_INSTANCE 0x00C050B0) 71 | 72 | set(C_BATTLE_RECORD_MAN_CREATE_INSTANCE 0x00C04CC0) 73 | 74 | set(C_MAPLE_TV_MAN_CREATE_INSTANCE 0x00C051A0) 75 | set(C_MAPLE_TV_MAN_INSTANCE_ADDR 0x0100A6D0) 76 | set(C_MAPLE_TV_MAN_INIT 0x006AF460) 77 | 78 | set(C_MONSTER_BOOK_MAN_CREATE_INSTANCE 0x00C0C580) 79 | set(C_MONSTER_BOOK_MAN_INSTANCE_ADDR 0x0100A2C4) 80 | set(C_MONSTER_BOOK_MAN_LOAD_BOOK 0x0071A900) 81 | 82 | set(C_OUT_PACKET 0x0074C290) 83 | set(C_OUT_PACKET_ENCODE_1 0x00418770) 84 | set(C_OUT_PACKET_ENCODE_2 0x00437860) 85 | set(C_OUT_PACKET_ENCODE_4 0x004187C0) 86 | set(C_OUT_PACKET_ENCODE_STR 0x004A9C20) 87 | set(C_OUT_PACKET_ENCODE_BUFFER 0x004A4410) 88 | 89 | set(C_QUEST_MAN_CREATE_INSTANCE 0x00C04C40) 90 | set(C_QUEST_MAN_INSTANCE_ADDR 0x0100A2C0) 91 | set(C_QUEST_MAN_LOAD_DEMAND 0x00790C30) 92 | set(C_QUEST_MAN_LOAD_PARTY_QUEST_INFO 0x00793790) 93 | set(C_QUEST_MAN_LOAD_EXCLUSIVE 0x00783E50) 94 | 95 | set(C_QUICKSLOT_KEY_MAPPED_MAN 0x00C05300) 96 | 97 | set(C_RADIO_MANAGER_CREATE_INSTANCE 0x00C05290) 98 | set(C_RADIO_MANAGER_INSTANCE_ADDR 0x0100761C) 99 | 100 | set(C_SECURITY_CLIENT_CREATE_INSTANCE 0x00C05120) 101 | set(C_SECURITY_CLIENT_INSTANCE_ADDR 0x010075D8) 102 | set(C_SECURITY_CLIENT_ON_PACKET 0x00C7B530) 103 | 104 | set(STAGE_INSTANCE_ADDR 0x0100BD2C) 105 | set(SET_STAGE 0x008125D0) 106 | 107 | set(GR_INSTANCE_ADDR 0x01013A30) 108 | 109 | set(RESET_LSP 0x0047CB70) 110 | 111 | set(C_STAGE_ON_MOUSE_ENTER 0x008114F0) 112 | set(C_STAGE_ON_PACKET 0x00813E40) 113 | 114 | set(C_SYSTEM_INFO 0x00C7FBB0) 115 | set(C_SYSTEM_INFO_INIT 0x00C7FBF0) 116 | set(C_SYSTEM_INFO_GET_GAME_ROOM_CLIENT 0x00C7FFC0) 117 | set(C_SYSTEM_INFO_GET_MACHINE_ID 0x00C7FEC0) 118 | 119 | set(C_UI_TITLE_INSTANCE_ADDR 0x0100B260) 120 | 121 | set(G_DW_TARGET_OS 0x00FFFDB8) 122 | 123 | set(C_WVS_APP 0x00C0C600) 124 | set(C_WVS_APP_INSTANCE_ADDR 0x01002884) 125 | set(C_WVS_APP_IS_MSG_PROC 0x00C04A00) 126 | set(C_WVS_APP_INITIALIZE_AUTH 0x00C05D20) 127 | set(C_WVS_APP_INITIALIZE_PCOM 0x00C045B0) 128 | set(C_WVS_APP_CREATE_MAIN_WINDOW 0x00C0BCA0) 129 | set(C_WVS_APP_CONNECT_LOGIN 0x00C048F0) 130 | set(C_WVS_APP_INITIALIZE_RES_MAN 0x00C0A9A0) 131 | set(C_WVS_APP_INITIALIZE_GR2D 0x00C09520) 132 | set(C_WVS_APP_INITIALIZE_INPUT 0x00C09E40) 133 | set(C_WVS_APP_INITIALIZE_SOUND 0x00C0BE50) 134 | set(C_WVS_APP_INITIALIZE_GAME_DATA 0x00C0BE80) 135 | set(C_WVS_APP_CREATE_WND_MANAGER 0x00C04AF0) 136 | set(C_WVS_APP_GET_CMD_LINE 0x00C0C320) 137 | set(C_WVS_APP_DIR_BACK_SLASH_TO_SLASH 0x00C045E0) 138 | set(C_WVS_APP_DIR_UP_DIR 0x00C04640) 139 | set(C_WVS_APP_DIR_SLASH_TO_BACK_SLASH 0x00C04610) 140 | set(C_WVS_APP_GET_EXCEPTION_FILE_NAME 0x00C098C0) 141 | set(C_WVS_APP_CALL_UPDATE 0x00C06670) 142 | set(C_WVS_APP_RUN 0x00C07360) 143 | set(C_WVS_APP_SET_UP 0x00C0CAD0) 144 | 145 | set(C_WVS_CONTEXT_INSTANCE_ADDR 0x01002560) 146 | set(C_WVS_CONTEXT_ON_ENTER_GAME 0x00000000) # TODO do we still need these 147 | set(C_WVS_CONTEXT_ON_ENTER_GAME_OFFSET 0x00000000) # TODO do we still need these 148 | 149 | set(WIN_MAIN 0x00C033A0) 150 | set(WIN_MAIN_AD_BALLOON_CONDITIONAL 0x589) 151 | set(WIN_MAIN_PATCHER_OFFSET 0x37F) 152 | 153 | set(C_WND_MAN_S_UPDATE 0x00BEE510) 154 | set(C_WND_MAN_REDRAW_INVALIDATED_WINDOWS 0x00BEBD20) 155 | 156 | set(Z_ARRAY_REMOVE_ALL 0x00435E80) 157 | 158 | set(Z_X_STRING_GET_BUFFER 0x00430400) 159 | set(Z_X_STRING_TRIM_RIGHT 0x004A6300) 160 | set(Z_X_STRING_TRIM_LEFT 0x004A63C0) 161 | 162 | set(C_FIELD_SEND_JOIN_PARTY_MSG 0x00) 163 | set(C_FIELD_SEND_JOIN_PARTY_MSG_OFFSET 0x00) 164 | 165 | set(C_FIELD_SEND_CREATE_NEW_PARTY_MSG 0x00) 166 | set(C_FIELD_SEND_CREATE_NEW_PARTY_MSG_OFFSET 0x00) 167 | 168 | set(C_WVS_CONTEXT_SEND_MIGRATE_TO_ITC_REQUEST 0x00) 169 | set(C_WVS_CONTEXT_SEND_MIGRATE_TO_ITC_REQUEST_OFFSET 0x00) 170 | 171 | set(DR_CHECK 0x004D6ED0) 172 | set(CE_TRACER_RUN 0x00C02F10) 173 | set(SEND_HS_LOG 0x00C03290) -------------------------------------------------------------------------------- /memory_maps/GMS/v95_1.cmake: -------------------------------------------------------------------------------- 1 | set(VERSION_HEADER 8) 2 | 3 | set(PLAYER_LOGGED_IN 0x14) 4 | set(CLIENT_START_ERROR 0x1A) 5 | 6 | set(GET_SE_PRIVILEGE 0x0045E030) 7 | 8 | set(C_ACTION_MAN_CREATE_INSTANCE_ADDR 0x009C22A0) 9 | set(C_ACTION_MAN_INSTANCE_ADDR 0x00C63EAC) 10 | set(C_ACTION_MAN_INIT 0x0041BEB0) 11 | set(C_ACTION_MAN_SWEEP_CACHE 0x00415F60) 12 | 13 | set(C_ANIMATION_DISPLAYER_CREATE_INSTANCE 0x009C2320) 14 | 15 | set(C_CLIENT_SOCKET_INSTANCE_ADDR 0x00C64064) 16 | set(C_CLIENT_SOCKET_CREATE_INSTANCE 0x009C23A0) 17 | set(C_CLIENT_SOCKET_SEND_PACKET 0x004AF9F0) 18 | set(C_CLIENT_SOCKET_MANIPULATE_PACKET 0x004B0220) 19 | set(C_CLIENT_SOCKET_PROCESS_PACKET 0x004B00F0) 20 | set(C_CLIENT_SOCKET_CLOSE 0x004AE990) 21 | set(C_CLIENT_SOCKET_CLEAR_SEND_RECEIVE_CTX 0x004AE1A0) 22 | set(C_CLIENT_SOCKET_ON_CONNECT 0x004AEF10) 23 | set(C_CLIENT_SOCKET_CONNECT_LOGIN 0x004B0590) 24 | set(C_CLIENT_SOCKET_CONNECT_CTX 0x004B0340) 25 | set(C_CLIENT_SOCKET_CONNECT_ADR 0x004AE720) 26 | 27 | set(Z_SOCKET_BASE_CLOSE_SOCKET 0x004ACF30) 28 | 29 | set(Z_SOCKET_BUFFER_ALLOC 0x004AEDB0) 30 | 31 | set(C_CONFIG 0x004B6740) 32 | set(C_CONFIG_INSTANCE_ADDR 0x00C687AC) 33 | set(C_CONFIG_GET_PARTNER_CODE 0x005D5160) 34 | set(C_CONFIG_APPLY_SYS_OPT 0x004B2300) 35 | set(C_CONFIG_CHECK_EXEC_PATH_REG 0x004B5850) 36 | set(C_CONFIG_SYS_OPT_WINDOWED_MODE 0x00CA4708) # TODO update 37 | 38 | set(C_FUNC_KEY_MAPPED_MAN 0x00568710) 39 | set(C_FUNC_KEY_MAPPED_MAN_VFTABLE 0x00B4DE08) 40 | set(C_FUNC_KEY_MAPPED_MAN_INSTANCE_ADDR 0x00C6AAE4) 41 | set(C_FUNC_KEY_MAPPED_MAN_CREATE_INSTANCE 0x009C2510) 42 | 43 | set(DEFAULT_FKM_INSTANCE_ADDR 0x00C56910) 44 | set(DEFAULT_QKM_INSTANCE_ADDR 0x00C56AD0) 45 | 46 | set(C_INPUT_SYSTEM 0x009C5D60) 47 | set(C_INPUT_SYSTEM_CREATE_INSTANCE 0x009C7C30) 48 | set(C_INPUT_SYSTEM_INSTANCE_ADDR 0x00C68C20) 49 | set(C_INPUT_SYSTEM_INIT 0x00571A60) 50 | set(C_INPUT_SYSTEM_UPDATE_DEVICE 0x00571710) 51 | set(C_INPUT_SYSTEM_GET_IS_MESSAGE 0x005708F0) 52 | set(C_INPUT_SYSTEM_GENERATE_AUTO_KEY_DOWN 0x0056F990) 53 | set(C_INPUT_SYSTEM_SHOW_CURSOR 0x0056FD60) 54 | 55 | set(C_LOGIN_UPDATE 0x005DEE90) 56 | set(C_LOGIN_SEND_CHECK_PASSWORD_PACKET 0x005DB9D0) 57 | 58 | set(C_LOGO 0x0060BBC0) 59 | set(C_LOGO_GET_RTTI 0x0060BC30) 60 | set(C_LOGO_IS_KIND_OF 0x0060BC50) 61 | set(C_LOGO_UPDATE 0x0060E430) 62 | set(C_LOGO_ON_MOUSE_BUTTON 0x0060C550) 63 | set(C_LOGO_ON_SET_FOCUS 0x0060BC20) 64 | set(C_LOGO_ON_KEY 0x0060C510) 65 | set(C_LOGO_LOGO_END 0x0060BD00) 66 | set(C_LOGO_FORCED_END 0x0060BF80) 67 | set(C_LOGO_INIT 0x0060E240) 68 | set(C_LOGO_INIT_NX_LOGO 0x0060DAE0) 69 | 70 | set(C_MACRO_SYS_MAN_CREATE_INSTANCE 0x009C2590) 71 | 72 | set(C_BATTLE_RECORD_MAN_CREATE_INSTANCE 0x009C2220) 73 | 74 | set(C_MAPLE_TV_MAN_CREATE_INSTANCE 0x009C2680) 75 | set(C_MAPLE_TV_MAN_INSTANCE_ADDR 0x00C6AD68) 76 | set(C_MAPLE_TV_MAN_INIT 0x0060FBC0) 77 | 78 | set(C_MONSTER_BOOK_MAN_CREATE_INSTANCE 0x009CA820) 79 | set(C_MONSTER_BOOK_MAN_INSTANCE_ADDR 0x00C6AB6C) 80 | set(C_MONSTER_BOOK_MAN_LOAD_BOOK 0x00664C10) 81 | 82 | set(C_OUT_PACKET 0x0068D090) 83 | set(C_OUT_PACKET_ENCODE_1 0x00415360) 84 | set(C_OUT_PACKET_ENCODE_2 0x0042CA10) 85 | set(C_OUT_PACKET_ENCODE_4 0x004153B0) 86 | set(C_OUT_PACKET_ENCODE_STR 0x004841F0) 87 | set(C_OUT_PACKET_ENCODE_BUFFER 0x00482200) 88 | 89 | set(C_QUEST_MAN_CREATE_INSTANCE 0x009C21A0) 90 | set(C_QUEST_MAN_INSTANCE_ADDR 0x00C6AB68) 91 | set(C_QUEST_MAN_LOAD_DEMAND 0x006C3D60) 92 | set(C_QUEST_MAN_LOAD_PARTY_QUEST_INFO 0x006C5540) 93 | set(C_QUEST_MAN_LOAD_EXCLUSIVE 0x006B9670) 94 | 95 | set(C_QUICKSLOT_KEY_MAPPED_MAN 0x009C27E0) 96 | 97 | set(C_RADIO_MANAGER_CREATE_INSTANCE 0x009C2770) 98 | set(C_RADIO_MANAGER_INSTANCE_ADDR 0x00C68E44) 99 | 100 | set(C_SECURITY_CLIENT_CREATE_INSTANCE 0x009C2600) 101 | set(C_SECURITY_CLIENT_INSTANCE_ADDR 0x00C68E30) 102 | set(C_SECURITY_CLIENT_ON_PACKET 0x00A1AE80) 103 | 104 | set(STAGE_INSTANCE_ADDR 0x00C6B63C) 105 | set(SET_STAGE 0x00719C30) 106 | 107 | set(GR_INSTANCE_ADDR 0x00C6F430) 108 | 109 | set(RESET_LSP 0x0045ECD0) 110 | 111 | set(C_STAGE_ON_MOUSE_ENTER 0x00718AD0) 112 | set(C_STAGE_ON_PACKET 0x0071B0B0) 113 | 114 | set(C_SYSTEM_INFO 0x00A1F170) 115 | set(C_SYSTEM_INFO_INIT 0x00A1F1B0) 116 | set(C_SYSTEM_INFO_GET_GAME_ROOM_CLIENT 0x00A1F580) 117 | set(C_SYSTEM_INFO_GET_MACHINE_ID 0x00A1F480) 118 | 119 | set(C_UI_TITLE_INSTANCE_ADDR 0x00C6B198) 120 | 121 | set(G_DW_TARGET_OS 0x00C61A30) 122 | 123 | set(C_WVS_APP 0x009CA8A0) 124 | set(C_WVS_APP_INSTANCE_ADDR 0x00C64314) 125 | set(C_WVS_APP_IS_MSG_PROC 0x009C1CE0) 126 | set(C_WVS_APP_INITIALIZE_AUTH 0x009C3AD0) 127 | set(C_WVS_APP_INITIALIZE_PCOM 0x009C16C0) 128 | set(C_WVS_APP_CREATE_MAIN_WINDOW 0x009C74A0) 129 | set(C_WVS_APP_CONNECT_LOGIN 0x009C1B30) 130 | set(C_WVS_APP_INITIALIZE_RES_MAN 0x009C9540) 131 | set(C_WVS_APP_INITIALIZE_GR2D 0x009C7670) 132 | set(C_WVS_APP_INITIALIZE_INPUT 0x009C7E40) 133 | set(C_WVS_APP_INITIALIZE_SOUND 0x009CA170) 134 | set(C_WVS_APP_INITIALIZE_GAME_DATA 0x009C8440) 135 | set(C_WVS_APP_CREATE_WND_MANAGER 0x009C2060) 136 | set(C_WVS_APP_GET_CMD_LINE 0x009CA600) 137 | set(C_WVS_APP_DIR_BACK_SLASH_TO_SLASH 0x009C1710) 138 | set(C_WVS_APP_DIR_UP_DIR 0x009C17F0) 139 | set(C_WVS_APP_DIR_SLASH_TO_BACK_SLASH 0x009C1780) 140 | set(C_WVS_APP_GET_EXCEPTION_FILE_NAME 0x009C79A0) 141 | set(C_WVS_APP_CALL_UPDATE 0x009C5360) 142 | set(C_WVS_APP_RUN 0x009C5F00) 143 | set(C_WVS_APP_SET_UP 0x009CAFB0) 144 | 145 | set(C_WVS_CONTEXT_INSTANCE_ADDR 0x00C64068) 146 | set(C_WVS_CONTEXT_ON_ENTER_GAME 0x00A9898B) # TODO do we still need these 147 | set(C_WVS_CONTEXT_ON_ENTER_GAME_OFFSET 0x11) # TODO do we still need these 148 | 149 | set(WIN_MAIN 0x009BF7D0) 150 | set(WIN_MAIN_AD_BALLOON_CONDITIONAL 0xA0E) 151 | set(WIN_MAIN_PATCHER_OFFSET 0x241) 152 | 153 | set(C_WND_MAN_S_UPDATE 0x009B4B00) 154 | set(C_WND_MAN_REDRAW_INVALIDATED_WINDOWS 0x009B2340) 155 | 156 | set(Z_ARRAY_REMOVE_ALL 0x0042AAE0) 157 | 158 | set(Z_X_STRING_GET_BUFFER 0x0042C880) 159 | set(Z_X_STRING_TRIM_RIGHT 0x00481CB0) 160 | set(Z_X_STRING_TRIM_LEFT 0x00481D70) 161 | 162 | set(C_FIELD_SEND_JOIN_PARTY_MSG 0x005570DF) 163 | set(C_FIELD_SEND_JOIN_PARTY_MSG_OFFSET 0xA0) 164 | 165 | set(C_FIELD_SEND_CREATE_NEW_PARTY_MSG 0x00556EB0) 166 | set(C_FIELD_SEND_CREATE_NEW_PARTY_MSG_OFFSET 0xA4) 167 | 168 | set(C_WVS_CONTEXT_SEND_MIGRATE_TO_ITC_REQUEST 0x00AA7F49) 169 | set(C_WVS_CONTEXT_SEND_MIGRATE_TO_ITC_REQUEST_OFFSET 0xE9) 170 | 171 | set(DR_CHECK 0x004AB900) 172 | set(CE_TRACER_RUN 0x009BF370) 173 | set(SEND_HS_LOG 0x009BF6C0) --------------------------------------------------------------------------------