Function at 0x6ca04ca0
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x44
mov esi, dword [0x6ca0a5a8]
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x38], ecx
test esi, esi
jle 0x6ca04e60
mov eax, dword [0x6ca0a5ac]
xor ecx, ecx
add eax, 4
lea esi, [esi]
mov edx, dword [eax]
cmp ebx, edx
jb 0x6ca04ce4
mov edi, dword [eax + 4]
add edx, dword [edi + 8]
cmp ebx, edx
jb 0x6ca04e52
add ecx, 1
add eax, 0xc
cmp ecx, esi
jne 0x6ca04cd0
mov dword [esp], ebx
call sym.___mingw_GetSectionForAddress
mov edi, eax
test eax, eax
je 0x6ca04eb4
mov eax, dword [0x6ca0a5ac]
lea esi, [esi + esi*2]
shl esi, 2
add eax, esi
mov dword [eax + 8], edi
mov dword [eax], 0
call sym.__GetPEImageBase
mov ecx, dword [0x6ca0a5ac]
add eax, dword [edi + 0xc]
mov dword [ecx + esi + 4], eax
lea ecx, [ebp - 0x2c]
mov dword [esp + 4], ecx
mov dword [esp + 8], 0x1c
mov dword [esp], eax
mov dword [ebp - 0x3c], ecx
call sym._VirtualQuery_12
mov ecx, dword [ebp - 0x3c]
sub esp, 0xc
test eax, eax
je 0x6ca04e94
mov eax, dword [ebp - 0x18]
cmp eax, 0x40
je 0x6ca04d92
cmp eax, 4
je 0x6ca04d92
mov eax, dword [ebp - 0x20]
add esi, dword [0x6ca0a5ac]
mov dword [esp + 8], 0x40
mov dword [esp + 0xc], esi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x3c], ecx
mov dword [esp], eax
call sym._VirtualProtect_16
mov ecx, dword [ebp - 0x3c]
sub esp, 0x10
test eax, eax
je 0x6ca04e67
add dword [0x6ca0a5a8], 1
mov dword [esp + 8], 0x1c
mov dword [esp + 4], ecx
mov dword [esp], ebx
call sym._VirtualQuery_12
sub esp, 0xc
test eax, eax
je 0x6ca04e7c
mov eax, dword [ebp - 0x18]
cmp eax, 0x40
je 0x6ca04dc5
cmp eax, 4
jne 0x6ca04de3
mov eax, dword [ebp - 0x38]
mov dword [esp], ebx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x34]
mov dword [esp + 4], eax
call sym._memmove
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x20]
lea esi, [ebp - 0x30]
mov dword [esp + 8], 0x40
mov dword [esp + 0xc], esi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._VirtualProtect_16
mov eax, dword [ebp - 0x38]
sub esp, 0x10
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x34]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._memmove
mov eax, dword [ebp - 0x18]
cmp eax, 0x40
je 0x6ca04ddb
cmp eax, 4
je 0x6ca04ddb
mov eax, dword [ebp - 0x30]
mov dword [esp + 0xc], esi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._VirtualProtect_16
sub esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea ecx, [ebp - 0x2c]
jmp 0x6ca04d99
xor esi, esi
jmp 0x6ca04cee
call sym._GetLastError_0
mov dword [esp], str.__VirtualProtect_failed_with_code_0x_x
mov dword [esp + 4], eax
call sym.___report_error
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x1c
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
call sym.___report_error
mov eax, dword [0x6ca0a5ac]
mov eax, dword [eax + esi + 4]
mov dword [esp + 8], eax
mov eax, dword [edi + 8]
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov dword [esp + 4], eax
call sym.___report_error
mov dword [esp + 4], ebx
mov dword [esp], str.Address__p_has_no_image_section
call sym.___report_error
lea esi, [esi]
lea esi, [esi]
nop