Back to legacygamers.net
WARPGATE

Login

CLoginMode state machine, packet handlers

Functions 61Code 45 KBAddresses 0x005C4CD0 to 0x00DB7F60
61 functions
AddressSizeNameDescription
0x005C4CD0139CLoginMode__InitServerNameStringInitializes/resets a std::string member variable for server name storage with exception handling via SEH frame.
0x005C526073CLoginMode__SetServerAddressInitializes login mode server address fields to zero and sets default "unknown" string value
0x005E3C8066CLoginMode__SetStateStringInitializes login mode state by clearing a flag at offset +5 and resetting the associated state string buffer.
0x00877560314UILoginWnd__InitUIInitializes login window UI by sending packet 0x271E, creating CUIEditBox text input (0xB8 char max) at (40, 142), and setting up child controls.
0x00D00BE0681Login__handle_charserver_list_packetParses character server list packet (0x18-byte entries), creates server objects, adds to linked list at DAT_015fbb6c, triggers char select UI.
0x00D00F202082Login__handle_ban_notificationProcesses ban notification packet from login server, displays ban reason/duration UI to player
0x00D01F30900CharSelect__populate_character_listPopulates character selection UI with character data entries; creates window 0xb0 (initial) or 0xb1-0xb3 (paginated); manages CItemOwner trade list.
0x00D026B01107CharSelect__populate_character_list_extPopulates character selection UI with extended character data (0x3f-byte entries) including equipment and stats from server response packets.
0x00D1DD40140ConnectionInfoVector__DestroyRangeDestroys a range of ConnectionInfo objects by iterating through their memory and destructing 5 std::string members per element using SEH.
0x00D1DFE0506ConnectionInfoVector__InsertReallocInserts ConnectionInfo element into vector with 1.5x growth reallocation, handling copy-construction and old element destruction.
0x00D1E260422CLoginMode__ConstructorInitializes CLoginMode instance with vtable, zeroes ~12KB memory, sets up std::strings for username/password, initializes UI state to 1
0x00D1E410370CLoginMode__ConnectionInfo_CopyConstructCopy constructor for CLoginMode::ConnectionInfo struct; initializes and copies 5 std::string members plus 2 scalar fields
0x00D1E590204CLoginMode__ConnectionInfo_InitInitializes ConnectionInfo structure with zero values and sentinel markers (0xf) for multiple string/buffer fields.
0x00D1E720121ConnectionInfoVector__ClearClears ConnectionInfo vector by destroying all elements and deallocating the aligned heap buffer.
0x00D1E7C0185CLoginMode__dtorDestructor for CLoginMode class; deallocates vectors, strings, and ConnectionInfo structures in SEH-protected order.
0x00D1E880122CLoginMode__ConnectionInfo_DestroyDestructs multiple std::string members of a ConnectionInfo structure, likely cleaning up hostname, port, and account data fields.
0x00D1E900206CLoginMode__DestructorCLoginMode destructor that cleans up connection vectors, strings, and conditionally deallocates the 0x6F7C-byte object.
0x00D1E9E026CLoginMode__OnRecvAccountIdExtracts account ID from login packet at offset+2, stores in this+0x6f28, transitions login state to 0x18
0x00D1EA0058CLoginMode__ShowLoadingScreenRecords login screen load timestamp and assigns localized loading message (msgID 0x3AC) to a string member.
0x00D1EC90152CLoginMode__HandleDeleteCharConfirmShows character deletion confirmation dialog; sends packet 0x1BF if confirmed, otherwise disconnects and sets login state to 3.
0x00D1ED70113PacketHandler__OnRecvLoginMessageExtracts variable-length login message string from packet buffer and assigns it to destination string object.
0x00D1EE9018PacketHandler__OnRecvLoginErrorWrapper that receives login error packet and delegates to CLoginMode to display error message UI.
0x00D1EEB0446CLoginMode__HandleServerNotificationDisplays server notification dialog with formatted timestamp, schedules timed event for duration-based UI dismissal.
0x00D1F310459CLoginMode__CheckExeHashComputes MD5 hash of executable and sends packet 0x204 to server for specific service/region configurations.
0x00D200A0471CLoginMode__HandleCharList_0x6BParses 0x6B packet from char server, stores auth tokens, unpacks CHARACTER_INFO2 entries into character list array, validates size.
0x00D20380450CLoginMode__HandleCharRenameResult_0x290Handles packet 0x290 character rename result; displays modal dialogs with localized messages for 7 outcome codes (success/errors).
0x00D205F0825CLoginMode__HandleCharListPage_0xB72Processes 0xB72 packet to append paged character list (0xAF-byte entries) to character array, validates sizes, handles delete timers.
0x00D20940299CLoginMode__HandleCharDeleteConfirmDisplays character deletion confirmation dialog; sends packet 0x28F with char ID if user confirms scheduled deletion.
0x00D20CB0196CLoginMode__HandleCharListNotify_0x448Processes packet 0x448 to update character list by copying CHARACTER_INFO2 entries to character storage buffer, updates count, transitions to character selection UI state.
0x00D20DD0590CLoginMode__HandleCharCreateResult_0x82AHandles 0x82A packet (character creation result); sets state flag on success, displays localized error dialogs for failure codes
0x00D21050435CLoginMode__HandleCharDeleteResult_0x82CHandles 0x82C packet response for character deletion: error (0x718 msg), success (clears delete timer, state=7), or denied (0x719 msg)
0x00D21210591CLoginMode__HandleCharDeleteReserve_0x828Handles 0x828 packet for character deletion reservation; sets delete timer or displays error/denial messages via UI dialog.
0x00D21F10668CLoginMode__HandlePinCodeResult_0xAE9Processes 0xAE9 PIN code response packet, handles PIN validation states and displays appropriate UI dialogs based on server response code.
0x00D221E0678CLoginMode__HandlePinCodeResult_0x8B9Handles 0x8B9 PIN code response packet; processes 9 cases (0-8) with retry counter, error messages, and UI state updates.
0x00D22550642CLoginMode__ShowLoginErrorMessageHandles login error packets (0x6A, 0x1393-0x13C8, 0x14B4-0x14B5), displays localized error dialogs, disconnects, then reconnects or sets state based on DAT_01602328.
0x00D23180440CLoginMode__ConnectToCharServerStores selected char server index, sends 0x2719 packet, copies server IP/port to globals, disconnects, sets state to 0xC (connecting).
0x00D23340692CLoginMode__ParseClientInfoConnectionParses a single connection entry from clientinfo.xml and populates connection info vector with display/address/balloon data.
0x00D23600969CLoginMode__ParseClientInfoConnectionsParses clientinfo.xml connection entries; populates CLoginMode connection vector with display/address/balloon data.
0x00D239E0526CLoginMode__HandleOTPServiceSelectHandles OTP service selection (0x2D/0x2E/0x2F), displays localized UI prompts, pushes selection to vector at +0x6F20
0x00D23C00432CLoginMode__HandleOTPError_0xACDHandles OTP error packet 0xACD by displaying localized error messages and disconnecting; special case 0x65 includes 21-byte token data
0x00D23E50184CLoginMode__HandleOTPError_GenericHandles generic OTP errors by displaying localized error dialogs, disconnecting, and transitioning login state to 3.
0x00D23F70241CLoginMode__HandleLoginNotifyErrorExtracts error code and message from login packet, displays error via ShowLoginErrorMessage, cleans up string buffer.
0x00D240808229CLoginMode__OnChangeStateCLoginMode::OnChangeState (vtable[7]). Large state machine function (~10KB). Stack frame 0x6C8 bytes. Jump table at 0xd267a4, byte table at 0xd26808. State 0→0xd24113 (init/bg), State 1→0xd24382 (license), State 2→0xd2449f (account select), State 3→0xd24921 (login window), State 4→0xd2550c (send login packet). EDI=this (CLoginMode). g_serviceType at 0x0159b810, g_passwordencrypt at 0x15ffcb2.
0x00D26C20438CLoginMode__UpdateUpdates login mode by processing network packets, UI messages, rendering windows, and handling resource/renderer state changes based on service type.
0x00D26DE0868CLoginMode__HandleUIMessageDispatches UI timeout messages (login, connection, char server) with configurable thresholds; shows dialogs or disconnects on expiry.
0x00D27190329CLoginMode__MainLoopMain loop for login mode state machine; processes state transitions, calls per-frame updates, and handles nProtect GameGuard errors.
0x00D272E0447CLoginMode__PerFrameUpdatePer-frame login mode update: processes network packets, UI messages, timed events, handles resolution changes, renders UI and cursor.
0x00D275605993CLoginMode__HandleNetworkPacketsCLoginMode::HandleNetworkPackets - Main packet dispatcher (~6KB). Reads from network buffer at 0x15e8198. Handles packets: 0x69-0x81 (login responses, char list), 0x1B5 (account info), 0x1BE (service type error), 0x28B (char server list), 0x290 (rename result), 0x2EB/0x73 (map connect), 0x448 (char list notify), 0x828/0x82A/0x82C/0x82D (char create/delete), 0x8B9/0x8BB/0x8BF/0x8C4/0x8C6/0x8D5 (pin code), 0xAC4/0xAC5/0xAC9/0xACA/0xACD/0xAD1/0xAE3/0xAE9 (OTP/extended), 0xB6F-0xB72 (char slots), 0xC05 (third-party auth), 0x1393-0x13C8/0x14B4-0x14B5 (extended error). Sets state via param_1+0xC.
0x00D293D0608CLoginMode__HandleAccountInfo_0x1B5Handles 0x1B5 packet to display account subscription status (unlimited/premium/admin/expiry) in modal dialog with 90s timeout.
0x00D296301719CLoginMode__HandleLoginError_0x81Handles 0x81 login error packet; switches on error code, retrieves localized messages, shows dialog, manages reconnection/registration flow.
0x00D29DF0487CLoginMode__SendLoginPacket_0x277Constructs and sends login packet 0x277 with credentials, client version, MAC address via NetBIOS, and local IP via gethostbyname.
0x00D29FE0323CLoginMode__SendNPLogReportSends UDP packet containing accountId + login token to nplog.ragnarok.co.id:6001 for logging purposes.
0x00D2A1303785CLoginMode__HandleWindowMsgDispatches UI window messages (0-23, 0x2713-0x2736) for login mode; handles credentials, OTP, and state transitions.
0x00D2B2B0103CLoginMode__CopyStringFieldCopies a string field to a login mode object's member variable at offset 0x9c, handling small string optimization.
0x00D2B3E022CLoginMode__SetGender_wrapperWrapper that calls CMode::SetGender and returns success status (1).
0x00D2B4001071CLoginMode__HandleCharServerError_0xAE3Handles character server error packet 0xAE3; processes error codes (0/500/600/700/900) with localized messages, play timer, and reconnect logic.
0x00D2B840982CLoginMode__HandleCharServerError_0xAD1Handles char server error packet 0xAD1; displays error messages for codes 0/400/500/600/700/800 and manages reconnection
0x00D2BC20634CLoginMode__HandleMapServerConnect_0x2EBProcesses map server connection packet (0x2EB): sets map coordinates/name, initializes game UI, logs connection to PingLog.txt, transitions to game mode.
0x00D2BF90415CLoginMode__HandleMapServerConnect_0x73Handles 0x73 map server connection packet: sets map coordinates, initializes session, creates UI window, logs connection details to PingLog.txt
0x00DB63D0344CLoginMode__LaunchProcessLaunches game client process with encrypted or plaintext login credentials via CreateProcessA
0x00DB7F60406CLoginMode__ApplyAIPatchBacks up AI folder, applies AI_patch updates, displays restart dialog, and relaunches the game client.