Function at 0x408d90
Capabilities:
Access the windows event log
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x970
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov esi, ecx
mov edi, eax
mov ecx, eax
shr edi, 1
shr eax, 2
and ecx, 1
and edi, 1
and eax, 1
test ebx, ebx
mov dword [ebp - 4], esi
mov dword [ebp - 0xc], ecx
mov dword [ebp + 0xc], edi
mov dword [ebp - 8], eax
jne 0x408dc9
mov dword [ebp - 8], ebx
cmp ebx, dword [esi + 0x144]
jle 0x408dda
cmp ebx, 1
jg 0x409042
test ebx, ebx
jl 0x409042
cmp ebx, 5
jg 0x409042
mov eax, dword [ebp + 0x1c]
test eax, eax
je 0x408e0e
push eax
mov eax, dword [ebp + 0x18]
push eax
lea ecx, [ebp - 0x570]
push 0x400
push ecx
call dword [sym.imp.MSVCR71.dll__vsnprintf]
add esp, 0x10
jmp 0x408e27
mov edx, dword [ebp + 0x18]
push 0x400
push edx
lea eax, [ebp - 0x570]
push eax
call dword [sym.imp.MSVCR71.dll__mbsnbcpy]
add esp, 0xc
mov eax, dword [esi + 0x148]
test eax, eax
mov byte [ebp - 0x171], 0
je 0x408e51
lea ecx, [ebp - 0x570]
push ecx
call dword [sym.imp.MSVCR71.dll_printf]
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
test edi, edi
je 0x408ebe
mov edx, dword [esi + 0x14c]
test edx, edx
je 0x408ebe
cmp ebx, 1
jg 0x408ebe
test ebx, ebx
mov ecx, 1
jne 0x408e72
mov ecx, 4
test ebx, ebx
lea eax, [ebp - 0x570]
mov dword [ebp + 0x18], eax
mov eax, 0xc0070003
jne 0x408e89
mov eax, 0x40070001
push 0
lea edi, [ebp + 0x18]
push edi
push 0
push 1
push 0
push eax
push 0
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_ReportEventA]
test eax, eax
jne 0x408ebb
mov ecx, dword [esi + 0x14c]
push ecx
call dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
mov dword [esi + 0x14c], 0
mov edi, dword [ebp + 0xc]
cmp ebx, dword [esi + 0x144]
jg 0x409042
lea edx, [ebp - 0x14]
push edx
call dword [sym.imp.MSVCR71.dll__time64]
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.MSVCR71.dll__localtime64]
push eax
push str.__m__d__y__H:_M:_S_
lea ecx, [ebp - 0x70]
push 0x40
push ecx
call dword [sym.imp.MSVCR71.dll_strftime]
mov eax, dword [ebp + 0x14]
add esp, 0x18
test eax, eax
je 0x408f4b
push 0
lea edx, [ebp - 0x170]
push edx
push 0
push 0
push eax
call dword [sym.imp.MSVCR71.dll__splitpath]
mov ecx, dword [ebp + 0x10]
lea eax, [ebp - 0x570]
push eax
push ecx
lea edx, [ebp - 0x170]
push edx
lea eax, [ebx + ebx*4]
lea ecx, [eax*2 + str.Status:]
push ecx
lea edx, [ebp - 0x70]
push edx
push str._s_s__s:_d___s_r_n
lea eax, [ebp - 0x970]
push 0x400
push eax
call dword [sym.imp.MSVCR71.dll__snprintf]
add esp, 0x34
jmp 0x408f7b
lea ecx, [ebp - 0x570]
push ecx
lea edx, [ebx + ebx*4]
lea eax, [edx*2 + str.Status:]
push eax
lea ecx, [ebp - 0x70]
push ecx
push str._s_s_s_r_n
lea edx, [ebp - 0x970]
push 0x400
push edx
call dword [sym.imp.MSVCR71.dll__snprintf]
add esp, 0x18
mov eax, dword [ebp - 0xc]
test eax, eax
mov byte [ebp - 0x571], 0
je 0x40902e
lea eax, [ebp - 0x970]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408f96
push 0
sub eax, edx
lea ecx, [ebp + 8]
push ecx
push eax
mov eax, dword [esi + 0x150]
lea edx, [ebp - 0x970]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40901c
test edi, edi
je 0x40901c
mov eax, dword [esi + 0x14c]
test eax, eax
je 0x40901c
push 0
lea edx, [ebp + 0x18]
push edx
push 0
mov ecx, 6
mov esi, str.Cannot_write_to_log_file
lea edi, [ebp - 0x30]
rep movsd dword es:[edi], dword [esi]
push 1
push 0
push 0xc0070003
push 0
push 1
lea ecx, [ebp - 0x30]
push eax
movsb byte es:[edi], byte [esi]
mov dword [ebp + 0x18], ecx
call dword [sym.imp.ADVAPI32.dll_ReportEventA]
test eax, eax
mov esi, dword [ebp - 4]
jne 0x40901c
mov eax, dword [esi + 0x14c]
push eax
call dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
mov dword [esi + 0x14c], 0
cmp ebx, 1
jl 0x40902e
mov ecx, dword [esi + 0x150]
push ecx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov eax, dword [ebp - 8]
test eax, eax
je 0x409042
lea edx, [ebp - 0x970]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18