Function at 0x4050c0
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xbc
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
sub edx, eax
cmp edx, 7
jle 0x4051a0
cmp edx, 0xb
jg 0x4051a8
mov esi, dword [eax]
test esi, esi
jne 0x4051b2
mov ebx, dword [eax + 4]
test ebx, ebx
jne 0x4051b2
mov edx, dword [eax + 8]
lea edi, [eax + 0xc]
cmp edx, 1
jne 0x40561f
cmp edi, dword [ebp + 0xc]
jae 0x4051a0
mov esi, dword [edi + 4]
mov ebx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x10]
mov ecx, dword [edi + 8]
add ebx, esi
mov esi, dword [edi]
mov eax, dword [esi + edx]
mov dword [ebp - 0xb4], eax
movzx eax, cl
cmp eax, 0x10
je 0x405315
ja 0x4052df
cmp eax, 8
jne 0x405604
movzx eax, byte [ebx]
test al, al
mov dword [ebp - 0xa4], eax
mov edx, eax
jns 0x405163
or eax, 0xffffff00
mov dword [ebp - 0xa4], eax
mov edx, eax
mov eax, dword [ebp + 0x10]
add esi, eax
sub edx, esi
mov esi, dword [ebp - 0xb4]
lea eax, [edx + esi]
mov dword [ebp - 0xa4], eax
movzx eax, cl
cmp eax, 0x10
je 0x40533a
ja 0x4052ef
cmp eax, 8
je 0x4052c2
add edi, 0xc
cmp edi, dword [ebp + 0xc]
jb 0x405113
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [eax]
test ecx, ecx
je 0x4052a4
cmp eax, dword [ebp + 0xc]
mov esi, eax
jae 0x4051a0
lea edi, [ebp - 0x9c]
nop
mov edx, dword [esi + 4]
mov ebx, dword [ebp + 0x10]
mov eax, dword [esi]
add ebx, edx
mov ecx, dword [ebx]
add eax, ecx
mov dword [ebp - 0x9c], eax
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x4051f4
nop
lea esi, [esi]
cmp dword [eax], ebx
ja 0x4051ed
cmp dword [eax + 4], ebx
ja 0x405290
mov eax, dword [eax + 8]
test eax, eax
jne 0x4051e0
mov dword [esp], ebx
mov ecx, 0x1c
lea eax, [ebp - 0x38]
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
call sub.KERNEL32.dll_VirtualQuery
sub esp, 0xc
test eax, eax
je 0x40558b
mov eax, dword [ebp - 0x24]
cmp eax, 0x40
setne dl
cmp eax, 4
setne cl
movzx eax, cl
test eax, edx
jne 0x4053f8
mov dword [esp], ebx
mov ecx, 4
mov dword [esp + 8], ecx
mov dword [esp + 4], edi
call sub.msys_1.0.dll_memcpy
mov edx, dword [ebp - 0x24]
cmp edx, 0x40
setne bl
cmp edx, 4
setne al
movzx ecx, al
test ecx, ebx
je 0x405290
lea ecx, [ebp - 0xa0]
mov dword [esp + 0xc], ecx
mov edx, dword [ebp - 0xa0]
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov ebx, dword [ebp - 0x38]
mov dword [esp], ebx
call sub.KERNEL32.dll_VirtualProtect
sub esp, 0x10
lea esi, [esi]
lea edi, [edi]
add esi, 8
cmp esi, dword [ebp + 0xc]
jb 0x4051c0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [eax + 4]
test edx, edx
jne 0x4050e6
mov edi, dword [eax + 8]
test edi, edi
jne 0x4050e6
add eax, 0xc
jmp 0x4050e6
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x4054c9
cmp dword [eax], ebx
ja 0x4052da
cmp dword [eax + 4], ebx
ja 0x405194
mov eax, dword [eax + 8]
jmp 0x4052c5
cmp eax, 0x20
jne 0x405604
mov eax, dword [ebx]
jmp 0x40515b
cmp eax, 0x20
jne 0x405194
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x405425
cmp dword [eax], ebx
ja 0x405310
cmp dword [eax + 4], ebx
ja 0x405194
mov eax, dword [eax + 8]
jmp 0x4052fb
movzx eax, word [ebx]
mov edx, eax
mov dword [ebp - 0xa4], eax
and eax, 0x8000
test ax, ax
je 0x405163
mov eax, edx
or eax, 0xffff0000
jmp 0x40515b
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x405355
cmp dword [eax], ebx
ja 0x40534e
cmp dword [eax + 4], ebx
ja 0x405194
mov eax, dword [eax + 8]
test eax, eax
jne 0x405341
mov dword [esp], ebx
mov ecx, 0x1c
lea edx, [ebp - 0x78]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
call sub.KERNEL32.dll_VirtualQuery
sub esp, 0xc
test eax, eax
je 0x40558b
mov esi, dword [ebp - 0x64]
cmp esi, 0x40
setne dl
cmp esi, 4
setne cl
movzx eax, cl
test eax, edx
jne 0x40555e
mov dword [esp], ebx
mov edx, 2
lea esi, [ebp - 0xa4]
mov dword [esp + 8], edx
mov dword [esp + 4], esi
call sub.msys_1.0.dll_memcpy
mov ecx, dword [ebp - 0x64]
cmp ecx, 0x40
setne bl
cmp ecx, 4
setne al
movzx edx, al
test edx, ebx
je 0x405194
lea ecx, [ebp - 0xac]
mov dword [esp + 0xc], ecx
mov eax, dword [ebp - 0xac]
mov dword [esp + 8], eax
mov ebx, dword [ebp - 0x6c]
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x78]
mov dword [esp], eax
add edi, 0xc
call sub.KERNEL32.dll_VirtualProtect
sub esp, 0x10
jmp 0x405197
lea edx, [ebp - 0xa0]
mov eax, 0x40
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x2c]
mov dword [esp + 4], ecx
mov edx, dword [ebp - 0x38]
mov dword [esp], edx
call sub.KERNEL32.dll_VirtualProtect
sub esp, 0x10
jmp 0x405231
mov dword [esp], ebx
mov edx, 0x1c
lea esi, [ebp - 0x98]
mov dword [esp + 8], edx
mov dword [esp + 4], esi
call sub.KERNEL32.dll_VirtualQuery
sub esp, 0xc
test eax, eax
je 0x40558b
mov esi, dword [ebp - 0x84]
cmp esi, 0x40
setne cl
cmp esi, 4
setne dl
movzx eax, dl
test eax, ecx
jne 0x4055d1
mov dword [esp], ebx
mov ecx, 4
lea esi, [ebp - 0xa4]
mov dword [esp + 8], ecx
mov dword [esp + 4], esi
call sub.msys_1.0.dll_memcpy
mov edx, dword [ebp - 0x84]
cmp edx, 0x40
setne bl
cmp edx, 4
setne al
movzx ecx, al
test ecx, ebx
je 0x405194
lea edx, [ebp - 0xb0]
mov dword [esp + 0xc], edx
mov eax, dword [ebp - 0xb0]
mov dword [esp + 8], eax
mov ebx, dword [ebp - 0x8c]
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x98]
jmp 0x4053e5
mov dword [esp], ebx
mov edx, 0x1c
lea ecx, [ebp - 0x58]
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
call sub.KERNEL32.dll_VirtualQuery
sub esp, 0xc
test eax, eax
je 0x40558b
mov edx, dword [ebp - 0x44]
cmp edx, 0x40
setne cl
cmp edx, 4
setne al
movzx esi, al
test esi, ecx
jne 0x4055a4
mov dword [esp], ebx
mov ecx, 1
lea edx, [ebp - 0xa4]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
call sub.msys_1.0.dll_memcpy
mov esi, dword [ebp - 0x44]
cmp esi, 0x40
setne bl
cmp esi, 4
setne al
movzx ecx, al
test ecx, ebx
je 0x405194
lea esi, [ebp - 0xa8]
mov dword [esp + 0xc], esi
mov eax, dword [ebp - 0xa8]
mov dword [esp + 8], eax
mov ebx, dword [ebp - 0x4c]
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x58]
jmp 0x4053e5
mov ecx, 0x40
lea esi, [ebp - 0xac]
mov dword [esp + 0xc], esi
mov dword [esp + 8], ecx
mov eax, dword [ebp - 0x6c]
mov dword [esp + 4], eax
mov edx, dword [ebp - 0x78]
mov dword [esp], edx
call sub.KERNEL32.dll_VirtualProtect
sub esp, 0x10
jmp 0x405392
mov dword [esp + 8], ebx
mov edi, 0x1c
mov dword [esp + 4], edi
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
call fcn.00404e60
lea edx, [ebp - 0xa8]
mov eax, 0x40
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov esi, dword [ebp - 0x4c]
mov dword [esp + 4], esi
mov ecx, dword [ebp - 0x58]
mov dword [esp], ecx
call sub.KERNEL32.dll_VirtualProtect
sub esp, 0x10
jmp 0x405506
mov edx, 0x40
lea esi, [ebp - 0xb0]
mov dword [esp + 0xc], esi
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x8c]
mov dword [esp + 4], eax
mov ecx, dword [ebp - 0x98]
mov dword [esp], ecx
call sub.KERNEL32.dll_VirtualProtect
sub esp, 0x10
jmp 0x405468
xor ebx, ebx
movzx edi, cl
mov dword [ebp - 0xa4], ebx
mov dword [esp + 4], edi
mov dword [esp], str.__Unknown_pseudo_relocation_bit_size__d._n
call fcn.00404e60
mov dword [esp + 4], edx
mov dword [esp], str.__Unknown_pseudo_relocation_protocol_version__d._n
call fcn.00404e60
nop