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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x49cd88
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x4bfdd0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
xor eax, eax
mov dword [ebp - 4], eax
lea ebx, [ebp + 0x10]
mov byte [ebp - 0x11], al
mov byte [ebp - 4], 3
call fcn.00404290
mov edi, eax
call fcn.00404f70
mov eax, dword [eax]
push 0x4a6221
push eax
call fcn.00483f37
add esp, 8
test eax, eax
jne 0x40f8f8
push 8
push 0x4a85d8
mov ecx, ebx
call fcn.00404530
lea ebx, [ebp + 0xc]
call fcn.00404290
mov edi, eax
call fcn.00404f70
mov eax, dword [eax]
push 0x4a6221
push eax
call fcn.00483f37
add esp, 8
test eax, eax
jne 0x40f929
push 4
push str.HTSM
mov ecx, ebx
call fcn.00404530
call fcn.00470974
xor ecx, ecx
xor edi, edi
cmp eax, edi
setne cl
cmp ecx, edi
jne 0x40f945
push 0x80004005
call fcn.00404970
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x1c], eax
mov byte [ebp - 4], 4
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
push ecx
push edx
lea eax, [ebp - 0x1c]
push str.SYSTEMCurrentControlSetServicesEventlog_s_s
push eax
call fcn.004051a0
add esp, 0x10
mov dword [ebp - 0x18], edi
lea ecx, [ebp - 0x20]
push ecx
push 0x2001f
mov byte [ebp - 4], 5
mov ebx, dword [ebp - 0x1c]
push edi
push ebx
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0x20], edi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
cmp eax, edi
jne 0x40fac8
mov esi, dword [ebp - 0x20]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x18], esi
cmp esi, edi
je 0x40f9b4
push esi
call ebx
xor esi, esi
mov dword [ebp - 0x18], esi
mov eax, dword [ebp + 0x10]
push ecx
add eax, 0xfffffff0
mov dword [ebp - 0x20], esp
mov edi, esp
push eax
call fcn.00404650
add eax, 0x10
add esp, 4
mov dword [edi], eax
call fcn.0040fca0
mov edx, dword [ebp + 0xc]
push edx
push 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceA]
mov edi, eax
test edi, edi
je 0x40fa14
movzx edx, word [ebp + 0x18]
mov eax, dword [ebp + 8]
push 0
lea ecx, [ebp - 0x20]
push ecx
push 0
push 1
push 0
push edx
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0x14]
push 0
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_ReportEventA]
push edi
call dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
mov byte [ebp - 0x11], 1
test esi, esi
je 0x40fa1b
push esi
call ebx
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40fa3e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 2
mov byte [ebp - 4], 1
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40fa68
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40fa8b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40fab1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, byte [ebp - 0x11]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov edx, ebx
lea esi, [ebp - 0x18]
call fcn.00415c50
test eax, eax
je 0x40fb8a
mov eax, dword [ebp - 0x18]
cmp eax, edi
je 0x40fae8
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebx - 0x10]
mov byte [ebp - 4], 3
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40fb08
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40fb2b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40fb4e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40fb74
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
push str._SystemRoot_Microsoft.NETFramework_v2.0.50727EventLogMessages.dll__SystemRoot_System32ws03res.dll
call ebx
mov esi, dword [ebp - 0x18]
add eax, 1
push eax
push str._SystemRoot_Microsoft.NETFramework_v2.0.50727EventLogMessages.dll__SystemRoot_System32ws03res.dll
push 1
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push str.EventMessageFile
push esi
call edi
push 4
lea ecx, [ebp - 0x20]
push ecx
push 4
push 0
push str.TypesSupported
push esi
mov dword [ebp - 0x20], 7
call edi
push str._SystemRoot__system32eventlog.dll
call ebx
add eax, 1
push eax
push str._SystemRoot__system32eventlog.dll
push 1
push 0
push str.CategoryMessageFile
push esi
call edi
push 4
lea edx, [ebp - 0x20]
push edx
push 4
push 0
push str.CategoryCount
push esi
mov dword [ebp - 0x20], 7
call edi
test esi, esi
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
je 0x40fc14
push esi
call ebx
xor esi, esi
mov dword [ebp - 0x18], esi
mov eax, dword [ebp + 0x10]
push eax
lea ecx, [ebp - 0x1c]
push str.SYSTEMCurrentControlSetServicesEventlog_s
push ecx
call fcn.004051a0
mov eax, dword [ebp - 0x1c]
add esp, 0xc
lea edx, [ebp - 0x20]
push edx
push 0x2001f
push 0
push eax
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0x20], 0
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40f9b4
test esi, esi
je 0x40fc59
push esi
call ebx
test eax, eax
mov esi, dword [ebp - 0x20]
mov dword [ebp - 0x18], esi
jne 0x40f9b4
push 4
lea ecx, [ebp - 0x20]
push ecx
push 4
push eax
push str.Maxsize
push esi
mov dword [ebp - 0x20], 0x1f40000
call edi
test esi, esi
jmp 0x40f9aa