static int read_image_resource_directory(RBuffer *b, ut64 addr, Pe_image_resource_directory *dir) {
	st64 o_addr = r_buf_seek (b, 0, R_BUF_CUR);
	if (r_buf_seek (b, addr, R_BUF_SET) < 0) {
		return -1;
	}
	dir->Characteristics = r_buf_read_le32 (b);
	dir->TimeDateStamp = r_buf_read_le32 (b);
	dir->MajorVersion = r_buf_read_le16 (b);
	dir->MinorVersion = r_buf_read_le16 (b);
	dir->NumberOfNamedEntries = r_buf_read_le16 (b);
	dir->NumberOfIdEntries = r_buf_read_le16 (b);
	r_buf_seek (b, o_addr, R_BUF_SET);
	return sizeof (Pe_image_resource_directory);
}
static int read_image_resource_directory(RBuffer *b, ut64 addr, Pe_image_resource_directory *dir) {
	st64 o_addr = r_buf_seek (b, 0, R_BUF_CUR);
	if (r_buf_seek (b, addr, R_BUF_SET) < 0) {
		return -1;
	}
	dir->Characteristics = r_buf_read_le32 (b);
	dir->TimeDateStamp = r_buf_read_le32 (b);
	dir->MajorVersion = r_buf_read_le16 (b);
	dir->MinorVersion = r_buf_read_le16 (b);
	dir->NumberOfNamedEntries = r_buf_read_le16 (b);
	dir->NumberOfIdEntries = r_buf_read_le16 (b);
	r_buf_seek (b, o_addr, R_BUF_SET);
	return sizeof (Pe_image_resource_directory);
}