Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-30-2004, 02:43
Barry Barry is offline
Friend
 
Join Date: Dec 2003
Posts: 84
Rept. Given: 10
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
Barry Reputation: 2
Fixing an EXE to not call a DLL?

How do you stop an EXE calling in a DLL?

Do you have to edit the Import Table or something?
Reply With Quote
  #2  
Old 05-30-2004, 16:19
loman
 
Posts: n/a
if it uses LoadLibrary() to load Dll, simply nop the instruction, but probably the program won't work anymore

-loman
Reply With Quote
  #3  
Old 05-30-2004, 19:47
Barry Barry is offline
Friend
 
Join Date: Dec 2003
Posts: 84
Rept. Given: 10
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
Barry Reputation: 2
How many ways are there of calling a DLL? I'm a complete idio... err n00b

I tried LordPE and deleting the DLL in the Import Table section and also deleting a Section from the EXE, both result in a non working EXE.

I tried loading into IDA and looking for LoadLibraryA, but I think it's using GetModuleHandleA and it looks like its located in a separate Section. So I think deleting the Section could work, but how do you successfully delete a Section?
Reply With Quote
  #4  
Old 05-31-2004, 07:21
Friky
 
Posts: n/a
hm

Hi Barry.

IMHO, deleting your DLL call isnt a solution for any problem.
A :
- Describe you problem with more details.
B :
- As someone said, if you (let's say) 'delete' DLL call or 'stop' it somehow, i'm sure the application won't work. Simply, the DLL is needed. If you want to 'delete' it cuz of some kind of protection, you don't 'crack' the protection by 'deleting' the DLL...
You have to find the CALL and analyze it ... where it's called and stuff ... So you can jump over it or nop it ... (That's ok if that's part of protection)...

Bla, bla ...

But, provide us more info and you'll get better answers than this one...
Reply With Quote
  #5  
Old 05-31-2004, 07:43
Crk
 
Posts: n/a
if you kill the loadlibrary to some dll some part of the program might not work ... if a program loads a library/dll sure it needs it to some functions and could have many points and calls for the dll.... as previous reply says give us more details about your problem ...and you'll get better asnwers
Reply With Quote
  #6  
Old 05-31-2004, 09:28
sgdt
 
Posts: n/a
Without more information, here's a really easy fix. Works for me 99% of the time. No need for anything complex, just standard programming stuff.

Let's say your DLL is called DoBadThings.dll and you want to learn more about it, circumvent it, etc.

From a command prompt type:
dumpbin /EXPORTS DoBadThings.dll > DoBadThings.txt

In TextPad or simular editor, cut out all but the export entries, and in block mode, cut out the first 3 fields (Ordinal, hint, and RVA) leaving only the Names.

Rename "DoBadThings.txt" to "DoBadThings.def", and copy it to the files "DoBadThings.cpp" and "DoBadThings.h"

On the DEF file, insert the following two lines at the begining:

LIBRARY DoBadThings
EXPORTS

and then insert tabs infront of each of the names. You can now type:
lib /defoBadThings.def
to generate an import library.

On the H and CPP files, un-mangling if present (pretty easy, P means pointer, etc. google if you run into trouble) and create function stubs. For non-mangled names, use a Macro in Textpad to write out the Curely braces, etc.

If the caller program has savere encryption and antidebug, you can use OutputDebugString in the stub routines to grok calling sequence and parameters even if you have non-mangled names. Otherwise, it's shooting fish in a barrel. (look for push instructions, mov ecx, and add esp instructions to get calling convention and parameter counts).

Rename original "DoBadThings.dll" to "DoBadThings_Original.dll" and put in your own.

In your DLL, call "DoBadThings_Original.dll" as needed for snooping, or only call it sometimes, or don't even call it at all. Your choice.

Not rocket science. A little more work than "just deleting the DLL", but I think you'll find it a bit more usefull.
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
Help to fixing API-Calls Nukacola General Discussion 6 05-11-2005 16:49
Import OS Fixing MaRKuS-DJM General Discussion 31 07-16-2004 23:20
Problem with fixing IAT K3nny General Discussion 5 01-04-2004 19:26


All times are GMT +8. The time now is 04:39.


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