Function at 0x40cf40
Capabilities:
Allocate thread local storage
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4333f8
push 0x430760
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
mov eax, 0x521c
call fcn.00430730
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
mov ecx, 6
mov esi, str.ExecuteTSQL
lea edi, [ebp - 0xd58]
rep movsd dword es:[edi], dword [esi]
mov ax, word [0x4486c8]
mov word [ebp - 0x51c0], ax
mov ecx, 0x641
xor eax, eax
lea edi, [ebp - 0x51be]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov cx, word [0x4486d0]
mov word [ebp - 0x38b4], cx
mov ecx, 0x641
xor eax, eax
lea edi, [ebp - 0x38b2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dx, word [0x4486d8]
mov word [ebp - 0x1160], dx
mov ecx, 0xff
xor eax, eax
lea edi, [ebp - 0x115e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ax, word [0x4486e0]
mov word [ebp - 0x1fac], ax
mov ecx, 0x1f
xor eax, eax
lea edi, [ebp - 0x1faa]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov cx, word [0x4486e8]
mov word [ebp - 0xb3c], cx
mov ecx, 0xff
xor eax, eax
lea edi, [ebp - 0xb3a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dx, word [0x4486f0]
mov word [ebp - 0x11c], dx
mov ecx, 0x3f
xor eax, eax
lea edi, [ebp - 0x11a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ax, word [0x4486f8]
mov word [ebp - 0x330], ax
mov ecx, 0x41
xor eax, eax
lea edi, [ebp - 0x32e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov cx, word [0x448700]
mov word [ebp - 0x734], cx
mov ecx, 0xff
xor eax, eax
lea edi, [ebp - 0x732]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dx, word [0x448708]
mov word [ebp - 0x228], dx
mov ecx, 0x41
xor eax, eax
lea edi, [ebp - 0x226]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ax, word [0x448710]
mov word [ebp - 0x1f28], ax
mov ecx, 0x7f
xor eax, eax
lea edi, [ebp - 0x1f26]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov cx, word [0x448718]
mov word [ebp - 0xd40], cx
mov ecx, 0x7f
xor eax, eax
lea edi, [ebp - 0xd3e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dx, word [0x448720]
mov word [ebp - 0x5214], dx
mov ecx, 7
xor eax, eax
lea edi, [ebp - 0x5212]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [ebp - 0x334], 0
mov dword [ebp - 0x51f4], 0
mov dword [ebp - 0x120], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x38b8], 0
mov dword [ebp - 0xd60], 0
mov dword [ebp - 0xd5c], 0
mov dword [ebp - 0x73c], 0
mov dword [ebp - 0x51c4], 0
mov dword [ebp - 0xb40], 0
mov dword [ebp - 0x1168], 0
mov dword [ebp - 0x1164], 0
mov dword [ebp - 0x738], 0
mov dword [ebp - 4], 0
cmp dword [ebp + 8], 0
je 0x40d19c
mov eax, dword [ebp + 8]
cmp dword [eax + 0x18c], 0
je 0x40d19c
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x18c]
xor eax, eax
mov ax, word [edx]
test eax, eax
jne 0x40d1c8
push 0x400
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x708]
push edx
push 0x187
mov eax, dword [0x4492ac]
push eax
call dword [sym.imp.SQLUNIRL.dll__LoadString_16]
mov dword [ebp - 4], 0xffffffff
jmp 0x40e02c
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [ebp - 0x334], eax
cmp dword [ebp - 0x334], 0xffffffff
jne 0x40d1e9
mov dword [ebp - 4], 0xffffffff
jmp 0x40e02c
push 0x57
lea ecx, [ebp - 0xd58]
push ecx
push 0x5c
call fcn.00420465
add esp, 0xc
mov dword [ebp - 0xd5c], eax
cmp dword [ebp - 0xd5c], 0
jne 0x40d224
mov edx, dword [ebp - 0x334]
push edx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [ebp - 4], 0xffffffff
jmp 0x40e02c
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x708]
mov dword [ecx + 0x808], 1
push 0x5c
push 0
mov edx, dword [ebp - 0xd5c]
push edx
call sub.MSVCRT.dll_memset
add esp, 0xc
mov eax, dword [ebp - 0xd5c]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x708]
mov dword [eax + 8], edx
mov eax, dword [ebp + 8]
add eax, 0x420
push eax
mov ecx, dword [ebp - 0xd5c]
add ecx, 0xc
push ecx
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
mov edx, dword [ebp - 0xd5c]
push edx
mov eax, dword [ebp - 0x334]
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x408], 0
je 0x40d49d
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x408]
xor ecx, ecx
mov cx, word [eax]
test ecx, ecx
je 0x40d49d
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x194]
and eax, 2
test eax, eax
je 0x40d2d9
push 0x43b0c4
lea ecx, [ebp - 0x5214]
push ecx
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
jmp 0x40d2ee
push 0x43b0c8
lea edx, [ebp - 0x5214]
push edx
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
push 0x43b0cc
lea eax, [ebp - 0x5214]
push eax
call dword [sym.imp.MSVCRT.dll_wcscat]
add esp, 8
lea ecx, [ebp - 0x5214]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x408]
push eax
call fcn.00421816
add esp, 8
mov dword [ebp - 0x1164], eax
cmp dword [ebp - 0x1164], 0
jne 0x40d397
push 0x200
lea ecx, [ebp - 0x1160]
push ecx
push 0xdf
mov edx, dword [0x4492ac]
push edx
call dword [sym.imp.SQLUNIRL.dll__LoadString_16]
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x708]
push ecx
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov esi, eax
lea edx, [ebp - 0x1160]
push edx
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
add esi, eax
cmp esi, 0x3ff
jae 0x40d392
lea eax, [ebp - 0x1160]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x708]
push edx
call dword [sym.imp.MSVCRT.dll_wcscat]
add esp, 8
jmp 0x40d49d
mov eax, dword [ebp - 0xd5c]
mov ecx, dword [ebp - 0x1164]
mov dword [eax + 0x54], ecx
cmp dword [0x448b28], 0
je 0x40d3e2
cmp dword [0x448b1c], 0
jne 0x40d3e2
mov edx, dword [ebp - 0x1164]
push edx
push 0xff
call dword [sym.imp.MSVCRT.dll_fputc]
add esp, 8
mov eax, dword [ebp - 0x1164]
push eax
push 0xfe
call dword [sym.imp.MSVCRT.dll_fputc]
add esp, 8
mov ecx, dword [ebp + 8]
add ecx, 0x680
push ecx
mov edx, dword [ebp + 8]
add edx, 0x67c
push edx
lea eax, [ebp - 0x11c]
push eax
call fcn.0042125c
add esp, 0xc
push 0x200
lea ecx, [ebp - 0x1160]
push ecx
push 0xe1
mov edx, dword [0x4492ac]
push edx
call dword [sym.imp.SQLUNIRL.dll__LoadString_16]
cmp dword [0x448b2c], 0
je 0x40d43c
mov eax, dword [ebp + 8]
add eax, 0x466
mov dword [ebp - 0x5224], eax
jmp 0x40d44b
mov ecx, dword [ebp + 8]
add ecx, 0x420
mov dword [ebp - 0x5224], ecx
lea edx, [ebp - 0x11c]
push edx
mov eax, dword [ebp + 8]
add eax, 4
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
mov eax, dword [ebp - 0x5224]
push eax
lea ecx, [ebp - 0x1160]
push ecx
lea edx, [ebp - 0xb3c]
push edx
mov eax, dword [0x449ba0]
call dword [eax + 0x4cc]
add esp, 0x18
lea ecx, [ebp - 0xb3c]
push ecx
push 0x43b0d0
mov edx, dword [ebp - 0x1164]
push edx
call fcn.00410276
add esp, 0xc
cmp dword [ebp + 0xc], 0
je 0x40d4b3
mov eax, dword [ebp + 0xc]
cmp dword [eax + 8], 0
jne 0x40d4b3
mov dword [ebp + 0xc], 0
cmp dword [ebp + 0xc], 0
jne 0x40d5a7
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
mov eax, dword [ebp + 8]
add eax, 0x420
push eax
push str.SQLAgent___TSQL_JobStep__Job__s_:_Step__ld_
lea ecx, [ebp - 0x228]
push ecx
mov edx, dword [0x449ba0]
call dword [edx + 0x4cc]
add esp, 0x10
lea eax, [ebp - 0x228]
push eax
lea ecx, [ebp - 0x1d28]
push ecx
call fcn.00407820
add esp, 8
mov edx, dword [ebp + 8]
add edx, 0x1ec
push edx
lea eax, [ebp - 0x19fc]
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
push 0x2c
push 0
lea ecx, [ebp - 0x51f0]
push ecx
call sub.MSVCRT.dll_memset
add esp, 0xc
mov dword [ebp - 0x51f0], 0x40c0b9
mov edx, dword [0x44b4cc]
mov dword [ebp - 0x51ec], edx
lea eax, [ebp - 0x51f0]
push eax
xor ecx, ecx
cmp dword [0x449e60], 0
sete cl
or ecx, 0x1808
push ecx
lea edx, [ebp - 0x1d28]
push edx
call dword [sym.imp.SQLSVC.dll_QSQLLogonEx]
add esp, 0xc
test eax, eax
je 0x40d583
cmp dword [ebp - 0x1d20], 0
je 0x40d583
mov dword [ebp - 0x5228], 1
jmp 0x40d58d
mov dword [ebp - 0x5228], 0
mov eax, dword [ebp - 0x5228]
mov dword [ebp - 0xb40], eax
lea ecx, [ebp - 0x1d28]
mov dword [ebp + 0xc], ecx
jmp 0x40d67a
lea edx, [ebp - 0xd58]
push edx
push 0
mov eax, dword [ebp + 0xc]
push eax
call fcn.004078f6
add esp, 0xc
test eax, eax
je 0x40d67a
mov dword [ebp - 0xb40], 1
mov ecx, dword [ebp + 0xc]
add ecx, 0x32c
push ecx
lea edx, [ebp - 0x330]
push edx
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
push 0x400
lea eax, [ebp - 0x734]
push eax
push 0x43b130
push 0x43b138
mov ecx, dword [ebp + 0xc]
add ecx, 0x32c
push ecx
call fcn.0042f530
add esp, 0x14
lea edx, [ebp - 0x734]
push edx
push 0x43b13c
lea eax, [ebp - 0x51c0]
push eax
mov ecx, dword [0x449ba0]
call dword [ecx + 0x4cc]
add esp, 0xc
lea edx, [ebp - 0x51c0]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.SQLSVC.dll_QSQLPurgeExec]
add esp, 8
mov ecx, dword [ebp - 0xb40]
and ecx, eax
mov dword [ebp - 0xb40], ecx
mov edx, dword [ebp + 8]
add edx, 0x1ec
push edx
mov eax, dword [ebp + 0xc]
add eax, 0x32c
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
mov dword [ebp - 0x1168], 1
cmp dword [ebp - 0xb40], 0
je 0x40dd9d
mov ecx, dword [ebp - 0x334]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.SQLSVC.dll_QSQLSetUserData]
add esp, 8
mov eax, dword [ebp + 8]
cmp dword [eax + 0x678], 0
jne 0x40d93c
push 0x200
lea ecx, [ebp - 0x1f28]
push ecx
push 0x43b150
push 0x43b158
mov edx, dword [ebp + 8]
add edx, 0x1ec
push edx
call fcn.0042f530
add esp, 0x14
push 0x200
lea eax, [ebp - 0xd40]
push eax
push 0x43b15c
push 0x43b164
mov ecx, dword [ebp + 8]
add ecx, 0x56e
push ecx
call fcn.0042f530
add esp, 0x14
lea edx, [ebp - 0x1f28]
push edx
lea eax, [ebp - 0xd40]
push eax
lea ecx, [ebp - 0xd40]
push ecx
lea edx, [ebp - 0x1f28]
push edx
push 0x43b168
lea eax, [ebp - 0x51c0]
push eax
mov ecx, dword [0x449ba0]
call dword [ecx + 0x4cc]
add esp, 0x18
lea edx, [ebp - 0x51c0]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.SQLSVC.dll_QSQLExecDirect]
add esp, 8
cmp eax, 1
jne 0x40d7a5
lea ecx, [ebp - 0x738]
push ecx
mov edx, dword [ebp + 8]
add edx, 0x2f4
push edx
push 0x108
push 0xfffffffffffffff8
push 1
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.SQLSVC.dll_QSQLBind]
add esp, 0x18
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.SQLSVC.dll_QSQLNextRow]
add esp, 4
cmp eax, 0xffffffff
jne 0x40d786
jmp 0x40d772
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.SQLSVC.dll_QSQLResults]
add esp, 4
cmp eax, 1
je 0x40d74b
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.SQLSVC.dll_QSQLPurgeResults]
add esp, 4
mov ecx, dword [ebp + 8]
xor edx, edx
mov dx, word [ecx + 0x2f4]
test edx, edx
jne 0x40d93c
push 0x200
lea eax, [ebp - 0x1160]
push eax
push 0xfa
mov ecx, dword [0x4492ac]
push ecx
call dword [sym.imp.SQLUNIRL.dll__LoadString_16]
push 0x200
lea edx, [ebp - 0x734]
push edx
push 0x17
mov eax, dword [0x4492ac]
push eax
call dword [sym.imp.SQLUNIRL.dll__LoadString_16]
mov ecx, dword [ebp - 0xd5c]
cmp dword [ecx + 4], 0
je 0x40d818
mov edx, dword [ebp - 0xd5c]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov dword [ebp - 0x522c], eax
jmp 0x40d82e
lea ecx, [ebp - 0x734]
push ecx
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov dword [ebp - 0x522c], eax
push 0xd4
lea edx, [ebp - 0xd58]
push edx
lea eax, [ebp - 0x1160]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov esi, dword [ebp - 0x522c]
add esi, eax
mov ecx, dword [ebp + 8]
add ecx, 0x466
push ecx
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
add esi, eax
lea edx, [esi + esi + 0x20]
push edx
call fcn.00420465
add esp, 0xc
mov dword [ebp - 0xd60], eax
cmp dword [ebp - 0xd60], 0
je 0x40d924
mov eax, dword [ebp - 0xd5c]
cmp dword [eax + 4], 0
je 0x40d8a4
mov ecx, dword [ebp - 0xd5c]
mov edx, dword [ecx + 4]
mov dword [ebp - 0x5230], edx
jmp 0x40d8b0
lea eax, [ebp - 0x734]
mov dword [ebp - 0x5230], eax
mov ecx, dword [ebp - 0x5230]
push ecx
mov edx, dword [ebp + 8]
add edx, 0x466
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
lea edx, [ebp - 0x1160]
push edx
mov eax, dword [ebp - 0xd60]
push eax
mov ecx, dword [0x449ba0]
call dword [ecx + 0x4cc]
add esp, 0x14
push 0x3ff
mov edx, dword [ebp - 0xd60]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x708]
push ecx
call dword [sym.imp.MSVCRT.dll_wcsncpy]
add esp, 0xc
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x708]
mov word [eax + 0x7fe], 0
mov ecx, dword [ebp - 0xd60]
push ecx
call fcn.004209ff
add esp, 4
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x708]
mov dword [eax + 0x808], 0
jmp 0x40dd0a
mov ecx, dword [ebp + 8]
xor edx, edx
mov dx, word [ecx + 0x2f4]
test edx, edx
je 0x40da18
push 0x400
lea eax, [ebp - 0x734]
push eax
push 0x43b40c
push 0x43b414
mov ecx, dword [ebp + 8]
add ecx, 0x2f4
push ecx
call fcn.0042f530
add esp, 0x14
lea edx, [ebp - 0x734]
push edx
push 0x43b418
lea eax, [ebp - 0x51c0]
push eax
mov ecx, dword [0x449ba0]
call dword [ecx + 0x4cc]
add esp, 0xc
lea edx, [ebp - 0x51c0]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.SQLSVC.dll_QSQLPurgeExec]
add esp, 8
test eax, eax
jne 0x40da18
push 0x200
lea ecx, [ebp - 0x1160]
push ecx
push 0x1c
mov edx, dword [0x4492ac]
push edx
call dword [sym.imp.SQLUNIRL.dll__LoadString_16]
mov eax, dword [ebp + 8]
add eax, 0x1ec
push eax
mov ecx, dword [ebp + 8]
add ecx, 0x2f4
push ecx
lea edx, [ebp - 0x1160]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x708]
push ecx
mov edx, dword [0x449ba0]
call dword [edx + 0x4cc]
add esp, 0x10
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x708]
mov dword [ecx + 0x808], 0
jmp 0x40dd0a
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x194]
and eax, 4
neg eax
sbb eax, eax
inc eax
mov dword [ebp - 0x51c4], eax
mov dword [ebp - 0x120], 0
mov ecx, dword [ebp - 0x120]
mov dword [ebp - 0x51f4], ecx
push 0x1908
push 0
lea edx, [ebp - 0x51c0]
push edx
call sub.MSVCRT.dll_memset
add esp, 0xc
mov eax, dword [ebp + 8]
cmp dword [eax + 0x18c], 0
je 0x40dbc9
lea ecx, [ebp - 0x120]
push ecx
lea edx, [ebp - 0x38b4]
push edx
lea eax, [ebp - 0x51f4]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x18c]
push edx
call fcn.0040f630
add esp, 0x10
test eax, eax
je 0x40dbc9
push 0
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x684]
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
xor edx, edx
cmp eax, 0x102
setne dl
mov dword [ebp - 0x73c], edx
cmp dword [ebp - 0x73c], 0
jne 0x40dbc9
push 0x43b450
lea eax, [ebp - 0x38b4]
push eax
call dword [sym.imp.MSVCRT.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x40db14
push 0x43b458
lea ecx, [ebp - 0x38b4]
push ecx
call dword [sym.imp.MSVCRT.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x40db14
push 0x43b460
lea edx, [ebp - 0x38b4]
push edx
call dword [sym.imp.MSVCRT.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x40db1d
cmp dword [ebp - 0x120], 0
je 0x40db39
lea eax, [ebp - 0x38b4]
push eax
lea ecx, [ebp - 0x51c0]
push ecx
call dword [sym.imp.MSVCRT.dll_wcscat]
add esp, 8
jmp 0x40dbc4
lea edx, [ebp - 0x51c0]
push edx
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
push eax
lea eax, [ebp - 0x51c0]
push eax
call fcn.0040fa12
add esp, 8
test eax, eax
jne 0x40db8d
mov ecx, dword [ebp - 0xd5c]
push ecx
lea edx, [ebp - 0x51c4]
push edx
mov eax, dword [ebp - 0x1164]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
lea eax, [ebp - 0x51c0]
push eax
call fcn.0040e03d
add esp, 0x18
test eax, eax
je 0x40db98
mov ecx, dword [ebp - 0xd5c]
cmp dword [ecx], 0
je 0x40dbaf
push 0x448724
lea edx, [ebp - 0x51c0]
push edx
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
jmp 0x40dbc9
push 0x448728
lea eax, [ebp - 0x51c0]
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
jmp 0x40da5b
cmp dword [ebp - 0x73c], 0
jne 0x40dd0a
lea ecx, [ebp - 0x51c0]
push ecx
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
push eax
lea edx, [ebp - 0x51c0]
push edx
call fcn.0040fa12
add esp, 8
test eax, eax
jne 0x40dc26
mov eax, dword [ebp - 0xd5c]
push eax
lea ecx, [ebp - 0x51c4]
push ecx
mov edx, dword [ebp - 0x1164]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x51c0]
push edx
call fcn.0040e03d
add esp, 0x18
mov eax, dword [ebp - 0xd5c]
cmp dword [eax + 4], 0
je 0x40dcdf
mov dword [ebp - 0x5218], 0x400
mov ecx, dword [ebp - 0x5218]
sub ecx, 1
push ecx
mov edx, dword [ebp - 0xd5c]
mov eax, dword [edx + 4]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x708]
push edx
call dword [sym.imp.MSVCRT.dll_wcsncpy]
add esp, 0xc
mov eax, dword [ebp - 0xd5c]
mov ecx, dword [eax + 4]
push ecx
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov edx, dword [ebp - 0x5218]
sub edx, 1
cmp eax, edx
jbe 0x40dcc9
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x708]
mov edx, dword [ebp - 0x5218]
mov word [ecx + edx*2 - 4], 0x2e
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x708]
mov edx, dword [ebp - 0x5218]
mov word [ecx + edx*2 - 6], 0x2e
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x708]
mov edx, dword [ebp - 0x5218]
mov word [ecx + edx*2 - 8], 0x2e
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x708]
mov edx, dword [ebp - 0x5218]
mov word [ecx + edx*2 - 2], 0
mov eax, dword [ebp - 0xd5c]
cmp dword [eax], 0
je 0x40dcfd
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x708]
mov dword [edx + 0x808], 2
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.SQLSVC.dll_QSQLCancel]
add esp, 4
cmp dword [ebp - 0x1168], 0
jne 0x40dd22
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.SQLSVC.dll_QSQLLogoff]
add esp, 4
jmp 0x40dd98
push 0x400
lea edx, [ebp - 0x734]
push edx
push 0x43b468
push 0x43b470
mov eax, dword [ebp + 0xc]
add eax, 0x32c
push eax
call fcn.0042f530
add esp, 0x14
lea ecx, [ebp - 0x734]
push ecx
push 0x43b474
lea edx, [ebp - 0x51c0]
push edx
mov eax, dword [0x449ba0]
call dword [eax + 0x4cc]
add esp, 0xc
lea ecx, [ebp - 0x51c0]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.SQLSVC.dll_QSQLPurgeExec]
add esp, 8
lea eax, [ebp - 0x330]
push eax
mov ecx, dword [ebp + 0xc]
add ecx, 0x32c
push ecx
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
jmp 0x40df01
mov dword [ebp - 0x521c], 0
mov dword [ebp - 0x5220], 0
push 0x200
lea edx, [ebp - 0x1160]
push edx
push 0x15
mov eax, dword [0x4492ac]
push eax
call dword [sym.imp.SQLUNIRL.dll__LoadString_16]
mov ecx, dword [ebp - 0x1d14]
and ecx, 0xffff
test ecx, ecx
je 0x40ddfd
lea edx, [ebp - 0x1d14]
push edx
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
test eax, eax
je 0x40ddfd
lea eax, [ebp - 0x1d14]
mov dword [ebp - 0x1f2c], eax
jmp 0x40de09
lea ecx, [ebp - 0x1160]
mov dword [ebp - 0x1f2c], ecx
mov dword [ebp - 0x521c], 0
mov dword [ebp - 0x5220], 0
cmp dword [0x448b28], 0
je 0x40de4e
cmp dword [0x448b1c], 0
je 0x40de4e
lea edx, [ebp - 0x5220]
push edx
lea eax, [ebp - 0x521c]
push eax
push 1
lea ecx, [ebp - 0x1f2c]
push ecx
call fcn.004218f3
add esp, 0x10
cmp dword [0x448b28], 0
je 0x40de6e
cmp dword [0x448b1c], 0
je 0x40de6e
mov edx, dword [ebp - 0x521c]
mov dword [ebp - 0x5234], edx
jmp 0x40de7a
lea eax, [ebp - 0x1f2c]
mov dword [ebp - 0x5234], eax
mov ecx, dword [ebp - 0x5234]
push ecx
push 0x400
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x708]
push eax
push 0
push 0x800000cf
mov ecx, dword [0x44b984]
push ecx
push 0x2800
call dword [sym.imp.SQLUNIRL.dll__FormatMessage_28]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x40debe
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x38b8], eax
cmp dword [ebp - 0x521c], 0
je 0x40ded6
mov edx, dword [ebp - 0x521c]
push edx
call fcn.004209ff
add esp, 4
cmp dword [ebp - 0x5220], 0
je 0x40deee
mov eax, dword [ebp - 0x5220]
push eax
call fcn.004209ff
add esp, 4
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x708]
mov dword [edx + 0x808], 2
cmp dword [ebp - 0xd5c], 0
je 0x40df28
mov eax, dword [ebp - 0xd5c]
cmp dword [eax + 4], 0
je 0x40df28
mov ecx, dword [ebp - 0xd5c]
mov edx, dword [ecx + 4]
push edx
call fcn.004209ff
add esp, 4
mov eax, dword [ebp - 0x334]
push eax
call dword [sym.imp.KERNEL32.dll_TlsFree]
cmp dword [ebp - 0x1164], 0
je 0x40df58
mov ecx, dword [ebp - 0x1164]
push ecx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov dword [ebp - 0x1164], 0
mov dword [ebp - 4], 0xffffffff
jmp 0x40e005
push 0
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.SQLSVC.dll_QSQLSetUserData]
add esp, 8
cmp dword [ebp - 0xd5c], 0
je 0x40e02c
mov ecx, dword [ebp - 0xd5c]
push ecx
call fcn.004209ff
add esp, 4
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret