-
-
几个16进制数:146DB842B-140000000+00007FF7ED5B1000-1000怎么加减运算?
-
发表于: 2020-5-21 11:36 2512
-
146DB842B-140000000 +00007FF7ED5B1000-1000
上面是几个数为Delphi的几个编辑框
求计算方法?
踩到坑了,求点拨
无论直接转,还是间接转,只要结果是:7FF7F436842B 就对了。
试了网上给出的答案各种坑儿。
要么位数有问题,要么结果有问题,要么不是想要的。
unit Unit2;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
Vcl.StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
Edit2: TEdit;
Button2: TButton;
Button3: TButton;
Edit3: TEdit;
Edit4: TEdit;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
function HexToOct(hValue: string): Integer;
begin
Result := StrToInt('$' + hValue);
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
Edit1.Text := IntToStr(HexToOct(Edit1.Text));
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
// Edit1.Text := IntToStr(HexToOct(Edit1.Text)+ HexToOct(Edit3.Text)-HexToOct(Edit4.Text));
end;
end.
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)