View Single Post
  #5  
Old 12-15-2013, 01:29
0xd0000 0xd0000 is offline
Family
 
Join Date: Nov 2013
Posts: 53
Rept. Given: 3
Rept. Rcvd 37 Times in 14 Posts
Thanks Given: 12
Thanks Rcvd at 23 Times in 12 Posts
0xd0000 Reputation: 37
Not sure I understand the exact context, (.net/native) but would reflection work? I've approached something that sounds similar to your scenario using InvokeMember.


http://msdn.microsoft.com/en-us/library/system.type.invokemember(v=vs.110).aspx

Code:
            Assembly asm = Assembly.LoadFrom(this.g_exePath);
            Type hwidClass = null;
            foreach (Type type in asm.GetTypes())
            {
                if (type.Name == "x500000hsd76")
                    hwidClass = type;
            }
            object hwid = Activator.CreateInstance(hwidClass);
            object somethingRandom = hwid.GetType().InvokeMember("get_8850XynnG", BindingFlags.InvokeMethod, null, hwid, null);
            string resultedValue = somethingRandom.GetType().GetField("resultedValue").GetValue(somethingRandom).ToString();
            return resultedValue.GetHashCode();
Reply With Quote