Function at 0x6d974a90
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 [0x6d979488]
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x38], ecx
test esi, esi
jle 0x6d974c50
mov eax, dword [0x6d97948c]
xor ecx, ecx
add eax, 4
lea esi, [esi]
mov edx, dword [eax]
cmp ebx, edx
jb 0x6d974ad4
mov edi, dword [eax + 4]
add edx, dword [edi + 8]
cmp ebx, edx
jb 0x6d974c42
add ecx, 1
add eax, 0xc
cmp ecx, esi
jne 0x6d974ac0
mov dword [esp], ebx
call sym.___mingw_GetSectionForAddress
mov edi, eax
test eax, eax
je 0x6d974ca4
mov eax, dword [0x6d97948c]
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 [0x6d97948c]
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 0x6d974c84
mov eax, dword [ebp - 0x18]
cmp eax, 0x40
je 0x6d974b82
cmp eax, 4
je 0x6d974b82
mov eax, dword [ebp - 0x20]
add esi, dword [0x6d97948c]
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 0x6d974c57
add dword [0x6d979488], 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 0x6d974c6c
mov eax, dword [ebp - 0x18]
cmp eax, 0x40
je 0x6d974bb5
cmp eax, 4
jne 0x6d974bd3
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 0x6d974bcb
cmp eax, 4
je 0x6d974bcb
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 0x6d974b89
xor esi, esi
jmp 0x6d974ade
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 [0x6d97948c]
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