Function at 0x402c10
Capabilities:
Allocate or change rwx memory
Get system information on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x6c
push ebx
push esi
push edi
push 0x3e8
push dword [0x475d28]
mov edi, ecx
mov dword [ebp - 0x34], edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [0x475d08]
mov ecx, edx
mov eax, dword [edx + 4]
cmp byte [eax + 0xd], 0
jne 0x402c61
cmp dword [eax + 0x10], edi
jae 0x402c4a
mov eax, dword [eax + 8]
jmp 0x402c4e
mov ecx, eax
mov eax, dword [eax]
cmp byte [eax + 0xd], 0
je 0x402c40
cmp ecx, edx
je 0x402c61
cmp edi, dword [ecx + 0x10]
jae 0x402f01
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x475ce0]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0xc], esi
test esi, esi
jne 0x402c90
lea eax, [ebp - 0x6c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov esi, dword [ebp - 0x68]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0xc], esi
mov dword [0x475ce0], esi
test edi, edi
jne 0x402cb9
push 0x40
push 0x3000
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov esi, eax
test esi, esi
je 0x402f01
mov dword [ebp - 0x28], esi
lea eax, [ebp - 0x28]
jmp 0x402e42
mov eax, edi
push 0
cdq
mov ebx, edx
mov edi, eax
push esi
push ebx
push edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x24], ebx
call fcn.004501b0
mov ecx, edi
sub ecx, eax
mov eax, ebx
mov edi, ecx
mov dword [ebp - 0x28], ecx
sbb eax, edx
sub edi, esi
mov ebx, eax
mov dword [ebp - 0x18], eax
sbb ebx, 0
mov dword [ebp - 0x48], edi
add esi, ecx
mov dword [ebp - 0x44], ebx
mov edx, 0
mov dword [ebp - 0x10], esi
adc edx, eax
mov dword [ebp - 0x40], esi
xor al, al
mov dword [ebp - 8], edx
mov dword [ebp - 0x3c], edx
mov byte [ebp - 2], al
sub ecx, edi
mov byte [ebp - 1], 0
mov dword [ebp - 0x2c], ecx
mov eax, esi
mov ecx, dword [ebp - 0x18]
sbb ecx, ebx
sub eax, dword [ebp - 0x28]
mov dword [ebp - 0x30], eax
mov eax, edx
sbb eax, dword [ebp - 0x18]
cmp ecx, eax
jg 0x402d35
jl 0x402d30
mov eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x30]
jae 0x402d35
lea eax, [ebp - 0x48]
jmp 0x402d3c
lea eax, [ebp - 0x40]
mov byte [ebp - 1], 1
mov eax, dword [eax]
lea ecx, [ebp - 0x64]
push 0x1c
push ecx
push eax
mov dword [ebp - 0x30], eax
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
jne 0x402d78
cmp byte [ebp - 2], al
jne 0x402d5b
mov byte [ebp - 2], 1
cmp byte [ebp - 1], 0
mov edx, dword [ebp - 8]
je 0x402dd9
add esi, dword [ebp - 0x58]
mov dword [ebp - 0x10], esi
adc edx, 0
mov dword [ebp - 0x40], esi
mov dword [ebp - 8], edx
mov dword [ebp - 0x3c], edx
jmp 0x402de5
cmp dword [ebp - 0x54], 0x10000
jne 0x402d5b
push 0x40
push 0x3000
push dword [ebp - 0xc]
push dword [ebp - 0x30]
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov esi, eax
test esi, esi
jne 0x402e3c
mov esi, dword [ebp - 0x10]
mov edx, dword [ebp - 8]
cmp byte [ebp - 1], al
je 0x402dc5
add esi, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x28]
adc edx, eax
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x40], esi
mov dword [ebp - 8], edx
mov dword [ebp - 0x3c], edx
jmp 0x402d07
sub edi, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x28]
sbb ebx, 0
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x44], ebx
jmp 0x402d07
sub edi, dword [ebp - 0x58]
mov dword [ebp - 0x48], edi
sbb ebx, 0
mov dword [ebp - 0x44], ebx
mov eax, dword [ebp - 0xc]
mov ecx, 0
add eax, esi
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x20]
adc ecx, edx
add eax, 0x7fffffff
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x24]
adc eax, 0
cmp ecx, eax
jl 0x402e34
jg 0x402e13
mov eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x2c]
jb 0x402e34
mov ecx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x24]
add ecx, 0x80000000
adc eax, 0
cmp ebx, eax
jl 0x402ef0
jg 0x402e34
cmp edi, ecx
jbe 0x402ef0
mov ecx, dword [ebp - 0x28]
jmp 0x402d07
mov dword [ebp - 0x30], esi
lea eax, [ebp - 0x30]
push eax
mov ecx, 0x475d38
call fcn.00403560
mov ebx, dword [ebp - 0xc]
add ebx, 0xffffffc0
add ebx, esi
cmp esi, ebx
ja 0x402f01
mov ecx, dword [0x475d30]
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], esi
cmp eax, ecx
jae 0x402ea8
mov edx, eax
mov eax, dword [0x475d2c]
cmp eax, edx
ja 0x402ea8
mov edi, edx
sub edi, eax
sar edi, 2
cmp ecx, dword [0x475d34]
jne 0x402e98
push ecx
mov ecx, 0x475d2c
call fcn.004038e0
mov ecx, dword [0x475d30]
test ecx, ecx
je 0x402ecd
mov eax, dword [0x475d2c]
mov eax, dword [eax + edi*4]
mov dword [ecx], eax
jmp 0x402ec7
cmp ecx, dword [0x475d34]
jne 0x402ec1
push ecx
mov ecx, 0x475d2c
call fcn.004038e0
mov ecx, dword [0x475d30]
test ecx, ecx
je 0x402ecd
mov dword [ecx], esi
mov ecx, dword [0x475d30]
add ecx, 4
add esi, 0x40
mov dword [0x475d30], ecx
cmp esi, ebx
jbe 0x402e63
push dword [0x475d28]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push dword [ebp - 0x30]
lea eax, [ebp - 0x34]
push eax
push ecx
lea eax, [ebp - 0x48]
push eax
call fcn.00404360
push dword [0x475d28]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret