find a values position within a binary file
lets say i have a 4 byte word as 0xAAFF, how would i find the position where 0xAAFF is (as in offset from 0)?
Quote: Original post by Genjix
lets say i have a 4 byte word as 0xAAFF, how would i find the position where 0xAAFF is (as in offset from 0)?
you need to load in the file (stream until EOF) and then search for the value, keeping track of how many bytes/words you have already read (for the offset).
EDIT: thougth this was in a programming forum :( unix i believe has tools for it (dump or cmp or something). Sorry dont know for sure.
HTH
hmmmm, if I don't get any answers will someone tell me how to convert a hex value to an int? (stl is fine)
Quote: Original post by Genjix
hmmmm, if I don't get any answers will someone tell me how to convert a hex value to an int? (stl is fine)
int foo = 0xAAFF; // ?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement