Function at 0x415750
Capabilities:
Access the windows event log

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x585a7d
mov eax, dword fs:[0]
push eax
sub esp, 0x18
push ebx
push esi
push edi
mov eax, dword [0x5eb1c0]
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 0x415922
push 0x5977a4
push 0
mov dword [ebp - 0x1c], 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov dword [ebp - 0x24], eax
test eax, eax
je 0x415922
xor ebx, ebx
cmp dword [ebp + 0xc], ebx
setne bl
xor edi, edi
add ebx, 0x6d7
cmp dword [ebp + 0x10], edi
je 0x4157c7
mov edi, 1
jmp 0x4157d2
cmp dword [ebp + 0x14], edi
mov eax, 4
cmovne edi, eax
mov eax, dword [ebp + 8]
cmp dword [eax - 4], 1
jle 0x4157e9
push dword [eax - 0xc]
lea ecx, [ebp + 8]
call fcn.00404180
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 0x415847
call esi
cmp eax, 0x3f0
je 0x415829
xor esi, esi
jmp 0x415902
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 0x415847
xor esi, esi
jmp 0x415902
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 0x415865
xor esi, esi
jmp 0x415902
call esi
cmp eax, 0x7a
je 0x415873
xor esi, esi
jmp 0x415902
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 0x415902
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 0x4158aa
xor esi, esi
jmp 0x415902
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 0x415902
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 0x4158e2
xor esi, esi
jmp 0x415902
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4158f0
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 0x41593d
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