Jump to content
Tuts 4 You
Sign in to follow this  
high6

VB.net LateBinding?

Recommended Posts

high6

Does the VB.net compiler using LateBinding or is this a feature of the obfuscator being used? And what is LateBinding? Is it just helper functions for reflection?

public static byte[] Ã?a????Ã?öo??aâ?I(string Ã?????ÕoÓ??o??â??)
{
byte[] buffer2 = Ã?Å?Ò??áu????óaaÂø?oÃ(Convert.FromBase64String(Ã?????ÕoÓ??o??â??));
using (object obj2 = new MemoryStream())
{
int num = BitConverter.ToInt32(buffer2, 0x0);
object[] arguments = new object[] { buffer2, 0x4, buffer2.Length - 0x4 };
bool[] copyBack = new bool[] { true, false, false };
NewLateBinding.LateCall(obj2, null, "Write", arguments, null, null, copyBack, true);
if (copyBack[0x0])
{
buffer2 = (byte[]) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0x0]), typeof(byte[]));
}
object objectValue = new byte[(num - 0x1) + 0x1];
NewLateBinding.LateSetComplex(obj2, null, "Position", new object[] { 0x0 }, null, null, false, true);
using (object obj4 = new GZipStream((Stream) obj2, CompressionMode.Decompress))
{
arguments = new object[0x3];
arguments[0x0] = RuntimeHelpers.GetObjectValue(objectValue);
arguments[0x1] = 0x0;
object instance = objectValue;
arguments[0x2] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(instance, null, "Length", new object[0x0], null, null, null));
object[] objArray = arguments;
copyBack = new bool[] { true, false, true };
NewLateBinding.LateCall(obj4, null, "Read", objArray, null, null, copyBack, true);
if (copyBack[0x0])
{
objectValue = RuntimeHelpers.GetObjectValue(objArray[0x0]);
}
if (copyBack[0x2])
{
NewLateBinding.LateSetComplex(instance, null, "Length", new object[] { RuntimeHelpers.GetObjectValue(objArray[0x2]) }, null, null, true, false);
}
}
return (byte[]) objectValue;
}
}

Share this post


Link to post
k5h

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.Performs a late-bound call to an object method.

http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.compilerservices.latebinding.latecall.aspx

Share this post


Link to post
CodeExplorer

Reflection baby, Reflection! That’s exactly what the VB.NET latebinder ends up doing – Reflecting on the “o” instance to find “m”, then a .Invoke() to actually invoke the method it finds.


/>http://blogs.msdn.com/b/joelpob/archive/2005/07/01/434728.aspx

Use Late-Binding in C# Now, without .NET 4.0
/>http://andy.edinborough.org/Use-Late-Binding-in-C-Now-without-NET-4-0/

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×
×
  • Create New...