Function at 0x10004170
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [0x10064870]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
push dword [0x10064010]
mov edi, dword [ebp + 8]
xor ebx, ebx
call dword [sym.imp.kernel32.dll_TlsGetValue]
test eax, eax
je 0x1001ed65
cmp dword [eax + 0x1078], ebx
je 0x1001ed65
push dword [0x10064010]
call dword [sym.imp.kernel32.dll_TlsGetValue]
test eax, eax
je 0x1001ed36
mov esi, dword [eax + 0x1078]
mov dword [ebp - 0x28], esi
test esi, esi
je 0x1002056d
xor ecx, ecx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], ecx
test esi, esi
je 0x1001ed5b
test byte [esi + 0x2c], 2
jne 0x1001ed5b
cmp dword [esi + 0x24], ecx
lea eax, [esi + 0xc]
jne 0x10020578
lea ecx, [esi + 4]
cmp dword [0x10066330], ebx
je 0x100043d2
mov eax, 1
lock xadd dword [ecx], eax
inc dword [esi + 8]
test edi, edi
je 0x1001ed51
mov eax, dword [edi]
mov esi, dword [eax + 0x14]
mov ecx, esi
call dword [0x10067390]
mov ecx, edi
call esi
test al, 4
je 0x1001ed51
mov eax, dword [ebp - 0x28]
cmp eax, dword [edi + 0x10]
jne 0x1001ed40
mov eax, dword [edi]
mov esi, dword [eax + 0x20]
cmp esi, fcn.10003f90
je 0x100043c6
jmp 0x1001ecdd
mov ecx, esi
call dword [0x10067390]
mov ecx, edi
call esi
push dword [0x10064010]
mov ebx, eax
call dword [sym.imp.kernel32.dll_TlsGetValue]
jmp 0x1001ecee
cmp dword [0x10066330], 0
lea ecx, [esi + 4]
mov edx, 1
je 0x100043db
mov eax, edx
lock xadd dword [ecx], eax
inc dword [esi + 8]
mov esi, ebx
mov ecx, dword [ebx + 0x10]
mov dword [ebp - 0x24], esi
lea eax, [ecx + 1]
mov dword [ebx + 0x10], eax
test ecx, ecx
jne 0x100042a8
mov dword [ebx + 0x14], ecx
cmp dword [0x10066330], 0
mov eax, dword [ebx + 0x18]
mov dword [ebp - 0x1c], eax
lea eax, [ebx + 4]
mov dword [ebx + 0x18], 1
je 0x100205d0
lock xadd dword [eax], edx
inc edx
mov eax, dword [ebp - 0x28]
cmp dword [eax + 0x28], 0
jne 0x100205dc
mov eax, edi
test byte [eax + 0x3c], 2
je 0x10004674
mov eax, dword [eax + 0x28]
test eax, eax
je 0x100042ef
add eax, 0xffffffd8
jne 0x100042d9
cmp dword [edi + 0x8c], 0
jne 0x100043bc
or dword [edi + 0x3c], 0x20000000
mov eax, dword [edi + 0x28]
test eax, eax
je 0x10004363
add eax, 0xffffffd8
je 0x10004363
mov ecx, dword [eax + 0x3c]
test ecx, 0x40000000
jne 0x1000432f
or ecx, 0x40000000
mov dword [eax + 0x3c], ecx
mov eax, dword [eax + 0x28]
test eax, eax
je 0x1000432f
add eax, 0xffffffd8
jne 0x1000430f
test dword [edi + 0x3c], 0x80000
jne 0x10004363
mov eax, dword [edi + 0x28]
test eax, eax
je 0x10004363
add eax, 0xffffffd8
je 0x10004363
mov ecx, dword [eax + 0x3c]
test ecx, 0x20000000
jne 0x100043bc
test ecx, 0x80000
jne 0x10004363
mov eax, dword [eax + 0x28]
test eax, eax
je 0x10004363
add eax, 0xffffffd8
jne 0x10004344
mov eax, dword [edi + 0xac]
mov edx, edi
sub eax, dword [edi + 0xa4]
mov dword [ebp - 0x10], eax
mov eax, dword [edi + 0xb0]
sub eax, dword [edi + 0xa8]
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0xc], eax
mov ecx, dword [edx + 0x28]
test ecx, ecx
je 0x10004484
lea eax, [ecx - 0x28]
test eax, eax
je 0x10004484
test ecx, ecx
je 0x100043e4
lea edx, [ecx - 0x28]
jmp 0x10004391
mov ecx, edi
call fcn.10003470
jmp 0x10004262
mov ebx, 1
jmp 0x1001ed29
mov ecx, edi
call fcn.10003f90
jmp 0x10004262
inc dword [ecx]
mov eax, dword [ecx]
jmp 0x10004210
inc dword [ecx]
mov eax, dword [ecx]
jmp 0x10004290
xor edx, edx
jmp 0x10004391
xor edx, edx
jmp 0x10004491
or edi, 0xffffffff
test esi, esi
je 0x1000443b
dec dword [esi + 0x10]
jne 0x10004405
cmp dword [esi + 0x14], 0
jne 0x1002060c
xor ecx, ecx
mov eax, dword [ebp - 0x1c]
mov dword [esi + 0x18], eax
test ecx, ecx
jne 0x10020620
cmp dword [0x10066330], 0
lea ecx, [esi + 4]
je 0x10020638
mov eax, edi
lock xadd dword [ecx], eax
dec eax
test eax, eax
je 0x10020644
mov dword [ebp - 0x24], 0
mov ecx, dword [ebp - 0x20]
test ecx, ecx
je 0x1000446f
dec dword [ecx + 8]
lea eax, [ecx + 4]
cmp dword [0x10066330], 0
je 0x1002065b
lock xadd dword [eax], edi
dec edi
test edi, edi
je 0x10020667
cmp dword [ecx + 0x24], 0
lea eax, [ecx + 0xc]
jne 0x1002067e
mov ecx, dword [ebp - 8]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.10002e40
mov esp, ebp
pop ebp
ret 4
test dword [edx + 0x3c], 0x400000
je 0x100043e8
push 1
lea eax, [ebp - 0x18]
mov ecx, edi
push eax
push dword [edx + 0xb4]
call fcn.10016da7
jmp 0x100043bc
test dword [edi + 0x3c], 0x80000
jne 0x100205ee
jmp 0x100043bc
cmp esi, fcn.10003470
jne 0x10004256
jmp 0x100043b0
test eax, eax
je 0x1001ed4a
mov esi, dword [eax + 0x1078]
test esi, esi
je 0x10020590
test ebx, ebx
je 0x100205a2
test byte [esi + 0x2c], 2
jne 0x100205a2
cmp dword [esi + 0x24], 0
lea eax, [esi + 0xc]
mov ecx, esi
mov dword [ebp - 0x20], ecx
je 0x10004275
jmp 0x100205b7
mov ecx, dword [ebp - 0x28]
call fcn.1001f0a0
jmp 0x100043ef
xor esi, esi
mov dword [ebp - 0x28], esi
jmp 0x100041cf
push 0x8004001e
jmp 0x100205fe
xor esi, esi
jmp 0x1002059a
push 0x80070057
jmp 0x100205fe
push 0x80070057
jmp 0x10020697
push 0x80040014
jmp 0x10020697
mov dword [0], ebx
jmp 0x100041cf
cmp dword [0x10066330], ecx
je 0x100041f8
push eax
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
jmp 0x100041f8
mov dword [0], 0
test esi, esi
jne 0x1001ed00
push 0x80070057
call dword [sym.imp.kernel32.dll_SetLastError]
mov esi, dword [ebp - 0x24]
xor ebx, ebx
jmp 0x1001ed29
cmp dword [0x10066330], 0
je 0x10004275
push eax
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
jmp 0x10004275
inc dword [eax]
mov eax, dword [eax]
mov esi, dword [ebp - 0x24]
jmp 0x100042ca
push 0x8004001f
call dword [sym.imp.kernel32.dll_SetLastError]
xor ebx, ebx
jmp 0x1001ed29
mov ecx, edi
call fcn.10016da7
mov byte [eax + 0x16], 1
jmp 0x100043bc
call dword [sym.imp.kernel32.dll_SetLastError]
mov esi, dword [ebp - 0x24]
jmp 0x1001ed29
cmp dword [esi + 0x18], 0
je 0x10004405
mov ecx, 1
jmp 0x10004407
cmp dword [esi + 8], 0
lea eax, [esi + 8]
je 0x10004415
push eax
call fcn.10016da7
jmp 0x10004415
dec dword [ecx]
mov eax, dword [ecx]
mov esi, dword [ebp - 0x24]
jmp 0x1000442c
mov eax, dword [esi]
mov esi, dword [eax + 8]
mov ecx, esi
call dword [0x10067390]
mov ecx, dword [ebp - 0x24]
call esi
jmp 0x10004434
dec dword [eax]
mov edi, dword [eax]
mov ecx, dword [ebp - 0x20]
jmp 0x1000445a
mov edx, dword [ecx]
mov esi, dword [edx + 8]
mov ecx, esi
call dword [0x10067390]
mov ecx, dword [ebp - 0x20]
call esi
jmp 0x1000446f
cmp dword [0x10066330], 0
je 0x1000446f
push eax
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
jmp 0x1000446f
call dword [sym.imp.kernel32.dll_SetLastError]
jmp 0x1000446f