Function at 0x4167b0
Capabilities:
Access the windows event log

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x58fccd
mov eax, dword fs:[0]
push eax
sub esp, 0x18
push ebx
push esi
push edi
mov eax, dword [0x5fb1a0]
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 0x416982
push 0x5a2c8c
push 0
mov dword [ebp - 0x1c], 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov dword [ebp - 0x24], eax
test eax, eax
je 0x416982
xor ebx, ebx
cmp dword [ebp + 0xc], ebx
setne bl
xor edi, edi
add ebx, 0x6d7
cmp dword [ebp + 0x10], edi
je 0x416827
mov edi, 1
jmp 0x416832
cmp dword [ebp + 0x14], edi
mov eax, 4
cmovne edi, eax
mov eax, dword [ebp + 8]
cmp dword [eax - 4], 1
jle 0x416849
push dword [eax - 0xc]
lea ecx, [ebp + 8]
call fcn.00404770
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 0x4168a7
call esi
cmp eax, 0x3f0
je 0x416889
xor esi, esi
jmp 0x416962
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 0x4168a7
xor esi, esi
jmp 0x416962
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 0x4168c5
xor esi, esi
jmp 0x416962
call esi
cmp eax, 0x7a
je 0x4168d3
xor esi, esi
jmp 0x416962
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 0x416962
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 0x41690a
xor esi, esi
jmp 0x416962
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 0x416962
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 0x416942
xor esi, esi
jmp 0x416962
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x416950
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 0x41699d
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