Function at 0x100161c9
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x10]
sub esp, 0x18
push esi
push edi
xor edi, edi
mov esi, edi
test eax, eax
je 0x100161de
mov dword [eax], edi
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x100161e7
mov dword [eax], edi
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x100161f0
mov dword [eax], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x10040b80], eax
je 0x10016208
mov eax, 0x10dd
jmp 0x1001646b
mov eax, dword [0x10040b84]
test eax, eax
jne 0x1001646b
mov eax, dword [ebp + 8]
test eax, eax
jne 0x10016224
push 6
pop eax
jmp 0x1001646b
mov ecx, dword [eax]
test ecx, ecx
jne 0x1001623f
push 6
pop ecx
mov dword [0x10040b88], eax
mov eax, ecx
mov dword [0x10040b84], ecx
jmp 0x1001646b
push ebx
push 0
push ecx
mov ebx, edi
call fcn.10016473
push 0
push dword [ebp + 0xc]
mov dword [ebp - 4], eax
call fcn.10016473
mov ecx, eax
mov dword [ebp - 0x18], ecx
cmp ecx, dword [ebp - 4]
jne 0x10016272
cmp dword [0x10040b78], ebx
jne 0x10016439
jmp 0x10016413
mov eax, dword [ebp + 0x14]
mov esi, dword [ebp - 4]
test eax, eax
je 0x1001627e
mov dword [eax], esi
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x10016287
mov dword [eax], ecx
push 0x18
call fcn.10016ef1
mov edi, eax
mov dword [ebp - 0x10], edi
pop ecx
test edi, edi
jne 0x100162a0
push 8
pop esi
jmp 0x10016413
push esi
call fcn.10015dea
mov ebx, eax
pop ecx
test ebx, ebx
je 0x10016298
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x100162b6
mov dword [eax], ebx
push 8
lea eax, [ebx + 0x38]
push 0
push eax
call fcn.10018a60
mov edi, dword [ebp - 4]
lea edx, [ebx + 0x1e]
mov eax, ebx
mov dword [ebp - 8], edx
add esp, 0xc
mov dword [ebp + 0x14], eax
mov ecx, esi
jmp 0x100162de
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0xc]
and dword [ebp - 0xc], 0
lea edx, [ebp - 0xc]
push edx
push 0
push ecx
mov esi, ecx
lea ecx, [ebp - 8]
push ecx
push eax
call fcn.10016d5d
mov ecx, dword [ebp + 0x14]
mov edx, eax
mov eax, dword [ebp - 0xc]
sub eax, esi
mov dword [ebp + 0xc], edx
add eax, edx
add ecx, eax
mov eax, edx
mov dword [ebp + 0x14], ecx
sub eax, edi
sub cl, bl
mov dword [ebp + 0x18], eax
shl cl, 3
and al, 7
xor cl, al
push esi
mov byte [ebx + 0x38], cl
call fcn.10015f5e
mov edx, dword [ebp + 0x18]
pop ecx
test eax, eax
jne 0x1001632f
cmp edx, 5
jb 0x100162d8
mov edi, dword [ebp - 0x10]
jmp 0x1001637d
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0x90
jne 0x100163b2
and dword [ebp - 0x10], 0
lea ecx, [ebp - 0x10]
push ecx
push 0
push eax
mov esi, eax
lea eax, [ebp - 8]
push eax
push dword [ebp + 0x14]
call fcn.10016d5d
mov ecx, dword [ebp + 0x14]
mov edx, eax
mov dword [ebp + 0xc], eax
mov eax, dword [ebp - 0x10]
sub eax, esi
add eax, edx
sub edx, dword [ebp - 4]
add ecx, eax
mov dword [ebp + 0x18], edx
mov dword [ebp + 0x14], ecx
mov al, dl
sub cl, bl
and al, 7
shl cl, 3
xor cl, al
mov byte [ebx + 0x38], cl
cmp edx, 5
jb 0x10016334
mov eax, dword [ebp + 0x14]
cmp eax, dword [ebp - 8]
jbe 0x1001638b
int3
sub al, bl
mov byte [ebx + 0x36], dl
push edx
push dword [ebp - 4]
mov byte [ebx + 0x1e], al
lea eax, [ebx + 0x20]
push eax
call fcn.100184e0
mov esi, dword [ebp + 0x18]
add esp, 0xc
cmp esi, 0x19
jbe 0x100163c5
push 6
jmp 0x1001629a
cmp edx, 5
jae 0x10016382
cmp dword [0x10040b78], 0
push 9
pop esi
jne 0x10016419
jmp 0x10016413
movzx ecx, byte [ebx + 0x1e]
mov edx, dword [ebp - 4]
add ecx, ebx
mov eax, dword [ebp - 0x18]
add edx, esi
mov dword [ebx + 0x44], eax
mov dword [ebx + 0x40], edx
lea eax, [ecx + 5]
mov byte [ecx], 0xe9
sub edx, eax
lea eax, [ecx + 5]
mov dword [ecx + 1], edx
push dword [ebp - 8]
push eax
call fcn.10016021
and dword [ebp - 0x14], 0
lea eax, [ebp - 0x14]
pop ecx
pop ecx
push eax
push 0x40
push esi
mov esi, dword [ebp - 4]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x10016445
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [0x10040b84], esi
test ebx, ebx
je 0x1001642e
push ebx
call fcn.10015fb5
mov eax, dword [ebp + 0x10]
pop ecx
test eax, eax
je 0x1001642e
and dword [eax], 0
test edi, edi
je 0x10016439
push edi
call fcn.100177de
pop ecx
mov eax, dword [ebp + 8]
mov dword [0x10040b88], eax
mov eax, esi
jmp 0x1001646a
mov eax, dword [ebp + 8]
and dword [edi + 4], 0
mov dword [edi + 8], eax
mov dword [edi + 0x10], ebx
mov dword [edi + 0xc], esi
mov eax, dword [ebp - 0x14]
mov dword [edi + 0x14], eax
mov eax, dword [0x10040b90]
mov dword [edi], eax
xor eax, eax
mov dword [0x10040b90], edi
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0x14