Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-10-2024, 16:01
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
Thanks a bunch for the tip!

My target is a .NET Core app without plugin support. What's the best way to inject LibHarmony Patcher?
One of examples in the docs that works on my case, involve npm, which seems odd for my case. Any other methods you know of?
Reply With Quote
  #2  
Old 01-11-2024, 15:09
Levis Levis is offline
Family
 
Join Date: Mar 2012
Location: The Earth
Posts: 44
Rept. Given: 76
Rept. Rcvd 42 Times in 13 Posts
Thanks Given: 31
Thanks Rcvd at 51 Times in 23 Posts
Levis Reputation: 42
Quote:
Originally Posted by cracki View Post
Thanks a bunch for the tip!

My target is a .NET Core app without plugin support. What's the best way to inject LibHarmony Patcher?
One of examples in the docs that works on my case, involve npm, which seems odd for my case. Any other methods you know of?
Yes, all you need is to find a DLL or something that being called right before your target method, from the main executable, or any 3rd parties DLL,... then inject some small pieces of code to Reflective load your DLL into AppDomain, then you can do whatever you want, in this case, you're able to perform IL patch before the target method being called.
Remember that if your target is .NET Core, your hooking DLL must be .NET Core, too. Exact Runtime and exact version. For e.g, Target is .NET 6, then your code must be .NET 6, and so on.

If using function name is hard (when it's obfuscated), then you can try to resolve method using Method token. There is no big difference.
__________________
My Personal Blog:http://ltops9.wordpress.com
Reply With Quote
The Following User Says Thank You to Levis For This Useful Post:
niculaita (01-13-2024)
  #3  
Old 01-13-2024, 12:31
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 Levis View Post
Yes, all you need is to find a DLL or something that being called right before your target method, from the main executable, or any 3rd parties DLL,... then inject some small pieces of code to Reflective load your DLL into AppDomain, then you can do whatever you want, in this case, you're able to perform IL patch before the target method being called.
Remember that if your target is .NET Core, your hooking DLL must be .NET Core, too. Exact Runtime and exact version. For e.g, Target is .NET 6, then your code must be .NET 6, and so on.

If using function name is hard (when it's obfuscated), then you can try to resolve method using Method token. There is no big difference.
Thanks a lot for your guidance! The approach you suggested seems quite practical for my case

One other question:
How i can "resolve method using Method token" by HarmonyLib? is this possible?

Thanks again for the valuable insight!
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 19:02.


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