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

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x34
mov ebp, dword [edx + 8]
test ebp, ebp
je 0x401148
mov dword [esp + 8], ecx
mov edi, edx
mov eax, dword [0x5b8040]
test eax, eax
je 0x401153
dec eax
push eax
call dword [sym.imp.kernel32.dll_TlsGetValue]
cmp eax, 2
mov dword [esp + 4], edi
jb 0x401048
mov ecx, dword [eax]
mov esi, dword [eax + 4]
mov eax, ecx
mov dword [esp], ecx
or eax, esi
jne 0x4010dd
mov eax, dword [0x5b8040]
test eax, eax
je 0x401204
dec eax
push eax
call dword [sym.imp.kernel32.dll_TlsGetValue]
cmp eax, 1
je 0x40121e
mov ebx, eax
test eax, eax
jne 0x4010b3
movzx eax, byte [0x5b9430]
xor ecx, ecx
mov edx, 0x10
call fcn.0051b940
test eax, eax
je 0x401295
mov dword [eax + 4], 0
mov dword [eax], 0
mov dword [eax + 8], 0x5b8040
mov ebx, eax
mov eax, dword [0x5b8040]
test eax, eax
je 0x401264
dec eax
push ebx
push eax
call dword [sym.imp.kernel32.dll_TlsSetValue]
call fcn.0050f0c0
test eax, eax
je 0x401273
mov ecx, dword [eax + 8]
mov esi, dword [eax + 0xc]
mov dword [esp], ecx
lock dec dword [eax]
jne 0x4010d5
mov ecx, eax
call fcn.0050eef0
mov eax, dword [esp]
mov dword [ebx + 4], esi
mov dword [ebx], eax
mov ecx, dword [edi + 4]
lea eax, [ebp + ebp*2]
lea edx, [ecx + eax*4]
xor ebx, ebx
jmp 0x4010fc
add ecx, 0xc
inc ebx
cmp ecx, edx
je 0x401252
mov ebp, dword [ecx]
mov edi, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
xor edi, dword [esp]
xor eax, esi
or edi, eax
je 0x4010f0
mov edi, dword [ecx + 4]
xor eax, eax
lock cmpxchg dword [ebp + 0x14], edi
jne 0x4010f0
mov eax, dword [ecx + 8]
test eax, eax
je 0x401123
mov dword [ebp + 0x18], eax
mov esi, dword [ebp + 0x10]
mov al, 1
xchg byte [esi + 0x18], al
mov edi, dword [esp + 4]
cmp al, 0xff
jne 0x4011bd
mov eax, dword [0x5b93ec]
add esi, 0x18
test eax, eax
je 0x401162
push esi
call eax
jmp 0x4011bd
mov dword [ecx], 0
jmp 0x40125c
mov ecx, 0x5b8040
call fcn.00545b80
jmp 0x401026
mov ecx, dword [0x5b80c8]
cmp ecx, 0xffffffff
jne 0x4011b0
mov dword [esp + 0xc], 0xffffffff
lea ecx, [esp + 0xc]
mov eax, dword [0x5b80d4]
push 0
push 0
push 0xc0000000
push ecx
call eax
test eax, eax
jne 0x4012a4
mov ecx, dword [esp + 0xc]
mov eax, 0xffffffff
lock cmpxchg dword [0x5b80c8], ecx
je 0x4011b0
mov ebp, eax
push ecx
call dword [sym.imp.kernel32.dll_CloseHandle]
mov ecx, ebp
mov eax, dword [0x5b80d8]
push 0
push 0
push esi
push ecx
call eax
mov ebp, dword [edi + 8]
cmp ebp, ebx
jbe 0x401287
mov eax, dword [edi + 4]
lea ecx, [ebx + ebx*2]
mov esi, dword [esp + 8]
not ebx
add ebx, ebp
shl ebx, 2
mov edx, dword [eax + ecx*4 + 8]
mov dword [esi + 8], edx
lea edx, [eax + ecx*4]
movsd xmm0, qword [eax + ecx*4]
lea eax, [eax + ecx*4 + 0xc]
lea ecx, [ebx + ebx*2]
movsd qword [esi], xmm0
push ecx
push eax
push edx
call sub.VCRUNTIME140.dll_memmove
add esp, 0xc
dec ebp
mov dword [edi + 8], ebp
jmp 0x40125c
mov ecx, 0x5b8040
call fcn.00545b80
push eax
call dword [sym.imp.kernel32.dll_TlsGetValue]
cmp eax, 1
jne 0x401066
call fcn.0050f0c0
test eax, eax
je 0x401273
mov ecx, dword [eax + 8]
mov esi, dword [eax + 0xc]
mov dword [esp], ecx
lock dec dword [eax]
jne 0x40123c
mov ecx, eax
call fcn.0050eef0
mov eax, dword [edi + 8]
test eax, eax
je 0x401252
mov ecx, dword [esp + 4]
lea eax, [eax + eax*2]
mov ecx, dword [ecx + 4]
jmp 0x4010e4
mov eax, dword [esp + 8]
mov dword [eax], 0
add esp, 0x34
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, 0x5b8040
call fcn.00545b80
jmp 0x4010ab
mov ecx, 0x5a3bbc
mov edx, 0x5e
push 0x5a3c1c
call fcn.0053bf30
mov ecx, ebx
mov edx, ebp
push 0x5479a4
call fcn.0053b890
mov ecx, 8
mov edx, 0x10
call fcn.0053b730
lea edx, [esp + 0x10]
lea ecx, [esp + 0x14]
mov dword [esp + 0x1c], 0x5a5508
mov dword [esp + 0x20], 1
mov dword [esp + 0x2c], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x1c]
mov edx, 0x5a5544
mov dword [esp + 0x18], 0x45e1b0
mov dword [esp + 0x28], 1
call fcn.0053ba80
int3