def parse_header(self, fp): self.file_magic = data.f_string(13, fp) self.hd_size = data.f_uint32(fp) self.version = data.f_uint32(fp) self.save_num = data.f_uint32(fp) self.player_nm = data.f_wstring(fp) self.player_lvl = data.f_uint32(fp) self.player_loc = data.f_wstring(fp) self.ingame_dt = data.f_wstring(fp) self.player_race = data.f_wstring(fp) self.unknown_1 = data.f_uint16(fp) self.unknown_2 = data.f_float(fp) self.unknown_3 = data.f_float(fp) self.filetime = data.f_filetime(fp) self.shot_w = data.f_uint32(fp) self.shot_h = data.f_uint32(fp) self.shot_data = data.f_buf(3*self.shot_h*self.shot_w, fp) self.form_ver = data.f_uint8(fp)
def parse_changed_form(self, fp): cf = data._CHANGEDFORM() cf.unknown_1 = data.f_uint8(fp) cf.unknown_2 = data.f_uint8(fp) cf.unknown_3 = data.f_uint8(fp) cf.unknown_4 = data.f_uint32(fp) cf.flags = data.f_uint8(fp) cf.version = data.f_uint8(fp) len_flag = (cf.flags & 0xC0) >> 6 #print "flags: %02X, version: %d, len_flag: %d" % (cf.flags, cf.version, len_flag) if len_flag == 0: cf.len_1 = data.f_uint8(fp) cf.len_2 = data.f_uint8(fp) elif len_flag == 1: cf.len_1 = data.f_uint16(fp) cf.len_2 = data.f_uint16(fp) elif len_flag == 2: cf.len_1 = data.f_uint32(fp) cf.len_2 = data.f_uint32(fp) #print "len1: %d, len2: %d" % (cf.len_1, cf.len_2) if cf.len_1 > 0: cf.data = data.f_buf(cf.len_1, fp) return cf
def parse_plugins(self, fp): self.plugin_info_size = data.f_int32(fp) self.plugin_count = data.f_uint8(fp) self.plugins = [] for i in xrange(0, self.plugin_count): self.plugins.append( data.f_wstring(fp) )
def from_fobj(self, fobj): self.name = data.f_wstring(fobj) self.categ = data.f_uint8(fobj) self.value = data.f_int32(fobj) return self