def loadTlsInfo(self): tlsStruct = pedata.getTlsStruct(self.__pe) self._data_block_start_va.SetValue(hex_up(tlsStruct.StartAddressOfRawData)) self._data_block_end_va.SetValue(hex_up(tlsStruct.EndAddressOfRawData)) self._index_variable_va.SetValue(hex_up(tlsStruct.AddressOfIndex)) self._callback_table_va.SetValue(hex_up(tlsStruct.AddressOfCallBacks)) self._size_of_zero_fill.SetValue(hex_up(tlsStruct.SizeOfZeroFill)) self._characteristics.SetValue(hex_up(tlsStruct.Characteristics))
def OnSaveButton(self, event): sVa = int(self._data_block_start_va.GetValue(), 16) eVa = int(self._data_block_end_va.GetValue(), 16) iVa = int(self._index_variable_va.GetValue(), 16) cVa = int(self._callback_table_va.GetValue(), 16) sZf = int(self._size_of_zero_fill.GetValue(), 16) cHa = int(self._characteristics.GetValue(), 16) tlsStruct = pedata.getTlsStruct(self.__pe) tlsStruct.StartAddressOfRawData = sVa tlsStruct.EndAddressOfRawData = eVa tlsStruct.AddressOfIndex = iVa tlsStruct.AddressOfCallBacks = cVa tlsStruct.SizeOfZeroFill = sZf tlsStruct.Characteristics = cHa try: self.__pe.write(self._fp) except IOError, e: raise str(e)