示例#1
0
        static void Main(string[] args)
        {
            CSteamID qq = 133724098;


            if (!Steamworks.Load())
            {
                return;
            }

            ISteamClient008 steamclient = Steamworks.CreateInterface <ISteamClient008>("SteamClient008");

            Console.WriteLine("client: " + steamclient);

            int pipe = steamclient.CreateSteamPipe();
            int user = steamclient.ConnectToGlobalUser(pipe);

            Console.WriteLine(user);
            Console.WriteLine(pipe);

            ISteamUtils004   utils   = Steamworks.CastInterface <ISteamUtils004>(steamclient.GetISteamUtils(pipe, "SteamUtils004"));
            ISteamFriends005 friends = Steamworks.CastInterface <ISteamFriends005>(steamclient.GetISteamFriends(user, pipe, "SteamFriends005"));

            int num = friends.GetFriendCount(EFriendFlags.k_EFriendFlagAll);

            for (int i = 0; i < num; i++)
            {
                CSteamID id   = friends.GetFriendByIndex(i, (int)EFriendFlags.k_EFriendFlagAll);
                string   name = friends.GetFriendPersonaName(id);

                Debug.WriteLine(name);
            }

            CallbackDispatcher.SpawnDispatchThread(pipe);
            Thread.Sleep(5000);
            CallbackDispatcher.StopDispatchThread(pipe);

            steamclient.ReleaseUser(pipe, user);
            steamclient.ReleaseSteamPipe(pipe);
        }
示例#2
0
        public bool GetInterface()
        {
            steamFriends = Steamworks.CastInterface<ISteamFriends002>( steamClient.GetISteamFriends( user, pipe, "SteamFriends002" ) );

            if ( steamFriends == null )
                return false;

            clientFriends = Steamworks.CastInterface<IClientFriends>( clientEngine.GetIClientFriends( user, pipe, "CLIENTFRIENDS_INTERFACE_VERSION001" ) );

            if ( clientFriends == null )
                return false;

            VTable vTable = new VTable( clientFriends.Interface );

            getChatMsg = vTable.GetFunc<NativeGetChatRoomEntry>( 99 );
            getChatName = vTable.GetFunc<NativeGetChatRoomName>( 117 );

            groupChatEnabled = true;
            groupStatusMsg = "Enabled with vtable offsets. (Dangerous)";

            CallbackDispatcher.SpawnDispatchThread( pipe );

            return true;
        }
示例#3
0
        public bool GetInterface()
        {
            steamFriends = Steamworks.CastInterface <ISteamFriends002>(steamClient.GetISteamFriends(user, pipe, "SteamFriends002"));

            if (steamFriends == null)
            {
                return(false);
            }

            clientFriends = Steamworks.CastInterface <IClientFriends>(clientEngine.GetIClientFriends(user, pipe, "CLIENTFRIENDS_INTERFACE_VERSION001"));

            if (clientFriends == null)
            {
                return(false);
            }

            VTScan vtScan = new VTScan(clientFriends.Interface);

            if (vtScan.Init())
            {
                /*
                 * .text:3809F73D 6A 00                                   push    0
                 * .text:3809F73F 68 62 D4 46 38                          push    offset unk_3846D462
                 * .text:3809F744 68 95 03 00 00                          push    394h
                 * .text:3809F749 68 40 E7 3C 38                          push    offset aEBuild_slav_20 ; "e:\\build_slave\\steam_rel_client_win32\\b"...
                 * .text:3809F74E 6A 00                                   push    0
                 * .text:3809F750 68 90 E7 3C 38                          push    offset asc_383CE790 ; "Assertion Failed: bufRet.GetUint8() == "...
                 * .text:3809F755 FF 15 44 E5 37 38                       call    ds:AssertMsgImplementation
                 */
                var results = vtScan.DoScan <NativeGetChatRoomEntry>(
                    "\x6A\x00\x68\x62\xD4\x46\x38\x68\x83\x03\x00\x00\x68\x40\xE7\x3C\x38\x6A\x00\x68\x90\xE7\x3C\x38\xFF\x15\x44\xE5\x37\x38",
                    "xxx????xxxxxx????xxx????xx????"
                    );

                bool foundFirst = false;

                if (results.Count == 0)
                {
                    groupStatusMsg = "Error: Unable to scan for GetChatRoomEntry";
                }
                else
                {
                    if (results.Count > 1)
                    {
                        groupStatusMsg = "Error: Scan for GetChatRoomEntry gave multiple results!";
                    }
                    else
                    {
                        getChatMsg = results[0].Delegate;
                        foundFirst = true;
                    }
                }

                /*
                 * .text:380A06A4 6A 00                                   push    0
                 * .text:380A06A6 68 69 D4 46 38                          push    offset unk_3846D469
                 * .text:380A06AB 68 AB 03 00 00                          push    3AAh
                 * .text:380A06B0 68 40 E7 3C 38                          push    offset aEBuild_slav_20 ; "e:\\build_slave\\steam_rel_client_win32\\b"...
                 * .text:380A06B5 6A 00                                   push    0
                 * .text:380A06B7 68 90 E7 3C 38                          push    offset asc_383CE790 ; "Assertion Failed: bufRet.GetUint8() == "...
                 * .text:380A06BC FF 15 44 E5 37 38                       call    ds:AssertMsgImplementation
                 */

                var results2 = vtScan.DoScan <NativeGetChatRoomName>(
                    "\x6A\x00\x68\x69\xD4\x46\x38\x68\x99\x03\x00\x00\x68\x40\xE7\x3C\x38\x6A\x00\x68\x90\xE7\x3C\x38\xFF\x15\x44\xE5\x37\x38",
                    "xxx????xxxxxx????xxx????xx????"
                    );

                if (results2.Count == 0)
                {
                    groupStatusMsg = "Error: Unable to scan for GetChatRoomName";
                }
                else
                {
                    if (results2.Count > 1)
                    {
                        groupStatusMsg = "Error: Scan for GetChatRoomName gave multiple results!";
                    }
                    else
                    {
                        getChatName      = results2[0].Delegate;
                        groupChatEnabled = foundFirst && true;
                    }
                }
            }
            else
            {
                groupStatusMsg = "Error: Unable to initialize scan!";
            }

            CallbackDispatcher.SpawnDispatchThread(pipe);

            return(true);
        }