Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

LOAD ASSEMBLY USING INTERNAL METHOD | NEW CLASS | SUPPORTS ALL FRAMEWORKS+++

I'm sure most of you who are up to speed on .NET development at Hack Forums has heard about the internal method nLoadImage() to load a .NET assembly. The method can cause some problems if you don't know that the signature changes in the different frameworks. I wrote this class to work around that, and you can use it in any framework version to load your assemblies. The purpose of this is to avoid hooks on calls to Assembly.Load

Usage:
' Wrote:NetLoader.Load(byte[]);

[Image: Syr3DlV.png]
Thank you

why do you need to cast it as (Assembly) line 16 ? what is the returntype of invoke ?
Assert failure(PID 10704 [0x000029d0], Thread: 10960 [0x2ad0]): pBuffer != NULL
(Aug 3, 2017 09:12 PM)Aristocles Wrote:  Thank you

why do you need to cast it as (Assembly) line 16 ? what is the returntype of invoke ?


https://msdn.microsoft.com/en-us/library....110).aspx

Type object
(Aug 3, 2017 09:12 PM)Aristocles Wrote:  Thank you

why do you need to cast it as (Assembly) line 16 ? what is the returntype of invoke ?

It's object to match all methods
[Image: Syr3DlV.png]
Nice. I wrote something similar for a project of mine, as I wanted to protect a library I made. I had a 'client DLL' and a 'server DLL'. The client DLL contained interfaces and an InstanceBuilder class, and the server DLL contained a reference to client DLL (for the interfaces) and classes that inherited from those interfaces. The InstanceBuilder would accept the server DLL in byte form or stream form or whatever and then you could instantiate the classes that were loaded in. This is still easily breakable but at least offers some protection.
The method.Invoke will be detected, but it's a nice idea 🤝
(Aug 6, 2017 09:35 AM)Paskowsky Wrote:  The method.Invoke will be detected, but it's a nice idea 🤝

I'm fairly positive (MethodInfo).Invoke is not detected, or (delegate).Invoke would be too, which wouldn't make any sense. Anyway, it's not for the purpose of being undetected by virus analysis, it's just supposed to bypass hooks on Assembly.Load
[Image: Syr3DlV.png]


Possibly Related Threads...
Thread / Author Replies Views Last Post
by silentlycanadianJan 28, 2026 05:22 AM 4 209 Jan 28, 2026 05:22 AM
Last Post: CL1B
[C] by lockheadApr 22, 2021 07:10 AM 0 147 Apr 22, 2021 07:10 AM
Last Post: lockhead
[C#] by gigajewJul 26, 2018 07:38 PM 10 802 Jul 26, 2018 07:38 PM
Last Post: techcrunch