Function at 0x401000
Capabilities:
Allocate or change rwx memory
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
mov esi, edx
mov dword [ebp - 0xc], esi
push edi
mov edi, ecx
mov dword [ebp - 8], edi
cmp esi, 0x40
jb 0x401313
mov eax, 0x5a4d
cmp word [edi], ax
jne 0x401313
mov ecx, dword [edi + 0x3c]
mov dword [ebp - 0x14], ecx
lea eax, [ecx + 0xf8]
cmp esi, eax
jl 0x401313
cmp dword [ecx + edi], 0x4550
jne 0x401313
mov eax, 0x2000
test word [ecx + edi + 0x16], ax
jne 0x401313
mov eax, 0xe0
cmp word [ecx + edi + 0x14], ax
jne 0x401313
mov ebx, dword [ecx + edi + 0x38]
lea eax, [edi + 0xf8]
add eax, ecx
mov dword [ebp - 0x10], 0
mov ecx, dword [ecx + edi + 0x54]
xor edx, edx
dec ecx
mov dword [ebp - 4], eax
add ecx, ebx
mov eax, ecx
div ebx
mov eax, dword [ebp - 0x14]
sub ecx, edx
movzx eax, word [eax + edi + 6]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x401113
mov edi, dword [ebp - 4]
add edi, 0x10
mov eax, dword [edi + 4]
mov edx, dword [edi]
add eax, edx
cmp eax, esi
ja 0x40130a
mov eax, dword [edi - 4]
test eax, eax
je 0x4010e4
mov ecx, dword [edi - 8]
test ecx, ecx
je 0x4010d3
add eax, ecx
xor edx, edx
lea ecx, [ebx - 1]
add ecx, eax
mov eax, ecx
div ebx
sub ecx, edx
jmp 0x401101
add eax, edx
lea ecx, [ebx - 1]
add ecx, eax
xor edx, edx
mov eax, ecx
div ebx
sub ecx, edx
jmp 0x401101
mov eax, dword [edi - 8]
lea esi, [ebx - 1]
cmp eax, edx
jae 0x4010f2
add esi, edx
jmp 0x4010f4
add esi, eax
mov eax, esi
xor edx, edx
div ebx
sub esi, edx
add ecx, esi
mov esi, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
add edi, 0x28
inc eax
mov dword [ebp - 0x10], eax
cmp eax, dword [ebp - 0x18]
jl 0x4010a5
mov edi, dword [ebp - 8]
mov eax, dword [ebp + 0x14]
mov dword [eax], ecx
test ecx, ecx
je 0x401313
push 0x40
push 0x1000
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ecx, dword [ebp + 0x10]
mov ebx, eax
mov dword [ebp - 0x18], ebx
mov dword [ecx], ebx
test ebx, ebx
je 0x40133b
mov eax, dword [ebp - 0x14]
movzx edx, word [eax + edi + 6]
mov ecx, dword [eax + edi + 0x54]
xor edi, edi
test edx, edx
je 0x40125a
cmp edx, 8
jb 0x40125a
cmp dword [0x4053f0], 2
jl 0x40125a
mov eax, dword [ebp - 4]
mov esi, edx
movups xmm7, xmmword [0x403240]
and esi, 0xfffffff8
add eax, 0x64
movd xmm0, ecx
xorps xmm6, xmm6
pshufd xmm4, xmm0, 0
movaps xmm5, xmm4
nop
movd xmm2, dword [eax + 0x28]
lea eax, [eax + 0x140]
movd xmm0, dword [eax - 0x140]
add edi, 8
movd xmm1, dword [eax - 0x168]
movd xmm3, dword [eax - 0x190]
punpckldq xmm3, xmm0
movaps xmm0, xmm4
punpckldq xmm1, xmm2
movd xmm2, dword [eax - 0x78]
punpckldq xmm3, xmm1
movaps xmm1, xmm3
pcmpeqd xmm1, xmm6
pandn xmm1, xmm7
pminud xmm0, xmm3
movd xmm3, dword [eax - 0xf0]
pand xmm0, xmm1
pandn xmm1, xmm4
por xmm0, xmm1
movd xmm1, dword [eax - 0xc8]
punpckldq xmm1, xmm2
movaps xmm4, xmm0
movd xmm0, dword [eax - 0xa0]
punpckldq xmm3, xmm0
movaps xmm0, xmm5
punpckldq xmm3, xmm1
movaps xmm1, xmm3
pcmpeqd xmm1, xmm6
pandn xmm1, xmm7
pminud xmm0, xmm3
pand xmm0, xmm1
pandn xmm1, xmm5
por xmm0, xmm1
movaps xmm5, xmm0
cmp edi, esi
jl 0x401190
pminud xmm4, xmm5
movaps xmm0, xmm4
psrldq xmm0, 8
pminud xmm4, xmm0
movups xmm0, xmm4
psrldq xmm0, 4
pminud xmm4, xmm0
movd ecx, xmm4
cmp edi, edx
jge 0x401283
mov esi, dword [ebp - 4]
lea eax, [edi + edi*4]
lea esi, [esi + eax*8]
add esi, 0x14
sub edx, edi
nop dword [eax]
mov eax, dword [esi]
test eax, eax
je 0x40127b
cmp eax, ecx
cmovb ecx, eax
add esi, 0x28
sub edx, 1
jne 0x401270
push ecx
push dword [ebp - 8]
push ebx
call sub.VCRUNTIME140.dll_memmove
mov eax, dword [ebp + 8]
xor edx, edx
mov esi, dword [ebx + 0x3c]
add esp, 0xc
add esi, ebx
mov dword [ebp - 0x14], esi
mov dword [eax], esi
mov eax, dword [ebp + 0xc]
mov ecx, dword [esi + 0x38]
lea edi, [esi + 0xf8]
mov dword [eax], edi
mov eax, dword [esi + 0x54]
dec eax
add eax, ecx
div ecx
mov edx, eax
xor eax, eax
imul edx, ecx
add edx, ebx
xor ebx, ebx
cmp ax, word [esi + 6]
jae 0x40133b
lea esi, [edi + 0x10]
nop dword [eax]
mov eax, dword [esi - 4]
mov edi, dword [ebp - 0x18]
add edi, eax
test eax, eax
mov eax, dword [esi]
cmove edi, edx
test eax, eax
je 0x40131c
push eax
mov eax, dword [esi + 4]
add eax, dword [ebp - 8]
push eax
push edi
call sub.VCRUNTIME140.dll_memmove
mov ecx, dword [ebp - 0x14]
add esp, 0xc
mov eax, dword [esi - 8]
mov edx, dword [esi]
mov ecx, dword [ecx + 0x38]
cmp eax, edx
jae 0x40131f
lea eax, [ecx - 1]
add eax, edx
jmp 0x401322
mov eax, dword [ebp + 0x14]
mov dword [eax], 0
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi - 8]
dec eax
add eax, ecx
xor edx, edx
inc ebx
div ecx
add esi, 0x28
imul eax, ecx
lea edx, [edi + eax]
mov eax, dword [ebp - 0x14]
movzx eax, word [eax + 6]
cmp ebx, eax
jl 0x4012d0
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret