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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x445da8
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push esi
push edi
mov eax, dword [0x4584b8]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov ecx, dword [ebp + 0x14]
lea edx, [ebp - 0x34]
mov dword [ebp - 4], 0
call fcn.00409e50
mov eax, dword [ebp + 0x18]
cmp byte [eax], 0
jne 0x40d8f1
mov ebx, dword [ebp + 0xc]
xor edi, edi
cmp byte [ebp + 0x20], 0
jne 0x40d70b
mov eax, dword [ebx]
test eax, eax
cmovne edi, eax
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x40d709
push 0x40
push 0x3000
push 0x1000
push 0
push dword [eax + 0x1c]
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov dword [ebx], eax
cmp dword [ebx], 0
jne 0x40d799
sub esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp + 0x1c]
call fcn.00403410
add esp, 0xc
push eax
mov edx, 0x45b8cc
mov byte [ebp - 4], 1
lea ecx, [ebp + 0x20]
call fcn.0040e7f0
add esp, 4
push 0x30
push dword [0x45b890]
push dword [eax]
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov edx, dword [ebp + 0x20]
or esi, 0xffffffff
add edx, 0xfffffff0
mov eax, esi
lea ecx, [edx + 0xc]
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x40d770
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov edx, dword [ebp + 0x1c]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x40d904
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
xor bl, bl
jmp 0x40d95e
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov ecx, dword [ebp + 0x10]
lea edx, [ebp - 0x2c]
mov byte [ebp - 4], 4
call fcn.00409e50
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x1c]
mov edx, dword [ebp - 0x30]
push ecx
mov ecx, dword [ebx]
add ecx, dword [ebp - 0x28]
push eax
push 5
lea edx, [edx + esi]
call fcn.0040a450
mov edx, dword [ebx]
lea eax, [ebp - 0x24]
add esp, 8
mov ecx, esi
push eax
push dword [ebp - 0x30]
call fcn.0040a450
mov eax, dword [ebp - 0x14]
lea ecx, [ebp - 0x2c]
add esp, 0xc
add eax, 0x2c
mov dword [ebp + 8], eax
push ecx
push dword [ebx]
mov ecx, eax
call fcn.00411860
mov ecx, dword [ebx]
mov ebx, dword [ebp - 0x28]
add ecx, ebx
mov byte [ebp + 0x23], al
lea eax, [ebp - 0x1c]
push eax
push ecx
mov ecx, dword [ebp + 8]
call fcn.00411860
and byte [ebp + 0x23], al
lea eax, [ebp - 0x24]
push eax
push esi
mov esi, dword [ebp + 8]
mov ecx, esi
call fcn.00411860
mov cl, byte [ebp + 0x23]
and cl, al
mov byte [ebp + 0x23], cl
test edi, edi
je 0x40d867
mov eax, dword [esi]
test eax, eax
je 0x40d867
push 0x8000
push 0
push edi
push dword [eax + 0x1c]
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov cl, byte [ebp + 0x23]
mov eax, dword [ebp - 0x1c]
test cl, cl
jne 0x40d8b2
test eax, eax
je 0x40d881
cmp dword [ebp - 0x18], 0
jle 0x40d881
push eax
call fcn.0042cc84
add esp, 4
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x40d897
cmp dword [ebp - 0x20], 0
jle 0x40d897
push eax
call fcn.0042cc84
add esp, 4
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x40d904
test ebx, ebx
jle 0x40d904
push eax
call fcn.0042cc84
add esp, 4
xor bl, bl
jmp 0x40d95e
test eax, eax
je 0x40d8c5
cmp dword [ebp - 0x18], 0
jle 0x40d8c5
push eax
call fcn.0042cc84
add esp, 4
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x40d8db
cmp dword [ebp - 0x20], 0
jle 0x40d8db
push eax
call fcn.0042cc84
add esp, 4
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x40d92a
test ebx, ebx
jle 0x40d92a
push eax
call fcn.0042cc84
add esp, 4
jmp 0x40d92a
lea eax, [ebp - 0x34]
push eax
push dword [ebp + 8]
lea ecx, [esi + 0x2c]
call fcn.00411860
test al, al
jne 0x40d908
xor bl, bl
jmp 0x40d95e
mov eax, dword [esi + 0x2c]
mov esi, dword [ebp + 0xc]
test eax, eax
je 0x40d924
push 0x8000
push 0
push dword [esi]
push dword [eax + 0x1c]
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
mov dword [esi], 0
mov eax, dword [ebp + 0x18]
cmp byte [eax], 0
sete bl
cmp byte [ebp + 0x1c], 0
mov byte [eax], bl
je 0x40d95c
push 0x40005
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
xor eax, eax
test bl, bl
setne al
add eax, 0x95
push eax
call dword [sym.imp.WINMM.dll_PlaySoundW]
mov bl, 1
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x40d975
mov ecx, dword [ebp - 0x30]
test ecx, ecx
jle 0x40d975
push eax
call fcn.0042cc84
add esp, 4
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x1c