python - Get the address for f.seek()? -


i'd address hex byte in file, example change ff bytes af.

so, first have find matching byte sequence. how do that?

actually, tried

import re target = 0x76c0 f = open("bin.dat", 'rb+') data = f.read() match = re.search(target, data) if match:     print "found."     data.replace(target,0xffff) else:     print "no match" f.close() 

to find , replace it, somehow python complains f.close(). started approach using f.seek() , f.write, need address of first byte match.

any ideas?

thanks, john


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -