Function at 0x40ec47
Capabilities:
Print debug messages
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x168
push ebx
push esi
push edi
push 0x413ff4
push 1
push 0
mov dword [ebp - 0x14], edx
mov dword [ebp - 0xc], ecx
call dword [sym.imp.kernel32.dll_CreateWaitableTimerA]
mov ebx, dword [sym.imp.kernel32.dll_GetLastError]
mov esi, eax
call ebx
mov edi, dword [sym.imp.kernel32.dll_CancelWaitableTimer]
push esi
call edi
call ebx
push 0x39a
xor esi, esi
push esi
call dword [sym.imp.kernel32.dll_LocalAlloc]
push eax
call dword [sym.imp.kernel32.dll_LocalFree]
lea eax, [ebp - 0x18]
push eax
push 0x20019
push esi
push 0x414004
push 0x80000001
call dword [sym.imp.advapi32.dll_RegOpenKeyExA]
push esi
push 0x21a
push esi
push 4
push esi
push 0xffffffffffffffff
call dword [sym.imp.kernel32.dll_CreateFileMappingW]
mov esi, eax
lea eax, [ebp - 0x1c]
push eax
push 0x20019
push 0
push 0x414010
push 0x80000001
call dword [sym.imp.advapi32.dll_RegOpenKeyExA]
push esi
call dword [sym.imp.kernel32.dll_]
call ebx
push 0x41401c
xor esi, esi
push esi
push esi
call dword [sym.imp.kernel32.dll_CreateMutexA]
test eax, eax
je 0x40ed00
push eax
call dword [0x411020]
jmp 0x40ed0b
push 0x414028
call dword [sym.imp.kernel32.dll_OutputDebugStringA]
push 0x414034
push 1
push esi
call dword [sym.imp.kernel32.dll_CreateWaitableTimerA]
mov esi, eax
call ebx
test esi, esi
je 0x40ed24
push esi
call edi
mov eax, dword [0x4151bc]
push dword [ebp - 0xc]
mov esi, dword [0x41504c]
mov dword [ebp - 0x10], eax
mov eax, dword [0x415090]
call eax
lea eax, [eax*2 + 0x100]
push eax
push 0x40
call esi
mov ebx, eax
xor edi, edi
mov eax, dword [ebp - 0xc]
push 2
pop ecx
push 0x414044
cmp word [eax], 0x5c
push 0x414050
cmove edi, ecx
add edi, eax
call dword [sym.imp.kernel32.dll_SetEnvironmentVariableA]
lea eax, [ebp - 0x164]
push eax
push 0x41405c
call dword [sym.imp.kernel32.dll_FindFirstFileA]
push eax
call dword [sym.imp.kernel32.dll_pd_3JD9_w_8]
push 0x414068
push 0
push 1
push 0
call dword [sym.imp.kernel32.dll____TEg_Td:kJ__FfFpIDL_]
mov esi, eax
push esi
call dword [sym.imp.kernel32.dll_SetEvent]
push esi
call dword [sym.imp.kernel32.dll_ResetEvent]
push 0x414074
push 1
push 0
call dword [sym.imp.kernel32.dll_CreateWaitableTimerA]
mov esi, dword [sym.imp.kernel32.dll_CancelWaitableTimer]
push eax
call esi
xor eax, eax
push eax
push 0x12f3
push eax
push 4
push eax
push 0xffffffffffffffff
call dword [sym.imp.kernel32.dll_CreateFileMappingW]
push eax
call dword [sym.imp.kernel32.dll_]
push 0x414084
push 0
push 0
call dword [sym.imp.kernel32.dll_CreateMutexA]
mov dword [ebp - 8], eax
test eax, eax
je 0x40ee09
push 0x414090
push 0x41409c
call dword [sym.imp.kernel32.dll_SetEnvironmentVariableA]
push dword [ebp - 8]
call dword [0x411020]
jmp 0x40ee0f
call dword [sym.imp.kernel32.dll_GetLastError]
push 0x4140a8
push 1
push 0
push 0
call dword [sym.imp.kernel32.dll_CreateSemaphoreA]
push 0
push 1
push eax
call dword [sym.imp.kernel32.dll_ReleaseSemaphore]
push 0x4140b4
push 1
push 0
call dword [sym.imp.kernel32.dll_CreateWaitableTimerA]
test eax, eax
je 0x40ee46
push eax
call esi
jmp 0x40ef2f
lea eax, [ebp - 0x20]
push eax
push 0x20019
push 0
push 0x4140c4
push 0x80000001
call dword [sym.imp.advapi32.dll_RegOpenKeyExA]
jmp 0x40ef2f
push dword [ebp - 0xc]
mov eax, dword [0x415090]
mov esi, dword [0x41504c]
call eax
lea eax, [eax*2 + 0x100]
push eax
push 0x40
call esi
push dword [0x4152a8]
mov ecx, dword [0x415190]
push edi
mov dword [ebp - 8], eax
call ecx
mov esi, eax
test esi, esi
je 0x40eecf
sub esi, edi
lea edx, [ebp - 8]
sar esi, 1
mov ecx, edi
push esi
push 0
call fcn.0040ef56
pop ecx
pop ecx
test eax, eax
je 0x40eec7
mov edx, dword [ebp - 0x10]
mov ecx, ebx
call fcn.0040f343
mov edx, dword [ebp - 8]
mov ecx, eax
call fcn.0040f343
mov ebx, eax
lea edi, [edi + esi*2]
add edi, 2
jmp 0x40ef26
cmp dword [ebp + 8], 0
je 0x40eee4
mov edx, dword [ebp - 0x10]
mov ecx, ebx
call fcn.0040f343
mov edx, dword [ebp + 8]
jmp 0x40ef0c
mov eax, dword [0x415090]
push edi
call eax
push eax
push 0
lea edx, [ebp - 8]
mov ecx, edi
call fcn.0040ef56
pop ecx
pop ecx
test eax, eax
je 0x40ef15
mov edx, dword [ebp - 0x10]
mov ecx, ebx
call fcn.0040f343
mov edx, dword [ebp - 8]
mov ecx, eax
call fcn.0040f343
mov ebx, eax
mov esi, dword [ebp - 0x14]
mov eax, dword [0x415144]
push ebx
push dword [esi]
call eax
mov dword [esi], eax
xor edi, edi
push dword [ebp - 8]
call dword [0x4150cc]
test edi, edi
jne 0x40ee66
mov esi, dword [ebp - 0x14]
mov ecx, dword [0x415144]
push ebx
push dword [esi]
call ecx
push ebx
mov dword [esi], eax
call dword [0x4150cc]
pop edi
xor eax, eax
pop esi
inc eax
pop ebx
leave
ret