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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x158
push ebx
push esi
push edi
lea eax, [ebp - 0x158]
push eax
call sym.ProcessHacker.exe_PhInitializeAutoPool
mov esi, dword [ebp + 8]
push 0
push 0
push 0x411
push esi
call dword [sym.imp.USER32.dll_SendMessageW]
mov dword [ebp - 0x18], eax
lea edx, [ebp - 4]
mov ecx, esi
lea edi, [eax + 1]
lea eax, [ebp - 0x10]
mov dword [ebp - 0x28], edi
push eax
lea eax, [ebp - 0xc]
push eax
call fcn.004d4f60
mov ebx, dword [ebp - 0x10]
lea ecx, [ebp - 8]
push ebx
mov edx, edi
mov dword [ebp - 0x24], ebx
call fcn.004d4540
mov ecx, dword [ebp - 0xc]
xor edi, edi
mov eax, dword [ebp - 8]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x14], eax
test ebx, ebx
je 0x4d542a
lea ecx, [ecx]
mov eax, dword [ecx + edi*4]
mov ecx, eax
mov dword [ebp - 8], eax
lea edx, [ecx + 2]
jmp 0x4d53c0
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4d53c0
push dword [0x5b1d70]
sub ecx, edx
sar ecx, 1
lea eax, [ecx + ecx]
mov dword [ebp - 0xc], eax
lea eax, [ecx*2 + 0xa]
push eax
call sym.ProcessHacker.exe_PhCreateObject
mov esi, eax
xor edx, edx
mov eax, dword [ebp - 0xc]
lea ecx, [esi + 8]
mov dword [esi + 4], ecx
mov dword [esi], eax
mov word [ecx + eax], dx
mov ecx, dword [ebp - 8]
test ecx, ecx
je 0x4d5411
push eax
push ecx
push dword [esi + 4]
call fcn.00521a30
add esp, 0xc
push esi
call sym.ProcessHacker.exe_PhAutoDereferenceObject
mov ecx, dword [ebp - 0x14]
mov ecx, dword [ecx]
mov dword [ecx + edi*4], eax
inc edi
mov ecx, dword [ebp - 0x10]
cmp edi, ebx
jb 0x4d53b0
mov eax, dword [ebp - 0x14]
mov esi, dword [ebp - 4]
xor ecx, ecx
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], esi
cmp dword [ebp - 0x18], ecx
jbe 0x4d552c
mov edi, dword [ebp + 8]
add eax, 4
lfence
mov dword [ebp - 4], eax
mov esi, 0x5b3880
nop
push 0
push ecx
push 0x412
push edi
call dword [sym.imp.USER32.dll_SendMessageW]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x4d55c3
xor esi, esi
test ebx, ebx
je 0x4d5508
mov dword ds:[ebp - 0x38], eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + esi*4]
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x3c]
push eax
push 0
push 0x413
push edi
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
call dword [sym.imp.USER32.dll_SendMessageW]
mov ebx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
push dword [0x5b1d70]
mov dword [ebp - 0x20], eax
lea eax, [ebx + 0xa]
push eax
call sym.ProcessHacker.exe_PhCreateObject
mov edi, eax
xor eax, eax
lea ecx, [edi + 8]
mov dword [edi], ebx
mov dword [edi + 4], ecx
mov word [ecx + ebx], ax
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x4d54e2
push ebx
push eax
push dword [edi + 4]
call fcn.00521a30
add esp, 0xc
push edi
call sym.ProcessHacker.exe_PhAutoDereferenceObject
mov ecx, dword ds:[ebp - 4]
mov ebx, dword [ebp - 0x24]
mov edi, dword [ebp + 8]
mov ecx, dword [ecx]
mov dword [ecx + esi*4], eax
inc esi
mov eax, dword [ebp - 0x1c]
cmp esi, ebx
jb 0x4d5474
mov esi, 0x5b3880
mov ecx, dword ds:[ebp - 8]
add dword [ebp - 4], 4
inc ecx
mov dword [ebp - 8], ecx
cmp ecx, dword [ebp - 0x18]
jb 0x4d5450
mov esi, dword [ebp - 0xc]
push dword [ebp - 0x10]
push 0
push dword [0x5b1dac]
call dword [sym.imp.ntdll.dll_RtlFreeHeap]
push esi
push 0
push dword [0x5b1dac]
call dword [sym.imp.ntdll.dll_RtlFreeHeap]
push dword [ebp + 0xc]
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x14]
push ebx
call fcn.004d46a0
mov esi, eax
lea eax, [ebp - 0x158]
push eax
call sym.ProcessHacker.exe_PhDrainAutoPool
push dword [0x5b3864]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea ecx, ds:[ebp - 0x158]
cmp eax, ecx
jne 0x4d5654
push dword [ebp - 0x48]
push dword [0x5b3864]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x4d5654
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x4d55b5
push eax
push 0
push dword [0x5b1dac]
call dword [sym.imp.ntdll.dll_RtlFreeHeap]
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
xor edi, edi
test ebx, ebx
je 0x4d564c
lea ecx, [ecx]
xor ecx, ecx
xor eax, eax
lock cmpxchg dword [esi], ecx
mov esi, eax
test esi, esi
jne 0x4d5625
push dword [0x5b1d70]
push 0xa
call sym.ProcessHacker.exe_PhCreateObject
mov edx, eax
xor eax, eax
lea ecx, [edx + 8]
mov dword [edx], esi
mov esi, 0x5b3880
mov dword [edx + 4], ecx
mov word [ecx], ax
mov ecx, edx
lock cmpxchg dword [esi], ecx
mov esi, eax
test esi, esi
jne 0x4d560f
mov esi, edx
jmp 0x4d5625
lea ecx, [edx - 8]
or eax, 0xffffffff
lock xadd dword [ecx + 4], eax
dec eax
jne 0x4d5625
lea ecx, [ecx]
call fcn.004b3960
lock inc dword [esi - 4]
push esi
call sym.ProcessHacker.exe_PhAutoDereferenceObject
mov edx, dword ds:[ebp - 4]
mov esi, 0x5b3880
mov ecx, dword [edx]
mov dword [ecx + edi*4], eax
inc edi
cmp edi, ebx
jb 0x4d55d0
mov edi, dword [ebp + 8]
jmp 0x4d5508
mov edi, dword [ebp + 8]
jmp 0x4d550d
push 0xc0000001
call dword [sym.imp.ntdll.dll_RtlRaiseStatus]
int3