Function at 0x1005a830
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0x64
mov eax, dword [0x1007e5f0]
xor eax, esp
mov dword [esp + 0x60], eax
mov edx, dword [esp + 0x70]
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x6c]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x90]
push edi
mov dword [esp + 0x1c], edx
mov edx, dword [0x1007eed0]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x84]
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x90]
push edx
mov dword [esp + 0x28], eax
mov dword [esp + 0x18], ecx
xor edi, edi
xor ebp, ebp
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
push 4
push ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x20], edi
call fcn.10069dc0
test eax, eax
mov ecx, dword [esp + 0x14]
mov dword [ecx], eax
je 0x1005aa16
push 0x20b
push ebx
call fcn.10069dc0
mov edi, eax
test edi, edi
je 0x1005aa16
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x10]
push ecx
mov ecx, dword [esp + 0x28]
push 0x200
push edi
mov dword [esi], ebp
mov eax, dword [edx]
mov word [eax], bp
lea edx, [esp + 0x38]
push edx
mov edx, dword [esp + 0x2c]
lea eax, [esp + 0x44]
push eax
mov eax, dword [esp + 0x3c]
push ecx
push edx
push eax
call dword [0x1007f0c0]
movzx eax, ax
cmp ax, 0x64
je 0x1005aa1e
nop
cmp ax, 0xfffe
je 0x1005aa1e
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ecx, [eax + eax + 2]
push ecx
push ebx
call fcn.10069dc0
mov ebp, eax
test ebp, ebp
je 0x1005aa16
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, 1
push eax
push ebp
push 0xffffffffffffffff
push edi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x1005aa16
push 0x14
lea edx, [esp + 0x4c]
push edx
push 0xffffffffffffffff
lea eax, [esp + 0x40]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x1005aa16
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x30]
push eax
push 0
push 0
push ebp
push str.ODBC
push eax
push ecx
call fcn.1005a040
lea edx, [esp + 0x48]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebx, eax
mov eax, 2
sub eax, dword [esi]
cmp eax, ebx
jbe 0x1005a9d9
mov edx, dword [esp + 0x14]
mov eax, dword [edx]
lea ecx, [esp + 0x48]
push ecx
push 2
push eax
call fcn.1000c2d0
movzx edx, word [esp + 0x10]
add ebx, 1
add dword [esi], ebx
mov eax, dword [esi]
mov ecx, 2
sub ecx, eax
cmp ecx, edx
jbe 0x1005a9d9
mov eax, dword [esp + 0x14]
mov ecx, dword [eax]
push ebp
push 2
push ecx
call fcn.1000c2d0
movzx edx, word [esp + 0x10]
add dword [esi], edx
lea eax, [esp + 0x10]
push eax
mov eax, dword [esp + 0x28]
push 0x200
push edi
lea ecx, [esp + 0x38]
push ecx
mov ecx, dword [esp + 0x2c]
lea edx, [esp + 0x44]
push edx
mov edx, dword [esp + 0x3c]
push eax
push ecx
push edx
call dword [0x1007f0c0]
mov ebx, dword [esp + 0x20]
movzx eax, ax
cmp ax, 0x64
jne 0x1005a900
jmp 0x1005aa1e
mov dword [esp + 0x18], 7
mov eax, dword [esp + 0x14]
mov eax, dword [eax]
test eax, eax
je 0x1005aa39
push eax
push ebx
call fcn.1006a020
mov ecx, dword [esp + 0x14]
mov dword [ecx], 0
test edi, edi
je 0x1005aa44
push edi
push ebx
call fcn.1006a020
test ebp, ebp
je 0x1005aa4f
push ebp
push ebx
call fcn.1006a020
mov ecx, dword [esp + 0x70]
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.1006ac47
add esp, 0x64
ret 0x20