Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2022, 13:17
aijundi aijundi is offline
Friend
 
Join Date: Jul 2019
Posts: 36
Rept. Given: 1
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 2
Thanks Rcvd at 30 Times in 16 Posts
aijundi Reputation: 0
How to patch a dll with relocations?

Hi,
I'm trying to patch a dll, but the resultant file gets corrupted.
After doing some research, it seems like it is due to relocations.
Is there any way to get around this?
Reply With Quote
  #2  
Old 10-12-2022, 23:31
sendersu sendersu is offline
VIP
 
Join Date: Oct 2010
Posts: 1,305
Rept. Given: 337
Rept. Rcvd 237 Times in 127 Posts
Thanks Given: 340
Thanks Rcvd at 652 Times in 357 Posts
sendersu Reputation: 200-299 sendersu Reputation: 200-299 sendersu Reputation: 200-299
You should not touch any bytes which are corrected by relocation mechanism
try to patch non-relocated bytes only...
Here is a tip how I"m answering the question whether bytes are relocated or not -
I'm using Hiew util and if the byte is colored in gray color - do not touch it, eg:
https://prnt.sc/XRAXWahjzZ6q
Reply With Quote
  #3  
Old 10-13-2022, 03:08
Kerlingen Kerlingen is offline
VIP
 
Join Date: Feb 2011
Posts: 338
Rept. Given: 0
Rept. Rcvd 278 Times in 100 Posts
Thanks Given: 0
Thanks Rcvd at 358 Times in 110 Posts
Kerlingen Reputation: 200-299 Kerlingen Reputation: 200-299 Kerlingen Reputation: 200-299
Why not just (re-)move the relocation entry for the positions you are patching? Deleting or moving inside the same block is just a two byte patch.
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
Relocations Directory arnix General Discussion 3 06-04-2005 15:37
Armadillo DLL Relocations.. xzz General Discussion 4 09-28-2004 02:17
pecompact, dll, relocations ftw General Discussion 2 07-25-2004 07:49


All times are GMT +8. The time now is 09:25.


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