Changeset 113 for oup/current/Tools
- Timestamp:
- Feb 25, 2007, 6:20:22 PM (18 years ago)
- Location:
- oup/current/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/Tools/BinEdit.pas
r111 r113 140 140 var 141 141 mem: TMemoryStream; 142 Data: TByteData;143 142 begin 144 143 if ConID <> -1 then … … 183 182 Data: TByteData; 184 183 i: Word; 184 tempi: Integer; 185 185 floatformat: TFormatSettings; 186 186 begin … … 218 218 Result := IntToBin(hex.Data[offset]); 219 219 11: 220 Result := '0x' + IntToHex(ConManager.Connection[ConID].GetRawInfo(fileid, offset).RawAddr, 8); 220 begin 221 tempi := ConManager.Connection[ConID].GetRawInfo(fileid, offset).RawAddr; 222 if tempi >= 0 then 223 Result := '0x' + IntToHex(tempi, 8) 224 else 225 Result := 'unused'; 226 end; 221 227 12: 222 Result := FormatNumber(hex.Data[offset + 1] + hex.Data[offset + 2] * 256 + 223 hex.Data[offset + 3] * 256 * 256, 5, '0'); 228 if hex.Data[offset] = 1 then 229 Result := FormatNumber(hex.Data[offset + 1] + hex.Data[offset + 2] * 256 + 230 hex.Data[offset + 3] * 256 * 256, 5, '0') 231 else 232 Result := 'no link'; 224 233 13: 225 234 Result := IntToStr(hex.Data[offset]); … … 308 317 if Pos('#', SubName) > 0 then 309 318 begin 310 Data.Offset := HexToLong(MidStr(SubName, Pos('#', SubName) + 1, 8));311 Data.Value := 319 Data.Offset := StrToInt('$'+MidStr(SubName, Pos('#', SubName) + 1, 8)); 320 Data.Value := '$' + 312 321 MidStr(SubName, PosEx('#', SubName, Pos('#', SubName) + 1) + 1, 8); 313 322 Data.Caption := MidStr(SubName, 1, Pos('#', SubName) - 1); … … 749 758 else 750 759 begin 751 if nodedata.DataType = 11then760 if (nodedata.DataType = 11) and (nodedata.Value <> 'unused') then 752 761 begin 753 762 if ConManager.Connection[ConID].GetRawInfo(fileid, nodedata.offset).RawSize > 0 then 754 763 Form_Main.open_child('rawedit', ConID, fileid); 755 764 end; 756 if nodedata.DataType = 12then765 if (nodedata.DataType = 12) and (nodedata.Value <> 'no link') then 757 766 begin 758 767 if (StrToInt(nodedata.Value) < ConManager.Connection[ConID].GetFileCount) and … … 794 803 begin 795 804 hex.SelStart := Data.Offset; 796 hex.SelEnd := Data.Offset + HexToLong(Data.Value) - 1;805 hex.SelEnd := Data.Offset + StrToInt(Data.Value) - 1; 797 806 end; 798 807 end; … … 825 834 CellText := Data.Value //GetValue(data.DataType, data.Offset) 826 835 else if Length(Data.Value) > 0 then 827 CellText := IntToStr( HexToLong(Data.Value)) + ' Bytes';836 CellText := IntToStr(StrToInt(Data.Value)) + ' Bytes'; 828 837 4: 829 838 CellText := Data.Description; -
oup/current/Tools/RawEdit.pas
r111 r113 54 54 procedure hexChange(Sender: TObject); 55 55 private 56 ConID,fileid, datoffset: Integer;56 fileid, datoffset: Integer; 57 57 public 58 58 end; … … 115 115 for i := 0 to filelist.Count - 1 do 116 116 begin 117 if ConManager.Connection[Con ID].ExtractFileIDOfName(filelist.Items.Strings[i]) = Raw_Info.SrcID then117 if ConManager.Connection[ConnectionID].ExtractFileIDOfName(filelist.Items.Strings[i]) = Raw_Info.SrcID then 118 118 begin 119 119 filelist.ItemIndex := i; … … 132 132 end; 133 133 mem := nil; 134 ConManager.Connection[Con ID].LoadRawFile(raw_info.SrcID, raw_info.SrcOffset, TStream(mem));134 ConManager.Connection[ConnectionID].LoadRawFile(raw_info.SrcID, raw_info.SrcOffset, TStream(mem)); 135 135 hex.LoadFromStream(mem); 136 136 ClearValues; … … 148 148 datoffset := StrToInt('$' + MidStr( 149 149 list_offset.Items.Strings[list_offset.ItemIndex], 3, 8)); 150 LoadRaw(ConManager.Connection[Con ID].GetRawInfo(fileid, datoffset));150 LoadRaw(ConManager.Connection[ConnectionID].GetRawInfo(fileid, datoffset)); 151 151 end; 152 152 … … 391 391 begin 392 392 case MessageBox(Self.Handle, PChar('Save changes to .raw-part of file ' + 393 ConManager.Connection[Con ID].GetFileInfo(fileid).Name + '?'), PChar('Data changed...'),393 ConManager.Connection[ConnectionID].GetFileInfo(fileid).Name + '?'), PChar('Data changed...'), 394 394 MB_YESNOCANCEL) of 395 395 idYes: … … 398 398 hex.SaveToStream(mem); 399 399 mem.Seek(0, soFromBeginning); 400 ConManager.Connection[Con ID].UpdateRawFile(fileid, datoffset, mem);400 ConManager.Connection[ConnectionID].UpdateRawFile(fileid, datoffset, mem); 401 401 mem.Free; 402 402 hex.Modified := False; … … 506 506 begin 507 507 saved.Filter := 'Files of matching extension (*.' + 508 ConManager.Connection[Con ID].GetFileInfo(fileid).Extension + ')|*.' +509 ConManager.Connection[Con ID].GetFileInfo(fileid).Extension +508 ConManager.Connection[ConnectionID].GetFileInfo(fileid).Extension + ')|*.' + 509 ConManager.Connection[ConnectionID].GetFileInfo(fileid).Extension + 510 510 '|All files|*.*'; 511 saved.DefaultExt := ConManager.Connection[Con ID].GetFileInfo(fileid).Extension;511 saved.DefaultExt := ConManager.Connection[ConnectionID].GetFileInfo(fileid).Extension; 512 512 if saved.Execute then 513 513 begin … … 525 525 // Data: Tdata; 526 526 fs: TFileStream; 527 data: TByteData;528 527 i: Integer; 529 528 rawinfo: TRawDataInfo; 530 529 begin 531 530 opend.Filter := 'Files of matching extension (*.' + 532 ConManager.Connection[Con ID].GetFileInfo(fileid).Extension + ')|*.' +533 ConManager.Connection[Con ID].GetFileInfo(fileid).Extension +531 ConManager.Connection[ConnectionID].GetFileInfo(fileid).Extension + ')|*.' + 532 ConManager.Connection[ConnectionID].GetFileInfo(fileid).Extension + 534 533 '|All files|*.*'; 535 534 if opend.Execute then … … 538 537 if fs.Size <> hex.DataSize then 539 538 begin 540 if (not (CR_ResizeRaw in ConManager.Connection[Con ID].ChangeRights)) and (not (CR_AppendRaw in ConManager.Connection[ConnectionID].ChangeRights)) then539 if (not (CR_ResizeRaw in ConManager.Connection[ConnectionID].ChangeRights)) and (not (CR_AppendRaw in ConManager.Connection[ConnectionID].ChangeRights)) then 541 540 begin 542 541 ShowMessage('Can''t import ' + ExtractFilename(importd.FileName) + … … 558 557 end; 559 558 end; 560 rawinfo := ConManager.Connection[Con ID].GetRawInfo(fileid, datoffset);561 if CR_ResizeRaw in ConManager.Connection[Con ID].ChangeRights then562 ConManager.Connection[Con ID].UpdateRawFile(fileid, datoffset, fs)563 else if CR_AppendRaw in ConManager.Connection[Con ID].ChangeRights then564 i := ConManager.Connection[Con ID].AppendRawFile(rawinfo.LocSep, fs);565 ConManager.Connection[Con ID].UpdateDatFilePart(fileid, datoffset, 4, @i);559 rawinfo := ConManager.Connection[ConnectionID].GetRawInfo(fileid, datoffset); 560 if CR_ResizeRaw in ConManager.Connection[ConnectionID].ChangeRights then 561 ConManager.Connection[ConnectionID].UpdateRawFile(fileid, datoffset, fs) 562 else if CR_AppendRaw in ConManager.Connection[ConnectionID].ChangeRights then 563 i := ConManager.Connection[ConnectionID].AppendRawFile(rawinfo.LocSep, fs); 564 ConManager.Connection[ConnectionID].UpdateDatFilePart(fileid, datoffset, 4, @i); 566 565 end else begin 567 ConManager.Connection[Con ID].UpdateRawFile(fileid, datoffset, fs);566 ConManager.Connection[ConnectionID].UpdateRawFile(fileid, datoffset, fs); 568 567 end; 569 568 fs.Seek(0, soFromBeginning); -
oup/current/Tools/Template.pas
r106 r113 153 153 combo_extension.Items.Add('_All files_ (' + 154 154 IntToStr(ConManager.Connection[FConnectionID].GetFileCount) + ')'); 155 exts := nil; 155 156 exts := ConManager.Connection[FConnectionID].GetExtensionsList(EF_ExtCount); 156 157 for i := 0 to exts.Count - 1 do … … 177 178 pattern: String; 178 179 files: TStrings; 179 i: Integer;180 180 begin 181 181 if FConnectionID > -1 then … … 192 192 Extension := ''; 193 193 194 files := nil; 194 195 files := ConManager.Connection[FConnectionID].GetFilesList(extension, pattern, no_zero_bytes, FSortBy); 195 196 … … 283 284 var 284 285 name: String; 285 nstart, nend: Integer;286 i: Integer;287 286 begin 288 287 if combo_connection.ItemIndex >= 0 then
Note:
See TracChangeset
for help on using the changeset viewer.