Function at 0x403d40
Capabilities:
Delete registry value
Get file size
Persist via windows service
Read file via mapping
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41bb50
push 0x4060fc
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x50
mov eax, dword [0x422948]
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
mov edi, ecx
mov dword [ebp - 0x48], edi
mov esi, dword [ebp + 8]
test esi, esi
jle 0x4041e3
cmp esi, 0x7fff
jg 0x4041e3
call fcn.004035e0
mov dword [ebp - 0x4c], eax
test eax, eax
jl 0x4041e3
cmp dword [edi], 0
je 0x4041e3
cmp eax, esi
je 0x403fb0
mov eax, dword [0x4238b4]
test eax, eax
jne 0x403e00
push str.imagehlp.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [0x4238b4], eax
test eax, eax
je 0x4041e3
push str.CheckSumMappedFile
push eax
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
call esi
mov dword [0x4238b0], eax
push str.ImageNtHeader
mov eax, dword [0x4238b4]
push eax
call esi
mov dword [0x4238ac], eax
mov eax, dword [0x4238b4]
test eax, eax
je 0x4041e3
mov eax, dword [0x4238b0]
test eax, eax
je 0x4041e3
mov eax, dword [0x4238ac]
test eax, eax
je 0x4041e3
mov ecx, edi
call fcn.004035b0
test eax, eax
je 0x403e38
push 0
push 0x10000000
lea ecx, [edi + 0x14]
push ecx
call fcn.00403150
add esp, 0xc
lea esi, [edi + 0x14]
push 0
push esi
call fcn.00403390
add esp, 8
push 0
push 0x80
push 3
push 0
push 1
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
test esi, esi
je 0x4041e3
cmp esi, 0xffffffff
je 0x4041e3
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x54], eax
cmp eax, 0xffffffff
je 0x4041dc
mov edx, dword [edi]
add edx, 0x80
cmp eax, edx
jbe 0x4041dc
push 0
push 0
push 0
push 4
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov edi, eax
mov dword [ebp - 0x30], edi
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x4041e3
cmp edi, 0xffffffff
je 0x4041e3
push 0
push 0
push 0
push 6
push edi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ebx, eax
mov dword [ebp - 0x3c], ebx
xor esi, esi
cmp ebx, esi
je 0x40414d
cmp dword [ebp + 8], 0xa
je 0x403f3e
mov eax, dword [0x4238bc]
cmp eax, esi
je 0x403f3e
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x403f3e
push ebx
call dword [0x4238ac]
cmp eax, esi
je 0x403f3e
cmp dword [eax], 0x4550
jne 0x403f3e
cmp dword [eax + 0x98], esi
jne 0x403f20
cmp dword [eax + 0x9c], esi
je 0x403f3e
push esi
push esi
push 0x2401
mov eax, dword [0x4238bc]
push eax
call dword [sym.imp.USER32.dll_SendMessageW]
cmp eax, 0x3e7
jne 0x404146
mov dword [ebp - 0x34], esi
mov edx, dword [ebp - 0x48]
mov ecx, edx
call fcn.004035b0
mov ecx, dword [edx]
test eax, eax
je 0x404134
mov byte [ebp - 0x2c], 0xf
mov byte [ebp - 0x2b], 0x87
mov byte [ebp - 0x2a], 0x8b
mov byte [ebp - 0x29], 0
mov byte [ebp - 0x28], 0
mov byte [ebp - 0x27], 0
mov al, 0x90
mov byte [ebp - 0x24], al
mov byte [ebp - 0x23], al
mov byte [ebp - 0x22], al
mov byte [ebp - 0x21], al
mov byte [ebp - 0x20], al
mov byte [ebp - 0x1f], al
lea eax, [ecx + ebx]
mov ecx, 3
lea edi, [ebp - 0x2c]
mov esi, eax
xor edx, edx
repe cmpsw word [esi], word es:[edi]
jne 0x4040df
cmp dword [ebp + 8], 0xa
jg 0x403fba
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, dword [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
jmp 0x4041e5
mov dword [ebp - 4], 0
push 6
lea ecx, [ebp - 0x24]
push ecx
push eax
call fcn.00405a90
add esp, 0xc
mov dword [ebp - 0x34], 1
mov dword [ebp - 4], 0xffffffff
mov edi, dword [ebp - 0x30]
xor esi, esi
cmp dword [ebp - 0x34], esi
je 0x404041
mov dword [0x4238b8], 1
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x44], esi
lea edx, [ebp - 0x44]
push edx
lea eax, [ebp - 0x40]
push eax
mov ecx, dword [ebp - 0x54]
push ecx
push ebx
call dword [0x4238b0]
push ebx
call dword [0x4238ac]
cmp eax, esi
je 0x404041
mov ecx, dword [eax + 0x58]
cmp ecx, dword [ebp - 0x40]
jne 0x404041
cmp dword [eax], 0x4550
jne 0x404041
mov dword [ebp - 4], 3
mov edx, dword [ebp - 0x44]
cmp ecx, edx
je 0x404037
mov dword [eax + 0x58], edx
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x34], esi
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp - 0x34]
cmp edi, esi
jne 0x4041ad
mov ecx, dword [ebp - 0x48]
call fcn.004035b0
test eax, eax
je 0x4041ad
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x5c], esi
lea ecx, [ebp - 0x5c]
push ecx
lea edx, [ebp - 0x38]
push edx
push esi
push 2
push esi
push esi
push esi
push str.SYSTEMCurrentControlSetServicesTcpipParameters
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x4041e3
mov eax, dword [ebp + 8]
cmp eax, 0xa
jle 0x40418a
mov dword [ebp - 0x50], eax
push 4
lea eax, [ebp - 0x50]
push eax
push 4
push esi
push str.TcpNumConnections
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
je 0x404199
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x4041e3
mov ecx, 3
lea edi, [ebp - 0x24]
mov esi, eax
xor edx, edx
repe cmpsw word [esi], word es:[edi]
jne 0x404124
cmp dword [ebp + 8], 0xa
jg 0x403fde
mov esi, 1
mov dword [ebp - 4], esi
push 6
lea ecx, [ebp - 0x2c]
push ecx
push eax
call fcn.00405a90
add esp, 0xc
mov dword [ebp - 0x34], esi
jmp 0x403fd7
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [ebp - 0x30]
push ecx
jmp 0x4041dd
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x58], eax
lea eax, [ecx + ebx]
lea edx, [ebp - 0x58]
mov ecx, dword [eax]
cmp ecx, dword [edx]
je 0x404153
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push edi
jmp 0x4041dd
mov edx, dword [ebp + 8]
mov dword [ebp - 0x60], edx
mov dword [ebp - 4], 2
push 4
lea ecx, [ebp - 0x60]
push ecx
push eax
call fcn.00405a90
add esp, 0xc
mov dword [ebp - 0x34], 1
mov dword [ebp - 4], 0xffffffff
jmp 0x403fe3
push str.TcpNumConnections
mov eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [0x4238b8], 1
xor eax, eax
cmp edi, esi
sete al
jmp 0x4041e5
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.0040559e
mov esp, ebp
pop ebp
ret 4