Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if _DEBUG
- static void*(*getNetMessageIDOrig)(void*, intptr_t);
- void tryPrintDescName(int descID);
- static void* getNetMessageID(void* outMessageID, intptr_t data) {
- void* retVal = getNetMessageIDOrig(outMessageID, data);
- intptr_t *netMessageID = (intptr_t*)*&outMessageID;
- int messageID = netMessageID[0];
- tryPrintDescName(messageID);
- return retVal;
- }
- typedef struct {
- char* messageName;
- int messageID;
- } MessageIDStruct;
- MessageIDStruct msgIDData[] = {
- { "CMsgTextChatStatusMSGID", 0 },
- { "msgScriptJoinMSGID", 1 },
- { "reassignConfirmMsgMSGID", 2 },
- { "MsgTransitionToGameNotifyMSGID", 3 },
- { "rlMsgSearchRequestMSGID", 4 },
- { "MsgBlacklistMSGID", 5 },
- { "cloneSyncMsgMSGID", 6 },
- { "MsgTransitionParametersMSGID", 7 },
- { "MsgTransitionToActivityStartMSGID", 8 },
- { "cxnRelayAddrChangedMsgMSGID", 9 },
- { "MsgCheckQueuedJoinRequestMSGID", 10 },
- { "msgRequestKickFromHostMSGID", 11 },
- { "MsgTransitionLaunchMSGID", 12 },
- { "MsgTransitionGamerInstructionMSGID", 13 },
- { "msgScriptVerifyHostMSGID", 14 },
- { "playerDataMsgMSGID", 15 },
- { "netIceSessionPingMSGID", 16 },
- { "MsgRadioStationSyncRequestMSGID", 17 },
- { "snMsgGamerMatchInfoRequestMSGID", 18 },
- { "PaddingMSGID19", 19 },
- { "rlSessionDetailResponseMSGID", 20 },
- { "MsgTransitionToActivityFinishMSGID", 21 },
- { "netIceSessionAnswerMSGID", 22 },
- { "PaddingMSGID23", 23 },
- { "msgScriptLeaveAckMSGID", 24 },
- { "nonPhysicalDataMsgMSGID", 25 },
- { "msgScriptHostRequestMSGID", 26 },
- { "CRoamingInitialBubbleMsgMSGID", 27 },
- { "msgScriptBotJoinAckMSGID", 28 },
- { "rlMsgQosProbeRequestMSGID", 29 },
- { "snMsgRequestGamerInfoMSGID", 30 },
- { "MsgRequestTransitionParametersMSGID", 31 },
- { "snMsgChangeSessionAttributesCmdMSGID", 32 },
- { "requestObjectIdsMsgMSGID", 33 },
- { "MsgCheckQueuedJoinRequestReplyMSGID", 34 },
- { "PaddingMSGID35", 35 },
- { "rlSessionDetailRequest@rageMSGID", 36 },
- { "snMsgSetInvitableCmdMSGID", 37 },
- { "MsgCheckQueuedJoinRequestInviteReplyMSGID", 38 },
- { "CMsgPackedEventsMSGID", 39 },
- { "MsgKickPlayerMSGID", 40 },
- { "reassignResponseMsgMSGID", 41 },
- { "MsgTransitionLaunchNotifyMSGID", 42 },
- { "unkMessageID__2bhMSGID", 43 },
- { "unkMessageID__2chMSGID", 44 },
- { "informObjectIdsMsgMSGID", 45 },
- { "snMsgHostLeftWhilstJoiningCmdMSGID", 46 },
- { "msgScriptMigrateHostMSGID", 47 },
- { "PaddingMSGID48", 48 },
- { "snMsgMigrateHostResponseMSGID", 49 },
- { "MsgTextMessageMSGID", 50 },
- { "CMsgPlayerIsTypingMSGID", 51 },
- { "reassignNegotiateMsgMSGID", 52 },
- { "msgScriptBotLeaveMSGID", 53 },
- { "CMsgVoiceStatusMSGID", 54 },
- { "msgScriptMigrateHostFailAckMSGID", 55 },
- { "snMsgRegisterForMatchRequestMSGID", 56 },
- { "MsgPlayerCardSyncMSGID", 57 },
- { "netComplaintMsg@rageMSGID", 58 },
- { "CMsgJoinRequestMSGID", 59 },
- { "MsgPlayerCardRequestMSGID", 60 },
- { "snMsgSessionAcceptChatMSGID", 61 },
- { "packedReliablesMSGID", 62 },
- { "snMsgEndMatchCmdMSGID", 63 },
- { "msgScriptVerifyHostAckMSGID", 64 },
- { "PaddingMSGID65", 65 },
- { "MsgReserveSlotsAckMSGID", 66 },
- { "msgScriptBotJoinMSGID", 67 },
- { "snMsgAddGamerToSessionCmdMSGID", 68 },
- { "msgScriptJoinHostAckMSGID", 69 },
- { "unkMessageID__46hMSGID", 70 },
- { "MsgRadioStationSyncMSGID", 71 },
- { "netIceSessionPong@rageMSGID", 72 },
- { "PaddingMSGID73", 73 },
- { "CMsgTextMessageMSGID", 74 },
- { "netIceSessionOffer@rageMSGID", 75 },
- { "msgScriptBotHandshakeAckMSGID", 76 },
- { "snMsgConfigRequestMSGID", 77 },
- { "msgScriptHandshakeMSGID", 78 },
- { "packedCloneSyncACKsMsgMSGID", 79 },
- { "CMsgPackedEventReliablesMsgsMSGID", 80 },
- { "CRoamingRequestBubbleMsgMSGID", 81 },
- { "MsgTransitionParameterStringMSGID", 82 },
- { "snMsgMigrateHostRequestMSGID", 83 },
- { "snMsgSessionMemberIdsMSGID", 84 },
- { "PaddingMSGID85", 85 },
- { "netTimeSyncMsgMSGID", 86 },
- { "msgScriptHandshakeAckMSGID", 87 },
- { "snMsgStartMatchCmdMSGID", 88 },
- { "CRoamingJoinBubbleAckMsgMSGID", 89 },
- { "MsgReserveSlotsMSGID", 90 },
- { "snMsgGamerMatchInfoResponseMSGID", 91 },
- { "msgScriptLeaveMSGID", 92 },
- { "msgScriptJoinAckMSGID", 93 },
- { "msgUpdate@netArrayManagerMSGID", 94 },
- { "msgSplitUpdateAck@netArrayManagerMSGID", 95 },
- { "CRoamingJoinBubbleMsgMSGID", 96 },
- { "snMsgJoinRequestMSGID", 97 },
- { "msgUpdateAck@netArrayManagerMSGID", 98 },
- { "MsgTransitionToGameStartMSGID", 99 },
- { "msgScriptBotHandshakeMSGID", 100 },
- { "PaddingMSGID101", 101 },
- { "snMsgRemoveGamersFromSessionCmdMSGID", 102 },
- { "PaddingMSGID103", 103 },
- { "snMsgRegisterForMatchResponseMSGID", 104 },
- { "msgScriptNewHostMSGID", 105 },
- { "snMsgJoinResponseMSGID", 106 },
- { "CMsgJoinResponseMSGID", 107 },
- { "rlMsgSearchResponseMSGID", 108 }
- };
- void tryPrintDescName(int descID) {
- int arrSize = sizeof(msgIDData) / sizeof(MessageIDStruct);
- if (descID > arrSize || descID < 0) return; //Can never be sure
- trace("tryPrintDescName: %s\n", msgIDData[descID].messageName);
- }
- #endif
- static HookFunction hookFunction([] ()
- {
- #if _DEBUG
- // find getNetMessageID funcs and replace the calls (not all of them just some, couldn't make a signature for all of them and didn't feel like hooking the function itself)
- auto getNetMessageIDs = hook::pattern("48 8D 54 24 ? 48 8D 4C 24 ? E8 ? ? ? ? BF ? ? ? ? 85 C0");
- if (getNetMessageIDs.size() > 0)
- {
- location = getNetMessageIDs.get(0).get<char>(0xA);
- hook::set_call(&getNetMessageIDOrig, location);
- for (int i = 0; i < getNetMessageIDs.size(); i++)
- {
- location = getNetMessageIDs.get(i).get<char>(0xA);
- hook::call(location, getNetMessageID);
- }
- }
- #endif
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement