forked from Hendi48/Magicmida
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMagicmida.dpr
More file actions
71 lines (61 loc) · 1.58 KB
/
Magicmida.dpr
File metadata and controls
71 lines (61 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
program Magicmida;
{$WEAKLINKRTTI ON}
{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
uses
Windows,
TypInfo,
Vcl.Forms,
Unit2 in 'Unit2.pas' {ThemidaUnpackerWnd},
{$IFDEF CPUX86}
Themida in 'Themida.pas',
Patcher in 'Patcher.pas',
{$ENDIF }
{$IFDEF CPUX64}
Themida64 in 'Themida64.pas',
{$ENDIF }
Utils in 'Utils.pas',
Dumper in 'Dumper.pas',
PEInfo in 'PEInfo.pas',
BeaEngineDelphi in 'BeaEngineDelphi.pas',
Tracer in 'Tracer.pas',
AntiDumpFix in 'AntiDumpFix.pas',
DebuggerCore in 'DebuggerCore.pas';
{$R *.res}
procedure ConsoleLog(MsgType: TLogMsgType; const Msg: string);
begin
Writeln('[', Copy(TypInfo.GetEnumName(TypeInfo(TLogMsgType), Ord(MsgType)), 3, 10), '] ', Msg);
end;
procedure CheckCommandlineInvocation;
begin
if (ParamCount >= 1) and (ParamStr(1) = '/unpack') then
begin
if not AttachConsole(ATTACH_PARENT_PROCESS) then
begin
AssignFile(Output, 'NUL');
Rewrite(Output);
end;
Log := ConsoleLog;
if ParamCount < 2 then
begin
Writeln('Usage: ', ParamStr(0), ' /unpack <filename>');
Halt(1);
end;
try
with {$IFDEF CPUX86}TTMDebugger{$ELSE}TTMDebugger64{$ENDIF}.Create(ParamStr(2), '', True) do
try
WaitFor;
finally
Free;
end;
finally
Halt(0);
end;
end;
end;
begin
CheckCommandlineInvocation;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TThemidaUnpackerWnd, ThemidaUnpackerWnd);
Application.Run;
end.