Function at 0x40f140
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Get file size
Query or enumerate registry value
Read file via mapping

Disassembly:
sub esp, 0x88
mov eax, dword [esp + 0x8c]
push ebx
push ebp
push esi
xor ebx, ebx
mov esi, 0x80004005
push edi
mov edi, ecx
mov dword [esp + 0x14], esi
cmp eax, ebx
jne 0x40f26b
lea eax, [esp + 0x18]
push eax
push 0x20019
push ebx
push str.CLSIDD27CDB6E_AE6D_11cf_96B8_444553540000InprocServer32
push SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40f287
mov edx, dword [esp + 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea ecx, [esp + 0x10]
push ecx
push ebx
push ebx
push ebx
push 0x46177f
push edx
call esi
test eax, eax
jne 0x40f25e
mov eax, dword [esp + 0x10]
push eax
call fcn.0042bb84
mov edx, dword [esp + 0x1c]
add esp, 4
lea ecx, [esp + 0x10]
push ecx
mov ebp, eax
push ebp
push ebx
push ebx
push 0x46177f
push edx
mov dword [esp + 0x38], ebp
call esi
test eax, eax
jne 0x40f255
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocString
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x40f255
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push ebx
push eax
push ebx
push 2
push ebx
push esi
mov dword [esp + 0x4c], eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov dword [esp + 0x1c], eax
cmp eax, ebx
je 0x40f24e
push ebx
push ebx
push ebx
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ebp, eax
cmp ebp, ebx
je 0x40f23f
mov eax, dword [esp + 0x34]
push eax
push ebp
mov ecx, edi
call fcn.004125b0
push ebp
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebp, dword [esp + 0x20]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call fcn.0042bbbe
add esp, 4
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40f27f
mov ecx, dword [esp + 0xa0]
push ecx
push eax
mov ecx, edi
call fcn.004125b0
mov dword [esp + 0x14], eax
mov esi, dword [esp + 0x14]
cmp esi, ebx
je 0x40f296
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x88
ret 0x10
push 0x40
push 0x1000
mov al, 0x68
push 0xd
push ebx
mov byte [esp + 0x34], 0x58
mov byte [esp + 0x35], al
mov dword [esp + 0x36], edi
mov byte [esp + 0x3a], 0x50
mov byte [esp + 0x3b], al
mov dword [esp + 0x3c], 0x40e9a0
mov byte [esp + 0x40], 0xc3
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 0xd
lea edx, [esp + 0x28]
push edx
push eax
mov dword [edi + 0xfc], eax
call fcn.00411e80
mov eax, dword [edi + 0xfc]
add esp, 0xc
push 0xd
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
lea esi, [esp + 0x18]
call fcn.0040f070
mov eax, dword [esp + 0xa4]
cmp eax, ebx
jne 0x40f30f
mov eax, dword [esp + 0x18]
push eax
lea ecx, [esp + 0x14]
mov dword [esp + 0x14], ebx
call fcn.0040e4d0
mov ebp, dword [esp + 0x10]
lea esi, [edi + 0xf4]
push ebp
mov ecx, esi
call fcn.0040e4d0
push ebp
call fcn.0042bbbe
mov ecx, dword [edi + 0xfc]
mov edx, dword [0x475e10]
mov eax, dword [esi]
mov dword [esp + 0x44], ecx
add esp, 4
lea ecx, [esp + 0x38]
push ecx
mov dword [esp + 0x3c], 0x30
mov dword [esp + 0x40], 0x4008
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], edx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], 6
mov dword [esp + 0x60], ebx
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], ebx
call dword [sym.imp.USER32.dll_RegisterClassExA]
push str.user32.dll
mov word [edi + 0xf0], ax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
push str.RegisterClassExW
push esi
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebp, eax
cmp ebp, ebx
je 0x40f498
lea esi, [esp + 0x20]
call fcn.0040f070
mov edx, dword [eax]
push edx
lea eax, [esp + 0x14]
push eax
call fcn.00411dd0
mov ecx, dword [esp + 0x28]
push ecx
call fcn.0042bbbe
mov eax, dword [esp + 0xb4]
add esp, 0xc
cmp eax, ebx
jne 0x40f3ed
mov eax, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], ebx
call fcn.0040e540
mov edx, dword [esp + 0x14]
lea esi, [edi + 0xf8]
push edx
mov ecx, esi
call fcn.0040e540
mov eax, dword [esp + 0x14]
push eax
call fcn.0042bbbe
mov ecx, dword [edi + 0xfc]
mov edx, dword [0x475e10]
mov eax, dword [esi]
mov dword [esp + 0x74], ecx
add esp, 4
lea ecx, [esp + 0x68]
push ecx
mov dword [esp + 0x6c], 0x30
mov dword [esp + 0x70], 0x4008
mov dword [esp + 0x78], ebx
mov dword [esp + 0x7c], ebx
mov dword [esp + 0x80], edx
mov dword [esp + 0x84], ebx
mov dword [esp + 0x88], ebx
mov dword [esp + 0x8c], 6
mov dword [esp + 0x90], ebx
mov dword [esp + 0x94], eax
mov dword [esp + 0x98], ebx
call ebp
mov edx, dword [esp + 0x10]
push edx
mov word [edi + 0xf2], ax
call fcn.0042bbbe
mov esi, dword [esp + 0x20]
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x18]
push eax
call fcn.0042bbbe
add esp, 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x88
ret 0x10