Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2008, 14:47
omidgl omidgl is offline
Friend
 
Join Date: Jul 2004
Posts: 86
Rept. Given: 10
Rept. Rcvd 4 Times in 3 Posts
Thanks Given: 0
Thanks Rcvd at 5 Times in 5 Posts
omidgl Reputation: 4
Question Reliable PE Library or DLL for Adding Functions to Import Table

I'm looking for a Code Snippet or PE Library that is able to add new Libraries and functions to Portable Executable files.

I've used PE Library by Pumqara but it failed to do that (some access violations)
Reply With Quote
  #2  
Old 06-18-2008, 14:49
ahmadmansoor's Avatar
ahmadmansoor ahmadmansoor is offline
Coder
 
Join Date: Feb 2006
Location: Syria
Posts: 1,045
Rept. Given: 509
Rept. Rcvd 373 Times in 142 Posts
Thanks Given: 336
Thanks Rcvd at 407 Times in 119 Posts
ahmadmansoor Reputation: 300-399 ahmadmansoor Reputation: 300-399 ahmadmansoor Reputation: 300-399 ahmadmansoor Reputation: 300-399
I think there some way to do it manuallyone of them :
prepare a dll file which u want to add to the exe file then ....u must know the Function which u want to call it ....then u want to find some cave in the exe file then
Patch some place to jmp to ur cave code ....Then
in Patch code u want to load ur dll file first by kernel32.LoadLibraryA....
then get the Function address by KERNEL32.GetProcAddress ....then u can call that Function
__________________
Ur Best Friend Ahmadmansoor
Always My Best Friend: Aaron & JMI & ZeNiX
Reply With Quote
  #3  
Old 06-28-2008, 08:05
dj-siba's Avatar
dj-siba dj-siba is offline
Musician Member
 
Join Date: Jun 2003
Location: Outside the dot
Posts: 324
Rept. Given: 34
Rept. Rcvd 43 Times in 21 Posts
Thanks Given: 56
Thanks Rcvd at 159 Times in 43 Posts
dj-siba Reputation: 42
Hi

check out this PEFile C++ class by in4matics / AT4RE
Code:
http://www.at4re.com/f/showthread.php?t=2353
example
Code:
PEFile pe("1.exe"); 
pe.addSection(".at4re", 0x1000, false);
char* functions[] = { "MessageBoxA", "ShowWindow" }; 
pe.addImport("user32.dll", functions, 2); 
pe.saveToFile("1+.exe");
download
Code:
www.at4re.com/tools/Releases/in4matics/m-PEFile.zip
Reply With Quote
  #4  
Old 06-28-2008, 09:53
omidgl omidgl is offline
Friend
 
Join Date: Jul 2004
Posts: 86
Rept. Given: 10
Rept. Rcvd 4 Times in 3 Posts
Thanks Given: 0
Thanks Rcvd at 5 Times in 5 Posts
omidgl Reputation: 4
Nice Code

PE Library by EXEC may also worth a look

Thank you dj-siba
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
Add imports to DLL import table jonwil General Discussion 5 09-07-2020 16:47
Adding a function to Export-Table of a PE file omidgl General Discussion 3 04-17-2005 09:27
Import Rebuilding Without Import Table Kerlingen General Discussion 11 01-13-2005 10:24
Can`t restore import table thechatter General Discussion 9 11-14-2003 21:01
Changing Import Table?? magic General Discussion 3 09-14-2003 01:59


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


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