Function at 0x4be314f9
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffcc
push ebx
push esi
push edi
mov ebx, dword [ebp + 8]
mov eax, 0x4be573e4
call fcn.4be44284
mov word [ebp - 0x22], 0
mov edx, dword [ebx + 0x2e]
mov dword [ebp - 0x28], edx
mov cl, byte [ebx + 0x2c]
mov byte [ebp - 0x29], cl
mov al, byte [ebx + 0xa22]
mov byte [ebp - 0x2a], al
xor edx, edx
mov dword [ebp - 0x30], edx
xor ecx, ecx
mov dword [ebp - 0x34], ecx
mov word [ebp - 0x10], 8
push ebx
mov eax, dword [0x4be576f0]
push dword [eax + 0x3b]
call sub.KERNEL32.dll_TlsSetValue
cmp dword [ebx + 0x8a8], 0
je 0x4be31571
lea edx, [ebx + 0x8a8]
push edx
call sym.idapi32.dll_DbiDRClose
push 0x4be57688
lea ecx, [ebx + 0x8ac]
push ecx
call fcn.4be41cfc
add esp, 8
cmp dword [ebx + 0xb0], 0
jne 0x4be31583
cmp dword [ebx + 0xb4], 0
je 0x4be315d8
cmp dword [ebx + 0xb8], 0
jne 0x4be315d8
cmp dword [0x4be4f840], 0
jne 0x4be315a0
push dword [ebx + 0x880]
call sym.idapi32.dll_OsMuxUnlock
push ebx
call fcn.4be2e59c
cmp dword [0x4be4f840], 0
jne 0x4be315be
push 0
push dword [ebx + 0x880]
call sym.idapi32.dll_OsMuxLock
jmp 0x4be315d1
cmp dword [0x4be56a18], 0
je 0x4be315d1
push 0x4be56a18
call sym.idapi32.dll_OsMuxDelete
mov dword [ebp - 0x34], 1
xor esi, esi
jmp 0x4be3161b
movsx eax, si
cmp dword [ebx + eax*4 + 0xbc], 0
je 0x4be3161a
movsx edx, si
mov edi, dword [ebx + edx*4 + 0xbc]
push 2
push edi
mov eax, dword [edi + 0xe]
push eax
mov edx, dword [eax]
call dword [edx + 0x5c]
mov word [ebp - 0x22], ax
movsx ecx, si
xor eax, eax
mov dword [ebx + ecx*4 + 0xbc], eax
cmp word [ebx + 0x34], 0
je 0x4be3161a
dec word [ebx + 0x34]
inc esi
cmp word [ebx + 0x34], 0
ja 0x4be315dc
xor esi, esi
jmp 0x4be31665
movsx eax, si
mov edx, dword [ebx + 0x13c]
cmp dword [edx + eax*4], 0
je 0x4be31664
movsx ecx, si
mov eax, dword [ebx + 0x13c]
mov edx, dword [eax + ecx*4]
push edx
mov ecx, dword [edx]
call dword [ecx + 0x6c]
mov word [ebp - 0x22], ax
movsx eax, si
mov edx, dword [ebx + 0x13c]
xor ecx, ecx
mov dword [edx + eax*4], ecx
cmp word [ebx + 0x36], 0
je 0x4be31664
dec word [ebx + 0x36]
inc esi
cmp word [ebx + 0x36], 0
ja 0x4be31626
push dword [ebx + 0x13c]
call sym.idapi32.dll__OsFree
pop ecx
cmp byte [ebx + 0x4ae], 0
je 0x4be31689
push 0
push ebx
call fcn.4be32153
xor esi, esi
jmp 0x4be31711
movsx eax, si
mov edx, dword [ebx + 0x3c]
cmp dword [edx + eax*4], 0
je 0x4be31710
cmp dword [0x4be56de8], 0
je 0x4be316e7
push 0x4be57689
movsx ecx, si
mov eax, dword [ebx + 0x3c]
mov edx, dword [eax + ecx*4]
add edx, 0x32
push edx
call fcn.4be41cd0
add esp, 8
test eax, eax
je 0x4be316fa
push 0x4be57692
movsx ecx, si
mov eax, dword [ebx + 0x3c]
mov edx, dword [eax + ecx*4]
add edx, 0x32
push edx
call fcn.4be41cd0
add esp, 8
test eax, eax
jne 0x4be316e7
cmp dword [ebp - 0x34], 0
jne 0x4be316fa
movsx ecx, si
mov eax, dword [ebx + 0x3c]
mov edx, dword [eax + ecx*4]
push edx
mov ecx, dword [edx]
call dword [ecx + 0x2c]
mov word [ebp - 0x22], ax
movsx eax, si
mov edx, dword [ebx + 0x3c]
xor ecx, ecx
mov dword [edx + eax*4], ecx
cmp word [ebx + 0x32], 0
je 0x4be31710
dec word [ebx + 0x32]
inc esi
cmp word [ebx + 0x32], 0
jne 0x4be31690
cmp dword [ebx + 0x3c], 0
je 0x4be31730
push dword [ebx + 0x3c]
call sym.idapi32.dll__OsFreeShared
pop ecx
xor eax, eax
mov dword [ebx + 0x3c], eax
push 0x4be57699
call sym.idapi32.dll_CliGetDriver
mov esi, eax
test eax, eax
je 0x4be3174e
push ebx
push esi
mov edx, dword [esi]
call dword [edx + 0x80]
mov word [ebp - 0x22], ax
cmp dword [ebx + 0x6eb], 0
je 0x4be31768
push 0
push 0
push 0
push dword [ebx + 0x6eb]
call fcn.4be27dc3
cmp dword [ebx + 0x6ef], 0
je 0x4be31782
push 0
push 0
push 0
push dword [ebx + 0x6ef]
call fcn.4be27dc3
cmp dword [ebx + 0xa24], 0
je 0x4be3179c
push 0
push 0
push 0
push dword [ebx + 0xa24]
call fcn.4be27dc3
push 0
push 0
call sym.idapi32.dll_SysLock
mov dword [ebp - 0x30], 1
xor ecx, ecx
mov cl, byte [ebp - 0x29]
mov eax, dword [ebp - 0x28]
mov edx, dword [eax + 0x37]
xor eax, eax
mov dword [edx + ecx*4 - 4], eax
xor edx, edx
mov dl, byte [ebp - 0x2a]
mov ecx, dword [0x4be56de0]
mov eax, dword [ecx + 0x606]
mov byte [eax + edx - 1], 0
mov edx, dword [ebp - 0x28]
dec word [edx + 0x35]
lea ecx, [ebx + 0x880]
push ecx
call sym.idapi32.dll_OsMuxDelete
push ebx
call sym.idapi32.dll__OsFreeShared
pop ecx
push 0
mov eax, dword [0x4be576f0]
push dword [eax + 0x3b]
call sub.KERNEL32.dll_TlsSetValue
mov word [ebp - 0x10], 0
jmp 0x4be31811
cmp dword [ebp - 0x30], 0
je 0x4be31820
push 0
push 0
call sym.idapi32.dll_SysUnlock
mov ax, word [ebp - 0x22]
mov edx, dword [ebp - 0x20]
mov dword fs:[0], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4