Hey Guys!
First of all (because this is my first post :O) > I looooove this forum <3
So I try to load an assembly exe (njRAT Client in this example, without any options) as byte array, here are the working codes:
#1 Load NJ-Client (32bit) via "LoadFile" > Works
#2 Load DummyApp (just a 32bit testing Application) via "Load" (Byte Array) > Works
#3 Load NJ-Client (32bit) via "Load" (Byte Array > DOES NOT WORK :(
So my test Application works with the LoadFile and the Load (Byte Array) method, but the NJ-Client doesn't :(
I got these exception if i try it with the Load method (hope the translation is okay):
Main Exception: A call destination has caused an exception error
InnerException 1: The type initializer for "KOWvcoR00eSSwwUq2D.I1GZeOwfWjwFGK9nAc" threw an exception
InnerException 2: Common Language Runtime detected an invalid program
I tried calling the exe without VS also (the LoadFile for example only works, if I call the exe without VS / Debugger)
If I compare the assembly object with Load and LoadFile, I see these differences:
(Load vs LoadFile)
CodeBose > "C:\test\MyCaller.exe" vs "C:\test\NJ_Client.exe"
EscapedCodeBase > "C:\test\MyCaller.exe" vs "C:\test\NJ_Client.exe" (escaped)
IsStringNameVerified > "false" vs "true"
Location > "" vs "C:\test\NJ_Client.exe"
m_handle > "0x0017cf30" vs "0x01e93698"
The NJ-Client is just an example, I just want to try all assembly applications. Because of encrypting the client, I need a funktion which loads an byte array, so Assembly.LoadFile works, but with this function I need the "native" (decrypted) file :/
I tested this also with different RunPE functions, but I never found one which runs with assembly files. Also Convert assembly files (without source code) to native files seems very hard.
Any ideas?
Have big thanks! 🤝
First of all (because this is my first post :O) > I looooove this forum <3
So I try to load an assembly exe (njRAT Client in this example, without any options) as byte array, here are the working codes:
#1 Load NJ-Client (32bit) via "LoadFile" > Works
Code
string NJ_Path = @"C:\test\NJ_Client.exe"; // 32bit assembly
Assembly Asm = Assembly.LoadFile(NJ_Path);
MethodInfo AsmMethod = Asm.EntryPoint;
AsmMethod.Invoke(null, null);#2 Load DummyApp (just a 32bit testing Application) via "Load" (Byte Array) > Works
Code
string NJ_Path = @"C:\test\DummyApp.exe"; // 32bit assembly
Assembly Asm = Assembly.Load(File.ReadAllBytes(NJ_Path));
MethodInfo AsmMethod = Asm.EntryPoint;
AsmMethod.Invoke(null, null);#3 Load NJ-Client (32bit) via "Load" (Byte Array > DOES NOT WORK :(
Code
string NJ_Path = @"C:\test\NJ_Client.exe"; // 32bit assembly
Assembly Asm = Assembly.Load(File.ReadAllBytes(NJ_Path));
MethodInfo AsmMethod = Asm.EntryPoint;
AsmMethod.Invoke(null, null);So my test Application works with the LoadFile and the Load (Byte Array) method, but the NJ-Client doesn't :(
I got these exception if i try it with the Load method (hope the translation is okay):
Main Exception: A call destination has caused an exception error
InnerException 1: The type initializer for "KOWvcoR00eSSwwUq2D.I1GZeOwfWjwFGK9nAc" threw an exception
InnerException 2: Common Language Runtime detected an invalid program
I tried calling the exe without VS also (the LoadFile for example only works, if I call the exe without VS / Debugger)
If I compare the assembly object with Load and LoadFile, I see these differences:
(Load vs LoadFile)
CodeBose > "C:\test\MyCaller.exe" vs "C:\test\NJ_Client.exe"
EscapedCodeBase > "C:\test\MyCaller.exe" vs "C:\test\NJ_Client.exe" (escaped)
IsStringNameVerified > "false" vs "true"
Location > "" vs "C:\test\NJ_Client.exe"
m_handle > "0x0017cf30" vs "0x01e93698"
The NJ-Client is just an example, I just want to try all assembly applications. Because of encrypting the client, I need a funktion which loads an byte array, so Assembly.LoadFile works, but with this function I need the "native" (decrypted) file :/
I tested this also with different RunPE functions, but I never found one which runs with assembly files. Also Convert assembly files (without source code) to native files seems very hard.
Any ideas?
Have big thanks! 🤝

