Function at 0x100161a0
Capabilities:
Allocate or change rwx memory

Disassembly:
sub esp, 0x18
mov eax, dword [esp + 0x24]
push ebx
push ebp
push esi
push edi
xor edi, edi
cmp eax, edi
mov dword [esp + 0x10], edi
je 0x100161b7
mov dword [eax], edi
mov ebp, dword [esp + 0x38]
cmp ebp, edi
je 0x100161c2
mov dword [ebp], edi
mov ebx, dword [esp + 0x3c]
cmp ebx, edi
je 0x100161cc
mov dword [ebx], edi
mov esi, dword [esp + 0x30]
cmp esi, edi
jne 0x100161e3
pop edi
pop esi
pop ebp
mov eax, 0x57
pop ebx
add esp, 0x18
ret 0x14
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x10027718], eax
je 0x10016200
pop edi
pop esi
pop ebp
mov eax, 0x10dd
pop ebx
add esp, 0x18
ret 0x14
mov eax, dword [0x1002771c]
cmp eax, edi
jne 0x100164ac
mov ecx, dword [esp + 0x2c]
cmp ecx, edi
jne 0x10016224
pop edi
pop esi
pop ebp
mov eax, 6
pop ebx
add esp, 0x18
ret 0x14
mov eax, dword [ecx]
cmp eax, edi
jne 0x10016244
pop edi
pop esi
mov eax, 6
pop ebp
mov dword [0x1002771c], eax
mov dword [0x10027720], ecx
pop ebx
add esp, 0x18
ret 0x14
push edi
push eax
mov dword [esp + 0x40], edi
mov dword [esp + 0x20], edi
call fcn.10015c60
push 0
push esi
mov edi, eax
call fcn.10015c60
cmp eax, edi
mov dword [esp + 0x30], eax
jne 0x10016277
cmp dword [0x10027710], 0
jne 0x1001649e
jmp 0x10016469
test ebp, ebp
je 0x1001627e
mov dword [ebp], edi
test ebx, ebx
je 0x10016284
mov dword [ebx], eax
push 0x18
call sub.MSVCR80.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
test eax, eax
mov dword [esp + 0x18], eax
jne 0x100162a3
mov dword [esp + 0x10], 8
jmp 0x10016469
mov eax, edi
call fcn.10015a70
test eax, eax
mov dword [esp + 0x38], eax
jne 0x100162bf
mov dword [esp + 0x10], 8
jmp 0x10016469
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x100162c9
mov dword [ecx], eax
xor ecx, ecx
mov dword [eax + 0x38], ecx
mov dword [eax + 0x3c], ecx
mov ebx, eax
add eax, 0x1e
mov esi, edi
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], eax
xor ebp, ebp
jmp 0x100162e8
mov ebx, dword [esp + 0x3c]
lea eax, [esp + 0x10]
push eax
push 0
push esi
lea ecx, [esp + 0x20]
push ecx
push ebx
mov dword [esp + 0x30], esi
mov dword [esp + 0x24], 0
call fcn.10016a60
mov edx, dword [esp + 0x10]
sub edx, dword [esp + 0x1c]
mov esi, eax
mov eax, dword [esp + 0x38]
add edx, esi
add ebx, edx
mov dword [esp + 0x3c], ebx
mov cl, byte [esp + 0x3c]
sub cl, al
add cl, cl
mov ebx, esi
sub ebx, edi
add cl, cl
mov dl, bl
add cl, cl
and dl, 7
xor cl, dl
mov byte [eax + ebp + 0x38], cl
add ebp, 1
cmp ebp, 8
jae 0x1001635c
mov eax, dword [esp + 0x1c]
push eax
call fcn.10015600
add esp, 4
test eax, eax
jne 0x10016358
cmp ebx, 5
jb 0x100162e4
jmp 0x10016384
mov eax, dword [esp + 0x38]
cmp ebx, 5
jae 0x10016388
push esi
call fcn.10015660
add esp, 4
test eax, eax
je 0x1001637b
add esi, eax
mov ebx, esi
sub ebx, edi
cmp ebx, 5
jb 0x10016361
jmp 0x10016384
cmp ebx, 5
jb 0x10016458
mov eax, dword [esp + 0x38]
cmp ebp, 8
ja 0x10016458
mov ecx, dword [esp + 0x3c]
cmp ecx, dword [esp + 0x14]
jbe 0x1001639c
int3
mov esi, dword [esp + 0x24]
sub cl, al
push ebx
mov byte [eax + 0x36], bl
add eax, 0x20
push edi
push eax
mov byte [esi], cl
call sub.MSVCR80.dll_memcpy
add esp, 0xc
cmp ebx, 0x19
jbe 0x100163c7
mov dword [esp + 0x10], 6
jmp 0x10016469
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x30]
mov dword [edx + 0x44], eax
movzx eax, byte [esi]
add eax, edx
lea ecx, [ebx + edi]
mov dword [edx + 0x40], ecx
lea edx, [eax + 5]
mov byte [eax], 0xe9
add eax, 1
sub ecx, edx
mov dword [eax], ecx
mov ecx, dword [esp + 0x14]
push ecx
add eax, 4
push eax
call fcn.100154c0
add esp, 8
lea edx, [esp + 0x20]
push edx
push 0x40
push ebx
xor esi, esi
push edi
mov dword [esp + 0x30], esi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x10016420
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
jmp 0x10016469
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x38]
mov dword [eax + 0xc], edi
pop edi
mov dword [eax + 4], esi
mov dword [eax + 0x10], edx
mov edx, dword [0x10027728]
mov dword [eax + 8], ecx
mov ecx, dword [esp + 0x1c]
pop esi
pop ebp
mov dword [eax + 0x14], ecx
mov dword [eax], edx
mov dword [0x10027728], eax
xor eax, eax
pop ebx
add esp, 0x18
ret 0x14
cmp dword [0x10027710], 0
mov dword [esp + 0x10], 9
jne 0x10016472
mov eax, dword [esp + 0x10]
mov dword [0x1002771c], eax
mov edi, dword [esp + 0x38]
test edi, edi
je 0x1001648d
call fcn.10015b90
mov eax, dword [esp + 0x34]
test eax, eax
je 0x1001648d
mov dword [eax], 0
mov eax, dword [esp + 0x18]
test eax, eax
je 0x1001649e
push eax
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
add esp, 4
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x10]
mov dword [0x10027720], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x14