Function at 0x40fa5c
Capabilities:
Access the windows event log
Delete registry value
Persist via windows service
Set registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x234
mov eax, dword [0x416004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x224], edi
call fcn.0040a1c2
mov eax, dword [edi]
xor esi, esi
push esi
xor ebx, ebx
inc ebx
push ebx
push 0x64
push edi
call dword [eax + 0x20]
mov edi, eax
cmp edi, esi
mov dword [ebp - 0x210], edi
jge 0x40fabe
push edi
push 0x4102a0
push ebx
call fcn.004018db
add esp, 0xc
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004018c9
leave
ret 8
push 0x20006
push 0x404288
push 0x80000000
lea ecx, [ebp - 0x234]
mov dword [ebp - 0x234], esi
mov dword [ebp - 0x230], esi
mov dword [ebp - 0x22c], esi
call fcn.00405279
mov edi, eax
cmp edi, esi
je 0x40fb25
push dword [ebp - 0x210]
push 0x410218
push ebx
call fcn.004018db
add esp, 0xc
cmp edi, esi
jle 0x40fb14
and edi, 0xffff
or edi, 0x80070000
mov esi, edi
lea ecx, [ebp - 0x234]
call fcn.004019ed
mov eax, esi
jmp 0x40faad
push 0x20006
push 0x404298
push dword [ebp - 0x234]
lea ecx, [ebp - 0x220]
mov dword [ebp - 0x220], esi
mov dword [ebp - 0x21c], esi
mov dword [ebp - 0x218], esi
call fcn.00405279
mov edi, eax
cmp edi, esi
je 0x40fb80
push dword [ebp - 0x210]
push 0x410198
jmp 0x40fbba
and edi, 0xffff
or edi, 0x80070000
lea ecx, [ebp - 0x220]
mov esi, edi
call fcn.004019ed
jmp 0x40fb16
mov edi, 0x404310
push edi
push dword [ebp - 0x220]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
cmp dword [ebp + 0xc], esi
je 0x40fc06
push ebx
push 0x405938
push edi
lea ecx, [ebp - 0x220]
call fcn.0040aabf
mov edi, eax
cmp edi, esi
je 0x40fbc9
push dword [ebp - 0x210]
push 0x410120
push ebx
call fcn.004018db
add esp, 0xc
cmp edi, esi
jle 0x40fb71
jmp 0x40fb65
push ebx
push 0x410108
push 0x4100e4
lea ecx, [ebp - 0x220]
call fcn.0040aabf
mov edi, eax
cmp edi, esi
jne 0x40fbaf
mov ecx, dword [ebp - 0x224]
call fcn.0040b369
mov edi, eax
cmp edi, esi
jge 0x40fc06
lea ecx, [ebp - 0x220]
call fcn.004019ed
jmp 0x40fb14
mov ecx, dword [ebp - 0x224]
push esi
push dword [ebp + 8]
call fcn.0040f984
mov edi, eax
cmp edi, esi
mov dword [ebp - 0x210], edi
jge 0x40fc32
push edi
push 0x410068
push ebx
call fcn.004018db
add esp, 0xc
jmp 0x40fbf6
push esi
lea eax, [ebp - 0x214]
push eax
push esi
push 0x20006
push esi
push esi
push esi
push 0x40ffe8
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
je 0x40fc76
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x214]
mov edi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edi
push 0x40ff70
jmp 0x40fbba
push 0x104
lea eax, [ebp - 0x20c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
cmp eax, esi
jne 0x40fcac
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x214]
mov edi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edi
push 0x40fee8
jmp 0x40fbba
mov edi, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
add eax, eax
push eax
lea eax, [ebp - 0x20c]
push eax
push 2
push esi
push 0x40fec0
push dword [ebp - 0x214]
call edi
test eax, eax
je 0x40fcea
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x214]
mov edi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edi
jmp 0x40fbb5
push 4
lea eax, [ebp - 0x228]
push eax
push 4
push esi
push 0x40fea0
push dword [ebp - 0x214]
mov dword [ebp - 0x228], 7
call edi
test eax, eax
jne 0x40fcd0
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x405938
push esi
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov dword [ebp - 0x224], eax
cmp eax, esi
jne 0x40fd46
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push edi
push 0x40fe18
jmp 0x40fbba
push esi
push esi
push esi
push esi
push esi
push 3
push esi
push 4
push eax
call dword [sym.imp.ADVAPI32.dll_ReportEventW]
test eax, eax
jne 0x40fd88
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp edi, 0x5de
je 0x40fd82
push dword [ebp - 0x224]
call dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
push edi
push 0x40fda0
jmp 0x40fbba
mov dword [ebp - 0x210], esi
lea ecx, [ebp - 0x220]
call fcn.004019ed
mov esi, dword [ebp - 0x210]
jmp 0x40fb16