Skip to content

Commit 18ed0f4

Browse files
author
tmcdos
committed
Synchronized to C++ version from April 1-st, 2017
1 parent 4204b5a commit 18ed0f4

25 files changed

+2458
-1117
lines changed

Decompiler.pas

+748-342
Large diffs are not rendered by default.

Def_decomp.pas

+10-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ interface
1414
IF_ARRAY_PTR, // 128;
1515
IF_INTVAL, // 256;
1616
IF_INTERFACE, // 512;
17-
IF_EXTERN_VAR // 1024; // Used for embedded procedures
17+
IF_EXTERN_VAR, // 1024; // Used for embedded procedures
18+
IF_RECORD_FOFS // 2048; // Offset inside record
1819
);
1920
TDecomIset = Set of TDecomIflag;
2021

@@ -31,11 +32,12 @@ interface
3132

3233
Const
3334
//Precedence of operations
34-
PRECEDENCE_ATOM = 8;
35-
PRECEDENCE_NOT = 4; //@,not
36-
PRECEDENCE_MULT = 3; //*,/,div, mod,and,shl,shr,as
37-
PRECEDENCE_ADD = 2; //+,-,or,xor
38-
PRECEDENCE_CMP = 1; //=,<>,<,>,<=,>=,in,is
35+
PRECEDENCE_ATOM = 24;
36+
PRECEDENCE_UNARY = 16;
37+
PRECEDENCE_MULT = 15; //*,/,div, mod,and,shl,shr,as
38+
PRECEDENCE_ADD = 14; //+,-,or,xor
39+
PRECEDENCE_NOT = 6; //@,not
40+
PRECEDENCE_CMP = 9; //=,<>,<,>,<=,>=,in,is
3941
PRECEDENCE_NONE = 0;
4042

4143
TAB_SIZE = 2;
@@ -132,7 +134,8 @@ TCaseTreeNode = record
132134
DContext = record
133135
adr:Integer;
134136
gregs:Regs; //general registers
135-
fregs:Regs; //float point registers
137+
fregs:Regs; //floating point registers
138+
fregsd:Regs; //floating point registers (copy)
136139
End;
137140
PDContext = ^DContext;
138141

Def_disasm.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ TDisInfo = record
9898
Offset:Integer;
9999
//ImmPresent:Boolean;
100100
Immediate:Integer;
101-
MemSize:Integer;
101+
OpSize:Byte;
102102
sSize:String[32];
103103
RepPrefix:Integer;
104104
SegPrefix:Integer;

Def_know.pas

+11-9
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ FieldInfo = class
144144
//FIELDINFO():xrefs(0){}
145145
//~FIELDINFO();
146146
Scope:Byte; //9-private, 10-protected, 11-public, 12-published
147-
Offset:Integer; //Offset in the object
147+
Offset:Integer; //Offset in class instance
148148
_Case:Integer; //case for record types (0xFFFFFFFF for the rest)
149149
Name:AnsiString; //Field name
150150
_Type:AnsiString; //Field type
151-
xrefs:TList; //References to this field from the CODE section
151+
xrefs:TList; //XRefs to this field from the CODE section
152152
Constructor Create;
153153
Destructor Destroy; Override;
154154
End;
@@ -220,14 +220,14 @@ MTypeInfo = record
220220
Kind:Byte; //drArrayDef,...,drVariantDef
221221
VMCnt:WORD; //Number of elements in VMT (indexed from 0)
222222
Decl:AnsiString; //Declaration
223-
DumpSz, //Ðàçìåð áèíàðíîãî äàìïà
224-
FixupNum:Integer; //Êîëè÷åñòâî ôèêñàïîâ äàìïà
225-
Dump:PAnsiChar; //Áèíàðíûé äàìï
226-
FieldsNum:WORD; //Êîëè÷åñòâî ïîëåé (class, interface, record)
223+
DumpSz, //Binary dump size
224+
FixupNum:Integer; //Binary dump fixup number
225+
Dump:PAnsiChar; //Binary dump
226+
FieldsNum:WORD; //Number of fields (class, interface, record)
227227
Fields:PAnsiChar;
228-
PropsNum:WORD; //Êîëè÷åñòâî ñâîéñòâ (class, interface)
228+
PropsNum:WORD; //Number of properties (class, interface)
229229
Props:PAnsiChar;
230-
MethodsNum:WORD; //Êîëè÷åñòâî ìåòîäîâ (class, interface)
230+
MethodsNum:WORD; //Number of methods (class, interface)
231231
Methods:PAnsiChar;
232232
//Constructor Create;
233233
end;
@@ -239,7 +239,7 @@ MVarInfo = record
239239
VarName:AnsiString;
240240
_Type:Byte; //'V'-Var;'A'-AbsVar;'S'-SpecVar;'T'-ThreadVar
241241
TypeDef:AnsiString;
242-
AbsName:AnsiString; //Äëÿ êëþ÷åâîãî ñëîâà absolute
242+
AbsName:AnsiString; //for the "absolute" keyword
243243
//Constructor Create;
244244
end;
245245
PMVarInfo = ^MVarInfo;
@@ -277,6 +277,8 @@ MProcInfo = record
277277

278278
Const
279279

280+
SCOPE_TMP = 32; // Temp struct FIELDINFO, to be deleted
281+
280282
// Description of the Kind values
281283
drArrayDef = $4C; //'L'
282284
drClassDef = $46; //'F'

Def_main.pas

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface
99
TChars = Set of Char;
1010

1111
//Float Type
12-
TFloatKind = (FT_NONE, FT_SINGLE, FT_DOUBLE, FT_EXTENDED, FT_REAL, FT_COMP);
12+
TFloatKind = (FT_NONE, FT_SINGLE, FT_DOUBLE, FT_EXTENDED, FT_REAL, FT_COMP, FT_CURRENCY);
1313
TUnit_type = (
1414
ut_Trivial, //Trivial unit
1515
ut_User, //User unit
@@ -149,6 +149,11 @@ SegmentInfo = record
149149
End;
150150
PSegmentInfo = ^SegmentInfo;
151151

152+
CaseInfo = record
153+
caseNo,count:Integer;
154+
end;
155+
PCaseInfo = ^CaseInfo;
156+
152157
FuncListRec = record
153158
name:AnsiString;
154159
codeOfs:Integer;

Def_thread.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface
88
Type
99
ThreadAnalysisOperation =
1010
(
11-
taStartPrBar, taUpdatePrBar, taStopPrBar, taUpdateStBar,
11+
taStartPrBar, taUpdatePrBar, taStopPrBar, taUpdateStBar,
1212
taUpdateUnits, taUpdateRTTIs, taUpdateVmtList, taUpdateStrings, taUpdateCode, taUpdateXrefs,
1313
taUpdateShortClassViewer, taUpdateClassViewer, taUpdateBeforeClassViewer,
1414
taFinished

Disasm.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ function MDisasm.GetOp(mnem:AnsiString): Byte;
627627
if sptr<>'' then
628628
begin
629629
if Assigned(disLine) then disLine^:=disLine^ + sptr + ' ptr ';
630-
DisInfo.MemSize := size;
630+
DisInfo.OpSize := size;
631631
DisInfo.sSize:=sptr;
632632
End;
633633
end;

EditFieldsDlg.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ procedure TFEditFieldsDlg.bApplyClick(Sender : TObject);
216216
recN := GetInfoRec(VmtAdr);
217217
if Op = FD_OP_ADD then
218218
begin
219-
fInfo := FMain.GetField(recN.Name, offset, vmt, adr);
219+
fInfo := FMain.GetField(recN.Name, offset, vmt, adr,'');
220220
if Not Assigned(fInfo) Then
221221
if Application.MessageBox('Field already exists', 'Replace?', MB_YESNO) = IDYES then
222222
recN.vmtInfo.AddField(0, 0, FIELD_PUBLIC, offset, -1, edtName.text, edtType.text);

EditFunctionDlg.dfm

+20-8
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ object FEditFunctionDlg: TFEditFunctionDlg
4242
TabOrder = 1
4343
OnClick = bAddClick
4444
end
45-
object bRemove: TButton
45+
object bRemoveSelected: TButton
4646
Left = 212
4747
Top = 5
48-
Width = 75
48+
Width = 100
4949
Height = 25
50-
Caption = 'Remove'
50+
Caption = 'Remove Selected'
5151
TabOrder = 2
52-
OnClick = bRemoveClick
52+
OnClick = bRemoveSelectedClick
5353
end
5454
object bOk: TButton
5555
Left = 625
@@ -61,6 +61,15 @@ object FEditFunctionDlg: TFEditFunctionDlg
6161
TabOrder = 3
6262
OnClick = bOkClick
6363
end
64+
object bRemoveAll: TButton
65+
Left = 368
66+
Top = 5
67+
Width = 97
68+
Height = 25
69+
Caption = 'Remove All'
70+
TabOrder = 4
71+
OnClick = bRemoveAllClick
72+
end
6473
end
6574
object pc: TPageControl
6675
Left = 0
@@ -314,23 +323,26 @@ object FEditFunctionDlg: TFEditFunctionDlg
314323
object lbVars: TListBox
315324
Left = 0
316325
Top = 0
317-
Width = 777
318-
Height = 137
326+
Width = 705
327+
Height = 298
328+
Align = alClient
319329
Font.Charset = RUSSIAN_CHARSET
320330
Font.Color = clWindowText
321331
Font.Height = -11
322332
Font.Name = 'Fixedsys'
323333
Font.Style = []
324334
ItemHeight = 16
335+
MultiSelect = True
325336
ParentFont = False
326337
TabOrder = 0
327338
OnClick = lbVarsClick
328339
end
329340
object pnlVars: TPanel
330341
Left = 0
331-
Top = 143
332-
Width = 777
342+
Top = 298
343+
Width = 705
333344
Height = 146
345+
Align = alBottom
334346
TabOrder = 1
335347
object rgLocBase: TRadioGroup
336348
Left = 260

0 commit comments

Comments
 (0)