Function at 0x404d40
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 0x404e20
cmp edx, 0xb
jg 0x404e28
mov esi, dword [eax]
test esi, esi
jne 0x404e32
mov ebx, dword [eax + 4]
test ebx, ebx
jne 0x404e32
mov edx, dword [eax + 8]
lea edi, [eax + 0xc]
cmp edx, 1
jne 0x40529f
cmp edi, dword [ebp + 0xc]
jae 0x404e20
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 0x404f95
ja 0x404f5f
cmp eax, 8
jne 0x405284
movzx eax, byte [ebx]
test al, al
mov dword [ebp - 0xa4], eax
mov edx, eax
jns 0x404de3
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 0x404fba
ja 0x404f6f
cmp eax, 8
je 0x404f42
add edi, 0xc
cmp edi, dword [ebp + 0xc]
jb 0x404d93
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [eax]
test ecx, ecx
je 0x404f24
cmp eax, dword [ebp + 0xc]
mov esi, eax
jae 0x404e20
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 0x404e74
nop
lea esi, [esi]
cmp dword [eax], ebx
ja 0x404e6d
cmp dword [eax + 4], ebx
ja 0x404f10
mov eax, dword [eax + 8]
test eax, eax
jne 0x404e60
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 0x40520b
mov eax, dword [ebp - 0x24]
cmp eax, 0x40
setne dl
cmp eax, 4
setne cl
movzx eax, cl
test eax, edx
jne 0x405078
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 0x404f10
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 0x404e40
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [eax + 4]
test edx, edx
jne 0x404d66
mov edi, dword [eax + 8]
test edi, edi
jne 0x404d66
add eax, 0xc
jmp 0x404d66
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x405149
cmp dword [eax], ebx
ja 0x404f5a
cmp dword [eax + 4], ebx
ja 0x404e14
mov eax, dword [eax + 8]
jmp 0x404f45
cmp eax, 0x20
jne 0x405284
mov eax, dword [ebx]
jmp 0x404ddb
cmp eax, 0x20
jne 0x404e14
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x4050a5
cmp dword [eax], ebx
ja 0x404f90
cmp dword [eax + 4], ebx
ja 0x404e14
mov eax, dword [eax + 8]
jmp 0x404f7b
movzx eax, word [ebx]
mov edx, eax
mov dword [ebp - 0xa4], eax
and eax, 0x8000
test ax, ax
je 0x404de3
mov eax, edx
or eax, 0xffff0000
jmp 0x404ddb
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x404fd5
cmp dword [eax], ebx
ja 0x404fce
cmp dword [eax + 4], ebx
ja 0x404e14
mov eax, dword [eax + 8]
test eax, eax
jne 0x404fc1
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 0x40520b
mov esi, dword [ebp - 0x64]
cmp esi, 0x40
setne dl
cmp esi, 4
setne cl
movzx eax, cl
test eax, edx
jne 0x4051de
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 0x404e14
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 0x404e17
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 0x404eb1
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 0x40520b
mov esi, dword [ebp - 0x84]
cmp esi, 0x40
setne cl
cmp esi, 4
setne dl
movzx eax, dl
test eax, ecx
jne 0x405251
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 0x404e14
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 0x405065
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 0x40520b
mov edx, dword [ebp - 0x44]
cmp edx, 0x40
setne cl
cmp edx, 4
setne al
movzx esi, al
test esi, ecx
jne 0x405224
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 0x404e14
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 0x405065
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 0x405012
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.00404ae0
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 0x405186
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 0x4050e8
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.00404ae0
mov dword [esp + 4], edx
mov dword [esp], str.__Unknown_pseudo_relocation_protocol_version__d._n
call fcn.00404ae0
nop