示例#1
0
        public static void Hook()
        {
            if (bHooked)
            {
                return;
            }

            for (ClientClass *pClass = g_Client.GetAllClasses(); (IntPtr)pClass != IntPtr.Zero; pClass = pClass->m_pNext)
            {
                if (Marshal.PtrToStringAnsi((IntPtr)pClass->m_pNetworkName) == "CBaseViewModel")
                {
                    var pClassTable = pClass->m_pRecvTable;

                    for (int nIndex = 0; nIndex < pClassTable->m_nProps; nIndex++)
                    {
                        var pProp = &pClassTable->m_pProps[nIndex];

                        if (Marshal.PtrToStringAnsi((IntPtr)pProp->m_pVarName) == "m_nSequence")
                        {
                            o_pSequence_Prop       = pProp;
                            o_ProxyFn              = pProp->m_ProxyFn;
                            o_SetViewModelSequence = Marshal.GetDelegateForFunctionPointer <SetViewModelSequence>(o_ProxyFn);
                            pProp->m_ProxyFn       = Marshal.GetFunctionPointerForDelegate(hkSetViewModelSequence_callback);
                            bHooked = true;
                            return;
                        }
                    }
                }
            }
        }
示例#2
0
        public NetvarMngr()
        {
            database = new List <netvar_table>();

            for (ClientClass *pClass = g_Client.GetAllClasses(); (IntPtr)pClass != IntPtr.Zero; pClass = pClass->m_pNext)
            {
                var recvTable = pClass->m_pRecvTable;
                if ((IntPtr)recvTable != IntPtr.Zero)
                {
                    database.Add(LoadTable(recvTable));
                }
            }
        }
示例#3
0
        public unsafe static Hashtable FullDump()
        {
            Hashtable hashtable = new Hashtable();

            for (ClientClass *i = (ClientClass *)(Memory.Client + signatures.dwGetAllClasses); i != null; i = i->Next())
            {
                Log.Debug("Dumping:", i->GetRecvTable()->GetName());
                if (!hashtable.ContainsKey(i->GetRecvTable()->GetName()))
                {
                    hashtable.Add(i->GetRecvTable()->GetName(), DumpTable(i->GetRecvTable()));
                }
            }
            return(hashtable);
        }