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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2d4
mov eax, dword [0x5ac004]
xor eax, esp
mov dword [esp + 0x2d0], eax
push ebx
push esi
push edi
lea eax, [esp + 0x30]
mov ebx, ecx
push eax
mov dword [esp + 0x24], ebx
call sym.ProcessHacker.exe_PhInitializeAutoPool
lea eax, ds:[esp + 0x1c]
mov ecx, ebx
push eax
sub esp, 8
lea edx, [esp + 0x154]
call fcn.004d5660
push 0
push 0
push 0x1004
push ebx
call dword [sym.imp.USER32.dll_SendMessageW]
push dword [0x5b1d70]
mov esi, 0x100
mov dword [esp + 0x2c], eax
push 0x10a
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
call sym.ProcessHacker.exe_PhCreateObject
mov edi, eax
xor eax, eax
lea ecx, [edi + 8]
mov dword [esp + 0x18], edi
mov dword [edi + 4], ecx
mov word [ecx + 0x100], ax
xor ecx, ecx
mov dword [edi], eax
mov eax, dword [edi + 4]
mov word [eax], cx
xor eax, eax
mov dword [esp + 0x24], eax
cmp dword [esp + 0x28], eax
jbe 0x4d5ad8
lfence
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x1c], ecx
push 2
push eax
push 0x102c
push ebx
call dword [sym.imp.USER32.dll_SendMessageW]
test al, 2
je 0x4d5ac5
xor ebx, ebx
cmp dword [esp + 0x1c], ebx
jbe 0x4d5a32
lea ebx, [ebx]
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
push ebx
call fcn.004d57c0
mov esi, dword [eax]
mov ecx, dword [eax + 4]
mov dword [esp + 0x2c], ecx
test esi, esi
je 0x4d59c7
mov eax, dword ds:[edi]
add eax, esi
cmp dword [esp + 0x10], eax
jae 0x4d59a6
lfence
mov edx, dword [edi]
lea ecx, [esp + 0x14]
add edx, esi
call fcn.004b6ea0
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x10], eax
test ecx, ecx
je 0x4d59ba
mov eax, dword [edi + 4]
add eax, dword [edi]
push esi
push ecx
push eax
call fcn.00521a30
add esp, 0xc
add dword [edi], esi
xor edx, edx
mov ecx, dword [edi]
mov eax, dword [edi + 4]
mov word [ecx + eax], dx
push 0x56b8b0
call sym.ProcessHacker.exe_PhCountStringZ
mov esi, eax
add esi, esi
je 0x4d5a23
mov eax, dword ds:[edi]
add eax, esi
cmp dword [esp + 0x10], eax
jae 0x4d5a02
lfence
mov edx, dword [edi]
lea ecx, [esp + 0x14]
add edx, esi
call fcn.004b6ea0
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
mov dword [esp + 0x10], eax
mov eax, dword [edi + 4]
add eax, dword [edi]
push esi
push 0x56b8b0
push eax
call fcn.00521a30
add dword [edi], esi
add esp, 0xc
mov ecx, dword [edi]
xor edx, edx
mov eax, dword [edi + 4]
mov word [ecx + eax], dx
inc ebx
cmp ebx, dword [esp + 0x1c]
jb 0x4d5960
mov esi, dword [esp + 0x10]
mov ebx, dword [edi]
test ebx, ebx
je 0x4d5a6a
mov ecx, dword [edi + 4]
mov eax, ebx
shr eax, 1
lea edx, [eax*2 - 4]
sub ebx, edx
lea eax, [ecx + eax*2]
sub ebx, 4
push ebx
push eax
lea eax, [ecx + edx]
push eax
call fcn.005214b0
add dword [edi], 0xfffffffc
add esp, 0xc
mov ecx, dword [edi]
xor edx, edx
mov eax, dword [edi + 4]
mov word [ecx + eax], dx
push 0x56a138
call sym.ProcessHacker.exe_PhCountStringZ
mov ebx, eax
add ebx, ebx
je 0x4d5ac1
mov ecx, dword ds:[edi]
add ecx, ebx
cmp esi, ecx
jae 0x4d5aa0
lfence
mov edx, dword [edi]
lea ecx, [esp + 0x14]
add edx, ebx
call fcn.004b6ea0
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
mov dword [esp + 0x10], esi
mov eax, dword [edi + 4]
add eax, dword [edi]
push ebx
push 0x56a138
push eax
call fcn.00521a30
add dword [edi], ebx
add esp, 0xc
mov ecx, dword [edi]
xor edx, edx
mov eax, dword [edi + 4]
mov word [ecx + eax], dx
mov ebx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
inc eax
mov dword [esp + 0x24], eax
cmp eax, dword [esp + 0x28]
jb 0x4d5935
lea eax, ds:[esp + 0x30]
push eax
call sym.ProcessHacker.exe_PhDrainAutoPool
push dword [0x5b3864]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea ecx, [esp + 0x30]
cmp eax, ecx
jne 0x4d5b41
push dword [esp + 0x140]
push dword [0x5b3864]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x4d5b41
mov eax, dword [esp + 0x13c]
test eax, eax
je 0x4d5b2a
push eax
push 0
push dword [0x5b1dac]
call dword [sym.imp.ntdll.dll_RtlFreeHeap]
mov ecx, dword [esp + 0x2dc]
mov eax, edi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0051e068
mov esp, ebp
pop ebp
ret
push 0xc0000001
call dword [sym.imp.ntdll.dll_RtlRaiseStatus]
int3