Function at 0x46f547
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
push edi
mov edi, ecx
mov dword [ebp - 0x1c], edi
cmp dword [edi], 0
je 0x46f8e9
push dword [edi]
push 0
push dword [edi + 4]
call fcn.0040af35
add esp, 0xc
mov dword [ebp - 8], 0x4e2
xor ecx, ecx
mov dword [ebp - 0x10], ecx
jmp 0x46f587
mov eax, dword [ebp - 0x10]
mov dword [ebp + eax*4 - 0x3c], 0x898f01ba
inc dword [ebp - 0x10]
cmp dword [ebp - 0x10], 3
jl 0x46f579
dec dword [ebp - 8]
push ebx
push esi
push 1
pop ebx
push 2
mov dword [ebp - 8], ecx
pop esi
jmp 0x46f691
mov dword [ebp - 0xc], 0xea122098
cmp dword [ebp - 8], ecx
je 0x46f5ff
mov dword [ebp - 0x18], 8
xor edx, edx
mov dword [ebp - 0x14], 0x1b17d72b
mov dword [ebp - 0x10], ebx
mov eax, dword [ebp - 0x14]
mov eax, dword [ebp - 0xc]
mov eax, dword [ebp - 0x14]
mov eax, dword [ebp - 8]
mov dword [ebp - 0x38], eax
dec dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp ecx, eax
mov eax, dword [ebp - 0xc]
setle dl
add edx, 0x108fc3a9
sub eax, edx
neg eax
sbb eax, eax
inc eax
xor ecx, ecx
mov dword [ebp - 0x14], eax
jmp 0x46f67b
mov dword [ebp - 0xc], esi
cmp dword [ebp - 0xc], ecx
jl 0x46f67b
mov dword [ebp - 0x14], 0xae7b1b0c
mov dword [ebp - 0x14], ecx
jmp 0x46f65e
mov dword [ebp - 0x18], 0xffffffff
mov dword [ebp - 0x18], esi
cmp dword [ebp - 0x18], ecx
jl 0x46f65b
mov dword [ebp - 0x10], 0x29207965
mov byte [ebp - 1], cl
cmp byte [ebp - 1], 0
je 0x46f63d
push ecx
push ecx
push ecx
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
xor ecx, ecx
mov dword [ebp - 0x10], ecx
jmp 0x46f650
mov eax, dword [ebp - 0x10]
mov dword [ebp + eax*4 - 0x3c], 0x653e3f36
inc dword [ebp - 0x10]
cmp dword [ebp - 0x10], 3
jl 0x46f642
dec dword [ebp - 0x18]
jns 0x46f622
inc dword [ebp - 0x14]
cmp dword [ebp - 0x14], esi
jle 0x46f613
mov byte [ebp - 1], cl
cmp byte [ebp - 1], 0
je 0x46f676
push ecx
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
xor ecx, ecx
dec dword [ebp - 0xc]
jns 0x46f607
mov byte [ebp - 1], cl
cmp byte [ebp - 1], 0
je 0x46f68e
push ecx
push ecx
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
xor ecx, ecx
inc dword [ebp - 8]
cmp dword [ebp - 8], 0x12
jl 0x46f5a0
push dword [edi + 4]
call fcn.004af9bd
mov dword [ebp - 0x10], 0xac204e2d
mov eax, 0x4ab462a7
mov dword [ebp - 0x18], 0xf6872920
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x10], 0xffffffe3
cmp dword [ebp - 0x10], 0xe
pop ecx
jle 0x46f7ca
push 4
lea ecx, [ebp - 0x30]
call fcn.0040b279
mov dword [ebp - 8], 0xfffffffc
mov dword [ebp - 0x14], 0
jmp 0x46f6fe
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x30]
mov dword [eax + ecx*4], 0x7ca0029b
inc dword [ebp - 0x14]
cmp dword [ebp - 0x14], 4
jl 0x46f6ee
mov dword [ebp - 8], 3
cmp dword [ebp - 8], 0
jl 0x46f7a9
push esi
lea ecx, [ebp - 0x48]
call fcn.0040b279
mov dword [ebp - 0x14], 0
jmp 0x46f737
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x48]
mov dword [eax + ecx*4], 0x1b0c
inc dword [ebp - 0x14]
cmp dword [ebp - 0x14], esi
jl 0x46f727
mov eax, dword [ebp - 8]
mov ecx, ebx
sub ecx, eax
add ecx, dword [ebp - 8]
je 0x46f752
cmp dword [ebp - 0x10], 0
je 0x46f752
mov edx, ebx
jmp 0x46f754
xor edx, edx
mov edi, dword [ebp - 8]
mov ecx, dword [ebp - 8]
mov esi, dword [ebp - 0x30]
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + ecx*4]
mov dword [esi + edi*4], eax
lea eax, [edx + 0x886a]
neg eax
sbb eax, eax
inc eax
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 8]
sub edx, 0x3e3f
neg edx
sbb edx, edx
xor ecx, ecx
inc edx
cmp edx, eax
setne cl
imul ecx, dword [esi + edi*4]
neg ecx
mov dword [ebp - 0x50], ecx
lea ecx, [ebp - 0x48]
call fcn.0040b34b
dec dword [ebp - 8]
push 2
pop esi
jns 0x46f715
mov eax, dword [ebp - 0x30]
lea ecx, [ebp - 0x30]
mov eax, dword [eax + 0xc]
mov dword [ebp - 8], eax
call fcn.0040b34b
inc dword [ebp - 0x10]
cmp dword [ebp - 0x10], 0xe
jg 0x46f6d4
mov edi, dword [ebp - 0x1c]
xor eax, eax
mov byte [ebp - 1], al
cmp byte [ebp - 1], al
je 0x46f7de
push eax
push eax
call dword [sym.imp.USER32.dll_LoadMenuW]
xor eax, eax
mov dword [edi + 4], eax
mov dword [ebp - 8], 0xfffffff8
mov dword [ebp - 0x10], 8
mov dword [ebp - 0x18], 0x62db8e96
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], 0xffffffff
mov dword [ebp - 0x18], 0xa87a5eaf
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0xc], 0xe13f5e3
mov dword [ebp - 0x1c], 0x3703
mov dword [ebp - 0x14], 0x72737ae9
mov dword [ebp - 0x14], eax
jmp 0x46f832
mov eax, dword [ebp - 0x14]
mov dword [ebp + eax*4 - 0x24], 0xfffffffb
inc dword [ebp - 0x14]
cmp dword [ebp - 0x14], esi
jl 0x46f824
mov dword [ebp - 0x18], 0x9310
xor edx, edx
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp ecx, eax
setl dl
mov dword [ebp - 0x18], edx
xor edx, edx
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 8]
cmp eax, ecx
setle dl
xor ecx, ecx
add edx, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
cmp eax, edx
mov eax, dword [ebp - 8]
setl cl
xor edx, edx
cmp ecx, eax
setl dl
sub edx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
neg edx
mov ecx, dword [ebp - 0x10]
sbb edx, edx
inc edx
sub esi, edx
neg esi
sbb esi, esi
imul ecx, dword [ebp - 8]
mov eax, dword [ebp - 8]
inc esi
imul eax, esi
sub ecx, eax
mov eax, dword [ebp - 0x1c]
dec dword [ebp - 0x10]
cmp ecx, eax
jle 0x46f8b4
xor ebx, ebx
mov eax, dword [ebp - 0xc]
xor ecx, ecx
imul eax, ebx
pop esi
pop ebx
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], 0xa6eb
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x14]
sub eax, dword [ebp - 8]
cmp eax, 0xd800
setg cl
xor eax, eax
cmp edx, ecx
setg al
and dword [edi], 0
mov dword [ebp - 0x18], eax
pop edi
mov esp, ebp
pop ebp
ret