R
rob stanton
I have a binary file in which I'd like to find multiple strings of 10
00 10 00 (hex) amongst all the other values, then following that is a
name.
I've found that
contents_array.find_all {|e| e== 0x10}
shows all the 0x10 in the file but not the index, there are several
hundred.
contents_array.index(0x10)
shows the first index of 0x10 (242), but how do I go on to list
subsequent indexes of 0x10?
puts(contents_array[242,4])
16
0
85
73
=> nil
shows me that the first 0x10 I find is not correct, i.e. its 10 00 55 49
so I need to go onto the next 0x10 and test again.
I'm a bit stuck now as to how to do that, I'm very new and finding it
difficult to find information...
00 10 00 (hex) amongst all the other values, then following that is a
name.
I've found that
contents_array.find_all {|e| e== 0x10}
shows all the 0x10 in the file but not the index, there are several
hundred.
contents_array.index(0x10)
shows the first index of 0x10 (242), but how do I go on to list
subsequent indexes of 0x10?
puts(contents_array[242,4])
16
0
85
73
=> nil
shows me that the first 0x10 I find is not correct, i.e. its 10 00 55 49
so I need to go onto the next 0x10 and test again.
I'm a bit stuck now as to how to do that, I'm very new and finding it
difficult to find information...