Function at 0x1016b5d
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 0x1016bd1
mov al, byte [0x10493e8]
cmp al, 4
jb 0x1016e22
mov eax, dword [0x10493d0]
mov ecx, dword [0x10493d4]
mov ebx, 0x80010000
and eax, 1
and ecx, ebx
or eax, ecx
je 0x1016bd1
mov eax, dword [0x10493d8]
mov esi, dword [0x10493dc]
mov ecx, eax
mov edx, esi
and ecx, 1
and edx, ebx
cmp ecx, eax
jne 0x1016bd1
cmp edx, esi
jne 0x1016bd1
push 0x1016e48
push dword [0x104939c]
push dword [0x1049398]
call fcn.01011f0f
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 0x1016e3c
cmp eax, 0xffffffff
je 0x1016e3c
mov esi, 0x80000000
push esi
push 0x10492d0
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
je 0x1016e3c
call fcn.01015c22
call dword [sym.imp.ADVAPI32.dll_RegDisablePredefinedCache]
lea eax, [ebp - 8]
push eax
push 0x20019
push edi
push 0x1016e78
push esi
call dword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x1016c42
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 0x1016c6e
test byte [eax + 0x1c], 2
jne 0x101a8de
push edi
push 0x10030cb
push 0x1016e68
call dword [sym.imp.API_MS_WIN_Service_Core_L1_1_0.dll_RegisterServiceCtrlHandlerExW]
mov dword [0x1049158], eax
cmp eax, edi
je 0x101a8f5
push 1
call fcn.01016569
mov dword [0x104915c], eax
cmp eax, 1
jne 0x1016e1b
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 0x101a92c
push 0x1011ee4
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
xor esi, esi
mov dword [0x1049140], eax
cmp eax, esi
je 0x101a97b
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x1016cf1
test byte [eax + 0x1c], 2
jne 0x101a9af
mov edi, 0x10157c4
push 0x88
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
pop ecx
cmp eax, esi
je 0x1016e2f
mov ecx, eax
call fcn.01012211
mov ecx, eax
mov dword [0x104913c], eax
call fcn.01011edd
test eax, eax
jl 0x1016d2d
mov ecx, dword [0x104913c]
push esi
push esi
call fcn.0101774a
call fcn.01016e89
mov esi, eax
test esi, esi
jne 0x101a9c7
push 1
call fcn.01016569
call fcn.010121c0
test eax, eax
jne 0x101aa07
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x1016d63
test byte [eax + 0x1c], 2
jne 0x101a9ef
mov byte [0x1049100], 0
cmp eax, ebx
je 0x1016d78
test byte [eax + 0x1c], 2
jne 0x101aa43
lea eax, [ebp - 0x10]
push eax
xor esi, esi
push esi
push dword [0x1049158]
push 0x101210d
push 0x10000
push esi
call dword [sym.imp.KERNEL32.dll_CreateThread]
cmp eax, esi
je 0x101aa69
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x1016db8
test byte [eax + 0x1c], 2
jne 0x101aa56
cmp dword [0x10493e4], esi
je 0x1016e14
mov al, byte [0x10493e8]
cmp al, 4
jb 0x1016e36
mov eax, dword [0x10493d0]
mov ecx, dword [0x10493d4]
mov edi, 0x80010000
and eax, 1
and ecx, edi
or eax, ecx
je 0x1016e14
mov eax, dword [0x10493d8]
mov esi, dword [0x10493dc]
mov ecx, eax
mov edx, esi
and ecx, 1
and edx, edi
cmp ecx, eax
jne 0x1016e14
cmp edx, esi
jne 0x1016e14
push 0x1016e58
push dword [0x104939c]
push dword [0x1049398]
call fcn.01011f0f
push 2
call fcn.01016569
pop edi
pop esi
pop ebx
leave
ret 8
test al, al
je 0x1016b86
jmp 0x1016bd1
xor eax, eax
jmp 0x1016d10
test al, al
je 0x1016dc9
jmp 0x1016e14
push 3
pop eax
jmp 0x1016e1b
push 0x10157c4
push 0xa
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01023f56
jmp 0x1016c6e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x101a91f
test byte [eax + 0x1c], 1
je 0x101a91f
push esi
push 0x10157c4
push 0xb
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01034754
push edi
push esi
push edi
call fcn.01024aa6
jmp 0x1016e1b
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x101a94d
test byte [eax + 0x1c], 2
je 0x101a94d
push 0x10157c4
push 0xc
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01023f56
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
call fcn.01016569
mov dword [0x104915c], eax
cmp eax, 1
jne 0x1016e1b
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x1016cac
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x101a9a8
test byte [eax + 0x1c], 2
je 0x101a9a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [0x1049104]
push 0x10157c4
push 0xd
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01034754
push esi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov edi, 0x10157c4
push edi
push 0xe
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01023f56
jmp 0x1016cf6
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x101a9e5
test byte [eax + 0x1c], 1
je 0x101a9e5
push esi
push edi
push 0xf
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01034754
push 0
push esi
push 1
jmp 0x101a922
push edi
push 0x10
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01023f56
mov eax, dword [0x1049104]
jmp 0x1016d63
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp eax, 0x1d4c0
sbb eax, eax
inc eax
test byte [0x1049100], al
je 0x101aa39
mov eax, dword [0x1049104]
cmp eax, ebx
je 0x1016d63
test byte [eax + 0x1c], 2
je 0x1016d63
push edi
push 0x11
jmp 0x101a9f2
mov eax, dword [0x1049104]
jmp 0x1016d6a
push edi
push 0x12
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01023f56
jmp 0x1016d78
push edi
push 0x13
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01023f56
jmp 0x1016db8
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
je 0x1016da5
push esi
push eax
jmp 0x101a9e8