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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebp, dword [0x4976bc]
mov eax, dword [esp + 0x40]
test ebp, ebp
jne 0x485264
mov eax, dword [eax + 8]
test eax, eax
je 0x4852c0
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebp, dword [eax + 8]
test ebp, ebp
je 0x485320
mov esi, dword [0x5b3540]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
mov ebx, eax
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov esi, eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
test esi, esi
je 0x4852d2
mov edx, dword [esi]
cmp ebp, edx
ja 0x4853a0
lea esi, [esi + ebp*4]
mov eax, dword [esi]
test eax, eax
jne 0x48525c
mov eax, dword [esp + 0x40]
call fcn.00485130
mov dword [esi], eax
jmp 0x48525c
mov eax, dword [esp + 0x40]
call fcn.00485130
mov ecx, dword [esp + 0x40]
mov dword [ecx + 8], eax
jmp 0x48525c
lea eax, [ebp + 0x21]
lea edx, [ebp + 0x20]
mov dword [esp + 4], 4
mov dword [esp], eax
mov dword [esp + 0x18], edx
call sub.msvcrt.dll_calloc
test eax, eax
mov esi, eax
mov edx, dword [esp + 0x18]
je 0x4854ab
mov dword [eax], edx
mov eax, dword [0x5b3540]
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
test eax, eax
jne 0x4852a7
call edi
jmp 0x4852a7
mov edi, dword [0x4976bc]
test edi, edi
je 0x485346
mov esi, dword [0x4976cc]
test esi, esi
je 0x485470
lock add dword [0x5b3544], 1
jne 0x485442
mov eax, dword [esp + 0x40]
mov ebp, dword [eax + 8]
test ebp, ebp
je 0x485428
mov eax, dword [0x4976bc]
test eax, eax
je 0x48526f
mov eax, 0xffffffff
lock xadd dword [0x5b3544], eax
sub eax, 1
js 0x48526f
mov eax, dword [0x5b3548]
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 0x48526f
lea ecx, [edx + edx]
lea eax, [ebp + 0x20]
mov dword [esp], esi
mov dword [esp + 0x1c], edx
cmp ebp, ecx
cmova ecx, eax
lea eax, [ecx*4 + 4]
mov dword [esp + 0x18], ecx
mov dword [esp + 4], eax
call sub.msvcrt.dll_realloc
test eax, eax
mov esi, eax
je 0x4854ab
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 sub.msvcrt.dll_memset
jmp 0x4852fc
call fcn.004851d0
mov dword [0x4976cc], 1
mov edx, dword [0x4976bc]
test edx, edx
jne 0x485338
mov eax, dword [esp + 0x40]
mov ebp, dword [eax + 8]
test ebp, ebp
jne 0x48526f
mov eax, dword [0x5b353c]
lea ebp, [eax + 1]
mov eax, dword [esp + 0x40]
mov dword [0x5b353c], ebp
mov dword [eax + 8], ebp
jmp 0x485355
mov eax, dword [0x5b3548]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
test eax, eax
je 0x485346
lock sub dword [0x5b3544], 1
jmp 0x485346
lock add dword [0x4976d0], 1
je 0x4853fc
mov ebx, dword [0x4976cc]
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
test ebx, ebx
jne 0x48540b
lea esi, [esi]
mov dword [esp], 0
call esi
mov ecx, dword [0x4976cc]
sub esp, 4
test ecx, ecx
je 0x485490
jmp 0x48540b
call sub.msvcrt.dll_abort
push ebx
mov eax, dword [esp + 8]
mov edx, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
mov ebx, dword [esp + 0x14]
cmp dword [eax], edx
jae 0x4854ce
mov dword [eax], edx
mov dword [eax + 0xc], 0
cmp dword [eax + 4], ecx
jae 0x4854d6
mov dword [eax + 4], ecx
test ebx, ebx
je 0x4854de
cmp edx, dword [eax]
je 0x4854e0
pop ebx
ret
mov dword [eax + 0xc], ebx
pop ebx
ret