Function at 0x1016ce1
Capabilities:
Allocate thread local storage
Create thread
Terminate process

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
push edi
xor edi, edi
mov dword [ebp - 0xc], 2
cmp dword [0x10493e4], edi
je 0x1016d55
mov al, byte [0x10493e8]
cmp al, 4
jb 0x1016fa6
mov eax, dword [0x10493d0]
mov ecx, dword [0x10493d4]
mov ebx, 0x80010000
and eax, 1
and ecx, ebx
or eax, ecx
je 0x1016d55
mov eax, dword [0x10493d8]
mov esi, dword [0x10493dc]
mov ecx, eax
mov edx, esi
and ecx, 1
and edx, ebx
cmp ecx, eax
jne 0x1016d55
cmp edx, esi
jne 0x1016d55
push 0x1016fc8
push dword [0x104939c]
push dword [0x1049398]
call fcn.0101213f
mov esi, dword [sym.imp.KERNEL32.dll_TlsAlloc]
call esi
mov dword [0x1049138], eax
call esi
cmp dword [0x1049138], 0xffffffff
mov dword [0x1049134], eax
je 0x1016fc0
cmp eax, 0xffffffff
je 0x1016fc0
mov esi, 0x80000000
push esi
push 0x10492d0
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
je 0x1016fc0
call fcn.01015e82
call dword [sym.imp.ADVAPI32.dll_RegDisablePredefinedCache]
lea eax, [ebp - 8]
push eax
push 0x20019
push edi
push 0x1016ff8
push esi
call dword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x1016dc6
push dword [ebp - 8]
call dword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
push 4
lea eax, [ebp - 0xc]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapSetInformation]
mov eax, dword [0x1049104]
mov ebx, 0x1049104
cmp eax, ebx
je 0x1016df2
test byte [eax + 0x1c], 2
jne 0x101aefe
push edi
push 0x10030cb
push 0x1016fe8
call dword [sym.imp.API_MS_WIN_Service_Core_L1_1_0.dll_RegisterServiceCtrlHandlerExW]
mov dword [0x1049158], eax
cmp eax, edi
je 0x101af15
push 1
call fcn.0100ce55
mov dword [0x104915c], eax
cmp eax, 1
jne 0x1016f9f
mov esi, dword [sym.imp.KERNEL32.dll_OpenEventW]
mov edi, str.Spooler_exiting
push edi
push 0
push 2
call esi
mov dword [ebp - 4], eax
test eax, eax
jne 0x101af4c
push 0x1011df0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
xor esi, esi
mov dword [0x1049140], eax
cmp eax, esi
je 0x101af9b
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x1016e75
test byte [eax + 0x1c], 2
jne 0x101afcf
mov edi, 0x1015a28
push 0x88
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
pop ecx
cmp eax, esi
je 0x1016fb3
mov ecx, eax
call fcn.01015246
mov ecx, eax
mov dword [0x104913c], eax
call fcn.01012136
test eax, eax
jl 0x1016eb1
mov ecx, dword [0x104913c]
push esi
push esi
call fcn.010178fa
call fcn.01017009
mov esi, eax
test esi, esi
jne 0x101afe7
push 1
call fcn.0100ce55
call fcn.010151f5
test eax, eax
jne 0x101b027
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x1016ee7
test byte [eax + 0x1c], 2
jne 0x101b00f
mov byte [0x1049100], 0
cmp eax, ebx
je 0x1016efc
test byte [eax + 0x1c], 2
jne 0x101b063
lea eax, [ebp - 0x10]
push eax
xor esi, esi
push esi
push dword [0x1049158]
push 0x1015195
push 0x10000
push esi
call dword [sym.imp.KERNEL32.dll_CreateThread]
cmp eax, esi
je 0x101b089
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x1016f3c
test byte [eax + 0x1c], 2
jne 0x101b076
cmp dword [0x10493e4], esi
je 0x1016f98
mov al, byte [0x10493e8]
cmp al, 4
jb 0x1016fba
mov eax, dword [0x10493d0]
mov ecx, dword [0x10493d4]
mov edi, 0x80010000
and eax, 1
and ecx, edi
or eax, ecx
je 0x1016f98
mov eax, dword [0x10493d8]
mov esi, dword [0x10493dc]
mov ecx, eax
mov edx, esi
and ecx, 1
and edx, edi
cmp ecx, eax
jne 0x1016f98
cmp edx, esi
jne 0x1016f98
push 0x1016fd8
push dword [0x104939c]
push dword [0x1049398]
call fcn.0101213f
push 2
call fcn.0100ce55
pop edi
pop esi
pop ebx
leave
ret 8
test al, al
je 0x1016d0a
jmp 0x1016d55
xor eax, eax
jmp 0x1016e94
test al, al
je 0x1016f4d
jmp 0x1016f98
push 3
pop eax
jmp 0x1016f9f
push 0x1015a28
push 0xa
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010245a6
jmp 0x1016df2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x101af3f
test byte [eax + 0x1c], 1
je 0x101af3f
push esi
push 0x1015a28
push 0xb
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010245cc
push edi
push esi
push edi
call fcn.010250d6
jmp 0x1016f9f
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x101af6d
test byte [eax + 0x1c], 2
je 0x101af6d
push 0x1015a28
push 0xc
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010245a6
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
call fcn.0100ce55
mov dword [0x104915c], eax
cmp eax, 1
jne 0x1016f9f
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x1016e30
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x101afc8
test byte [eax + 0x1c], 2
je 0x101afc8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [0x1049104]
push 0x1015a28
push 0xd
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010245cc
push esi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov edi, 0x1015a28
push edi
push 0xe
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010245a6
jmp 0x1016e7a
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x101b005
test byte [eax + 0x1c], 1
je 0x101b005
push esi
push edi
push 0xf
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010245cc
push 0
push esi
push 1
jmp 0x101af42
push edi
push 0x10
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010245a6
mov eax, dword [0x1049104]
jmp 0x1016ee7
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp eax, 0x1d4c0
sbb eax, eax
inc eax
test byte [0x1049100], al
je 0x101b059
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x1016ee7
test byte [eax + 0x1c], 2
je 0x1016ee7
push edi
push 0x11
jmp 0x101b012
mov eax, dword [0x1049104]
jmp 0x1016eee
push edi
push 0x12
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010245a6
jmp 0x1016efc
push edi
push 0x13
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010245a6
jmp 0x1016f3c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
je 0x1016f29
push esi
push eax
jmp 0x101b008