Hey there!
Ill just copy here my post from somewhere else and add some additional stuff afterwards:
ve been working a bit on the 4.0.1 client the last week and managed it to get the basic features working. You can see some ingame screenshots here
Now of course id like to share those informations with you as im not interested in developing everything on my own. First of all ive to say that there is a mayor problem blizzard has "implemented". Its called SMSG_REDIRECT_CLIENT. From what I have reversed so far the client and server now use 2 connections to send packets on. On which connection a packet is sent the client determines using this function:
So sadly this is a fixed algorithm that cannot be influenced externally by the server. Unless the second connection is opened every packet for which GetConnectionIndex returns 1 gets queued until the connection gets opened. Opening the connection is done using the packet SMSG_REDIRECT_CLIENT where among other stuff 256 bytes of extremely secured data get transmitted including the ip and the port of the second connection. Now, what do i mean with "highly secured"? First: From the 256 bytes actually only 6 bytes contain the ip and the port. All the rest are verifiers about that data to make sure it cannot be changed while in the network (someone's paranoid?). That wouldnt be a problem. Problems start with encryption. Blizzard encrypts those 256 bytes using the RSA-algorithm. As you may know so far this algorithm is save under certain circumstances.Code:signed int __cdecl GetConnectionIndex(unsigned int packet) { ... result = ((unsigned int)(unsigned __int8)gConnectionIndices[(opcode & 0x1E0 | ((opcode & 0x800 | (opcode >> 1) & 0x7000) >> 2)) >> 5] >> ((unsigned __int8)(opcode & 1) | (unsigned __int8)((opcode >> 1) & 6))) & 1; return result; }
Some little theory about RSA:
First you choose two large prime numbers and multiply those numbers to get a big number (= n) (in our case the resulting number is 256 Bytes long (~= 616 decimal digits)). Now you calculate the eulers totient function (= phi) on that big number. For products of two prime numbers this function returns (p - 1)*(q - 1) and is therefore very easy to calculate. After you have phi(n) you have to find e and d (public and private key) to satisfy the following equation: (e * d) mod phi(n) = 1 where mod means modulo and e has no common divider with phi(n). Now we can use e and d in the following way:
encrypt = (data ^ e) mod n;
data = (encrypt ^ d) mod n;
In both cases ^ means not XOR but exponentation.
Where lies now our problem? We know n and we know d. We have no clue about e and no clue about p and q. If we know phi(n) we can easily calculate e from (e * d) mod phi(n) = 1 using extended euclidic algorithm but calculating phi(n) for such a big n without knowing p and q will take ages (it uses > 10^313 iterations where each iteration again uses many additions/divisions...). What i want to say: You cannot calculate e. Period. Without e you cannot encrypt the data so that decrypting it using the hardcoded n and d will return the data. You cannot send SMSG_REDIRECT_CLIENT, you cannot open the second connection. Problem!
After a nearly sleepless night ive created a crack which modifies the clients memory when at character list telling the client that the second connection is opened and moving the pointer of the first ServerConnection-object into the second ServerConnection. This makes it possible that all packets get sent using the first connection. But you see the issue: It needs modification of the client or its memory at runtime. The code is pretty simple:
Ok, but now lets get to more friendly stuffCode:private const uint gNetClient = 0x8A5C34; ... Memory mem = new Memory("WoW"); uint netClient = gNetClient + mem.Base; // dont forget to add Base cause of ASLR uint basePtr = mem.Read<uint>(netClient); uint ofs1 = basePtr + 0x464C; // bool QueuePacketsForConnection1; uint ofs2 = basePtr + 0x464D; // bool QueuePacketsForConnection2; uint ofs3 = basePtr + 0x461C; // ServerConnection* pConnection1; uint ofs4 = basePtr + 0x4620; // ServerConnection* pConnection2; byte val1 = mem.Read<byte>(ofs1); uint ptr1 = mem.Read<uint>(ofs3); mem.Write(ofs2, val1); // QueuePacketsForConnection2 = QueuePacketsForConnection1; mem.Write(ofs4, ptr1); // pConnection2 = pConnection1;. Heres a list of opcodes i can confirm so far:
Here are some more opcodes. They are dumped automatically, so i didnt test all of them (but some) and the algo seems to be correct:Code:SMSG_LOGIN_SETTIMESPEED = 0x0A10, // implemented CMSG_CHAR_CREATE = 0x2BF0, // implemented CMSG_CHAR_ENUM = 0x03F8, // implemented CMSG_CHAR_DELETE = 0x8A78, // implemented SMSG_CHAR_CREATE = 0xC211, // implemented SMSG_CHAR_ENUM = 0x429C, // implemented SMSG_CHAR_DELETE = 0x0278, // implemented CMSG_PLAYER_LOGIN = 0x1621, // implemented SMSG_NEW_WORLD = 0x4A5D, // implemented CMSG_NAME_QUERY = 0x4354, // implemented SMSG_NAME_QUERY_RESPONSE = 0x0A14, // implemented CMSG_CREATURE_QUERY = 0xE3D5, // implemented SMSG_CREATURE_QUERY_RESPONSE = 0x83B8, // implemented CMSG_CONTACT_LIST = 0x63D4, // implemented SMSG_CONTACT_LIST = 0x439C, // implemented SMSG_FRIEND_STATUS = 0xBF16, // implemented CMSG_ADD_FRIEND = 0xCAB1, // implemented CMSG_MESSAGECHAT = 0xFFFF, // not longer used in client! Instead it uses the following: CMSG_CHAT_MSG_SAY = 0x5200, // implemented { uint32 lang, string message } CMSG_CHAT_MSG_YELL = 0x7200, // implemented { uint32 lang, string message } SMSG_MESSAGECHAT = 0xBD0, // implemented SMSG_UPDATE_OBJECT = 0x8BF0, // implemented SMSG_DESTROY_OBJECT = 0xE310, // implemented MSG_MOVE_START_FORWARD = 0x0B31, // implemented MSG_MOVE_START_BACKWARD = 0x0B50, // implemented MSG_MOVE_STOP = 0x433C, // implemented MSG_MOVE_START_STRAFE_LEFT = 0xE395, // implemented MSG_MOVE_START_STRAFE_RIGHT = 0x6BF4, // implemented MSG_MOVE_STOP_STRAFE = 0xA31C, // implemented MSG_MOVE_JUMP = 0x0A39, // implemented MSG_MOVE_START_TURN_LEFT = 0xAA90, // implemented MSG_MOVE_START_TURN_RIGHT = 0x4BFC, // implemented MSG_MOVE_STOP_TURN = 0xC39D, // implemented MSG_MOVE_SET_RUN_MODE = 0xE339, // implemented MSG_MOVE_SET_WALK_MODE = 0x8A74, // implemented MSG_MOVE_FALL_LAND = 0xAA58, // implemented MSG_MOVE_HEARTBEAT = 0xB38, // implemented SMSG_TRIGGER_CINEMATIC = 0x6310, // implemented SMSG_SET_PROFICIENCY = 0x22D4, // implemented SMSG_ACTION_BUTTONS = 0xEB74, // implemented SMSG_INITIAL_SPELLS = 0xC2B0, // implemented SMSG_LEARNED_SPELL = 0xCAFC, // implemented SMSG_BINDPOINTUPDATE = 0xA255, // implemented CMSG_PLAYED_TIME = 0x8355, // implemented SMSG_PLAYED_TIME = 0x6BF8, // implemented SMSG_AUTH_CHALLENGE = 0x8500, // implemented CMSG_AUTH_SESSION = 0x3000, // implemented SMSG_AUTH_RESPONSE = 0xEB58, // implemented SMSG_EXPLORATION_EXPERIENCE = 0x8B58, // implemented SMSG_ACCOUNT_DATA_TIMES = 0x82B5, // implemented CMSG_UPDATE_ACCOUNT_DATA = 0xEB55, // implemented SMSG_PLAY_SOUND = 0xA2D1, // implemented SMSG_MOTD = 0x4394, // implemented SMSG_REALM_SPLIT = 0x4270, // implemented CMSG_REALM_SPLIT = 0xAB58, // implemented SMSG_TIME_SYNC_REQ = 0xA318, // implemented CMSG_CHAR_CUSTOMIZE = 0x250, /// TODO: implement SMSG_CHAR_CUSTOMIZE = 0xE2B5, /// TODO: implement CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0x6A99, SMSG_LFG_BOOT_PLAYER = 0x8399,
Feel free to use what you can use! And also feel free to contribute!Code:SMSG_MESSAGECHAT: BD0 SMSG_CHANNEL_NOTIFY: 6358 SMSG_CHANNEL_LIST: A5D SMSG_TEXT_EMOTE: 83D8 SMSG_ZONE_UNDER_ATTACK: 6215 SMSG_DEFENSE_MESSAGE: A27C SMSG_SERVER_MESSAGE: 221C SMSG_RAID_INSTANCE_MESSAGE: EB78 SMSG_INSTANCE_RESET: 2B34 SMSG_INSTANCE_RESET_FAILED: CAB8 SMSG_UPDATE_LAST_INSTANCE: 2B91 SMSG_UPDATE_INSTANCE_OWNERSHIP: CB5D SMSG_EXPTECTED_SPAM_RECORDS: ABDD SMSG_TITLE_EARNED: B91 SMSG_RESET_FAILED_NOTIFY: A258 SMSG_GM_MESSAGECHAT: E3B0 SMSG_XP_GAIN: C3BC SMSG_DURABILITY_DAMAGE_DEATH: BF0 SMSG_CHANNEL_MEMBER_COUNT: AAB1 SMSG_COMSAT_RECONNECT_TRY: 63F8 SMSG_COMSAT_DISCONNECT: CB71 SMSG_COMSAT_CONNECTION_FAILED: 4B59 SMSG_VOICE_CHAT_STATUS: 627D SMSG_USERLIST_ADD: C2FC SMSG_USERLIST_REMOVE: CBB9 SMSG_USERLIST_UPDATE: AA5C SMSG_COMSAT_VOICE_SESSION_FULL: CB90 SMSG_SERVER_FIRST_ACHIEVEMENT: CA10 SMSG_NOTIFICATION: A31 SMSG_PLAYED_TIME: 6BF8 SMSG_TRANSFER_PENDING: 6210 SMSG_TRANSFER_ABORTED: B55 SMSG_NEW_WORLD: 4A5D SMSG_KICK_REASON: 4A71 SMSG_START_MIRROR_TIMER: 6A54 SMSG_PAUSE_MIRROR_TIMER: A55 SMSG_STOP_MIRROR_TIMER: 2299 SMSG_GROUP_JOINED_BATTLEGROUND: 18 SMSG_MAIL_SEND_RESULT: E351 SMSG_MAIL_LIST_RESULT: ABD1 MSG_QUERY_NEXT_MAIL_TIME: A51 SMSG_RECEIVED_MAIL: 4A54 SMSG_MEETINGSTONE_COMPLETE: EA14 MSG_RAID_TARGET_UPDATE: B74 MSG_RAID_READY_CHECK: 82D0 MSG_RAID_READY_CHECK_CONFIRM: 2250 MSG_RAID_READY_CHECK_FINISHED: 82D5 SMSG_RAID_READY_CHECK_ERROR: CB50 MSG_NOTIFY_PARTY_SQUELCH: C39C SMSG_ECHO_PARTY_SQUELCH: A3DD SMSG_PLAY_DANCE: 8BBD SMSG_STOP_DANCE: CA50 SMSG_NOTIFY_DANCE: 223D SMSG_LEARNED_DANCE_MOVES: 22D5 SMSG_GOSSIP_MESSAGE: AB3D SMSG_GOSSIP_COMPLETE: 6BF9 SMSG_GOSSIP_POI: BD9 MSG_AUCTION_HELLO: 8371 SMSG_AUCTION_COMMAND_RESULT: AB5D SMSG_AUCTION_LIST_RESULT: 827C SMSG_AUCTION_OWNER_LIST_RESULT: 4B94 SMSG_AUCTION_BIDDER_LIST_RESULT: 42D5 SMSG_AUCTION_BIDDER_NOTIFICATION: 4250 SMSG_AUCTION_OWNER_NOTIFICATION: 42B5 SMSG_AUCTION_REMOVED_NOTIFICATION: 4379 SMSG_AUCTION_LIST_PENDING_SALES: E2F9 SMSG_PET_SPELLS: 63F1 SMSG_PET_LEARNED_SPELL: EA71 SMSG_PET_UNLEARNED_SPELL: 2ABD SMSG_PET_MODE: 6219 SMSG_PET_ACTION_FEEDBACK: 370 SMSG_PET_BROKEN: 6A71 SMSG_PET_RENAMEABLE: 22F8 SMSG_PET_UPDATE_COMBO_POINTS: 8BF5 SMSG_PET_GUIDS: 3F0 SMSG_CREATURE_QUERY_RESPONSE: 83B8 SMSG_NAME_QUERY_RESPONSE: A14 SMSG_GAMEOBJECT_QUERY_RESPONSE: 231 SMSG_NPC_TEXT_UPDATE: 8310 SMSG_GUILD_QUERY_RESPONSE: EA1D SMSG_QUEST_QUERY_RESPONSE: 2AD4 SMSG_PAGE_TEXT_QUERY_RESPONSE: 8A58 SMSG_PET_NAME_QUERY_RESPONSE: B1C SMSG_PETITION_QUERY_RESPONSE: 2A7D SMSG_ITEM_TEXT_QUERY_RESPONSE: 8210 SMSG_INVALIDATE_PLAYER: AAD5 SMSG_ARENA_TEAM_QUERY_RESPONSE: 23B0 SMSG_INVALIDATE_DANCE: 233C SMSG_DANCE_QUERY_RESPONSE: CB10 SMSG_WHO: E2D0 SMSG_WHOIS: AD9 SMSG_RWHOIS: C35D SMSG_CONTACT_LIST: 439C SMSG_FRIEND_STATUS: AB14 SMSG_ACCOUNT_DATA_TIMES: 82B5 SMSG_UPDATE_ACCOUNT_DATA: 63B9 SMSG_UPDATE_ACCOUNT_DATA_COMPLETE: 42D4 SMSG_CHECK_FOR_BOTS: 2BB9 SMSG_PERIODICAURALOG: C35C SMSG_ENCHANTMENTLOG: 435C SMSG_PARTYKILLLOG: CA39 SMSG_PROCRESIST: EBB0 SMSG_DISPEL_FAILED: 4BB5 SMSG_DESTRUCTIBLE_BUILDING_DAMAGE: E3D9 SMSG_GAMESPEED_SET: 2354 SMSG_LOGIN_SETTIMESPEED: A10 SMSG_GAMETIME_UPDATE: EBF0 SMSG_SERVERTIME: 8AD0 SMSG_GAMETIME_SET: E2BD SMSG_UPDATE_LAST_INSTANCE_CREATED: 2255 SMSG_POWERGAINLOG_OBSOLETE: 633C SMSG_ENABLE_BARBER_SHOP: 82D4 SMSG_BARBER_SHOP_RESULT: 42F9 SMSG_LFG_TIMEDOUT: 238 SMSG_LFG_OTHER_TIMEDOUT: B1D
Greetings
Cromon