import struct


def read_header(src_file, file_ptr):
	""" return dict of rel_ptr, abs_ptr, script_len
		from src_file @ file_ptr location """

	# skip first four bytes of file header
	src_file.seek(file_ptr+4*4, 0)

	# relative pointers for two text blocks and their lengths
	names_ptr, names_len, script_ptr, script_len = \
		struct.unpack("<IIII", src_file.read(16))

	return {
			"rel_ptr": script_ptr,
			"script_len": script_len,
			"abs_ptr": script_ptr+file_ptr
			}