Howdy Fellas,
I'm trying to read a binary file that has a bunch of data, though I'm only interested in two pieces, a datestamp and some data.
I've been able to read some text using :
_WinAPI_ReadFile($hFile,DllStructGetPtr($struct),$nBytes,$nBytes)
where the struct is a char[256], and $nBytes is 256
this returns to me some strings that are up to 256 characters long, when I use 1024 it is up to 1024 and self-terminates
I also have an offset I need to account for from the header data, can I just use '_WinAPI_ReadFile' or is there a better way?
I noticed that the data is separated by a '00' or 'NULL' value
Looking at the file in a hex viewer and knowing some of the expected information, I can get an idea of what kind of data is where, but I'm wondering if someone can help me understand how I can read any information that exists between the NULL values. I'm guessing that I can just read every bit of information byte-by-byte and append it to my data until I find a NULL then based on the previous info read or the length I determine what kind of information I'm dealing with.
Is there a built in function that can search for the occurrence of a NULL (or other value) and split content based on that? Like a string split with a '00' as a delimiter.
I'm trying to read a binary file that has a bunch of data, though I'm only interested in two pieces, a datestamp and some data.
I've been able to read some text using :
_WinAPI_ReadFile($hFile,DllStructGetPtr($struct),$nBytes,$nBytes)
where the struct is a char[256], and $nBytes is 256
this returns to me some strings that are up to 256 characters long, when I use 1024 it is up to 1024 and self-terminates
I also have an offset I need to account for from the header data, can I just use '_WinAPI_ReadFile' or is there a better way?
I noticed that the data is separated by a '00' or 'NULL' value
Looking at the file in a hex viewer and knowing some of the expected information, I can get an idea of what kind of data is where, but I'm wondering if someone can help me understand how I can read any information that exists between the NULL values. I'm guessing that I can just read every bit of information byte-by-byte and append it to my data until I find a NULL then based on the previous info read or the length I determine what kind of information I'm dealing with.
Is there a built in function that can search for the occurrence of a NULL (or other value) and split content based on that? Like a string split with a '00' as a delimiter.