int
__cdecl main_0(
int
argc,
const
char
**argv,
const
char
**envp)
{
PVOID
lpBaseAddress;
...
if
( IsDebuggerPresent() )
{
falseflagfun();
return
0;
}
else
{
GetStartupInfoA(&StartupInfo);
GetModuleFileNameA(0, Filename, 0x104u);
if
( CreateProcessA(Filename, 0, 0, 0, 0, 3u, 0, 0, &StartupInfo, &ProcessInformation) )
{
v5 = 1;
LABEL_6:
while
( v5 )
{
dwContinueStatus = 0x10002;
WaitForDebugEvent(&DebugEvent, 0xFFFFFFFF);
switch
( DebugEvent.dwDebugEventCode )
{
case
1u:
if
( DebugEvent.u.Exception.ExceptionRecord.ExceptionCode == 0x80000003 )
{
v8 = 1;
dwContinueStatus = 65538;
lpBaseAddress = DebugEvent.u.Exception.ExceptionRecord.ExceptionAddress;
ReadProcessMemory(
ProcessInformation.hProcess,
DebugEvent.u.Exception.ExceptionRecord.ExceptionAddress,
Buffer,
0x23u,
NumberOfBytesRead);
if
( NumberOfBytesRead[0] )
{
for
( i = 1; i < 35 && Buffer[i] == 0x90; ++i )
;
}
if
( i == 1 )
v8 = 0;
if
( v8 )
{
switch
( i )
{
case
4:
Context.ContextFlags = 65543;
hThread = OpenThread(0x1FFFFFu, 0, DebugEvent.dwThreadId);
if
( !GetThreadContext(hThread, &Context) )
goto
LABEL_31;
++Context.Eip;
if
( SetThreadContext(hThread, &Context) )
{
dwContinueStatus = 65538;
CloseHandle(hThread);
}
goto
LABEL_33;
case
5:
LABEL_31:
ContinueDebugEvent(DebugEvent.dwProcessId, DebugEvent.dwThreadId, 0x80010001);
goto
LABEL_6;
case
7:
WriteProcessMemory(ProcessInformation.hProcess, lpBaseAddress, v16, 7u, NumberOfBytesWritten);
if
( NumberOfBytesWritten[0] == 7 )
{
ReadProcessMemory(ProcessInformation.hProcess, lpBaseAddress, Buffer, 7u, NumberOfBytesRead);
dwContinueStatus = 65538;
}
goto
LABEL_33;
case
30:
WriteProcessMemory(ProcessInformation.hProcess, lpBaseAddress, v15, 0x1Eu, NumberOfBytesWritten);
if
( NumberOfBytesWritten[0] == 30 )
dwContinueStatus = 65538;
goto
LABEL_33;
default
:
goto
LABEL_33;
...
}