Function at 0x1017ec00
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa9c
mov eax, dword [0x102519c8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov ebx, ecx
mov dword [ebp - 0xa30], eax
push edi
mov dword [ebp - 0xa3c], ebx
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0xa48], eax
mov dword [ebp - 0xa44], eax
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
lea ecx, [ebp - 0xa1c]
mov dword [ebp - 0xa40], 0
mov dword [ebp - 0xa1c], 0
mov dword [ebp - 0xa18], 0
lea edi, [eax + 0x10]
mov dword [ebp - 0xa14], edi
mov dword [ebp - 0xa24], edi
call fcn.10027330
mov esi, dword [ebx + 0x10]
or ebx, 0xffffffff
mov dword [ebp - 0xa1c], eax
mov eax, dword [ebp - 0xa3c]
mov dword [ebp - 0xa2c], esi
cmp esi, dword [eax + 0xc]
je 0x1017f421
jmp 0x1017ecb0
mov eax, dword [0x1025b450]
mov ebx, dword [esi - 8]
cmp eax, 0xffffffff
je 0x1017ed53
cmp dword [0x1025b454], 0xffffffff
je 0x1017ed53
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0xa38], eax
test ebx, ebx
je 0x1017ed1f
mov dword [ebp - 0xa10], 0
test eax, eax
jne 0x1017ed5d
mov ecx, dword [0x1025b458]
test ecx, ecx
je 0x1017ed5d
lea eax, [ebp - 0xa10]
push eax
call ecx
mov ebx, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push eax
push dword [0x1025b450]
call ebx
push dword [ebp - 0xa10]
push dword [0x1025b454]
call ebx
jmp 0x1017ed5d
test eax, eax
je 0x1017ed5d
cmp dword [0x1025b45c], 0
je 0x1017ed5d
push dword [0x1025b454]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push eax
call dword [0x1025b45c]
neg eax
sbb eax, eax
inc eax
push eax
push dword [0x1025b450]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x1017ed5d
mov dword [ebp - 0xa38], 0
cmp dword [esi - 0x14], 0xc0000
jne 0x1017f36e
lea ecx, [ebp - 0xa94]
call fcn.10032d00
cmp dword [esi - 0x30], 8
lea eax, [esi - 0x44]
jb 0x1017ed80
mov eax, dword [eax]
push eax
lea ecx, [ebp - 0xa94]
call fcn.1015b720
mov ecx, dword [0x10257628]
test ecx, ecx
jne 0x1017eded
lea ecx, [ebp - 0xa1d]
call fcn.10129b80
cmp dword [0x10257628], 0
jne 0x1017eddc
mov eax, dword [0x10257640]
test al, 1
jne 0x1017edd2
or eax, 1
mov ecx, 0x1025762c
mov dword [0x10257640], eax
call fcn.101b2990
push 0x102006f0
call fcn.101c8090
add esp, 4
mov dword [0x10257628], 0x1025762c
lea ecx, [ebp - 0xa1d]
call fcn.10129ba0
mov ecx, dword [0x10257628]
call fcn.101b31a0
push 0x208
lea eax, [ebp - 0x20c]
push 0
push eax
call sub.msvcrt.dll_memset
mov ecx, dword [0x10257628]
add esp, 0xc
test ecx, ecx
jne 0x1017ee69
lea ecx, [ebp - 0xa1e]
call fcn.10129b80
cmp dword [0x10257628], 0
jne 0x1017ee58
mov eax, dword [0x10257640]
test al, 1
jne 0x1017ee4e
or eax, 1
mov ecx, 0x1025762c
mov dword [0x10257640], eax
call fcn.101b2990
push 0x102006f0
call fcn.101c8090
add esp, 4
mov dword [0x10257628], 0x1025762c
lea ecx, [ebp - 0xa1e]
call fcn.10129ba0
mov ecx, dword [0x10257628]
push 0x104
lea eax, [ebp - 0x20c]
push eax
push dword [ebp - 0xa78]
call fcn.101b2f50
test eax, eax
je 0x1017f23c
mov dword [ebp - 0xa40], 1
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
lea ecx, [ebp - 0xa10]
mov dword [ebp - 0xa10], eax
lea eax, [ebp - 0x20c]
push eax
call fcn.10023e80
test al, al
jne 0x1017eee8
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1017eec6
sub ecx, edx
lea eax, [ebp - 0x20c]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0xa10]
call fcn.10003740
mov eax, dword [0x1024e5d8]
mov edi, dword [ebp - 0xa10]
mov dword [ebp - 0xa28], 0
test eax, eax
je 0x1017efbb
lea ecx, [ebp - 0xa28]
push ecx
push 0x1020526c
call eax
mov eax, dword [ebp - 0xa28]
test eax, eax
je 0x1017efbb
mov ecx, dword [eax]
push 1
push edi
push eax
call dword [ecx + 0xc]
test eax, eax
je 0x1017efbb
mov eax, dword [ebp - 0xa28]
lea edx, [ebp - 0xa10]
mov dword [ebp - 0xa10], 0
push edx
push eax
mov ecx, dword [eax]
call dword [ecx + 0x3c]
mov esi, dword [ebp - 0xa10]
test esi, esi
je 0x1017efbb
push 0x800
lea eax, [ebp - 0xa0c]
push 0
push eax
call sub.msvcrt.dll_memset
mov eax, dword [esi]
lea ecx, [ebp - 0xa0c]
add esp, 0xc
push 0x400
push ecx
push 9
push esi
call dword [eax + 0x10]
test eax, eax
je 0x1017efab
lea eax, [ebp - 0xa0c]
push eax
lea ecx, [ebp - 0xa34]
call fcn.10002490
mov eax, dword [ebp - 0xa10]
test eax, eax
je 0x1017eff6
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
jmp 0x1017eff6
mov eax, dword [ebp - 0xa10]
test eax, eax
je 0x1017efbb
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
lea ecx, [ebp - 0xa34]
push 0x10202940
mov dword [ebp - 0xa34], eax
call fcn.10023e80
test al, al
jne 0x1017eff6
push 0
push 0x10202940
lea ecx, [ebp - 0xa34]
call fcn.10003740
mov eax, dword [ebp - 0xa28]
test eax, eax
je 0x1017f006
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
or esi, 0xffffffff
add edi, 0xfffffff0
mov eax, esi
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x1017f020
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0xa34]
mov ecx, 0x10202940
mov eax, esi
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1017f056
test dx, dx
je 0x1017f052
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1017f056
add eax, 4
add ecx, 4
test dx, dx
jne 0x1017f030
xor eax, eax
jmp 0x1017f05b
sbb eax, eax
or eax, 1
test eax, eax
je 0x1017f214
mov eax, dword [ebp - 0xa1c]
mov edi, dword [eax + 4]
cmp byte [edi + 0xd], 0
jne 0x1017f103
mov ebx, eax
mov eax, dword [edi + 0x10]
mov ecx, esi
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1017f0a6
test dx, dx
je 0x1017f0a2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1017f0a6
add eax, 4
add ecx, 4
test dx, dx
jne 0x1017f080
xor eax, eax
jmp 0x1017f0ab
sbb eax, eax
or eax, 1
test eax, eax
jns 0x1017f0b4
mov edi, dword [edi + 8]
jmp 0x1017f0b8
mov ebx, edi
mov edi, dword [edi]
cmp byte [edi + 0xd], 0
je 0x1017f078
cmp ebx, dword [ebp - 0xa1c]
je 0x1017f103
mov ecx, dword [ebx + 0x10]
mov eax, esi
jmp 0x1017f0d0
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1017f0f6
test dx, dx
je 0x1017f0f2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1017f0f6
add eax, 4
add ecx, 4
test dx, dx
jne 0x1017f0d0
xor eax, eax
jmp 0x1017f0fb
sbb eax, eax
or eax, 1
test eax, eax
jns 0x1017f214
mov edi, dword [ebp - 0xa14]
mov ecx, 0x10202940
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1017f136
test dx, dx
je 0x1017f132
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1017f136
add eax, 4
add ecx, 4
test dx, dx
jne 0x1017f110
xor eax, eax
jmp 0x1017f13b
sbb eax, eax
or eax, 1
test eax, eax
je 0x1017f1d6
mov eax, dword [edi - 0xc]
mov ebx, 0x1021b6b8
push 1
sub ebx, edi
mov dword [ebp - 0xa10], 0x1021b6b8
push 0x1021b6b8
sar ebx, 1
mov dword [ebp - 0xa14], eax
call fcn.101e6fd0
mov ecx, dword [edi - 8]
mov edx, 1
sub edx, dword [edi - 4]
add esp, 8
mov dword [ebp - 0xa28], eax
add eax, dword [ebp - 0xa14]
sub ecx, eax
or edx, ecx
jge 0x1017f19d
push eax
lea ecx, [ebp - 0xa24]
call fcn.10003310
mov edi, dword [ebp - 0xa24]
mov eax, dword [ebp - 0xa14]
lea ecx, [edi + ebx*2]
cmp ebx, eax
jbe 0x1017f1b0
mov ecx, dword [ebp - 0xa10]
mov ebx, dword [ebp - 0xa28]
lea eax, [edi + eax*2]
push ebx
push ecx
push ebx
push eax
call fcn.10008010
mov eax, dword [ebp - 0xa14]
add esp, 0x10
add eax, ebx
xor ecx, ecx
mov dword [edi - 0xc], eax
mov word [edi + eax*2], cx
push dword [esi - 0xc]
lea ecx, [ebp - 0xa24]
push esi
call fcn.10002970
push dword [ebp - 0xa48]
lea eax, [ebp - 0xa34]
push eax
push 0
lea eax, [ebp - 0xa9c]
push eax
lea ecx, [ebp - 0xa1c]
call fcn.1001f820
mov edi, dword [ebp - 0xa24]
mov dword [ebp - 0xa14], edi
jmp 0x1017f21a
mov edi, dword [ebp - 0xa14]
or ebx, 0xffffffff
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x1017f234
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0xa2c]
jmp 0x1017f23f
or ebx, 0xffffffff
lea ecx, [ebp - 0xa54]
call fcn.10033320
mov edx, dword [ebp - 0xa58]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f267
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xa5c]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f284
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xa60]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f2a1
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xa68]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f2be
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xa70]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f2db
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xa78]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f2f8
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xa7c]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f315
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xa80]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f332
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xa88]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f34f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0xa90]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f371
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x1017f371
or ebx, 0xffffffff
mov eax, dword [0x1025b450]
cmp eax, 0xffffffff
je 0x1017f409
cmp dword [0x1025b454], 0xffffffff
je 0x1017f409
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp dword [ebp - 0xa38], 0
je 0x1017f3d7
mov dword [ebp - 0xa38], 0
test eax, eax
jne 0x1017f409
mov eax, dword [0x1025b458]
test eax, eax
je 0x1017f409
lea ecx, [ebp - 0xa38]
push ecx
call eax
push eax
push dword [0x1025b450]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push dword [ebp - 0xa38]
push dword [0x1025b454]
jmp 0x1017f403
test eax, eax
je 0x1017f409
cmp dword [0x1025b45c], 0
je 0x1017f409
push dword [0x1025b454]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push eax
call dword [0x1025b45c]
neg eax
sbb eax, eax
inc eax
push eax
push dword [0x1025b450]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [ebp - 0xa3c]
sub esi, 0x44
mov dword [ebp - 0xa2c], esi
cmp esi, dword [eax + 0xc]
jne 0x1017ecb0
mov ecx, 0x10202940
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1017f44e
test dx, dx
je 0x1017f44a
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1017f44e
add eax, 4
add ecx, 4
test dx, dx
jne 0x1017f428
xor eax, eax
jmp 0x1017f453
sbb eax, eax
or eax, 1
test eax, eax
jne 0x1017f501
cmp dword [ebp - 0xa40], eax
jne 0x1017f501
mov ebx, dword [ebp - 0xa48]
add ebx, 0xfffffff0
push ebx
call fcn.10002a60
mov ecx, dword [ebp - 0xa30]
add esp, 4
mov esi, dword [ebp - 0xa1c]
add eax, 0x10
mov dword [ecx], eax
lea ecx, [ebp - 0xa1c]
push dword [esi + 4]
call fcn.10029430
mov eax, dword [ebp - 0xa1c]
push 0x14
mov dword [eax + 4], esi
mov eax, dword [ebp - 0xa1c]
mov dword [eax], esi
mov eax, dword [ebp - 0xa1c]
mov dword [eax + 8], esi
push dword [ebp - 0xa1c]
mov dword [ebp - 0xa18], 0
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
or esi, 0xffffffff
add esp, 8
add edi, 0xfffffff0
mov eax, esi
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x1017f4e6
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
lock xadd dword [ebx + 0xc], esi
dec esi
test esi, esi
jg 0x1017f6d5
mov ecx, dword [ebx]
push ebx
mov edx, dword [ecx]
call dword [edx + 4]
jmp 0x1017f6d5
mov ecx, 0x10202940
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x1017f52e
test dx, dx
je 0x1017f52a
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x1017f52e
add eax, 4
add ecx, 4
test dx, dx
jne 0x1017f508
xor eax, eax
jmp 0x1017f533
sbb eax, eax
or eax, 1
test eax, eax
jne 0x1017f5c5
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
lea ecx, [ebp - 0xa14]
push 0x9cd9
mov dword [ebp - 0xa14], eax
call fcn.10023e80
test al, al
jne 0x1017f590
mov ecx, 0x9cd9
lea edx, [ecx + 2]
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1017f570
sub ecx, edx
sar ecx, 1
push ecx
push 0x9cd9
lea ecx, [ebp - 0xa14]
call fcn.10003740
lea eax, [ebp - 0xa14]
push eax
lea ecx, [ebp - 0xa24]
call fcn.10002790
mov edx, dword [ebp - 0xa14]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1017f5bf
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp - 0xa24]
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
lea ecx, [ebp - 0xa2c]
push 0x9cda
mov dword [ebp - 0xa2c], eax
call fcn.10023e80
test al, al
jne 0x1017f616
mov ecx, 0x9cda
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1017f5f6
sub ecx, edx
sar ecx, 1
push ecx
push 0x9cda
lea ecx, [ebp - 0xa2c]
call fcn.10003740
mov esi, dword [ebp - 0xa2c]
lea eax, [ebp - 0xa44]
push edi
push esi
push eax
call fcn.10002cb0
add esp, 0xc
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x1017f644
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov ebx, dword [ebp - 0xa44]
add ebx, 0xfffffff0
push ebx
call fcn.10002a60
mov ecx, dword [ebp - 0xa30]
add esp, 4
mov esi, dword [ebp - 0xa1c]
add eax, 0x10
mov dword [ecx], eax
lea ecx, [ebp - 0xa1c]
push dword [esi + 4]
call fcn.10029430
mov eax, dword [ebp - 0xa1c]
push 0x14
mov dword [eax + 4], esi
mov eax, dword [ebp - 0xa1c]
mov dword [eax], esi
mov eax, dword [ebp - 0xa1c]
mov dword [eax + 8], esi
push dword [ebp - 0xa1c]
mov dword [ebp - 0xa18], 0
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
or esi, 0xffffffff
add esp, 8
add edi, 0xfffffff0
mov eax, esi
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x1017f6c3
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
lock xadd dword [ebx + 0xc], esi
dec esi
test esi, esi
jg 0x1017f6d5
mov ecx, dword [ebx]
push ebx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0xa30]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.101f99c6
mov esp, ebp
pop ebp
ret 4