Function at 0x504690
Capabilities:
Access the windows event log

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x1986
push 0
push 0
dec ecx
jne 0x504699
xchg dword [ebp - 4], ecx
push ebx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], edx
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
call fcn.0040573c
xor eax, eax
push ebp
push 0x504b9e
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0x11], 0
mov eax, dword [ebp - 8]
call fcn.0040574c
push eax
push 0
call sub.advapi32.dll_OpenEventLogA
mov dword [ebp - 0x64], eax
cmp dword [ebp - 0x64], 0
je 0x504b6b
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x64]
push eax
call sub.advapi32.dll_GetNumberOfEventLogRecords
test eax, eax
je 0x504b6b
cmp dword [ebp - 0x18], 0
je 0x504b6b
lea eax, [ebp - 0xc400]
xor ecx, ecx
mov edx, 0xc388
call fcn.00403464
jmp 0x504b39
xor eax, eax
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0xc400]
add eax, dword [ebp - 0x20]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
cmp eax, dword [ebp - 0x10]
jb 0x504b62
push 0
push 0x989680
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xc]
xor edx, edx
call fcn.004062e8
add eax, 0xd53e8000
adc edx, 0x19db1de
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0x30]
and eax, 0xffffffff
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x2c]
xor edx, edx
mov dword [ebp - 0x5c], eax
lea eax, [ebp - 0x60]
push eax
lea eax, [ebp - 0x60]
push eax
call sub.kernel32.dll_FileTimeToLocalFileTime
lea eax, [ebp - 0x78]
push eax
lea eax, [ebp - 0x60]
push eax
call sub.kernel32.dll_FileTimeToSystemTime
lea eax, [ebp - 0x34]
push eax
movzx eax, word [ebp - 0x78]
mov dword [ebp - 0xcc00], eax
mov byte [ebp - 0xcbfc], 0
movzx eax, word [ebp - 0x76]
mov dword [ebp - 0xcbf8], eax
mov byte [ebp - 0xcbf4], 0
movzx eax, word [ebp - 0x72]
mov dword [ebp - 0xcbf0], eax
mov byte [ebp - 0xcbec], 0
movzx eax, word [ebp - 0x70]
mov dword [ebp - 0xcbe8], eax
mov byte [ebp - 0xcbe4], 0
movzx eax, word [ebp - 0x6e]
mov dword [ebp - 0xcbe0], eax
mov byte [ebp - 0xcbdc], 0
movzx eax, word [ebp - 0x6c]
mov dword [ebp - 0xcbd8], eax
mov byte [ebp - 0xcbd4], 0
lea edx, [ebp - 0xcc00]
mov ecx, 5
mov eax, 0x504bb8
call fcn.0040bf48
mov eax, dword [ebp - 4]
movzx eax, word [eax + 0x18]
cmp eax, 0x10
ja case.0x50481f.0
mov al, byte [eax + 0x504826]
jmp dword [eax*4 + 0x504837]
lea eax, [ebp - 0x38]
mov edx, 0x504be0
call fcn.00405324
jmp 0x5048a7
lea eax, [ebp - 0x38]
mov edx, 0x504bf0
call fcn.00405324
jmp 0x5048a7
lea eax, [ebp - 0x38]
mov edx, 0x504c00
call fcn.00405324
jmp 0x5048a7
lea eax, [ebp - 0x38]
mov edx, 0x504c14
call fcn.00405324
jmp 0x5048a7
lea eax, [ebp - 0x38]
mov edx, 0x504c2c
call fcn.00405324
jmp 0x5048a7
lea eax, [ebp - 0x38]
mov edx, 0x504c44
call fcn.00405324
push dword [ebp - 0x38]
push 0x504c54
lea edx, [ebp - 0xcc04]
mov eax, dword [ebp - 4]
movzx eax, word [eax + 0x18]
call fcn.0040a78c
push dword [ebp - 0xcc04]
push 0x504c60
lea eax, [ebp - 0x38]
mov edx, 4
call fcn.0040560c
lea edx, [ebp - 0x3c]
mov eax, dword [ebp - 4]
movzx eax, word [eax + 0x1c]
call fcn.0040a78c
lea eax, [ebp - 0x40]
call fcn.0040528c
mov dword [ebp - 0x18], 0x3e8
mov dword [ebp - 0x1c], 0x3e8
lea eax, [ebp - 0xc7e8]
xor ecx, ecx
mov edx, 0x3e8
call fcn.00403464
mov eax, dword [ebp - 4]
cmp dword [eax + 0x28], 0
je 0x504969
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0xcbd0]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0xc7e8]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2c]
add eax, dword [ebp - 4]
push eax
push 0
call sub.advapi32.dll_LookupAccountSidA
test eax, eax
je 0x504958
lea edx, [ebp - 0x40]
lea eax, [ebp - 0xc7e8]
call fcn.0040b6bc
jmp 0x504969
call sub.kernel32.dll_GetLastError_1
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x40]
call fcn.0040a878
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x44]
call fcn.0040a878
lea edx, [ebp - 0xcc08]
mov eax, dword [ebp - 4]
add eax, 0x38
call fcn.0040b6bc
mov eax, dword [ebp - 0xcc08]
lea edx, [ebp - 0x48]
call fcn.004bd2ec
push ebp
lea eax, [ebp - 0xcc0c]
call fcn.0050455c
pop ecx
mov edx, dword [ebp - 0xcc0c]
lea eax, [ebp - 0x4c]
call fcn.00405324
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x14]
and eax, 0xffff
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x54]
call fcn.0040a878
xor edx, edx
mov eax, dword [ebp - 0x44]
call fcn.0040a934
mov edx, eax
lea ecx, [ebp - 0x58]
mov eax, 0x504c6c
call fcn.00504c80
lea edx, [ebp - 0xcc10]
mov eax, dword [ebp - 8]
call fcn.004bd2ec
push dword [ebp - 0xcc10]
push 0x504c7c
lea edx, [ebp - 0xcc14]
mov eax, dword [ebp - 0x34]
call fcn.004bd2ec
push dword [ebp - 0xcc14]
push 0x504c7c
lea edx, [ebp - 0xcc18]
mov eax, dword [ebp - 0x38]
call fcn.004bd2ec
push dword [ebp - 0xcc18]
push 0x504c7c
lea edx, [ebp - 0xcc1c]
mov eax, dword [ebp - 0x3c]
call fcn.004bd2ec
push dword [ebp - 0xcc1c]
push 0x504c7c
lea edx, [ebp - 0xcc20]
mov eax, dword [ebp - 0x40]
call fcn.004bd2ec
push dword [ebp - 0xcc20]
push 0x504c7c
lea edx, [ebp - 0xcc24]
mov eax, dword [ebp - 0x44]
call fcn.004bd2ec
push dword [ebp - 0xcc24]
push 0x504c7c
lea edx, [ebp - 0xcc28]
mov eax, dword [ebp - 0x54]
call fcn.004bd2ec
push dword [ebp - 0xcc28]
push 0x504c7c
lea edx, [ebp - 0xcc2c]
mov eax, dword [ebp - 0x48]
call fcn.004bd2ec
push dword [ebp - 0xcc2c]
push 0x504c7c
lea edx, [ebp - 0xcc30]
mov eax, dword [ebp - 0x58]
call fcn.004bd2ec
push dword [ebp - 0xcc30]
push 0x504c7c
lea edx, [ebp - 0xcc34]
mov eax, dword [ebp - 0x4c]
call fcn.004bd2ec
push dword [ebp - 0xcc34]
lea eax, [ebp - 0x50]
mov edx, 0x13
call fcn.0040560c
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov edx, dword [eax]
call dword [edx + 0x14]
test eax, eax
jne 0x504b04
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov edx, dword [ebp - 0x50]
mov ecx, dword [eax]
call dword [ecx + 0x38]
jmp 0x504b13
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x50]
xor edx, edx
mov ebx, dword [eax]
call dword [ebx + 0x60]
mov eax, dword [ebp - 4]
mov eax, dword [eax]
add dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x20]
ja 0x50471f
lea eax, [ebp - 0xc400]
xor ecx, ecx
mov edx, 0xc388
call fcn.00403464
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x24]
push eax
push 0xc388
lea eax, [ebp - 0xc400]
push eax
push 0
push 9
mov eax, dword [ebp - 0x64]
push eax
call sub.advapi32.dll_ReadEventLogA
test eax, eax
jne 0x50471a
mov eax, dword [ebp - 0x64]
push eax
call sub.advapi32.dll_CloseEventLog
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x504ba5
lea eax, [ebp - 0xcc34]
mov edx, 0xd
call fcn.004052b0
lea eax, [ebp - 0x58]
mov edx, 0xa
call fcn.004052b0
lea eax, [ebp - 8]
call fcn.0040528c
ret