Function at 0x416920
Capabilities:
Access the windows event log

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x58b38d
mov eax, dword fs:[0]
push eax
sub esp, 0x18
push ebx
push esi
push edi
mov eax, dword [0x5f31c0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 4], 0
cmp dword [eax - 0xc], 0
je 0x416af2
push 0x59dc88
push 0
mov dword [ebp - 0x1c], 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov dword [ebp - 0x24], eax
test eax, eax
je 0x416af2
xor ebx, ebx
cmp dword [ebp + 0xc], ebx
setne bl
xor edi, edi
add ebx, 0x6d7
cmp dword [ebp + 0x10], edi
je 0x416997
mov edi, 1
jmp 0x4169a2
cmp dword [ebp + 0x14], edi
mov eax, 4
cmovne edi, eax
mov eax, dword [ebp + 8]
cmp dword [eax - 4], 1
jle 0x4169b9
push dword [eax - 0xc]
lea ecx, [ebp + 8]
call fcn.00404760
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x10]
push eax
push 1
push 8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenThreadToken]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x416a17
call esi
cmp eax, 0x3f0
je 0x4169f9
xor esi, esi
jmp 0x416ad2
lea eax, [ebp - 0x10]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x416a17
xor esi, esi
jmp 0x416ad2
lea eax, [ebp - 0x14]
push eax
push 0
push 0
push 1
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x416a35
xor esi, esi
jmp 0x416ad2
call esi
cmp eax, 0x7a
je 0x416a43
xor esi, esi
jmp 0x416ad2
mov esi, dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push esi
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
mov dword [ebp - 0x18], esi
test esi, esi
je 0x416ad2
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push esi
push 1
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x416a7a
xor esi, esi
jmp 0x416ad2
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
push eax
push 0
mov dword [ebp - 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x416ad2
mov eax, dword [ebp - 0x18]
push dword [eax]
push esi
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_CopySid]
test eax, eax
jne 0x416ab2
xor esi, esi
jmp 0x416ad2
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x416ac0
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x18]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push 0
lea eax, [ebp - 0x1c]
push eax
push 0
push 1
push esi
mov esi, dword [ebp - 0x24]
push ebx
push 0
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_ReportEventW]
push esi
call dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
mov edx, dword [ebp + 8]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x416b0d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret