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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x994
cmp dword [0x10050928], 0
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
je 0x100065b3
call fcn.100052f0
test al, al
je 0x100065b3
push 0xc
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov esi, 0xc
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [0x10056a08]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
test edi, edi
jne 0x1000696b
mov ecx, 0x950
call fcn.10033a20
mov esi, eax
mov dword [esp + 0x14], esi
test esi, esi
je 0x10006e7c
xorps xmm0, xmm0
mov byte [esi], 0
xor eax, eax
movlpd qword [esp + 0x60], xmm0
movlpd qword [esp + 0x68], xmm0
movlpd qword [esp + 0x70], xmm0
movlpd qword [esp + 0x78], xmm0
movlpd qword [esp + 0x80], xmm0
movlpd qword [esp + 0x88], xmm0
movlpd qword [esp + 0x90], xmm0
movlpd qword [esp + 0x98], xmm0
movlpd qword [esp + 0xa0], xmm0
movlpd qword [esp + 0xa8], xmm0
movlpd qword [esp + 0xb0], xmm0
movlpd qword [esp + 0xb8], xmm0
movlpd qword [esp + 0xc8], xmm0
movlpd qword [esp + 0xd0], xmm0
movlpd qword [esp + 0xd8], xmm0
movaps xmm0, xmmword [0x1004e200]
push 0x8c
push eax
mov word [esp + 0x11d], ax
mov byte [esp + 0x11f], al
mov dword [esp + 0x120], eax
mov dword [esp + 0x124], eax
mov byte [esp + 0x128], al
mov dword [esp + 0x140], eax
mov dword [esp + 0x144], eax
mov dword [esp + 0x148], eax
mov dword [esp + 0x14c], eax
lea eax, [esp + 0x150]
movups xmmword [esp + 0xe8], xmm0
mov word [esp + 0x60], di
xorps xmm0, xmm0
mov byte [esp + 0x62], 0
push eax
mov dword [esp + 0xcc], edi
mov word [esp + 0xfc], 0xffff
movups xmmword [esp + 0xfe], xmm0
mov word [esp + 0x11e], di
movups xmmword [esp + 0x10e], xmm0
mov byte [esp + 0x120], 0
movlpd qword [esp + 0x134], xmm0
movlpd qword [esp + 0x13c], xmm0
call fcn.10036180
add esp, 0xc
mov dword [esp + 0x1d4], 1
mov dword [esp + 0x1d8], edi
mov dword [esp + 0x1dc], 1
mov dword [esp + 0x1e0], edi
mov dword [esp + 0x1e4], 1
mov dword [esp + 0x1e8], edi
mov dword [esp + 0x1ec], 1
mov dword [esp + 0x1f0], edi
mov dword [esp + 0x1f4], 1
mov dword [esp + 0x1f8], edi
mov dword [esp + 0x1fc], 1
mov dword [esp + 0x200], edi
mov dword [esp + 0x204], 1
mov dword [esp + 0x208], edi
mov dword [esp + 0x20c], 1
mov dword [esp + 0x210], edi
mov dword [esp + 0x214], 1
mov dword [esp + 0x218], edi
mov dword [esp + 0x21c], 1
mov dword [esp + 0x220], edi
mov dword [esp + 0x224], 1
mov dword [esp + 0x228], edi
mov dword [esp + 0x22c], 1
mov dword [esp + 0x230], edi
mov dword [esp + 0x234], 1
mov dword [esp + 0x238], edi
mov dword [esp + 0x23c], 1
mov dword [esp + 0x240], edi
mov dword [esp + 0x244], 1
mov dword [esp + 0x248], edi
mov dword [esp + 0x24c], 1
mov dword [esp + 0x250], edi
mov dword [esp + 0x254], 1
mov dword [esp + 0x258], edi
mov dword [esp + 0x25c], 1
xor eax, eax
mov dword [esp + 0x260], edi
push 0x6d8
xorps xmm0, xmm0
mov word [esp + 0x299], ax
push eax
mov byte [esp + 0x29f], al
mov dword [esp + 0x2c0], eax
lea eax, [esp + 0x2c8]
push eax
mov dword [esp + 0x270], 1
mov dword [esp + 0x274], edi
mov dword [esp + 0x278], 1
mov dword [esp + 0x27c], edi
mov dword [esp + 0x280], 1
mov dword [esp + 0x284], edi
mov dword [esp + 0x288], 1
mov dword [esp + 0x28c], edi
mov dword [esp + 0x290], 1
mov dword [esp + 0x294], edi
mov dword [esp + 0x298], 1
mov dword [esp + 0x29c], edi
mov byte [esp + 0x2a0], 6
movlpd qword [esp + 0x2a4], xmm0
movlpd qword [esp + 0x2ac], xmm0
movlpd qword [esp + 0x2b4], xmm0
movlpd qword [esp + 0x2bc], xmm0
call fcn.10036180
mov dword [esp + 0x9a4], edi
add esp, 0xc
lea edi, [esi + 8]
mov byte [esp + 0x99c], 0
mov ecx, 0x252
lea esi, [esp + 0x58]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x14]
push edi
push dword [0x10056a08]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x10006e8b
add edi, 8
mov dword [esp + 0x18], edi
cmp byte [edi + 0x23c], 0
je 0x10006997
xor dl, dl
mov ecx, edi
call fcn.10032cd0
mov edi, eax
mov dword [esp + 0x18], eax
cmp byte [edi + 0x23c], 0
jne 0x10006bbd
mov ecx, dword [ebp + 0xc]
cmp ecx, 4
jb 0x10006baf
lea eax, [ecx - 1]
test ecx, eax
jne 0x10006baf
mov esi, 1
test ebx, ebx
je 0x100069c3
cmp ebx, 0x3800
ja 0x10006a49
test ebx, ebx
mov eax, esi
cmovne eax, ebx
mov ebx, eax
cmp ecx, 0x1000
ja 0x10006a49
lea edx, [ecx - 1]
mov eax, ecx
add edx, ebx
neg eax
and edx, eax
mov dword [esp + 0x14], edx
cmp edx, 0x1000
ja 0x10006a01
lea eax, [edx + 7]
shr eax, 3
movzx eax, byte [eax + 0x10056040]
mov esi, dword [eax*4 + 0x10055e80]
jmp 0x10006a35
cmp edx, 0x70000000
jbe 0x10006a0d
xor esi, esi
jmp 0x10006a35
lea ecx, [edx*2 - 1]
call fcn.10001000
mov ecx, 4
cmp eax, 7
jb 0x10006a26
lea ecx, [eax - 3]
mov eax, esi
mov esi, dword [esp + 0x14]
shl eax, cl
dec esi
add esi, eax
neg eax
and esi, eax
mov dword [esp + 0xc], esi
cmp esi, 0x4000
jae 0x10006a57
mov ebx, dword [ebp + 0xc]
jmp 0x10006ad1
cmp ecx, 0x70000000
ja 0x100065a5
jmp 0x10006a5c
mov esi, 1
cmp ebx, 0x4000
ja 0x10006a6f
mov esi, 0x4000
mov dword [esp + 0xc], esi
jmp 0x10006aac
cmp ebx, 0x70000000
jbe 0x10006a7b
xor esi, esi
jmp 0x10006aa0
lea ecx, [ebx*2 - 1]
call fcn.10001000
mov ecx, 4
cmp eax, 7
jb 0x10006a94
lea ecx, [eax - 3]
shl esi, cl
lea eax, [esi - 1]
lea esi, [eax + ebx]
not eax
and esi, eax
mov dword [esp + 0xc], esi
cmp esi, ebx
jb 0x100065a5
mov ebx, dword [ebp + 0xc]
mov eax, dword [0x10056a18]
add eax, 0xfffff000
lea ecx, [ebx + 0xfff]
and ecx, 0xfffff000
add ecx, esi
add eax, ecx
cmp eax, esi
jb 0x100065a5
test esi, esi
je 0x100065a5
cmp esi, 0x70000000
ja 0x100065a5
mov byte [esp + 0x10], 1
cmp esi, 0x3800
jbe 0x10006af7
mov byte [esp + 0x10], 0
lea ecx, [edi + 0x940]
mov edx, 0xe
push 0
call fcn.100010c0
add esp, 4
lea eax, [edi + 0x260]
xor edx, edx
mov ecx, edi
push eax
push dword [esp + 0x14]
push 0
push ebx
push esi
call fcn.100113f0
add esp, 0x14
mov dword [esp + 0x14], eax
test eax, eax
je 0x100065a5
mov ecx, dword [esp + 0x18]
add edi, 0x240
mov ebx, dword [esp + 0xc]
mov byte [esp + 0x24], 1
mov dword [esp + 0x28], edi
lea eax, [ecx + 8]
mov dword [esp + 0x2c], eax
lea eax, [ecx + 0x10]
mov dword [esp + 0x30], eax
lea eax, [ecx + 0x248]
mov dword [esp + 0x34], eax
mov edx, dword [edi]
mov ecx, edx
mov esi, dword [edi + 4]
add ecx, ebx
mov dword [edi], ecx
mov eax, esi
adc eax, 0
mov dword [edi + 4], eax
mov eax, dword [esp + 0x30]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
sub ecx, edx
sbb eax, esi
xor edx, edx
cmp edx, eax
jb 0x10006b9b
ja 0x10006b8e
cmp ebx, ecx
jb 0x10006b9b
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x24]
call fcn.10032540
mov eax, dword [ebp + 8]
xor esi, esi
mov ecx, dword [esp + 0x14]
mov dword [eax], ecx
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, 0x16
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0xc]
mov esi, 1
cmp ecx, 4
jb 0x10006e44
lea eax, [ecx - 1]
test ecx, eax
jne 0x10006e44
test ebx, ebx
je 0x10006bef
mov dword [esp + 0x10], ebx
mov edx, ebx
cmp ebx, 0x3800
ja 0x10006c9e
test ebx, ebx
mov edx, esi
cmovne edx, ebx
mov dword [esp + 0x10], edx
cmp ecx, 0x1000
ja 0x10006c9e
lea eax, [ecx - 1]
add eax, edx
mov dword [esp + 0xc], eax
mov eax, ecx
neg eax
and dword [esp + 0xc], eax
mov eax, dword [esp + 0xc]
cmp eax, 0x1000
ja 0x10006c38
add eax, 7
shr eax, 3
movzx eax, byte [eax + 0x10056040]
mov esi, dword [eax*4 + 0x10055e80]
jmp 0x10006c72
cmp eax, 0x70000000
jbe 0x10006c43
xor esi, esi
jmp 0x10006c72
lea ecx, [eax*2 - 1]
call fcn.10001000
mov ecx, 4
cmp eax, 7
jb 0x10006c5c
lea ecx, [eax - 3]
mov edx, dword [esp + 0x10]
mov eax, esi
mov esi, dword [esp + 0xc]
shl eax, cl
dec esi
mov ecx, dword [ebp + 0xc]
add esi, eax
neg eax
and esi, eax
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], edx
cmp esi, 0x4000
jb 0x10006d0c
mov esi, 1
cmp edx, 0x4000
ja 0x10006cb0
mov esi, 0x4000
mov dword [esp + 0xc], esi
jmp 0x10006cf0
cmp ecx, 0x70000000
jbe 0x10006c8b
mov esi, 0xc
jmp 0x10006e49
cmp edx, 0x70000000
jbe 0x10006cbc
xor esi, esi
jmp 0x10006ce5
lea ecx, [edx*2 - 1]
call fcn.10001000
mov ecx, 4
cmp eax, 7
jb 0x10006cd5
lea ecx, [eax - 3]
mov edx, dword [esp + 0x10]
mov eax, esi
shl eax, cl
dec eax
lea esi, [edx + eax]
not eax
and esi, eax
mov dword [esp + 0xc], esi
cmp esi, edx
jb 0x10006ca6
mov ecx, dword [ebp + 0xc]
lea eax, [ecx + 0xfff]
and eax, 0xfffff000
add eax, 0xfffff000
add eax, dword [0x10056a18]
add eax, esi
cmp eax, esi
jb 0x10006ca6
test esi, esi
je 0x10006ca6
cmp esi, 0x70000000
ja 0x10006ca6
mov al, byte [edi + 1]
xor ecx, ecx
test al, al
setg cl
dec ecx
cmp esi, 0x3800
mov dword [esp + 0x20], ecx
setbe byte [esp + 0x1c]
test al, al
jg 0x10006d61
cmp byte [edi], 0
jne 0x10006d4d
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
jmp 0x10006d93
lea eax, [edi + 0x260]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], eax
jmp 0x10006d93
mov edx, ecx
mov dword [esp + 0x10], 0
push 1
mov ecx, edi
call fcn.100014b0
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
jne 0x10006d93
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x10], eax
cmp ecx, dword [0x100582b8]
jae 0x10006ca6
lea ecx, [edi + 0x940]
mov edx, 0xe
push 0
call fcn.100010c0
mov edx, dword [esp + 0x18]
add esp, 4
mov ecx, edi
push dword [esp + 0x10]
push dword [esp + 0x20]
push 0
push dword [ebp + 0xc]
push esi
call fcn.100113f0
add esp, 0x14
mov dword [esp + 0x1c], eax
test eax, eax
je 0x10006ca6
mov ecx, dword [esp + 0x18]
add edi, 0x240
mov byte [esp + 0x38], 1
mov dword [esp + 0x3c], edi
lea eax, [ecx + 8]
mov dword [esp + 0x40], eax
lea eax, [ecx + 0x10]
mov dword [esp + 0x44], eax
lea eax, [ecx + 0x248]
mov ecx, dword [esp + 0xc]
mov dword [esp + 0x48], eax
xor eax, eax
mov edx, dword [edi]
add ecx, edx
mov esi, dword [edi + 4]
adc eax, esi
mov dword [edi], ecx
mov dword [edi + 4], eax
mov eax, dword [esp + 0x44]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
sub ecx, edx
sbb eax, esi
xor edx, edx
cmp edx, eax
jb 0x10006e37
ja 0x10006e2a
cmp dword [esp + 0xc], ecx
jb 0x10006e37
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x38]
call fcn.10032540
mov eax, dword [ebp + 8]
xor esi, esi
mov ecx, dword [esp + 0x1c]
mov dword [eax], ecx
jmp 0x10006e4c
mov esi, 0x16
mov eax, dword [ebp + 8]
mov dword [esp + 0x4c], eax
mov ecx, 1
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x50], eax
lea eax, [esp + 0x4c]
push eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x58], ebx
push esi
mov edx, dword [eax]
call fcn.100248b0
add esp, 8
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, str._jemalloc_:_Error_allocating_TSD_n
call fcn.10027c00
call fcn.10038150
mov ecx, str._jemalloc_:_Error_setting_TSD_n
call fcn.10027c00
call fcn.10038150
int3