Function at 0x504c80
Capabilities:
Access the windows event log
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push eax
mov eax, 0xe
add esp, 0xfffff004
push eax
dec eax
jne 0x504c89
mov eax, dword [ebp - 4]
add esp, 0xfffff28c
push ebx
xor ebx, ebx
mov dword [ebp - 0xed78], ebx
mov dword [ebp - 0xed74], ebx
mov dword [ebp - 0xec70], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.0040573c
xor eax, eax
push ebp
push 0x50504f
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 0xc]
call fcn.0040528c
mov eax, dword [ebp - 4]
call fcn.0040574c
push eax
push 0
call sub.advapi32.dll_OpenEventLogA
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
je 0x505011
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push 0xc388
lea eax, [ebp - 0xc3cc]
push eax
mov eax, dword [ebp - 8]
push eax
push 6
mov eax, dword [ebp - 0x40]
push eax
call sub.advapi32.dll_ReadEventLogA
test eax, eax
je 0x505011
push 0x505064
push dword [ebp - 4]
push 0x50509c
lea edx, [ebp - 0xec70]
lea eax, [ebp - 0xc394]
call fcn.0040b6bc
push dword [ebp - 0xec70]
lea eax, [ebp - 0x24]
mov edx, 4
call fcn.0040560c
lea eax, [ebp - 0x28]
push eax
mov cl, 2
mov edx, 0x5050a8
mov eax, dword [ebp - 0x24]
call fcn.004bfaf8
lea eax, [ebp - 0x2c]
push eax
mov cl, 2
mov edx, 0x5050c4
mov eax, dword [ebp - 0x24]
call fcn.004bfaf8
push 0x2710
lea eax, [ebp - 0xeadc]
push eax
mov eax, dword [ebp - 0x28]
call fcn.0040574c
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsA
test eax, eax
je 0x504dac
lea edx, [ebp - 0x28]
lea eax, [ebp - 0xeadc]
call fcn.0040b6bc
push 0x2710
lea eax, [ebp - 0xeadc]
push eax
mov eax, dword [ebp - 0x2c]
call fcn.0040574c
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsA
test eax, eax
je 0x504dd8
lea edx, [ebp - 0x2c]
lea eax, [ebp - 0xeadc]
call fcn.0040b6bc
push 1
push 0
mov eax, dword [ebp - 0x28]
call fcn.0040574c
push eax
call sub.kernel32.dll_LoadLibraryExA_1
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
je 0x505011
push 1
push 0
mov eax, dword [ebp - 0x2c]
call fcn.0040574c
push eax
call sub.kernel32.dll_LoadLibraryExA_1
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0xec6c]
xor ecx, ecx
mov edx, 0x190
call fcn.00403464
xor eax, eax
mov dword [ebp - 0x30], eax
movzx eax, word [ebp - 0xc3b2]
test eax, eax
jle 0x504efc
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x18], 1
cmp dword [ebp - 0x30], 0
jne 0x504e53
lea eax, [ebp - 0xc3cc]
add eax, dword [ebp - 0xc3a8]
mov dword [ebp - 0x30], eax
jmp 0x504e62
mov eax, dword [ebp - 0x30]
call fcn.0040b47c
add eax, dword [ebp - 0x30]
inc eax
mov dword [ebp - 0x30], eax
lea edx, [ebp - 0x24]
mov eax, dword [ebp - 0x30]
call fcn.0040b6bc
mov edx, dword [ebp - 0x24]
mov eax, 0x5050e4
call fcn.00405890
dec eax
jne 0x504ee3
cmp dword [ebp - 0x3c], 0
je 0x504ee3
lea eax, [ebp - 0x24]
mov ecx, 2
mov edx, 1
call fcn.004057ec
lea edx, [ebp - 0x20]
mov eax, dword [ebp - 0x24]
call fcn.004038b4
mov dword [ebp - 0x1c], eax
mov eax, 0x400
call fcn.0040b6d0
mov dword [ebp - 0x34], eax
push 0
push 0x400
mov eax, dword [ebp - 0x34]
push eax
push 0
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x3c]
push eax
push 0x1800
call sub.kernel32.dll_FormatMessageA
test eax, eax
jne 0x504edd
mov eax, dword [ebp - 0x34]
call fcn.0040b71c
jmp 0x504ee3
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x30]
mov dword [ebp + eax*4 - 0xec70], edx
inc dword [ebp - 0x18]
dec dword [ebp - 0x44]
jne 0x504e3c
lea eax, [ebp - 0xeadc]
xor ecx, ecx
mov edx, 0x2710
call fcn.00403464
lea eax, [ebp - 0xec6c]
push eax
push 0x400
lea eax, [ebp - 0xeadc]
push eax
push 0
mov eax, dword [ebp - 0xc3b8]
push eax
mov eax, dword [ebp - 0x38]
push eax
push 0x3800
call sub.kernel32.dll_FormatMessageA
mov eax, dword [ebp - 0xc3b8]
and eax, 0xffff
xor edx, edx
push edx
push eax
lea eax, [ebp - 0xed70]
call fcn.00406504
lea edx, [ebp - 0xed70]
lea eax, [ebp - 0x28]
call fcn.004054f0
mov eax, dword [ebp - 0x38]
push eax
call sub.kernel32.dll_FreeLibrary_1
cmp dword [ebp - 0x3c], 0
je 0x504f78
mov eax, dword [ebp - 0x3c]
push eax
call sub.kernel32.dll_FreeLibrary_1
lea edx, [ebp - 0xed74]
lea eax, [ebp - 0xeadc]
call fcn.0040b6bc
mov eax, dword [ebp - 0xed74]
lea edx, [ebp - 0x24]
call fcn.0040a298
lea eax, [ebp - 0x2c]
call fcn.0040528c
mov eax, dword [ebp - 0x24]
call fcn.0040554c
test eax, eax
jle 0x504ffd
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x1c], 1
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x1c]
mov al, byte [eax + edx - 1]
sub al, 0x20
jae 0x504fd2
lea eax, [ebp - 0x2c]
mov edx, 0x5050f0
call fcn.00405554
jmp 0x504ff5
lea eax, [ebp - 0xed78]
mov edx, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x1c]
mov dl, byte [edx + ecx - 1]
call fcn.00405474
mov edx, dword [ebp - 0xed78]
lea eax, [ebp - 0x2c]
call fcn.00405554
inc dword [ebp - 0x1c]
dec dword [ebp - 0x44]
jne 0x504fb5
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x2c]
call fcn.0040a298
mov eax, dword [ebp - 0x40]
push eax
call sub.advapi32.dll_CloseEventLog
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x505056
lea eax, [ebp - 0xed78]
mov edx, 2
call fcn.004052b0
lea eax, [ebp - 0xec70]
call fcn.0040528c
lea eax, [ebp - 0x2c]
mov edx, 3
call fcn.004052b0
lea eax, [ebp - 4]
call fcn.0040528c
ret