Function at 0x401050
Capabilities:
Allocate or change rwx memory
Enumerate pe sections
Execute shellcode via indirect call
Get system information on windows
Inspect section memory permissions
Parse pe header

Disassembly:
mov eax, 0x1044
call fcn.00402150
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x1058]
mov dword [esp + 0x20], ecx
test edi, edi
jne 0x40107f
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1044
ret 8
mov esi, dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
push 0x40
push edi
call esi
cmp eax, 1
je 0x401586
cmp word [edi], 0x5a4d
jne 0x401586
mov ebx, dword [edi + 0x3c]
push 0xf8
add ebx, edi
push ebx
call esi
cmp eax, 1
je 0x401574
cmp dword [ebx], 0x4550
jne 0x401574
cmp word [ebx + 0x14], 0xe0
jne 0x401562
cmp word [ebx + 0x18], 0x10b
jne 0x401562
mov cx, word [ebx + 6]
cmp cx, 1
jae 0x4010f4
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x1044
ret 8
mov eax, ecx
lea esi, [ebx + 0xf8]
and eax, 0xffff
mov dword [esp + 0x18], 0
lea edx, [eax + eax*4]
shl edx, 3
sub edx, edi
add edx, esi
test cx, cx
mov dword [esp + 0x2c], edx
mov ebp, edx
jbe 0x40118e
mov dword [esp + 0x10], 0
lea edi, [esi + 0xc]
mov dword [esp + 0x14], eax
mov eax, dword [edi + 4]
mov ecx, dword [edi]
add ecx, eax
cmp ebp, ecx
jae 0x40113a
mov ebp, ecx
mov esi, str..rsrc
lea ecx, [edi - 0xc]
mov al, byte [ecx]
mov dl, al
cmp al, byte [esi]
jne 0x401166
test dl, dl
je 0x401162
mov al, byte [ecx + 1]
mov dl, al
cmp al, byte [esi + 1]
jne 0x401166
add ecx, 2
add esi, 2
test dl, dl
jne 0x401142
xor ecx, ecx
jmp 0x40116b
sbb ecx, ecx
sbb ecx, 0xffffffff
test ecx, ecx
jne 0x401177
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x18], ecx
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
inc edx
add edi, 0x28
dec eax
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], eax
jne 0x40112d
lea edx, [esp + 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov ecx, dword [esp + 0x34]
mov eax, ebp
xor edx, edx
div ecx
xor edx, edx
mov esi, eax
mov eax, ebp
div ecx
mov dword [esp + 0x24], esi
test edx, edx
je 0x4011b8
inc esi
mov dword [esp + 0x24], esi
imul ecx, esi
push 0x40
push 0x1000
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebp, eax
test ebp, ebp
jne 0x4011e3
pop edi
pop esi
pop ebp
mov eax, 6
pop ebx
add esp, 0x1044
ret 8
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x1058]
mov edi, dword [sym.imp.MSVCRT.dll_memmove]
push eax
push ecx
push ebp
call edi
xor esi, esi
add esp, 0xc
cmp word [ebx + 6], si
jbe 0x40123b
mov eax, esi
and eax, 0xffff
lea edx, [eax + eax*4]
lea eax, [ebx + 0xf8]
mov ecx, dword [eax + edx*8 + 0x10]
lea eax, [eax + edx*8]
push ecx
mov ecx, dword [esp + 0x105c]
mov edx, dword [eax + 0x14]
mov eax, dword [eax + 0xc]
add edx, ecx
add eax, ebp
push edx
push eax
call edi
add esp, 0xc
inc esi
cmp si, word [ebx + 6]
jb 0x401204
mov ebx, dword [ebp + 0x3c]
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x18]
add ebx, ebp
test esi, esi
mov dword [esp + 0x28], ebx
mov dword [ecx + 8], ebp
je 0x401282
call fcn.00401040
cmp eax, 1
jne 0x401282
lea ecx, [esi + esi*4]
mov esi, dword [ebx + ecx*8 + 0x104]
lea eax, [ebx + ecx*8 + 0xf8]
mov ecx, dword [esp + 0x1058]
add esi, ecx
mov dword [eax + 0xc], esi
mov edx, dword [eax + 0x14]
add edx, ecx
mov dword [eax + 0x14], edx
mov eax, dword [ebx + 0x80]
test eax, eax
jne 0x4012ab
push 0x8000
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebp
mov eax, 7
pop ebx
add esp, 0x1044
ret 8
add eax, ebp
mov dword [esp + 0x10], eax
mov ecx, dword [eax + 4]
test ecx, ecx
jne 0x4012c3
mov ecx, dword [eax + 0xc]
test ecx, ecx
je 0x40137b
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x20]
mov esi, dword [edx + 0xc]
mov edx, dword [eax + 8]
add esi, edx
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov ebx, eax
test ebx, ebx
jne 0x4012ed
push esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
test ebx, ebx
je 0x401347
mov eax, dword [esp + 0x10]
mov edi, dword [eax]
mov esi, dword [eax + 0x10]
mov eax, dword [edi + ebp]
add edi, ebp
add esi, ebp
test eax, eax
je 0x401333
test eax, 0x80000000
je 0x401310
and eax, 0xffff
push eax
jmp 0x401315
lea ecx, [eax + ebp + 2]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test esi, esi
mov dword [esi], eax
je 0x40140b
mov eax, dword [edi + 4]
add edi, 4
add esi, 4
test eax, eax
jne 0x401301
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x28]
add eax, 0x14
mov dword [esp + 0x10], eax
jmp 0x4012b1
push 0
push str.Error_in_LoadPbDllFromMemory__
push str.Cant_find_required_Dll
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0x8000
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebp
mov eax, 9
pop ebx
add esp, 0x1044
ret 8
mov edx, dword [ebx + 0xa0]
test edx, edx
je 0x4013e1
mov eax, dword [edx + ebp]
add edx, ebp
test eax, eax
je 0x4013e1
mov edi, dword [edx + 4]
mov eax, edx
lea esi, [edx + 8]
add eax, edi
cmp esi, eax
jae 0x4013d9
xor eax, eax
mov ax, word [esi]
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x3000
jne 0x4013c7
mov edi, dword [edx]
and eax, 0xfff
add eax, edi
mov edi, dword [ebx + 0x34]
add eax, ebp
mov ecx, ebp
sub ecx, edi
add dword [eax], ecx
jmp 0x4013cb
test ecx, ecx
jne 0x40140b
mov edi, dword [edx + 4]
mov eax, edx
add esi, 2
add eax, edi
cmp esi, eax
jb 0x40139c
add edx, dword [edx + 4]
cmp dword [edx], 0
jne 0x40138e
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x54]
mov dword [esp + 0x10], eax
rep stosd dword es:[edi], eax
mov cx, word [ebx + 6]
mov word [esp + 0x18], cx
lea ecx, [ebx + 0x108]
mov ebx, dword [esp + 0x34]
mov dword [esp + 0x14], ecx
jmp 0x40142f
push 0x8000
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebp
mov eax, 0xa
pop ebx
add esp, 0x1044
ret 8
mov ecx, dword [esp + 0x14]
mov dx, word [esp + 0x18]
cmp word [esp + 0x10], dx
jne 0x401448
mov eax, dword [esp + 0x2c]
xor esi, esi
mov ecx, 0x60000000
jmp 0x401450
mov esi, dword [ecx - 4]
mov eax, dword [ecx]
mov ecx, dword [ecx + 0x14]
lea eax, [eax + esi - 1]
xor edx, edx
div ebx
xor edx, edx
mov edi, eax
mov eax, esi
div ebx
cmp eax, edi
ja 0x40149a
mov edx, ecx
mov esi, ecx
and edx, 0x20000000
and esi, 0x40000000
and ecx, 0x80000000
test edx, edx
je 0x401483
or byte [esp + eax + 0x54], 1
test esi, esi
je 0x40148c
or byte [esp + eax + 0x54], 2
test ecx, ecx
je 0x401495
or byte [esp + eax + 0x54], 4
inc eax
cmp eax, edi
jbe 0x40147a
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
inc eax
add edx, 0x28
cmp ax, word [esp + 0x18]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
jbe 0x40142b
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov edi, ebp
xor esi, esi
xor eax, eax
mov al, byte [esp + esi + 0x54]
sub eax, 2
je 0x4014ee
dec eax
je 0x4014e7
sub eax, 3
je 0x4014e0
mov dword [esp + 0x1c], 0x40
jmp 0x401509
mov eax, 4
jmp 0x4014f3
mov eax, 0x20
jmp 0x4014f3
mov eax, 2
mov edx, dword [esp + 0x34]
lea ecx, [esp + 0x1c]
push ecx
push eax
push edx
push edi
mov dword [esp + 0x2c], eax
call ebx
test eax, eax
je 0x401542
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x24]
add edi, edx
inc esi
cmp esi, eax
jbe 0x4014c3
mov eax, dword [esp + 0x28]
mov esi, dword [esp + 0x20]
push 0
push 1
mov ecx, dword [eax + 0x28]
push ebp
lea eax, [ecx + ebp]
mov dword [esi + 0x10], eax
call eax
mov dword [esi + 4], ebp
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1044
ret 8
push 0x8000
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebp
mov eax, 0xb
pop ebx
add esp, 0x1044
ret 8
pop edi
pop esi
pop ebp
mov eax, 4
pop ebx
add esp, 0x1044
ret 8
pop edi
pop esi
pop ebp
mov eax, 3
pop ebx
add esp, 0x1044
ret 8
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x1044
ret 8