python read binary file into array
hello pros!
im quite a newbie in python. please help me out! so i have a hex file, that is about 2821 sector size. i want to create an array for every 128 sectors. is there an example to do this? what ive done so far is, i read the hex file containment and added a comma after every 2 characters, to separate the values Code:
f = open(file_location, "rb") |
Code:
f = open("binary", "rb") |
hi! that is what exactly what im trying to do. now im stuck else where
so, now, i have a list of hex values that i want to pack using struct.pack. so here's what i did after reading from the hex file Code:
but i keep getting error message "struct error : cannot convert argument to integer" but ive already converted to int |
All times are GMT -5. The time now is 12:25 PM. |