Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-07-2024, 23:57
th3tuga th3tuga is offline
Friend
 
Join Date: Oct 2023
Posts: 31
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 16 Times in 10 Posts
th3tuga Reputation: 0
Quote:
Originally Posted by cracki View Post
I'm currently debugging a .NET DLL that, upon execution, loads some dependencies using the:
C#:
Code:
Assembly.Load
from its own resources. These new References (DLLs) appear in the dnSpy list, but how can I edit them?
You need to follow the techniques similar to the ones described here, although it's for another protector:
Quote:
https://insinuator.net/2018/04/reversing-and-patching-net-binaries-with-embedded-references/
Reply With Quote
The Following 2 Users Say Thank You to th3tuga For This Useful Post:
cracki (01-08-2024), niculaita (01-08-2024)
  #2  
Old 01-08-2024, 13:51
cracki cracki is offline
Friend
 
Join Date: Oct 2003
Posts: 96
Rept. Given: 19
Rept. Rcvd 11 Times in 6 Posts
Thanks Given: 12
Thanks Rcvd at 11 Times in 5 Posts
cracki Reputation: 11
Quote:
Originally Posted by th3tuga View Post
You need to follow the techniques similar to the ones described here, although it's for another protector:
Thank you for your response and the guidance you provided!


If I save a version of the DLL that has been extracted from the embedded state alongside the program and somehow (as per the techniques mentioned in the tutorial you provided) remove the "module initializer" so that "the embedded references will be ignored when running the binary" will the program then use the file I saved and patched?
Reply With Quote
  #3  
Old 01-10-2024, 23:55
th3tuga th3tuga is offline
Friend
 
Join Date: Oct 2023
Posts: 31
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 16 Times in 10 Posts
th3tuga Reputation: 0
Quote:
Originally Posted by cracki View Post
Thank you for your response and the guidance you provided!


If I save a version of the DLL that has been extracted from the embedded state alongside the program and somehow (as per the techniques mentioned in the tutorial you provided) remove the "module initializer" so that "the embedded references will be ignored when running the binary" will the program then use the file I saved and patched?
Yes it will work.
As long as the executable has import references to functions in the patched DLL. You should save it in the same folder the calling executable is in.
This is same principle why proxy dll or DLL hijacking works.
Reply With Quote
The Following User Says Thank You to th3tuga For This Useful Post:
cracki (01-13-2024)
  #4  
Old 01-11-2024, 08:15
NON NON is offline
Banned User
 
Join Date: Sep 2023
Posts: 77
Rept. Given: 2
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 30
Thanks Rcvd at 21 Times in 16 Posts
NON Reputation: 2
Quote:
Originally Posted by th3tuga View Post
Yes it will work.
As long as the executable has import references to functions in the patched DLL. You should save it in the same folder the calling executable is in.
This is same principle why proxy dll or DLL hijacking works.
I do not understand. Can someone explain with a simple example?
Reply With Quote
  #5  
Old 01-12-2024, 07:45
th3tuga th3tuga is offline
Friend
 
Join Date: Oct 2023
Posts: 31
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 16 Times in 10 Posts
th3tuga Reputation: 0
Quote:
Originally Posted by Gregory Morse View Post
I do not understand. Can someone explain with a simple example?
Dump the dll that is loaded from the resource, using DnSpy after it's loaded.
Then edit the dumped dll with your patches.
Remove the dll module initialize including the load statements from the exe.
Place the edited dll in the same folder with the exe and run. That's all.

I also use the nick Selya on some forums, since you cannot PM me here.
I respond only to known people though (no crack requests please).
Reply With Quote
Reply

Tags
.net, assembly, dnspy, dotnet

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Olly Crash when this simple app loaded... kunam General Discussion 6 10-10-2023 21:00
Question on IDA's Edit|Patch program? boya General Discussion 2 10-23-2004 01:36
IDA Pro (what happened to edit->patch) ReDucTor General Discussion 3 08-31-2004 21:02
Modules loaded by a exe loman General Discussion 15 05-18-2004 22:37


All times are GMT +8. The time now is 17:06.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )