Function at 0x100406190
Capabilities:
Create thread

Disassembly:
mov eax, 0x1058
call fcn.100402360
sub rsp, rax
mov rax, qword [0x10042d0d0]
xor rax, rsp
mov qword [rsp + 0x1040], rax
mov rax, qword [0x10042d108]
mov qword [rsp + 0x1050], rdi
mov edi, 1
cmp dword [rax + 0x8538], 0
je 0x1004063e2
lea rcx, [0x100455848]
mov qword [rsp + 0x1060], rbx
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x100455848]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea rdx, [0x100406820]
lea rcx, str.sqlserver
call qword [sym.imp.ADVAPI32.dll_RegisterServiceCtrlHandlerA]
mov qword [0x100455870], rax
test rax, rax
je 0x100406228
lea edx, [rdi + 3]
xor r9d, r9d
mov r8d, edi
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_SetServiceBits]
test eax, eax
jne 0x100406261
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [rsp + 0x40]
xor r9d, r9d
mov ecx, eax
xor r8d, r8d
call qword [sym.imp.sqldk.dll_Ordinal_479]
mov ecx, 0x42f5
mov rdx, rax
call fcn.1004137c0
mov edx, 0x42f5
mov r8d, reloc.sqldk.dll_Ordinal_1066
mov ecx, edi
call qword [sym.imp.sqldk.dll_Ordinal_816]
mov rcx, qword [0x100455870]
lea rdx, [0x100455878]
xor ebx, ebx
mov dword [0x100455878], 0x10
mov dword [0x10045587c], 2
mov qword [0x100455880], 7
mov dword [0x100455888], ebx
mov dword [0x10045588c], edi
mov dword [0x100455890], 0x4e20
call qword [sym.imp.ADVAPI32.dll_SetServiceStatus]
test eax, eax
jne 0x1004062f0
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [rsp + 0x40]
xor r9d, r9d
mov ecx, eax
xor r8d, r8d
call qword [sym.imp.sqldk.dll_Ordinal_479]
lea rdx, str.initsignal
mov ecx, 0x42f7
mov r8, rax
call fcn.1004137c0
mov edx, 0x42f7
mov r8d, reloc.sqldk.dll_Ordinal_1066
mov ecx, edi
call qword [sym.imp.sqldk.dll_Ordinal_816]
xor r9d, r9d
xor r8d, r8d
mov edx, edi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov qword [0x100455898], rax
test rax, rax
jne 0x10040634c
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, [rsp + 0x40]
xor r9d, r9d
mov ecx, eax
xor r8d, r8d
call qword [sym.imp.sqldk.dll_Ordinal_479]
lea rdx, str.initsignal:CreateEvent
mov ecx, 0x42f7
mov r8, rax
call fcn.1004137c0
mov edx, 0x42f7
mov r8d, reloc.sqldk.dll_Ordinal_1066
mov ecx, edi
call qword [sym.imp.sqldk.dll_Ordinal_816]
lea rcx, [0x100455848]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea r11, [rsp + 0x30]
lea r8, [0x100406d70]
mov qword [rsp + 0x28], r11
mov r9d, 2
xor edx, edx
xor ecx, ecx
mov dword [rsp + 0x20], ebx
call qword [sym.imp.MSVCR100.dll__beginthreadex]
mov rbx, rax
test rax, rax
jne 0x1004063aa
lea rdx, str.incrementsignal
mov ecx, 0x42e0
call fcn.1004137c0
mov edx, 0x42e0
mov r8d, reloc.sqldk.dll_Ordinal_1066
mov ecx, edi
call qword [sym.imp.sqldk.dll_Ordinal_816]
mov edx, 2
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov rdx, rdi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_SetThreadAffinityMask]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [sym.imp.sqldk.dll_Ordinal_971]
call qword [sym.imp.sqlmin.dll_Ordinal_1391]
mov rbx, qword [rsp + 0x1060]
mov rax, qword [0x10042d0c8]
mov ecx, 5
movzx edx, byte [rax + 0x1c3]
test dl, 0x10
cmovne ecx, edi
mov rdi, qword [rsp + 0x1050]
test dl, 8
je 0x10040640b
or ecx, 4
call qword [sym.imp.KERNEL32.dll_SetErrorMode]
mov rcx, qword [rsp + 0x1040]
xor rcx, rsp
call fcn.1004013c0
add rsp, 0x1058
ret