I have a binary file written by the delphi. This is what i know:
- Block 1: 4 bytes, stands for a integer value of 32 bits.
- Block 2: A String value (The length is not fixed for all binary files)
- Block 3: 4 bytes, stands for a integer value of 32 bits.
- Block 4: A String value (The length is not fixed for all binary files)
- ...
- BlockN
i made this to read the first block value:
import struct
f = open("filename", 'rb')
value = struct.unpack('i', f.read(4))
What about the Strings values? What a good solution would be like? Is there any way to iterate over the string and find the final delimiter "\0" of each string value like in C?