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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x874
mov dword [ebp - 0x810], 0
mov dword [ebp - 0x814], 0
mov dword [ebp - 0x818], 0
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [ebp - 0x814], eax
push 0x5c
push 0
lea eax, [ebp - 0x874]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0x80c
push 0
lea ecx, [ebp - 0x80c]
push ecx
call sub.MSVCRT.dll_memset
add esp, 0xc
lea edx, [ebp - 0x80c]
mov dword [ebp - 0x86c], edx
cmp dword [ebp + 0x20], 0
je 0x407c9d
mov eax, dword [ebp + 0x20]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
cmp eax, 0x23
jae 0x407c9d
mov ecx, dword [ebp + 0x20]
push ecx
lea edx, [ebp - 0x868]
push edx
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
lea eax, [ebp - 0x874]
push eax
mov ecx, dword [ebp - 0x814]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.SQLSVC.dll_QSQLGetUserData]
add esp, 4
mov dword [ebp - 0x818], eax
mov eax, dword [ebp - 0x814]
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.SQLSVC.dll_QSQLSetUserData]
add esp, 8
mov edx, 1
test edx, edx
je 0x407e38
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.SQLSVC.dll_QSQLExecDirect]
add esp, 8
mov dword [ebp - 0x810], eax
cmp dword [ebp + 0x14], 0
je 0x407d0f
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.SQLSVC.dll_QSQLPurgeResults]
add esp, 4
cmp dword [ebp - 0xc], 0x232a
jne 0x407d96
push 0x4389b0
mov eax, dword [ebp - 0x870]
push eax
call dword [sym.imp.MSVCRT.dll_wcsstr]
add esp, 8
test eax, eax
je 0x407d96
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.SQLSVC.dll_QSQLPurgeResults]
add esp, 4
push 0x1388
mov edx, dword [0x44b980]
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x407d96
push str.DUMP_TRANSACTION_msdb_WITH_NO_LOG
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.SQLSVC.dll_QSQLPurgeExec]
add esp, 8
cmp eax, 1
jne 0x407d85
mov ecx, dword [ebp + 0xc]
push ecx
push 0x438a00
push 0x130
push 0
push 2
call fcn.0041b8d1
add esp, 0x14
push 0
push 1
mov edx, dword [0x44b980]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
cmp dword [ebp - 0xc], 0x4b5
jne 0x407e31
cmp dword [ebp + 0x10], 0
je 0x407e31
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.SQLSVC.dll_QSQLPurgeResults]
add esp, 4
cmp dword [ebp - 0x870], 0
je 0x407ddc
mov ecx, dword [ebp - 0x870]
push ecx
call fcn.004209ff
add esp, 4
mov dword [ebp - 0x870], 0
mov dword [ebp - 0x874], 0
mov dword [ebp - 0x81c], 0
push 0x80c
push 0
lea edx, [ebp - 0x80c]
push edx
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [0x448b20], 0
je 0x407e2f
mov eax, dword [ebp + 0xc]
push eax
push 0x12f
push 0
push 2
call fcn.0041b8d1
add esp, 0x10
jmp 0x407e33
jmp 0x407e38
jmp 0x407cd8
cmp dword [ebp + 0x18], 0
je 0x407e5d
cmp dword [ebp - 8], 0
je 0x407e54
cmp dword [ebp - 8], 0xa
je 0x407e54
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp - 0xc]
mov dword [ecx], edx
jmp 0x407e5d
mov eax, dword [ebp + 0x18]
mov dword [eax], 0
cmp dword [ebp + 0x1c], 0
je 0x407e94
cmp dword [ebp - 0x870], 0
je 0x407e82
mov ecx, dword [ebp - 0x870]
push ecx
mov edx, dword [ebp + 0x1c]
push edx
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
jmp 0x407e94
push 0x4485d0
mov eax, dword [ebp + 0x1c]
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
mov ecx, dword [ebp - 0x818]
neg ecx
sbb ecx, ecx
and ecx, dword [ebp - 0x818]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.SQLSVC.dll_QSQLSetUserData]
add esp, 8
cmp dword [ebp - 0x870], 0
je 0x407eca
mov eax, dword [ebp - 0x870]
push eax
call fcn.004209ff
add esp, 4
mov ecx, dword [ebp - 0x814]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov eax, dword [ebp - 0x810]
mov esp, ebp
pop ebp
ret