Jump to content
Sign in to follow this  
toxicdav3

File Patcher, compare, offsets, etc

Recommended Posts

toxicdav3

How would i go about comparing 2 files or strings and creating a patch according to its offsets.

I found a script to do reading and writing at different positions...

http://www.autoitscript.com/forum/index.ph...mp;#entry336438

but I don't know how to compare 2 files. Any help, suggestions or pointers would be very appreciated!

cheers.

Share this post


Link to post
Share on other sites
Zaph

This could be a bit of the blind leading the blind since I am a bit new to AutoIt and scripting in general but it shouldn't be too hard to use http://www.autoitscript.com/autoit3/docs/f...ileReadLine.htm to go line by line and compare two .txt files. I have to do the exact same thing for a project I am working on at home so I will give it a try when I get there.

Share this post


Link to post
Share on other sites
toxicdav3

Thanks for your reply. The problem with comparing files line by line is... how would I know if half way through line 66 in file 1 is the same as the start of line 57 in file 2? Btw these files will be over 1gb in size.

EDIT: Just found these threads, could be useful.

http://www.autoitscript.com/forum/index.php?showtopic=34587

http://www.autoitscript.com/forum/index.php?showtopic=94799

Though they seem a bit too basic for what I need.

Just want to compare 2 files and find the hex offsets.

Edited by toxicdav3

Share this post


Link to post
Share on other sites
Zaph

Thanks for your reply. The problem with comparing files line by line is... how would I know if half way through line 66 in file 1 is the same as the start of line 57 in file 2? Btw these files will be over 1gb in size.

EDIT: Just found these threads, could be useful.

http://www.autoitscript.com/forum/index.php?showtopic=34587

http://www.autoitscript.com/forum/index.php?showtopic=94799

Though they seem a bit too basic for what I need.

Just want to compare 2 files and find the hex offsets.

thanks for those two links, everything I need to get it done myself is there. I think everything you need is there too but you will have to do a bit of figuring out for your specific need. Looks like it comes down to opening both files, reading a line from both files as an array, converting the arrays to strings then using StringCompare (in the help files) to compare each line. With some decent if then trees you can have the script generate a report to see when the two files stop being identical. With a bit more you can have the script pick up again when the files start being identical again.

you can do it! :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.