Function at 0x59a660
Capabilities:
Get thread local storage value
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x74
push ebx
mov ebx, dword [esp + 0x7c]
push ebp
push esi
push edi
mov edi, dword [esp + 0x98]
mov esi, ecx
or ebp, 0xffffffff
mov dword [esp + 0x1c], esi
push ebx
mov ecx, edi
mov dword [esp + 0x18], ebp
call fcn.0046b460
cmp eax, dword [edi + 8]
jg 0x59a7a3
push ebp
push ebx
mov ebx, dword [esp + 0xa8]
mov ecx, ebx
call fcn.0046b890
mov edi, eax
mov dword [esp + 0x14], edi
test edi, edi
js 0x59af38
mov edx, dword [esp + 0x90]
cmp edx, ebp
je 0x59af38
mov eax, dword [esi + 0x64]
lea ecx, [edx*8]
sub ecx, edx
mov eax, dword [eax + 8]
cmp dword [eax + ecx*4 + 0x10], 0
lea ebp, [eax + ecx*4]
jne 0x59a78f
push dword [0x884adc]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push 0xc
mov ecx, dword [eax + 0x2c]
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, eax
test esi, esi
je 0x59a78a
mov ecx, dword [ebp]
mov ecx, dword [ecx + 0x60]
mov edi, ecx
mov dword [esi], 0
mov dword [esi + 4], 0
mov dword [esi + 8], connect
test ecx, ecx
je 0x59a74f
lea eax, [ecx*4]
mov ecx, 0x7d8954
mov dword [esp + 0x34], eax
lea eax, [esp + 0x34]
push eax
mov eax, dword [0x7d8954]
call dword [eax + 0xc]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x34]
cdq
and edx, 3
lea ecx, [edx + eax]
mov edx, dword [esp + 0x3c]
sar ecx, 2
jmp 0x59a751
xor edx, edx
test ecx, ecx
mov dword [esi], edx
mov eax, connect
mov dword [esi + 4], edi
cmovne eax, ecx
mov dword [esi + 8], eax
test edi, edi
jle 0x59a770
mov ecx, edi
or eax, 0xffffffff
mov edi, edx
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x14]
mov eax, esi
mov dword [ebp + 0x10], esi
mov ecx, dword [eax]
mov eax, dword [esp + 0x94]
mov dword [ecx + eax*4], edi
jmp 0x59af38
xor esi, esi
mov dword [ebp + 0x10], esi
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax]
mov eax, dword [esp + 0x94]
mov dword [ecx + eax*4], edi
jmp 0x59af38
mov eax, dword [edi + 4]
mov ecx, edi
and eax, 0x7fffffff
push eax
push ebx
push 0x7d8954
call fcn.0046ba50
mov eax, dword [ebx]
mov ecx, ebx
push 2
call dword [eax + 0x20]
mov esi, eax
mov dword [esp + 0x54], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], connect
mov dword [esp + 0x64], esi
test esi, esi
je 0x59a819
push dword [0x884adc]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, eax
lea edx, [esi*8 + 0x7f]
and edx, 0xffffff80
mov eax, dword [ecx + 0xc]
lea edi, [eax + edx]
cmp edx, dword [ecx + 8]
jg 0x59a811
cmp edi, dword [ecx + 0x10]
ja 0x59a811
mov dword [ecx + 0xc], edi
jmp 0x59a81b
push edx
call fcn.0046a3c0
jmp 0x59a81b
xor eax, eax
mov dword [esp + 0x54], eax
lea ecx, [esp + 0x4c]
mov dword [esp + 0x60], eax
or esi, 0x80000000
lea eax, [esp + 0x54]
mov dword [esp + 0x5c], esi
mov dword [esp + 0x4c], eax
mov eax, dword [ebx]
push ecx
push 2
mov ecx, ebx
mov dword [esp + 0x58], 0
call dword [eax + 0x24]
mov ecx, dword [0x884f00]
mov eax, dword [esp + 0x58]
mov dword [esp + 0x28], eax
mov eax, dword [ecx]
call dword [eax + 0x14]
push ebx
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov byte [esp + 0x13], 0
cmp eax, 0x8d1250
jne 0x59a888
mov ecx, dword [esp + 0x90]
mov edx, ebx
mov dword [esp + 0x34], edx
mov dword [esp + 0x30], ecx
jmp 0x59ae51
cmp eax, 0x8d3ad4
jne 0x59ae2e
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x8c]
mov esi, dword [esp + 0x90]
mov dword [esp + 0x34], eax
mov ebp, dword [edx + 0x64]
add ebp, 8
mov dword [esp + 0x6c], eax
mov byte [esp + 0x13], 1
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x68], ebx
mov eax, dword [ebp + 8]
mov edi, dword [ebp + 4]
and eax, 0x3fffffff
mov dword [esp + 0x14], edi
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], esi
cmp edi, eax
jne 0x59a903
push 0x1c
push ebp
push 0x7d8954
call fcn.00467c00
mov edx, dword [esp + 0x28]
add esp, 0xc
mov eax, dword [ebp + 4]
lea ecx, [eax*8]
sub ecx, eax
mov eax, dword [ebp]
lea eax, [eax + ecx*4]
test eax, eax
je 0x59a936
movups xmm0, xmmword [esp + 0x68]
mov ecx, dword [esp + 0x94]
movups xmmword [eax], xmm0
movq xmm0, qword [esp + 0x78]
movq qword [eax + 0x10], xmm0
mov dword [eax + 0x18], ecx
inc dword [ebp + 4]
mov ecx, dword [edx + 0x64]
push edi
push ebx
push 0x7d8954
add ecx, 0x20
call fcn.0046ba50
cmp esi, 0xffffffff
je 0x59aa1e
mov eax, dword [ebp]
lea ecx, [esi*8]
sub ecx, esi
cmp dword [eax + ecx*4 + 0x10], 0
lea ebx, [eax + ecx*4]
jne 0x59aa08
push dword [0x884adc]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push 0xc
mov ecx, dword [eax + 0x2c]
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, eax
test esi, esi
je 0x59aa03
mov ecx, dword [ebx]
mov ecx, dword [ecx + 0x60]
mov edi, ecx
mov dword [esi], 0
mov dword [esi + 4], 0
mov dword [esi + 8], connect
test ecx, ecx
je 0x59a9d8
lea eax, [ecx*4]
mov ecx, 0x7d8954
mov dword [esp + 0x30], eax
lea eax, [esp + 0x30]
push eax
mov eax, dword [0x7d8954]
call dword [eax + 0xc]
mov ebp, eax
mov eax, dword [esp + 0x30]
cdq
and edx, 3
lea ecx, [edx + eax]
sar ecx, 2
jmp 0x59a9da
xor ebp, ebp
test ecx, ecx
mov dword [esi], ebp
mov eax, connect
mov dword [esi + 4], edi
cmovne eax, ecx
mov dword [esi + 8], eax
test edi, edi
jle 0x59a9f9
mov ecx, edi
or eax, 0xffffffff
mov edi, ebp
rep stosd dword es:[edi], eax
mov ebp, dword [esp + 0x2c]
mov edi, dword [esp + 0x14]
jmp 0x59aa05
xor esi, esi
mov dword [ebx + 0x10], esi
mov eax, dword [ebx + 0x10]
mov ecx, dword [esp + 0x94]
mov ebx, dword [esp + 0x88]
mov eax, dword [eax]
mov dword [eax + ecx*4], edi
mov eax, dword [ebx + 0x60]
xor ebx, ebx
mov dword [esp + 0x30], edi
mov dword [esp + 0x28], eax
test eax, eax
jle 0x59aaa0
mov ecx, dword [esp + 0x9c]
mov ebp, dword [esp + 0x88]
nop dword [eax]
cmp byte [ecx], 0
jne 0x59aa98
mov eax, dword [ebp + 0x5c]
xor edx, edx
xor esi, esi
mov ebp, 0x3000
mov edi, dword [eax + ebx*4]
mov eax, dword [edi + 0x30]
test eax, eax
jne 0x59aa5f
xor ecx, ecx
jmp 0x59aa62
mov ecx, dword [eax + 0xc]
cmp edx, ecx
mov ecx, dword [esp + 0x9c]
jge 0x59aa8a
cmp byte [ecx], 0
jne 0x59aa8a
mov eax, dword [eax + 8]
test word [eax + esi + 0x3a], bp
mov eax, 0
setne al
inc edx
mov byte [ecx], al
add esi, 0x3c
jmp 0x59aa54
mov ebp, dword [esp + 0x88]
inc ebx
cmp ebx, dword [esp + 0x28]
jl 0x59aa40
mov ebp, dword [esp + 0x2c]
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x88]
mov eax, dword [eax + 0x68]
test eax, eax
je 0x59ae46
lea edx, [eax + 8]
mov dword [esp + 0x48], edx
test edx, edx
je 0x59ae46
mov eax, dword [edx + 4]
lea ecx, [edi*8]
mov esi, dword [esp + 0x1c]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x8c]
test eax, eax
mov dword [esp + 0x18], 0
cmovne esi, eax
mov eax, dword [ebp]
sub ecx, edi
mov dword [esp + 0x20], esi
cmp dword [esp + 0x3c], 0
lea ebx, [eax + ecx*4]
mov dword [esp + 0x24], ebx
jle 0x59ae46
xor ecx, ecx
mov edi, 0x400
mov dword [esp + 0x38], ecx
nop dword [eax]
mov ebp, dword [edx]
add ebp, ecx
mov ecx, dword [esp + 0x9c]
cmp byte [ecx], 0
jne 0x59ab2f
mov eax, 0x3000
test word [ebp + 0x3a], ax
jne 0x59ab2f
xor eax, eax
jmp 0x59ab34
mov eax, 1
mov byte [ecx], al
test word [ebp + 0x3a], di
je 0x59ade0
mov edi, dword [ebp + 0x28]
cmp edi, 0xffffffff
je 0x59ac96
mov eax, dword [esi + 0x68]
test eax, eax
je 0x59ab5d
test edi, edi
js 0x59ab5d
mov eax, dword [eax + 8]
mov edi, dword [eax + edi*4]
cmp dword [ebx + 0xc], 0
jne 0x59ab98
push dword [0x884adc]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push 0xc
mov ecx, dword [eax + 0x2c]
mov eax, dword [ecx]
call dword [eax + 4]
test eax, eax
je 0x59ab93
mov dword [eax], 0
mov dword [eax + 4], 0
mov dword [eax + 8], 0xffffffff
jmp 0x59ab95
xor eax, eax
mov dword [ebx + 0xc], eax
mov ecx, dword [ebx + 0xc]
push 0xffffffffffffffff
push edi
call fcn.0046b890
movzx ecx, ax
cmp cx, 0xffff
jne 0x59abb0
xor esi, esi
jmp 0x59abdd
mov eax, dword [ebx]
mov eax, dword [eax + 0x68]
test eax, eax
jne 0x59abbd
xor edx, edx
jmp 0x59abc0
lea edx, [eax + 8]
movsx eax, cx
mov ecx, eax
shl ecx, 4
sub ecx, eax
mov eax, dword [edx]
lea esi, [eax + ecx*4]
test esi, esi
je 0x59abdd
mov ax, word [ebp + 0x38]
cmp ax, word [esi + 0x38]
jle 0x59abf3
mov edx, dword [esp + 0x18]
mov ecx, dword [ebx + 0xc]
movsx eax, dx
push eax
push edi
push 0x7d8954
call fcn.0046ba50
test esi, esi
jne 0x59add7
mov ebp, dword [esp + 0x1c]
push esi
push edi
mov ecx, dword [ebp + 0x64]
add ecx, 0x2c
call fcn.0046b890
mov esi, eax
test esi, esi
jne 0x59ac58
push dword [0x884adc]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push 0xc
mov ecx, dword [eax + 0x2c]
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, eax
test esi, esi
je 0x59ac44
mov dword [esi], 0
mov dword [esi + 4], 0
mov dword [esi + 8], connect
jmp 0x59ac46
xor esi, esi
mov ecx, dword [ebp + 0x64]
push esi
push edi
push 0x7d8954
add ecx, 0x2c
call fcn.0046ba50
mov eax, dword [esi + 8]
and eax, 0x3fffffff
cmp dword [esi + 4], eax
jne 0x59ad28
push 4
push esi
push 0x7d8954
call fcn.00467c00
mov ecx, dword [esi + 4]
add esp, 0xc
mov eax, dword [esi]
mov edi, 0x400
mov ebp, dword [esp + 0x14]
mov dword [eax + ecx*4], ebp
inc dword [esi + 4]
mov esi, dword [esp + 0x20]
jmp 0x59ade4
mov ebx, dword [ebx + 8]
test ebx, ebx
jne 0x59ad45
push dword [0x884adc]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push 0xc
mov ecx, dword [eax + 0x2c]
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, eax
test esi, esi
je 0x59accb
mov dword [esi], ebx
mov dword [esi + 4], ebx
mov dword [esi + 8], connect
jmp 0x59accd
xor esi, esi
mov ebx, dword [esp + 0x24]
mov dword [ebx + 8], esi
mov eax, dword [esi + 8]
and eax, 0x3fffffff
cmp dword [esi + 4], eax
jne 0x59acf1
push 2
push esi
push 0x7d8954
call fcn.00467c00
add esp, 0xc
mov ecx, dword [esi + 4]
mov eax, dword [esi]
mov edx, dword [esp + 0x18]
mov word [eax + ecx*2], dx
mov eax, dword [esp + 0x1c]
inc dword [esi + 4]
mov esi, dword [eax + 0x64]
mov eax, dword [esi + 0x1c]
add esi, 0x14
and eax, 0x3fffffff
cmp dword [esi + 4], eax
jne 0x59ad28
push 4
push esi
push 0x7d8954
call fcn.00467c00
add esp, 0xc
mov ecx, dword [esi + 4]
mov edi, 0x400
mov eax, dword [esi]
mov ebp, dword [esp + 0x14]
mov dword [eax + ecx*4], ebp
inc dword [esi + 4]
mov esi, dword [esp + 0x20]
jmp 0x59ade4
mov eax, dword [ebx + 4]
xor esi, esi
mov dword [esp + 0x2c], eax
test eax, eax
jle 0x59ada2
mov eax, dword [esp + 0x24]
movzx ecx, word [ebp + 0x38]
mov edi, dword [ebx]
mov ebp, dword [esp + 0x2c]
mov eax, dword [eax]
mov dword [esp + 0x40], ecx
mov eax, dword [eax + 0x68]
mov dword [esp + 0x44], eax
nop dword [eax]
test eax, eax
jne 0x59ad78
xor edx, edx
jmp 0x59ad7b
lea edx, [eax + 8]
movsx eax, word [edi]
mov ecx, eax
shl ecx, 4
sub ecx, eax
mov eax, dword [edx]
mov edx, dword [esp + 0x40]
cmp dx, word [eax + ecx*4 + 0x38]
jg 0x59ae08
mov eax, dword [esp + 0x44]
inc esi
add edi, 2
cmp esi, ebp
jl 0x59ad70
mov eax, dword [esp + 0x2c]
mov ebp, dword [esp + 0x18]
cmp esi, eax
jne 0x59add3
mov eax, dword [ebx + 8]
and eax, 0x3fffffff
cmp dword [ebx + 4], eax
jne 0x59adc7
push 2
push ebx
push 0x7d8954
call fcn.00467c00
add esp, 0xc
mov ecx, dword [ebx + 4]
mov eax, dword [ebx]
mov word [eax + ecx*2], bp
inc dword [ebx + 4]
mov ebx, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
mov edi, 0x400
mov ebp, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x38]
inc eax
mov edx, dword [esp + 0x48]
add ecx, 0x3c
mov dword [esp + 0x18], eax
mov dword [esp + 0x38], ecx
cmp eax, dword [esp + 0x3c]
jl 0x59ab10
jmp 0x59ae4a
mov ebp, dword [esp + 0x18]
mov ecx, ebx
movzx eax, bp
mov dword [esp + 0x44], eax
lea eax, [esp + 0x44]
push eax
push esi
push 0x7d8954
call fcn.0059bac0
mov eax, dword [esp + 0x2c]
jmp 0x59ada6
mov eax, dword [esp + 0x90]
mov edx, dword [esp + 0x8c]
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], edx
jmp 0x59ae51
mov ebp, dword [esp + 0x14]
mov edx, dword [esp + 0x8c]
mov ebx, dword [esp + 0xa0]
xor esi, esi
cmp dword [esp + 0x28], esi
jle 0x59aeb5
mov edi, dword [esp + 0x9c]
nop word [eax + eax]
mov eax, dword [esp + 0x54]
cmp byte [esp + 0x13], 0
lea ecx, [eax + esi*8]
mov eax, dword [esp + 0x94]
push ebx
push edi
push dword [esp + 0xa0]
cmovne eax, esi
push eax
push dword [esp + 0x40]
push edx
push dword [ecx]
mov ecx, dword [esp + 0x38]
call fcn.0059a660
mov edx, dword [esp + 0x34]
cmp ebp, 0xffffffff
cmove ebp, eax
inc esi
cmp esi, dword [esp + 0x28]
jl 0x59ae70
mov dword [esp + 0x14], ebp
mov edi, dword [esp + 0x60]
xor ecx, ecx
mov eax, dword [esp + 0x58]
cmp edi, dword [esp + 0x54]
push dword [0x884adc]
cmove eax, ecx
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x68]
lea esi, [eax*8 + 0x7f]
and esi, 0xffffff80
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea edx, [esi + 0xf]
and edx, 0xfffffff0
cmp esi, dword [eax + 8]
jg 0x59af01
lea ecx, [edx + edi]
cmp ecx, dword [eax + 0xc]
jne 0x59af01
cmp dword [eax + 0x14], edi
je 0x59af01
mov dword [eax + 0xc], edi
jmp 0x59af0a
push edx
push edi
mov ecx, eax
call fcn.0046a590
mov eax, dword [esp + 0x5c]
mov dword [esp + 0x58], 0
test eax, eax
js 0x59af34
and eax, 0x3fffffff
mov ecx, 0x7d8954
shl eax, 3
push eax
mov eax, dword [0x7d8954]
push dword [esp + 0x58]
call dword [eax + 0x10]
mov edi, dword [esp + 0x14]
push edi
push dword [esp + 0x8c]
mov ecx, ebx
push 0x7d8954
call fcn.0046ba50
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x74
ret 0x1c