Jump to content

Read, Search, Copy & Save Binary Data from file


 Share

Recommended Posts

Hello guys

I'm again here to beg for help. Here is a simple flow chart of what I need to achieve.

I've a BINARY file: (e.g. $file = "C:\my.bin" )

I need to read total data in a variable (e.g. $totaldatafrmfile) (as HEX value)

Then, I've two String Values which need to be converted to HEX value. ($strv1 and $strv2 to $hexofstrv1 and $hexofstrv2)

Now, I need the position of the second occurrence of $hexofstrv1 in $totaldatafrmfile (probably with StringInStr) And the 1st occurrence of $hexofstrv2

Next, I need to copy the binary data from $totaldatafrmfile that is within $hexofstrv1 to $hexofstrv2 + Lenght of $hexofstrv2 and save to a new binary file. (e.g. C:\Cropped.bin)

Please help me out. If possible give the complete code. Error handling (in case StringInStr returns 0) not required.

Regards

Shafayat

[Not using this account any more. Using "iShafayet" instead]

Link to comment
Share on other sites

Can't someone help me?

Can you show something you have tried so far even if it fails, and give a sample file to read?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...