Function at 0x10009040
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x1005d53c]
xor eax, ebp
mov dword [ebp - 4], eax
mov edx, dword [ebp + 8]
mov dword [ebp - 0xc], edx
push ebx
push esi
push edi
test edx, edx
je 0x1000920f
cmp dword [ebp + 0xc], 0
je 0x1000920f
mov eax, dword fs:[0x2c]
mov ecx, dword [0x1005fcdc]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x1005f954]
cmp eax, dword [ecx + 4]
jg 0x10009272
jmp 0x10009090
mov edx, dword [ebp - 0xc]
cmp byte [0x1005f950], 0
je 0x1000920f
mov eax, dword [ebp + 0x10]
sub eax, 0
je 0x100090ba
sub eax, 1
je 0x100090ba
sub eax, 1
je 0x100090b3
xor edi, edi
jmp 0x100090bf
mov edi, 6
jmp 0x100090bf
mov edi, 5
xor esi, esi
xor eax, eax
add esi, eax
cmp esi, edi
jae 0x100090dd
lea eax, [edx + esi]
push eax
call fcn.10009390
mov edx, dword [ebp - 0xc]
add esp, 4
cmp eax, 0xffffffff
jne 0x100090c3
test edi, edi
je 0x1000920f
cmp esi, edi
jb 0x1000920f
push 0x40
push 0x3000
lea eax, [esi + 0x94]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
test ebx, ebx
je 0x1000920f
mov dword [ebx], 0x40443332
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea edi, [esi + eax]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
add eax, edi
mov dword [ebx + 0x10], esi
mov edi, dword [ebp - 0xc]
mov dword [ebx + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [ebx + 0xc], eax
lea eax, [ebx + 0x20]
cdq
push 4
push edx
push eax
mov dword [ebx + 8], edi
call fcn.100092b0
mov dword [ebx + 0x14], eax
add eax, 0xa
add eax, dword [ebx + 0x10]
push 4
push 0
push eax
mov dword [ebx + 0x18], 5
call fcn.100092b0
push dword [ebx + 0x10]
mov dword [ebx + 0x1c], eax
push dword [ebx + 8]
push dword [ebx + 0x14]
call fcn.10009300
mov ecx, dword [ebx + 0x10]
add esp, 0x24
mov edx, dword [ebx + 0x14]
mov eax, dword [ebx + 8]
add edx, ecx
sub ecx, edx
add ecx, 0xfffffffb
add eax, ecx
mov byte [edx], 0xe9
mov dword [edx + 1], eax
mov ecx, dword [ebx + 0x1c]
mov eax, dword [ebx + 0xc]
sub eax, ecx
sub eax, 5
mov byte [ecx], 0xe9
mov dword [ecx + 1], eax
mov eax, dword [ebp + 0x10]
sub eax, 0
je 0x100091dc
sub eax, 1
je 0x100091c5
sub eax, 1
jne 0x10009201
mov eax, dword [ebx + 0x1c]
mov dword [ebp - 0x13], eax
lea eax, [ebp - 0x14]
push 6
push eax
push dword [ebx + 8]
mov byte [ebp - 0x14], 0x68
mov byte [ebp - 0xf], 0xc3
jmp 0x100091f5
mov eax, dword [ebx + 0x1c]
mov ecx, dword [ebx + 8]
sub eax, ecx
sub eax, 5
mov byte [ebp - 0xc], 0xe8
mov dword [ebp - 0xb], eax
lea eax, [ebp - 0xc]
jmp 0x100091f1
mov eax, dword [ebx + 0x1c]
mov ecx, dword [ebx + 8]
sub eax, ecx
sub eax, 5
mov byte [ebp - 0x1c], 0xe9
mov dword [ebp - 0x1b], eax
lea eax, [ebp - 0x1c]
push 5
push eax
push ecx
call fcn.10009300
add esp, 0xc
test al, al
jne 0x1000922c
push 0x8000
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
call fcn.10009380
test al, 1
je 0x10009219
int3
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1000d6b4
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0
push eax
push 0x20
lea eax, [esi + 0x94]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
push esi
push edi
call fcn.10009360
lea eax, [esi + 0x94]
push eax
push ebx
call fcn.10009360
mov ecx, dword [ebp - 4]
add esp, 0x10
mov eax, dword [ebx + 0x14]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.1000d6b4
mov esp, ebp
pop ebp
ret
push 0x1005f954
call fcn.1000df7e
add esp, 4
cmp dword [0x1005f954], 0xffffffff
jne 0x1000908d
call fcn.10009480
cmp eax, 0xffffffff
push 0x1005f954
setne byte [0x1005f950]
call fcn.1000df34
add esp, 4
jmp 0x1000908d