Function at 0x40010050
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Get system information on windows
Read file on windows

Disassembly:
sub esp, 0x3c
push ebx
mov ebx, dword [esp + 0x44]
push esi
push 0x24
lea eax, [esp + 0x24]
push 0
push eax
call fcn.40001a40
add esp, 0xc
lea ecx, [esp + 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov edx, dword [esp + 0x4c]
mov esi, dword [esp + 0x24]
push 0
push 0
push 0
push edx
mov dword [esp + 0x24], esi
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x400100a8
pop esi
mov eax, 0x7d27
pop ebx
add esp, 0x3c
ret 8
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 1
push 0x2000
push 0x4000000
push 0
call ebp
mov dword [ebx + 0x20], eax
test eax, eax
jne 0x400100d4
pop ebp
pop esi
mov eax, 0x7d1c
pop ebx
add esp, 0x3c
ret 8
push edi
push 4
push 0x1000
push esi
push eax
mov edi, eax
call ebp
cmp eax, edi
jne 0x40010540
mov ecx, dword [esp + 0x54]
push 0
lea eax, [esp + 0x14]
push eax
push esi
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4001019d
mov edx, dword [ebx + 0x20]
lea ebp, [ebx + 0x2c]
mov eax, ebp
mov dword [ebp + 8], edx
call fcn.400072e0
cmp eax, 0x7d00
jne 0x40010531
mov eax, dword [ebx + 0x38]
cmp dword [eax + 0x50], 0x4000000
ja 0x40010531
cmp dword [eax + 0x38], esi
jae 0x400101ac
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40010394
cmp dword [eax + 0x50], esi
jbe 0x40010394
mov edi, dword [ebx + 0x20]
add edi, esi
test eax, eax
je 0x40010158
mov eax, dword [eax + 0x50]
jmp 0x4001015a
xor eax, eax
push 0x40
push 0x1000
push eax
push edi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
cmp eax, edi
jne 0x40010540
mov ebp, dword [ebp + 0xc]
test ebp, ebp
je 0x4001017d
mov eax, dword [ebp + 0x50]
jmp 0x4001017f
xor eax, eax
mov edx, dword [esp + 0x54]
push 0
lea ecx, [esp + 0x14]
push ecx
sub eax, esi
push eax
push edi
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40010394
pop edi
pop ebp
pop esi
mov eax, 0x7d2a
pop ebx
add esp, 0x3c
ret 8
mov eax, dword [eax + 0x54]
cmp eax, esi
jae 0x400101c8
mov ecx, dword [ebx + 0x20]
sub esi, eax
push esi
add ecx, eax
push 0
push ecx
call fcn.40001a40
add esp, 0xc
jmp 0x40010226
jbe 0x40010226
sub eax, esi
xor edx, edx
mov ebp, eax
div esi
mov ebx, ebp
test edx, edx
je 0x400101db
lea ebx, [esi + ebp]
call fcn.4000b650
mov edx, dword [esp + 0x50]
mov edi, dword [edx + 0x20]
push 4
not eax
push 0x1000
and ebx, eax
push ebx
add edi, esi
push edi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
cmp eax, edi
jne 0x40010540
mov ecx, dword [esp + 0x54]
push 0
lea eax, [esp + 0x14]
push eax
push ebx
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4001019d
cmp dword [esp + 0x10], ebp
jb 0x4001019d
mov esi, dword [esp + 0x50]
mov eax, dword [esi + 0x38]
mov ecx, dword [eax + 0x3c]
mov edx, dword [eax + 0x38]
lea eax, [ecx - 1]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x14], edx
test ecx, eax
jne 0x40010255
lea eax, [edx - 1]
test edx, eax
jne 0x40010255
test ecx, 0x1ff
je 0x40010264
cmp edx, ecx
je 0x40010268
mov eax, 0x7d16
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x3c
ret 8
cmp edx, ecx
jb 0x40010255
mov eax, dword [esi + 0x38]
test eax, eax
je 0x40010274
mov eax, dword [eax + 0x34]
jmp 0x40010276
xor eax, eax
movzx ecx, ax
test ecx, ecx
jne 0x40010255
mov eax, dword [esi + 0x38]
add esi, 0x2c
mov dword [esp + 0x18], ecx
test eax, eax
je 0x40010394
movzx eax, word [eax + 6]
cmp ecx, eax
jae 0x40010394
mov esi, dword [esp + 0x50]
lea eax, [esi + 0x2c]
call fcn.400073b0
mov edi, eax
test edi, edi
je 0x40010531
mov ebx, dword [edi + 0xc]
mov ecx, dword [edi + 8]
add ebx, dword [esi + 0x20]
cmp ecx, 0x4000000
ja 0x40010531
mov ebp, dword [esi + 0x38]
mov eax, dword [edi + 0x14]
xor edx, edx
div dword [ebp + 0x3c]
test edx, edx
jne 0x40010255
mov ebp, dword [esp + 0x14]
mov eax, ebx
div ebp
test edx, edx
jne 0x40010255
test ecx, ecx
je 0x40010255
lea eax, [ebp - 1]
test ecx, eax
je 0x400102fc
add ecx, ebp
mov eax, ecx
div ebp
sub ecx, edx
push 4
push 0x1000
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
cmp eax, ebx
jne 0x40010540
test byte [edi + 0x24], 0x60
je 0x4001038a
mov esi, dword [edi + 0x10]
mov ecx, dword [esp + 0x20]
xor edx, edx
mov eax, esi
div ecx
test edx, edx
je 0x4001032c
add esi, ecx
xor edx, edx
mov eax, esi
div ecx
mov eax, dword [esp + 0x54]
push 0
push 0
sub esi, edx
mov edx, dword [edi + 0x14]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40010531
mov edi, dword [edi + 8]
cmp edi, esi
jae 0x4001036a
mov esi, edi
lea eax, [ebp - 1]
test esi, eax
je 0x4001036a
add esi, ebp
mov eax, esi
xor edx, edx
div ebp
sub esi, edx
mov edx, dword [esp + 0x54]
push 0
lea ecx, [esp + 0x14]
push ecx
push esi
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40010531
mov esi, dword [esp + 0x50]
mov ecx, dword [esp + 0x18]
inc ecx
jmp 0x4001027d
mov ebx, dword [esp + 0x50]
lea edi, [ebx + 0x2c]
mov eax, edi
call fcn.400073f0
test al, al
je 0x40010453
lea eax, [esp + 0x54]
push eax
push ebx
call fcn.40010cd0
cmp eax, 0x7d00
jne 0x4001025a
mov ebp, dword [esp + 0x54]
test ebp, ebp
je 0x40010453
call fcn.4000b5e0
mov ebx, eax
xor esi, esi
mov edi, dword [esp + 0x50]
mov eax, dword [edi + 0x38]
add edi, 0x2c
test eax, eax
je 0x4001042f
cmp esi, dword [eax + 0x50]
jae 0x4001042f
mov ecx, dword [esp + 0x50]
mov edx, dword [ecx + 0x20]
push 1
add edx, esi
push edx
call fcn.40001d00
test al, al
je 0x4001042b
push 4
push 0x1000
push ebx
lea edi, [esi + ebp]
push edi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
je 0x40010540
mov eax, dword [esp + 0x50]
mov ecx, dword [eax + 0x20]
push ebx
add ecx, esi
push ecx
push edi
call fcn.40001a60
add esp, 0xc
add esi, ebx
jmp 0x400103d5
mov esi, dword [esp + 0x50]
mov edx, dword [esi + 0x20]
push 0x8000
push 0
push edx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov dword [esi + 0x20], ebp
mov eax, edi
mov dword [edi + 8], ebp
call fcn.400072e0
mov ebx, esi
push ebx
call fcn.400107a0
cmp eax, 0x7d00
jne 0x4001025a
mov eax, dword [esp + 0x14]
cmp eax, dword [esp + 0x1c]
jb 0x4001054f
mov eax, dword [ebx + 0x38]
mov edx, dword [eax + 0x54]
mov eax, dword [ebx + 0x20]
lea ecx, [esp + 0x24]
push ecx
push 2
push edx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x40010540
xor ebp, ebp
mov eax, dword [edi + 0xc]
test eax, eax
je 0x4001054f
movzx eax, word [eax + 6]
cmp ebp, eax
jae 0x4001054f
mov ecx, ebp
mov eax, edi
call fcn.400073b0
xor edx, edx
test eax, eax
je 0x40010531
mov esi, dword [eax + 0xc]
mov ecx, dword [eax + 0x24]
add esi, dword [ebx + 0x20]
test ecx, 0x20000000
je 0x400104ec
test ecx, 0x40000000
je 0x400104e5
and ecx, 0x80000000
neg ecx
sbb ecx, ecx
and ecx, 0x20
add ecx, 0x20
jmp 0x40010504
mov edx, 0x10
jmp 0x40010506
test ecx, 0x40000000
je 0x40010506
and ecx, 0x80000000
neg ecx
sbb ecx, ecx
and ecx, 2
add ecx, 2
mov edx, ecx
mov ecx, dword [eax + 8]
test ecx, ecx
jne 0x40010510
mov ecx, dword [eax + 0x10]
test edx, edx
jne 0x40010519
mov edx, 1
lea eax, [esp + 0x24]
push eax
push edx
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x40010540
inc ebp
jmp 0x40010494
pop edi
pop ebp
pop esi
mov eax, 0x7d27
pop ebx
add esp, 0x3c
ret 8
pop edi
pop ebp
pop esi
mov eax, 0x7d1c
pop ebx
add esp, 0x3c
ret 8
pop edi
pop ebp
pop esi
mov eax, 0x7d00
pop ebx
add esp, 0x3c
ret 8