| 33 |
|
|
| 34 |
|
procedure LoadDat(_fileid: Integer); |
| 35 |
|
function Save: Boolean; |
| 36 |
< |
function GetValue(datatype: Word; offset: LongWord): String; |
| 37 |
< |
procedure SetNewValue(datatype: Word; offset: LongWord; Value: String); |
| 36 |
> |
function GetValue(datatype: Word; offset: Integer): String; |
| 37 |
> |
procedure SetNewValue(datatype: Word; offset: Integer; Value: String); |
| 38 |
|
|
| 39 |
|
procedure WriteStructureInfos; |
| 40 |
|
procedure ClearStructViewer; |
| 139 |
|
procedure TForm_BinEdit.LoadDat(_fileid: Integer); |
| 140 |
|
var |
| 141 |
|
mem: TMemoryStream; |
| 142 |
– |
Data: TByteData; |
| 142 |
|
begin |
| 143 |
|
if ConID <> -1 then |
| 144 |
|
begin |
| 177 |
|
|
| 178 |
|
|
| 179 |
|
|
| 180 |
< |
|
| 182 |
< |
function IntToBin(Value: Byte): String; |
| 183 |
< |
var |
| 184 |
< |
i: Byte; |
| 185 |
< |
begin |
| 186 |
< |
Result := ''; |
| 187 |
< |
for i := 7 downto 0 do |
| 188 |
< |
Result := Result + IntToStr((Value shr i) and $01); |
| 189 |
< |
end; |
| 190 |
< |
|
| 191 |
< |
|
| 192 |
< |
|
| 193 |
< |
|
| 194 |
< |
function TForm_BinEdit.GetValue(datatype: Word; offset: LongWord): String; |
| 180 |
> |
function TForm_BinEdit.GetValue(datatype: Word; offset: Integer): String; |
| 181 |
|
var |
| 182 |
|
Data: TByteData; |
| 183 |
|
i: Word; |
| 184 |
+ |
tempi: Integer; |
| 185 |
|
floatformat: TFormatSettings; |
| 186 |
|
begin |
| 187 |
|
floatformat.DecimalSeparator := '.'; |
| 217 |
|
10: |
| 218 |
|
Result := IntToBin(hex.Data[offset]); |
| 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; |
| 227 |
|
12: |
| 228 |
< |
Result := FormatNumber(hex.Data[offset + 1] + hex.Data[offset + 2] * 256 + |
| 229 |
< |
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'; |
| 233 |
|
13: |
| 234 |
|
Result := IntToStr(hex.Data[offset]); |
| 235 |
|
14: |
| 282 |
|
|
| 283 |
|
procedure TForm_BinEdit.WriteStructureInfos; |
| 284 |
|
var |
| 285 |
< |
i, j: LongWord; |
| 285 |
> |
i, j: Integer; |
| 286 |
|
pdata: PNodeData; |
| 287 |
|
Data: TNodeData; |
| 288 |
|
node: PVirtualNode; |
| 316 |
|
begin |
| 317 |
|
if Pos('#', SubName) > 0 then |
| 318 |
|
begin |
| 319 |
< |
Data.Offset := HexToLong(MidStr(SubName, Pos('#', SubName) + 1, 8)); |
| 320 |
< |
Data.Value := |
| 319 |
> |
Data.Offset := StrToInt('$'+MidStr(SubName, Pos('#', SubName) + 1, 8)); |
| 320 |
> |
Data.Value := '$' + |
| 321 |
|
MidStr(SubName, PosEx('#', SubName, Pos('#', SubName) + 1) + 1, 8); |
| 322 |
|
Data.Caption := MidStr(SubName, 1, Pos('#', SubName) - 1); |
| 323 |
|
Data.Description := SubDesc; |
| 384 |
|
i, j: Integer; |
| 385 |
|
Data: TByteData; |
| 386 |
|
str: String; |
| 387 |
< |
Value: LongWord; |
| 387 |
> |
Value: Integer; |
| 388 |
|
floatformat: TFormatSettings; |
| 389 |
|
begin |
| 390 |
|
floatformat.DecimalSeparator := '.'; |
| 497 |
|
function TForm_BinEdit.Save: Boolean; |
| 498 |
|
var |
| 499 |
|
mem: TMemoryStream; |
| 500 |
< |
i: LongWord; |
| 500 |
> |
i: Integer; |
| 501 |
|
begin |
| 502 |
|
case MessageBox(Self.Handle, PChar('Save changes to file ' + |
| 503 |
|
ConManager.Connection[ConID].GetFileInfo(fileid).Name + '?'), PChar('Data changed...'), |
| 679 |
|
procedure TForm_BinEdit.value_viewer_context_copyClick(Sender: TObject); |
| 680 |
|
var |
| 681 |
|
Name: String; |
| 682 |
< |
Value: LongWord; |
| 682 |
> |
Value: Integer; |
| 683 |
|
begin |
| 684 |
|
Name := TMenuItem(Sender).Name; |
| 685 |
|
if Pos('asstring', Name) > 0 then |
| 757 |
|
end |
| 758 |
|
else |
| 759 |
|
begin |
| 760 |
< |
if nodedata.DataType = 11 then |
| 760 |
> |
if (nodedata.DataType = 11) and (nodedata.Value <> 'unused') then |
| 761 |
|
begin |
| 762 |
|
if ConManager.Connection[ConID].GetRawInfo(fileid, nodedata.offset).RawSize > 0 then |
| 763 |
|
Form_Main.open_child('rawedit', ConID, fileid); |
| 764 |
|
end; |
| 765 |
< |
if nodedata.DataType = 12 then |
| 765 |
> |
if (nodedata.DataType = 12) and (nodedata.Value <> 'no link') then |
| 766 |
|
begin |
| 767 |
|
if (StrToInt(nodedata.Value) < ConManager.Connection[ConID].GetFileCount) and |
| 768 |
|
(StrToInt(nodedata.Value) > 0) and |
| 802 |
|
else |
| 803 |
|
begin |
| 804 |
|
hex.SelStart := Data.Offset; |
| 805 |
< |
hex.SelEnd := Data.Offset + HexToLong(Data.Value) - 1; |
| 805 |
> |
hex.SelEnd := Data.Offset + StrToInt(Data.Value) - 1; |
| 806 |
|
end; |
| 807 |
|
end; |
| 808 |
|
|
| 833 |
|
if Data.DataType > 0 then |
| 834 |
|
CellText := Data.Value //GetValue(data.DataType, data.Offset) |
| 835 |
|
else if Length(Data.Value) > 0 then |
| 836 |
< |
CellText := IntToStr(HexToLong(Data.Value)) + ' Bytes'; |
| 836 |
> |
CellText := IntToStr(StrToInt(Data.Value)) + ' Bytes'; |
| 837 |
|
4: |
| 838 |
|
CellText := Data.Description; |
| 839 |
|
end; |
| 864 |
|
|
| 865 |
|
|
| 866 |
|
|
| 867 |
< |
procedure TForm_BinEdit.SetNewValue(datatype: Word; offset: LongWord; Value: String); |
| 867 |
> |
procedure TForm_BinEdit.SetNewValue(datatype: Word; offset: Integer; Value: String); |
| 868 |
|
var |
| 869 |
|
Data: TByteData; |
| 870 |
|
value_int: LongWord; |
| 931 |
|
|
| 932 |
|
procedure TForm_BinEdit.value_viewerDblClick(Sender: TObject); |
| 933 |
|
var |
| 934 |
< |
offset: LongWord; |
| 934 |
> |
offset: Integer; |
| 935 |
|
datatype: Word; |
| 936 |
|
objectname: String; |
| 937 |
|
Value: String; |