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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov edx, dword [0x70ddd014]
mov eax, dword [esp + 0x40]
test edx, edx
jne 0x70d10338
mov eax, dword [eax + 8]
test eax, eax
je 0x70d10398
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [eax + 8]
test edi, edi
je 0x70d103b0
mov ebx, dword [0x70e270bc]
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebp
mov esi, eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
test ebx, ebx
je 0x70d10430
mov edx, dword [ebx]
cmp edx, edi
jb 0x70d10480
sub edi, 1
mov eax, dword [ebx + edi*4 + 4]
test eax, eax
jne 0x70d1032c
mov eax, dword [esp + 0x40]
call fcn.70d101f0
mov dword [ebx + edi*4 + 4], eax
jmp 0x70d1032c
mov eax, dword [esp + 0x40]
call fcn.70d101f0
mov ecx, dword [esp + 0x40]
mov dword [ecx + 8], eax
jmp 0x70d1032c
mov ebp, dword [0x70ddd014]
test ebp, ebp
je 0x70d104f6
mov edi, dword [0x70ddd028]
test edi, edi
je 0x70d10520
lock add dword [0x70e270c0], 1
jne 0x70d10558
mov eax, dword [esp + 0x40]
mov edi, dword [eax + 8]
test edi, edi
je 0x70d10505
mov eax, dword [0x70ddd014]
test eax, eax
je 0x70d1033f
lock sub dword [0x70e270c0], 1
js 0x70d1033f
mov eax, dword [0x70e270c4]
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
sub esp, 0xc
jmp 0x70d1033f
lea eax, [edi + 0x21]
mov dword [esp + 4], 4
lea edx, [edi + 0x20]
mov dword [esp], eax
mov dword [esp + 0x18], edx
call sub.msvcrt.dll_calloc
mov ebx, eax
test eax, eax
je 0x70dd6d7e
mov edx, dword [esp + 0x18]
mov dword [eax], edx
mov eax, dword [0x70e270bc]
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
test eax, eax
jne 0x70d1037b
call ebp
jmp 0x70d1037b
lea ecx, [edx + edx]
lea eax, [edi + 0x20]
mov dword [esp], ebx
cmp ecx, edi
mov dword [esp + 0x1c], edx
cmovb ecx, eax
lea eax, [ecx*4 + 4]
mov dword [esp + 0x18], ecx
mov dword [esp + 4], eax
call sub.msvcrt.dll_realloc
mov ebx, eax
test eax, eax
je 0x70dd6d7e
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov dword [eax], ecx
sub ecx, edx
lea eax, [eax + edx*4 + 4]
shl ecx, 2
mov dword [esp + 4], 0
mov dword [esp + 8], ecx
mov dword [esp], eax
call fcn.70d19a80
jmp 0x70d1045a
call fcn.70d10290
mov dword [0x70ddd028], 1
mov edx, dword [0x70ddd014]
test edx, edx
jne 0x70d103cc
mov eax, dword [esp + 0x40]
mov edi, dword [eax + 8]
test edi, edi
jne 0x70d1033f
mov eax, dword [0x70e270b8]
lea edi, [eax + 1]
mov dword [0x70e270b8], edi
mov eax, dword [esp + 0x40]
mov dword [eax + 8], edi
jmp 0x70d103e9
lock add dword [0x70ddd02c], 1
je 0x70d104d9
mov esi, dword [0x70ddd028]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
test esi, esi
jne 0x70d104e8
lea esi, [esi]
mov dword [esp], 0
call ebx
mov ecx, dword [0x70ddd028]
sub esp, 4
test ecx, ecx
je 0x70d10540
jmp 0x70d104e8
mov eax, dword [0x70e270c4]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
test eax, eax
je 0x70d103da
lock sub dword [0x70e270c0], 1
jmp 0x70d103da