Function at 0x4021a0
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov dword [ebp - 0x1c], 0
cmp dword [ebp + 0x10], 0
je 0x4021bc
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
cmp dword [ebp + 0x14], 0
je 0x4021cb
mov ecx, dword [ebp + 0x14]
mov dword [ecx], 0
cmp dword [ebp + 0x18], 0
je 0x4021da
mov edx, dword [ebp + 0x18]
mov dword [edx], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x68126c], eax
je 0x4021f2
mov eax, 0x10dd
jmp 0x402597
cmp dword [0x681270], 0
je 0x402205
mov eax, dword [0x681270]
jmp 0x402597
cmp dword [ebp + 8], 0
jne 0x402215
mov eax, 6
jmp 0x402597
mov eax, dword [ebp + 8]
cmp dword [eax], 0
jne 0x40223e
mov dword [ebp - 0x1c], 6
mov ecx, dword [ebp - 0x1c]
mov dword [0x681270], ecx
mov edx, dword [ebp + 8]
mov dword [0x681274], edx
mov eax, dword [ebp - 0x1c]
jmp 0x402597
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x2c], 0
push 0
mov edx, dword [ebp - 0x10]
push edx
call fcn.00401620
mov dword [ebp - 0x10], eax
push 0
mov eax, dword [ebp + 0xc]
push eax
call fcn.00401620
mov dword [ebp + 0xc], eax
mov ecx, dword [ebp + 0xc]
cmp ecx, dword [ebp - 0x10]
jne 0x40228b
cmp dword [0x681264], 0
je 0x402287
jmp 0x4022d0
jmp 0x4022c7
cmp dword [ebp + 0x14], 0
je 0x402299
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp - 0x10]
mov dword [edx], eax
cmp dword [ebp + 0x18], 0
je 0x4022a7
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp + 0xc]
mov dword [ecx], edx
push 0x18
call fcn.0059e2c1
add esp, 4
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x402327
mov dword [ebp - 0x1c], 8
mov ecx, dword [ebp - 0x1c]
mov dword [0x681270], ecx
cmp dword [ebp - 0x24], 0
je 0x4022f8
mov edx, dword [ebp - 0x24]
push edx
call fcn.00401a90
add esp, 4
mov dword [ebp - 0x24], 0
cmp dword [ebp + 0x10], 0
je 0x4022f8
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
cmp dword [ebp - 0x2c], 0
je 0x402317
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x40], ecx
mov edx, dword [ebp - 0x40]
push edx
call fcn.0059f0cc
add esp, 4
mov dword [ebp - 0x2c], 0
mov eax, dword [ebp + 8]
mov dword [0x681274], eax
mov eax, dword [ebp - 0x1c]
jmp 0x402597
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.004026c0
add esp, 4
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x402345
mov dword [ebp - 0x1c], 8
jmp 0x4022c7
cmp dword [ebp + 0x10], 0
je 0x402353
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x24]
mov dword [edx], eax
push 8
push 0
mov ecx, dword [ebp - 0x24]
add ecx, 0x38
push ecx
call fcn.005a38c0
add esp, 0xc
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0x24]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
add ecx, 0x1e
mov dword [ebp - 0x18], ecx
mov dword [ebp - 8], 0
mov dword [ebp - 0x20], 5
mov dword [ebp - 0x14], 0
mov edx, dword [ebp - 8]
cmp edx, dword [ebp - 0x20]
jae 0x402431
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], 0
lea ecx, [ebp - 0x30]
push ecx
push 0
mov edx, dword [ebp - 0xc]
push edx
lea eax, [ebp - 0x18]
push eax
mov ecx, dword [ebp - 4]
push ecx
call fcn.00402ba0
mov dword [ebp - 0xc], eax
mov edx, dword [ebp - 0xc]
sub edx, dword [ebp - 0x34]
add edx, dword [ebp - 0x30]
add edx, dword [ebp - 4]
mov dword [ebp - 4], edx
mov eax, dword [ebp - 0xc]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 8], eax
mov cl, byte [ebp - 8]
and cl, 7
mov edx, dword [ebp - 0x24]
add edx, dword [ebp - 0x14]
mov al, byte [edx + 0x38]
and al, 0xf8
or al, cl
mov ecx, dword [ebp - 0x24]
add ecx, dword [ebp - 0x14]
mov byte [ecx + 0x38], al
mov edx, dword [ebp - 4]
sub edx, dword [ebp - 0x24]
and dl, 0x1f
shl dl, 3
mov eax, dword [ebp - 0x24]
add eax, dword [ebp - 0x14]
mov cl, byte [eax + 0x38]
and cl, 7
or cl, dl
mov edx, dword [ebp - 0x24]
add edx, dword [ebp - 0x14]
mov byte [edx + 0x38], cl
mov eax, dword [ebp - 0x34]
push eax
call fcn.004025a0
add esp, 4
test eax, eax
je 0x40242c
jmp 0x402431
jmp 0x402390
mov ecx, dword [ebp - 8]
cmp ecx, dword [ebp - 0x20]
jae 0x402464
mov edx, dword [ebp - 0xc]
push edx
call fcn.004026a0
add esp, 4
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
jne 0x402450
jmp 0x402464
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 0x38]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 0xc]
sub ecx, dword [ebp - 0x10]
mov dword [ebp - 8], ecx
jmp 0x402431
mov edx, dword [ebp - 8]
cmp edx, dword [ebp - 0x20]
jb 0x402472
cmp dword [ebp - 0x14], 8
jbe 0x40248e
mov dword [ebp - 0x1c], 9
cmp dword [0x681264], 0
je 0x402489
jmp 0x4022d0
jmp 0x4022c7
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 0x18]
jbe 0x402497
int3
mov ecx, dword [ebp - 4]
sub ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x24]
mov byte [edx + 0x1e], cl
mov eax, dword [ebp - 0x24]
mov cl, byte [ebp - 8]
mov byte [eax + 0x36], cl
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0x24]
add ecx, 0x20
push ecx
call fcn.005a2910
add esp, 0xc
mov edx, 0x1e
sub edx, dword [ebp - 0x20]
cmp dword [ebp - 8], edx
jbe 0x4024dc
mov dword [ebp - 0x1c], 6
jmp 0x4022c7
mov eax, dword [ebp - 0x10]
add eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x24]
mov dword [ecx + 0x40], eax
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp + 0xc]
mov dword [edx + 0x44], eax
mov ecx, dword [ebp - 0x24]
movzx edx, byte [ecx + 0x1e]
add edx, dword [ebp - 0x24]
mov dword [ebp - 4], edx
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + 0x40]
push ecx
mov edx, dword [ebp - 4]
push edx
call fcn.00401eb0
add esp, 8
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [ebp - 4]
push ecx
call fcn.00401ef0
add esp, 8
mov dword [ebp - 4], eax
mov dword [ebp - 0x28], 0
lea edx, [ebp - 0x28]
push edx
push 0x40
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x402554
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c], eax
jmp 0x4022c7
mov edx, dword [ebp - 0x2c]
mov dword [edx + 4], 0
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp + 8]
mov dword [eax + 8], ecx
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x24]
mov dword [edx + 0x10], eax
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x10]
mov dword [ecx + 0xc], edx
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x28]
mov dword [eax + 0x14], ecx
mov edx, dword [ebp - 0x2c]
mov eax, dword [0x68127c]
mov dword [edx], eax
mov ecx, dword [ebp - 0x2c]
mov dword [0x68127c], ecx
xor eax, eax
mov esp, ebp
pop ebp
ret 0x14