Jump to content

Extract data from hex file


-null-

Recommended Posts

I'm trying to extract some data from a hex file.  The data I want is prefixed by a series of hex characters then a country name a couple more hex characters then a user name.  I've attached a screen grab showing the data I'm extracting from.

 

There can be multiple sections in the file like this, with different countries (from a preset list) and user names.  And I'd like to extract all the countries and their associated user names.

 

I have a regular expression that I believe should work and does so in Editpad Pro however it doesn't in PHP.  This is my regex code

preg_match_all('/\x00\x0E[\x07|\x06]\x00(a\x00u\x00s\x00t\x00r\x00i\x00a|b\x00r\x00i\x00t\x00a\x00i\x00n|f\x00r\x00a\x00n\x00c\x00e)\x00\x0E(.*?)\x00\x0E/Us',$data,$matches);

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/148399-extract-data-from-hex-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

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.