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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [0x102519c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
cmp dword [ebx + 0x10], 0
jne 0x1003783b
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.101f99c6
mov esp, ebp
pop ebp
ret
push esi
push edi
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x38], 0
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
lea edi, [eax + 0x10]
mov dword [ebp - 0x44], edi
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
cmp dword [ebp + 8], 0
lea esi, [eax + 0x10]
mov dword [ebp - 0x40], esi
je 0x100378c5
mov eax, dword [0x1025b450]
cmp eax, 0xffffffff
je 0x100378c5
cmp dword [0x1025b454], 0xffffffff
je 0x100378c5
push eax
mov dword [ebp - 0x3c], 0
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
jne 0x100378c5
mov eax, dword [0x1025b458]
test eax, eax
je 0x100378c5
lea ecx, [ebp - 0x3c]
push ecx
call eax
push eax
push dword [0x1025b450]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push dword [ebp - 0x3c]
push dword [0x1025b454]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp dword [ebx + 0x14], 8
mov eax, ebx
jb 0x100378cf
mov eax, dword [ebx]
push 0xf
push str._Program_Files_
push 0
push dword [ebx + 0x10]
push eax
call fcn.1002bcf0
add esp, 0x14
cmp eax, 0xffffffff
je 0x1003795e
push 0xf
push str._Program_Files_
lea ecx, [ebp - 0x44]
call fcn.10003740
cmp dword [ebx + 0x14], 8
mov eax, ebx
jb 0x10037902
mov eax, dword [ebx]
push 0xf
push str._Program_Files_
push 0
push dword [ebx + 0x10]
push eax
call fcn.1002bcf0
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x38]
push str._programfiles__
push eax
call fcn.10008d60
add esp, 0x1c
lea ecx, [ebp - 0x40]
push eax
call fcn.10002790
mov edx, dword [ebp - 0x38]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1003794c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp - 0x44]
mov esi, dword [ebp - 0x40]
mov dword [ebp - 0x38], 1
jmp 0x10037a34
cmp dword [ebx + 0x14], 8
mov eax, ebx
jb 0x10037968
mov eax, dword [ebx]
push 8
push str._System_
push 0
push dword [ebx + 0x10]
push eax
call fcn.1002bcf0
add esp, 0x14
cmp eax, 0xffffffff
je 0x10037a2e
push 8
push str._System_
lea ecx, [ebp - 0x44]
call fcn.10003740
push 0
push str._System_
mov ecx, ebx
call fcn.1004e700
mov dword [ebp - 0x3c], eax
call fcn.10009c50
test eax, eax
je 0x100379e6
cmp dword [ebp + 8], 0
jne 0x100379e6
lea eax, [ebp - 0x38]
push str._systemroot_SysWOW64_
push eax
call fcn.10008d60
add esp, 8
lea ecx, [ebp - 0x40]
push eax
call fcn.10002790
lea ecx, [ebp - 0x38]
call fcn.10007e10
mov edi, dword [ebp - 0x44]
mov esi, dword [ebp - 0x40]
mov dword [ebp - 0x38], 1
jmp 0x10037a34
lea eax, [ebp - 0x38]
push str._systemroot_System32_
push eax
call fcn.10008d60
add esp, 8
lea ecx, [ebp - 0x40]
push eax
call fcn.10002790
mov edx, dword [ebp - 0x38]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1003794c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp - 0x44]
mov esi, dword [ebp - 0x40]
mov dword [ebp - 0x38], 1
jmp 0x10037a34
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x3c], eax
cmp dword [ebp + 8], 0
je 0x10037a86
mov eax, dword [0x1025b450]
cmp eax, 0xffffffff
je 0x10037a86
cmp dword [0x1025b454], 0xffffffff
je 0x10037a86
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x10037a86
cmp dword [0x1025b45c], 0
je 0x10037a86
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]
cmp dword [ebp - 0x38], 0
je 0x10037bc5
cmp dword [esi - 4], 1
mov eax, dword [edi - 0xc]
mov dword [ebp - 0x38], eax
jle 0x10037aaa
push dword [esi - 0xc]
lea ecx, [ebp - 0x40]
call fcn.10002c20
mov esi, dword [ebp - 0x40]
mov ecx, esi
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10037ab0
sub ecx, edx
sar ecx, 1
push ecx
push esi
push dword [ebp - 0x38]
mov ecx, ebx
push dword [ebp - 0x3c]
call fcn.10007630
push dword [esi - 8]
push esi
call fcn.101e6fd0
mov dword [esi - 0xc], eax
xor ecx, ecx
add esp, 8
mov dword [ebp - 0x48], 1
mov word [esi + eax*2], cx
mov eax, ebx
cmp dword [ebx + 0x14], 8
jb 0x10037af4
mov eax, dword [ebx]
push 1
push 0x102053b4
push 0
push dword [ebx + 0x10]
push eax
call fcn.1002bcf0
add esp, 0x14
mov dword [ebp - 0x3c], eax
cmp eax, 0xffffffff
je 0x10037bc5
push 0
push 0x102054a0
mov ecx, ebx
call fcn.1004e700
cmp eax, 0xffffffff
je 0x10037b66
push 0x10202944
lea ecx, [ebp - 0x34]
call fcn.10020470
push 0x102054a0
lea ecx, [ebp - 0x1c]
call fcn.10020470
push dword [ebp - 0x3c]
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x1c]
push eax
push ebx
call fcn.10006610
add esp, 0x10
lea ecx, [ebp - 0x1c]
call fcn.10005250
lea ecx, [ebp - 0x34]
call fcn.10005250
push 0
push 0x10205498
mov ecx, ebx
mov dword [ebp - 0x48], 1
call fcn.1004e700
cmp eax, 0xffffffff
je 0x10037bc5
push 0x10202944
lea ecx, [ebp - 0x1c]
call fcn.10020470
push 0x10205498
lea ecx, [ebp - 0x34]
call fcn.10020470
push dword [ebp - 0x3c]
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x34]
push eax
push ebx
call fcn.10006610
add esp, 0x10
lea ecx, [ebp - 0x34]
call fcn.10005250
lea ecx, [ebp - 0x1c]
call fcn.10005250
mov dword [ebp - 0x48], 1
or ebx, 0xffffffff
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10037bdf
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
add edi, 0xfffffff0
lock xadd dword [edi + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x10037bf4
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x48]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.101f99c6
mov esp, ebp
pop ebp
ret