Skip to content

Commit

Permalink
Synchronized to C++ version from April 1-st, 2017
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcdos committed Jul 14, 2017
1 parent 4204b5a commit 18ed0f4
Show file tree
Hide file tree
Showing 25 changed files with 2,458 additions and 1,117 deletions.
1,090 changes: 748 additions & 342 deletions Decompiler.pas

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions Def_decomp.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ interface
IF_ARRAY_PTR, // 128;
IF_INTVAL, // 256;
IF_INTERFACE, // 512;
IF_EXTERN_VAR // 1024; // Used for embedded procedures
IF_EXTERN_VAR, // 1024; // Used for embedded procedures
IF_RECORD_FOFS // 2048; // Offset inside record
);
TDecomIset = Set of TDecomIflag;

Expand All @@ -31,11 +32,12 @@ interface

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

TAB_SIZE = 2;
Expand Down Expand Up @@ -132,7 +134,8 @@ TCaseTreeNode = record
DContext = record
adr:Integer;
gregs:Regs; //general registers
fregs:Regs; //float point registers
fregs:Regs; //floating point registers
fregsd:Regs; //floating point registers (copy)
End;
PDContext = ^DContext;

Expand Down
2 changes: 1 addition & 1 deletion Def_disasm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ TDisInfo = record
Offset:Integer;
//ImmPresent:Boolean;
Immediate:Integer;
MemSize:Integer;
OpSize:Byte;
sSize:String[32];
RepPrefix:Integer;
SegPrefix:Integer;
Expand Down
20 changes: 11 additions & 9 deletions Def_know.pas
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ FieldInfo = class
//FIELDINFO():xrefs(0){}
//~FIELDINFO();
Scope:Byte; //9-private, 10-protected, 11-public, 12-published
Offset:Integer; //Offset in the object
Offset:Integer; //Offset in class instance
_Case:Integer; //case for record types (0xFFFFFFFF for the rest)
Name:AnsiString; //Field name
_Type:AnsiString; //Field type
xrefs:TList; //References to this field from the CODE section
xrefs:TList; //XRefs to this field from the CODE section
Constructor Create;
Destructor Destroy; Override;
End;
Expand Down Expand Up @@ -220,14 +220,14 @@ MTypeInfo = record
Kind:Byte; //drArrayDef,...,drVariantDef
VMCnt:WORD; //Number of elements in VMT (indexed from 0)
Decl:AnsiString; //Declaration
DumpSz, //Ðàçìåð áèíàðíîãî äàìïà
FixupNum:Integer; //Êîëè÷åñòâî ôèêñàïîâ äàìïà
Dump:PAnsiChar; //Áèíàðíûé äàìï
FieldsNum:WORD; //Êîëè÷åñòâî ïîëåé (class, interface, record)
DumpSz, //Binary dump size
FixupNum:Integer; //Binary dump fixup number
Dump:PAnsiChar; //Binary dump
FieldsNum:WORD; //Number of fields (class, interface, record)
Fields:PAnsiChar;
PropsNum:WORD; //Êîëè÷åñòâî ñâîéñòâ (class, interface)
PropsNum:WORD; //Number of properties (class, interface)
Props:PAnsiChar;
MethodsNum:WORD; //Êîëè÷åñòâî ìåòîäîâ (class, interface)
MethodsNum:WORD; //Number of methods (class, interface)
Methods:PAnsiChar;
//Constructor Create;
end;
Expand All @@ -239,7 +239,7 @@ MVarInfo = record
VarName:AnsiString;
_Type:Byte; //'V'-Var;'A'-AbsVar;'S'-SpecVar;'T'-ThreadVar
TypeDef:AnsiString;
AbsName:AnsiString; //Äëÿ êëþ÷åâîãî ñëîâà absolute
AbsName:AnsiString; //for the "absolute" keyword
//Constructor Create;
end;
PMVarInfo = ^MVarInfo;
Expand Down Expand Up @@ -277,6 +277,8 @@ MProcInfo = record

Const

SCOPE_TMP = 32; // Temp struct FIELDINFO, to be deleted

// Description of the Kind values
drArrayDef = $4C; //'L'
drClassDef = $46; //'F'
Expand Down
7 changes: 6 additions & 1 deletion Def_main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface
TChars = Set of Char;

//Float Type
TFloatKind = (FT_NONE, FT_SINGLE, FT_DOUBLE, FT_EXTENDED, FT_REAL, FT_COMP);
TFloatKind = (FT_NONE, FT_SINGLE, FT_DOUBLE, FT_EXTENDED, FT_REAL, FT_COMP, FT_CURRENCY);
TUnit_type = (
ut_Trivial, //Trivial unit
ut_User, //User unit
Expand Down Expand Up @@ -149,6 +149,11 @@ SegmentInfo = record
End;
PSegmentInfo = ^SegmentInfo;

CaseInfo = record
caseNo,count:Integer;
end;
PCaseInfo = ^CaseInfo;

FuncListRec = record
name:AnsiString;
codeOfs:Integer;
Expand Down
2 changes: 1 addition & 1 deletion Def_thread.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface
Type
ThreadAnalysisOperation =
(
taStartPrBar, taUpdatePrBar, taStopPrBar, taUpdateStBar,
taStartPrBar, taUpdatePrBar, taStopPrBar, taUpdateStBar,
taUpdateUnits, taUpdateRTTIs, taUpdateVmtList, taUpdateStrings, taUpdateCode, taUpdateXrefs,
taUpdateShortClassViewer, taUpdateClassViewer, taUpdateBeforeClassViewer,
taFinished
Expand Down
2 changes: 1 addition & 1 deletion Disasm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ function MDisasm.GetOp(mnem:AnsiString): Byte;
if sptr<>'' then
begin
if Assigned(disLine) then disLine^:=disLine^ + sptr + ' ptr ';
DisInfo.MemSize := size;
DisInfo.OpSize := size;
DisInfo.sSize:=sptr;
End;
end;
Expand Down
2 changes: 1 addition & 1 deletion EditFieldsDlg.pas
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ procedure TFEditFieldsDlg.bApplyClick(Sender : TObject);
recN := GetInfoRec(VmtAdr);
if Op = FD_OP_ADD then
begin
fInfo := FMain.GetField(recN.Name, offset, vmt, adr);
fInfo := FMain.GetField(recN.Name, offset, vmt, adr,'');
if Not Assigned(fInfo) Then
if Application.MessageBox('Field already exists', 'Replace?', MB_YESNO) = IDYES then
recN.vmtInfo.AddField(0, 0, FIELD_PUBLIC, offset, -1, edtName.text, edtType.text);
Expand Down
28 changes: 20 additions & 8 deletions EditFunctionDlg.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ object FEditFunctionDlg: TFEditFunctionDlg
TabOrder = 1
OnClick = bAddClick
end
object bRemove: TButton
object bRemoveSelected: TButton
Left = 212
Top = 5
Width = 75
Width = 100
Height = 25
Caption = 'Remove'
Caption = 'Remove Selected'
TabOrder = 2
OnClick = bRemoveClick
OnClick = bRemoveSelectedClick
end
object bOk: TButton
Left = 625
Expand All @@ -61,6 +61,15 @@ object FEditFunctionDlg: TFEditFunctionDlg
TabOrder = 3
OnClick = bOkClick
end
object bRemoveAll: TButton
Left = 368
Top = 5
Width = 97
Height = 25
Caption = 'Remove All'
TabOrder = 4
OnClick = bRemoveAllClick
end
end
object pc: TPageControl
Left = 0
Expand Down Expand Up @@ -314,23 +323,26 @@ object FEditFunctionDlg: TFEditFunctionDlg
object lbVars: TListBox
Left = 0
Top = 0
Width = 777
Height = 137
Width = 705
Height = 298
Align = alClient
Font.Charset = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Fixedsys'
Font.Style = []
ItemHeight = 16
MultiSelect = True
ParentFont = False
TabOrder = 0
OnClick = lbVarsClick
end
object pnlVars: TPanel
Left = 0
Top = 143
Width = 777
Top = 298
Width = 705
Height = 146
Align = alBottom
TabOrder = 1
object rgLocBase: TRadioGroup
Left = 260
Expand Down
Loading

0 comments on commit 18ed0f4

Please sign in to comment.