Function at 0x10016789
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 0x1001679e
mov dword [eax], edi
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x100167a7
mov dword [eax], edi
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x100167b0
mov dword [eax], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x10040b80], eax
je 0x100167c8
mov eax, 0x10dd
jmp 0x10016a2b
mov eax, dword [0x10040b84]
test eax, eax
jne 0x10016a2b
mov eax, dword [ebp + 8]
test eax, eax
jne 0x100167e4
push 6
pop eax
jmp 0x10016a2b
mov ecx, dword [eax]
test ecx, ecx
jne 0x100167ff
push 6
pop ecx
mov dword [0x10040b88], eax
mov eax, ecx
mov dword [0x10040b84], ecx
jmp 0x10016a2b
push ebx
push 0
push ecx
mov ebx, edi
call fcn.10016a33
push 0
push dword [ebp + 0xc]
mov dword [ebp - 4], eax
call fcn.10016a33
mov ecx, eax
mov dword [ebp - 0x18], ecx
cmp ecx, dword [ebp - 4]
jne 0x10016832
cmp dword [0x10040b78], ebx
jne 0x100169f9
jmp 0x100169d3
mov eax, dword [ebp + 0x14]
mov esi, dword [ebp - 4]
test eax, eax
je 0x1001683e
mov dword [eax], esi
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x10016847
mov dword [eax], ecx
push 0x18
call fcn.100174b1
mov edi, eax
mov dword [ebp - 0x10], edi
pop ecx
test edi, edi
jne 0x10016860
push 8
pop esi
jmp 0x100169d3
push esi
call fcn.100163aa
mov ebx, eax
pop ecx
test ebx, ebx
je 0x10016858
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x10016876
mov dword [eax], ebx
push 8
lea eax, [ebx + 0x38]
push 0
push eax
call fcn.10019120
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 0x1001689e
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.1001731d
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.1001651e
mov edx, dword [ebp + 0x18]
pop ecx
test eax, eax
jne 0x100168ef
cmp edx, 5
jb 0x10016898
mov edi, dword [ebp - 0x10]
jmp 0x1001693d
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0x90
jne 0x10016972
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.1001731d
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 0x100168f4
mov eax, dword [ebp + 0x14]
cmp eax, dword [ebp - 8]
jbe 0x1001694b
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.10018ba0
mov esi, dword [ebp + 0x18]
add esp, 0xc
cmp esi, 0x19
jbe 0x10016985
push 6
jmp 0x1001685a
cmp edx, 5
jae 0x10016942
cmp dword [0x10040b78], 0
push 9
pop esi
jne 0x100169d9
jmp 0x100169d3
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.100165e1
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 0x10016a05
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [0x10040b84], esi
test ebx, ebx
je 0x100169ee
push ebx
call fcn.10016575
mov eax, dword [ebp + 0x10]
pop ecx
test eax, eax
je 0x100169ee
and dword [eax], 0
test edi, edi
je 0x100169f9
push edi
call fcn.10017e9c
pop ecx
mov eax, dword [ebp + 8]
mov dword [0x10040b88], eax
mov eax, esi
jmp 0x10016a2a
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