比如有个函数unsafe getClass(intptr add,byte* buff),返回buff,请问如何获取这个buff?如何判断buff的类型?
望不吝赐教,谢谢!!!!!!!!

解决方案 »

  1.   

    本帖最后由 caozhy 于 2013-09-06 10:01:25 编辑
      

  2.   

    byte[] buf = new byte[16];
                byte[] trans = new byte[16];
                uint size;
                IntPtr ptr = IntPtr.Zero;
    unsafe 
                {
                    fixed (byte* pi = &buf[0])
                    {
                        string str = "";
                        size = getclass((UIntPtr)0x0019A8B8, pi);
                        for (int i = 0; i < size; i++)
                        {
                            trans[i] = Marshal.ReadByte(pi[i+1],i+1);
                            str+=trans[i].ToString();
                        }
                        str = System.Text.Encoding.Unicode.GetString(trans, 1, 8);
                        MessageBox.Show(str);
                    }
                    
                }
      

  3.   

    不知道getclass干嘛的,也不知道0x0019A8B8是什么。
      

  4.   


    ReadMemory(UIntPtr address, byte* buffer, uint count, uint unitSize)
      

  5.   

    你既然是以byte拿的怎么可能知道拿到的类型是什么,没有size的要求就是费。