int PE_(read_image_section_header)(RBuffer *b, ut64 addr, PE_(image_section_header) *section_header) {
	st64 o_addr = r_buf_seek (b, 0, R_BUF_CUR);
	if (r_buf_seek (b, addr, R_BUF_SET) < 0) {
		section_header->Name[0] = 0;
		return -1;
	}

	ut8 buf[sizeof (PE_(image_section_header))] = {0};
	r_buf_read (b, buf, sizeof (buf));
	memcpy (section_header->Name, buf, PE_IMAGE_SIZEOF_SHORT_NAME);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), Misc.PhysicalAddress, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), VirtualAddress, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), SizeOfRawData, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), PointerToRawData, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), PointerToRelocations, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), PointerToLinenumbers, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), NumberOfRelocations, 16);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), NumberOfLinenumbers, 16);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), Characteristics, 32);
	r_buf_seek (b, o_addr, R_BUF_SET);
	return sizeof (PE_(image_section_header));
}
int PE_(read_image_section_header)(RBuffer *b, ut64 addr, PE_(image_section_header) *section_header) {
	st64 o_addr = r_buf_seek (b, 0, R_BUF_CUR);
	if (r_buf_seek (b, addr, R_BUF_SET) < 0) {
		section_header->Name[0] = 0;
		return -1;
	}

	ut8 buf[sizeof (PE_(image_section_header))] = {0};
	r_buf_read (b, buf, sizeof (buf));
	memcpy (section_header->Name, buf, PE_IMAGE_SIZEOF_SHORT_NAME);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), Misc.PhysicalAddress, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), VirtualAddress, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), SizeOfRawData, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), PointerToRawData, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), PointerToRelocations, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), PointerToLinenumbers, 32);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), NumberOfRelocations, 16);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), NumberOfLinenumbers, 16);
	PE_READ_STRUCT_FIELD (section_header, PE_(image_section_header), Characteristics, 32);
	r_buf_seek (b, o_addr, R_BUF_SET);
	return sizeof (PE_(image_section_header));
}