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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
push edi
push 7
mov esi, ecx
push 0x490e3c
push esi
mov dword [ebp - 0xc], edx
call sub.MSVCRT.dll__strnicmp
add esp, 0xc
test eax, eax
je 0x4156e2
xor al, al
jmp 0x4159a4
add esi, 7
mov eax, esi
mov dword [ebp - 0x10], esi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4156ed
mov ebx, dword [sym.imp.KERNEL32.DLL_TlsGetValue]
sub eax, ecx
mov dword [ebp - 8], eax
cmp byte [0x4c6ce8], dl
je 0x41573c
mov eax, dword [0x4c6cec]
cmp eax, 0xffffffff
je 0x41573c
push eax
call ebx
mov esi, eax
test esi, esi
jne 0x41573e
push 0x20
call sub.MSVCRT.dll_malloc
pop ecx
push 8
mov esi, eax
pop ecx
xor eax, eax
mov edi, esi
push esi
rep stosd dword es:[edi], eax
push dword [0x4c6cec]
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
jmp 0x41573e
xor esi, esi
mov eax, dword [ebp - 8]
inc eax
mov dword [esi + 0x14], eax
cmp byte [0x4c6ce8], 0
mov esi, dword [0x4c6cec]
je 0x41578c
cmp esi, 0xffffffff
je 0x41578c
push esi
call ebx
mov esi, eax
test esi, esi
jne 0x415782
push 0x20
call sub.MSVCRT.dll_malloc
pop ecx
push 8
mov esi, eax
pop ecx
xor eax, eax
mov edi, esi
push esi
rep stosd dword es:[edi], eax
push dword [0x4c6cec]
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
mov eax, esi
mov esi, dword [0x4c6cec]
jmp 0x41578e
xor eax, eax
mov eax, dword [eax + 0x14]
call section..text
cmp byte [0x4c6ce8], 0
mov dword [ebp - 8], esp
je 0x4157d2
cmp esi, 0xffffffff
je 0x4157d2
push esi
call ebx
mov esi, eax
test esi, esi
jne 0x4157d4
push 0x20
call sub.MSVCRT.dll_malloc
pop ecx
push 8
mov esi, eax
pop ecx
xor eax, eax
mov edi, esi
push esi
rep stosd dword es:[edi], eax
push dword [0x4c6cec]
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
jmp 0x4157d4
xor esi, esi
mov eax, dword [ebp - 8]
mov dword [esi + 0x18], eax
cmp byte [0x4c6ce8], 0
mov eax, dword [0x4c6cec]
je 0x415820
cmp eax, 0xffffffff
je 0x415820
push eax
call ebx
mov esi, eax
test esi, esi
jne 0x415816
push 0x20
call sub.MSVCRT.dll_malloc
pop ecx
push 8
mov esi, eax
pop ecx
xor eax, eax
mov edi, esi
push esi
rep stosd dword es:[edi], eax
push dword [0x4c6cec]
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
mov eax, dword [0x4c6cec]
mov dword [ebp - 8], esi
jmp 0x415824
and dword [ebp - 8], 0
cmp byte [0x4c6ce8], 0
je 0x41585f
cmp eax, 0xffffffff
je 0x41585f
push eax
call ebx
mov esi, eax
test esi, esi
jne 0x41585b
push 0x20
call sub.MSVCRT.dll_malloc
pop ecx
push 8
mov esi, eax
pop ecx
xor eax, eax
mov edi, esi
push esi
rep stosd dword es:[edi], eax
push dword [0x4c6cec]
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
mov ecx, esi
jmp 0x415861
xor ecx, ecx
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x14]
mov ecx, dword [ecx + 0x18]
push eax
push dword [ebp - 0x10]
push ecx
call sub.MSVCRT.dll_memcpy
mov ecx, dword [ebp + 8]
add esp, 0xc
mov byte [ebp - 1], 0
test ecx, ecx
je 0x415885
and dword [ecx], 0
mov ebx, dword [ebp + 0xc]
lea edi, [eax + 1]
mov dl, 0x26
mov ecx, edi
call fcn.0043abad
mov dl, 0x3d
mov ecx, edi
mov dword [ebp + 0xc], eax
call fcn.0043abad
mov ecx, edi
mov esi, eax
call fcn.004435b5
test esi, esi
je 0x4158b4
mov ecx, esi
call fcn.004435b5
push 2
push 0x491fac
push edi
call sub.MSVCRT.dll__strnicmp
add esp, 0xc
test eax, eax
jne 0x41591a
test esi, esi
je 0x41591a
push 9
push str.urn:btih:
push esi
call sub.MSVCRT.dll__strnicmp
add esp, 0xc
test eax, eax
jne 0x41591a
add esi, 9
mov eax, esi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4158e8
sub eax, ecx
cmp eax, 0x20
jne 0x415905
mov ecx, dword [ebp - 0xc]
push eax
push esi
push 0x14
pop edx
call fcn.00443082
jmp 0x415915
cmp eax, 0x28
jne 0x415988
mov ecx, dword [ebp - 0xc]
push eax
mov edx, esi
call fcn.0041485d
mov byte [ebp - 1], al
jmp 0x415988
cmp dword [ebp + 8], 0
je 0x415946
push 2
push 0x491f9c
push edi
call sub.MSVCRT.dll__strnicmp
add esp, 0xc
test eax, eax
jne 0x415946
test esi, esi
je 0x415988
mov ecx, esi
call fcn.00444cbc
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
jmp 0x415988
test ebx, ebx
je 0x415988
push 2
push 0x491f98
push edi
call sub.MSVCRT.dll__strnicmp
add esp, 0xc
test eax, eax
jne 0x415988
test esi, esi
je 0x415988
mov ecx, esi
call fcn.00444cbc
mov esi, eax
mov eax, dword [ebx + 8]
cmp eax, dword [ebx + 4]
jb 0x41597a
mov ecx, ebx
call fcn.0040840e
mov eax, dword [ebx + 8]
lea ecx, [eax + 1]
mov dword [ebx + 8], ecx
mov ecx, dword [ebx]
mov dword [ecx + eax*4], esi
mov edi, dword [ebp + 0xc]
test edi, edi
jne 0x41588b
cmp byte [ebp - 1], 0
jne 0x4159a1
mov ecx, dword [ebp + 8]
call fcn.0043b306
mov al, byte [ebp - 1]
lea esp, [ebp - 0x1c]
pop edi
pop esi
pop ebx
leave
ret 8