Function at 0x504e4c
Capabilities:
Access the windows event log
Clear windows event logs

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffbc
push ebx
push esi
push edi
xor edx, edx
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x44], edx
mov dword [ebp - 4], edx
mov dword [ebp - 8], edx
mov dword [ebp - 0xc], edx
mov byte [ebp - 0xd], al
xor eax, eax
push ebp
push 0x5050a2
push dword fs:[eax]
mov dword fs:[eax], esp
push 0x5050b0
push 0
call sub.advapi32.dll_OpenEventLogW
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x505062
xor eax, eax
mov dword [ebp - 0x28], eax
xor eax, eax
mov dword [ebp - 0x20], eax
xor eax, eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], 0x10000
mov eax, dword [ebp - 0x1c]
call fcn.00406eb8
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x28], 0
jne 0x505016
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x24]
push eax
push 0
push 9
mov eax, dword [ebp - 0x14]
push eax
call sub.advapi32.dll_ReadEventLogW
test eax, eax
jne 0x504f0c
call sub.KERNEL32.DLL_GetLastError
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0x7a
jne 0x50500c
xor eax, eax
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x24]
mov edx, dword [ebp - 0x18]
call fcn.00406eec
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x1c], eax
jmp 0x50500c
mov ebx, dword [ebp - 0x24]
cmp dword [ebp - 0x20], 0
jbe 0x50500c
mov esi, ebx
lea eax, [ebp - 4]
mov edi, ebx
mov edx, edi
add edx, 0x38
call fcn.0040b26c
mov eax, dword [ebp - 4]
mov edx, 0x5050d4
call fcn.0040b590
jne 0x504ff7
cmp dword [esi + 0x30], 0
je 0x504ff7
mov eax, dword [esi + 0x30]
push eax
lea eax, [ebp - 0xc]
mov ecx, 1
mov edx, dword [0x404b04]
call fcn.0040d144
add esp, 4
mov eax, dword [esi + 0x34]
add eax, edi
mov dword [ebp - 0x2c], eax
mov eax, dword [esi + 0x30]
mov dword [ebp - 0x30], eax
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x30]
call fcn.0040707c
lea ecx, [ebp - 8]
xor edx, edx
mov eax, dword [ebp - 0xc]
call fcn.005040a4
test al, al
je 0x504ff7
cmp dword [ebp - 8], 0
je 0x504ff7
mov dl, 1
mov eax, dword [ebp - 4]
call fcn.005036c8
push 0x505108
lea edx, [ebp - 0x40]
mov eax, dword [esi + 0xc]
call fcn.00504d24
lea eax, [ebp - 0x40]
lea edx, [ebp - 0x38]
call fcn.00504d64
push dword [ebp - 0x38]
push 0x50511c
mov eax, dword [esi + 8]
xor edx, edx
push edx
push eax
lea edx, [ebp - 0x44]
mov eax, 8
call fcn.004225f0
push dword [ebp - 0x44]
push 0x505130
push dword [ebp - 8]
lea eax, [ebp - 0x34]
mov edx, 6
call fcn.0040b4e0
mov eax, dword [ebp - 0x34]
mov dl, 1
call fcn.005036c8
mov eax, dword [ebx]
sub dword [ebp - 0x20], eax
mov eax, dword [ebx]
add eax, edi
mov ebx, eax
cmp dword [ebp - 0x20], 0
ja 0x504f19
cmp dword [ebp - 0x28], 0
je 0x504ebe
mov eax, dword [ebp - 0x24]
call fcn.00406ed4
mov eax, dword [ebp - 0x14]
push eax
call sub.advapi32.dll_CloseEventLog
cmp byte [ebp - 0xd], 0
jne 0x505062
push 0x5050b0
push 0
call sub.advapi32.dll_OpenEventLogW
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x505062
push 0
mov eax, dword [ebp - 0x14]
push eax
call sub.advapi32.dll_ClearEventLogW
mov eax, dword [ebp - 0x14]
push eax
call sub.advapi32.dll_CloseEventLog
mov dl, 1
mov eax, 0x505148
call fcn.005036c8
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5050a9
lea eax, [ebp - 0x44]
call fcn.0040a7b4
lea eax, [ebp - 0x38]
mov edx, 2
call fcn.0040a814
lea eax, [ebp - 0xc]
mov edx, dword [0x404b04]
call fcn.0040d268
lea eax, [ebp - 8]
mov edx, 2
call fcn.0040a814
pop eax
jmp eax