Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2009, 09:14
bball0002 bball0002 is offline
Friend
 
Join Date: Sep 2009
Posts: 28
Rept. Given: 3
Rept. Rcvd 6 Times in 4 Posts
Thanks Given: 1
Thanks Rcvd at 5 Times in 1 Post
bball0002 Reputation: 6
Creating a Loader for DotNet Apps?

Hello. I've been trying to create a loader (with DUP) for a dotnet application that has a login, and I can't seem to get it to work. The reason I think this is odd is because I cracked the target by dumping the IL with ILDasm, then editing the IL in notepad and compiling with IlAsm, but when I try to patch the same offsets (I got the offsets using IDA Pro) with DUP, clicking the Login button makes the program error. All I am trying to do is turn a 'nop' into a 'br IL****', and patch another 'nop' to a 'ret'.


I dumped my exe after it was patched in memory, and when I view the method in IDA Pro, the 'nop' to 'ret' patch seems to look correct, but I'm not sure how to patch the 'nop' to a 'br', since it appears to overwrite some IL instructions. If someone with knowledge in creating a Loader for dotnet has any knowledge about this, or can post a DUP project file with a loader that patches a function, it would be great to see.



Thanks.
Reply With Quote
  #2  
Old 09-24-2009, 13:31
NoneForce NoneForce is offline
Lo*eXeTools*rd
 
Join Date: Mar 2002
Posts: 465
Rept. Given: 237
Rept. Rcvd 141 Times in 80 Posts
Thanks Given: 297
Thanks Rcvd at 61 Times in 30 Posts
NoneForce Reputation: 100-199 NoneForce Reputation: 100-199
Hi,

this is a very handy guide for OpCode :

Compact Framework OpCode Support in a Nutshell

Code:
http://blogs.msdn.com/bluecollar/archive/2006/09/27/773065.aspx
When you're making a loader for a .Net app with dUP make sure that "Target is a compressed PE file" is checked.
Reply With Quote
  #3  
Old 09-24-2009, 22:06
nanobit nanobit is offline
Curious reverseR
 
Join Date: Nov 2008
Location: Cyberspace
Posts: 226
Rept. Given: 7
Rept. Rcvd 111 Times in 55 Posts
Thanks Given: 3
Thanks Rcvd at 30 Times in 14 Posts
nanobit Reputation: 100-199 nanobit Reputation: 100-199
as what you said "...I'm not sure how to patch the 'nop' to a 'br', since it appears to overwrite some IL instructions...", isn't this a common problem in all patchings, not just the .NET targets!? the normal procedure to pass this problem is:

1) you have to find a code cave
2) patch where-you-want-to-patch to jump to that code cave
3) insert the bytes you want to be executed and take care of the damaged instructions because of #2
4) resume the program control flow

and as NoneForce said:
Quote:
Originally Posted by NoneForce View Post
When you're making a loader for a .Net app with dUP make sure that "Target is a compressed PE file" is checked.
P.S: are you certain that the file is not protected against tampering?
Reply With Quote
Reply


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
Creating a Loader to modify a DLL file <|nAbOo|> General Discussion 29 05-17-2005 16:16
Creating a DC hub... fixxorion General Discussion 3 09-12-2004 09:46
Creating a buffer overflow ? Rhodium General Discussion 6 08-19-2003 04:39


All times are GMT +8. The time now is 12:46.


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