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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
mov esi, ecx
push edi
mov eax, dword [esi + 0x50]
shl eax, 3
cmp byte [esi + 0x140], 1
jne 0x481846
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esi + 0x144], 0
jne 0x4818b1
call fcn.00476ab0
mov edi, dword [0x56161c]
push edi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x48188e
push 0xc08
call fcn.004bb5d5
add esp, 4
mov esi, eax
push 0xc08
push 0
push esi
call fcn.004c13c0
add esp, 0xc
push esi
push edi
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push dword [ebp + 0xc]
mov dword [esi], 0x8000006
push dword [ebp + 8]
push str.is_clustalloc:_Bitmap_pointer_is_null:__llu_n
call fcn.004768f0
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
cmp edi, dword [esi + 0x44]
jb 0x4818e9
ja 0x4818c3
cmp ecx, dword [esi + 0x40]
jbe 0x4818e9
call fcn.00476ab0
mov ecx, 0x8000009
call fcn.00476850
push str.is_clustalloc:_cluster_too_large
call fcn.004768f0
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cdq
push edx
push eax
push edi
push ecx
call fcn.004c4c60
mov dword [ebp - 8], eax
mov edi, ecx
lea eax, [esi + 0x148]
mov dword [ebp - 0x14], ebx
mov ebx, edx
mov dword [ebp - 0x1c], edi
push eax
mov dword [ebp - 0x14], ebx
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 8]
cmp eax, dword [esi + 0x168]
jne 0x48192a
cmp ebx, dword [esi + 0x16c]
je 0x481a80
mov edi, eax
mov eax, dword [esi + 0x144]
test eax, eax
je 0x481950
mov edx, dword [eax + 0x1c]
mov ecx, dword [eax + 0x18]
cmp edx, ebx
ja 0x4819bb
jb 0x481946
cmp ecx, edi
ja 0x4819bb
mov eax, dword [eax]
sub edi, ecx
sbb ebx, edx
test eax, eax
jne 0x481936
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.00476ab0
mov eax, dword [0x56161c]
push eax
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x48199c
push 0xc08
call fcn.004bb5d5
add esp, 4
mov esi, eax
push 0xc08
push 0
push esi
call fcn.004c13c0
add esp, 0xc
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push ebx
push edi
push str.is_clustalloc:_cluster_not_found_in_bitmap:__llu
mov dword [esi], 0x8000007
call fcn.004768f0
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [eax + 0x10]
mov edx, dword [eax + 0x14]
add ecx, edi
mov eax, ecx
mov dword [ebp - 0x10], ecx
adc edx, ebx
or eax, edx
mov dword [ebp - 0xc], edx
je 0x481950
cmp edx, dword [esi + 0x44]
jb 0x481a16
ja 0x4819e1
cmp ecx, dword [esi + 0x40]
jbe 0x481a16
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.00476ab0
mov ecx, 0x8000007
call fcn.00476850
push dword [ebp - 0xc]
push dword [ebp - 0x10]
push str.is_clustalloc:_Cluster_in_bitmap_too_large_for_image:__llu
call fcn.004768f0
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push dword [esi + 0x50]
mov eax, dword [ebp - 8]
push edx
mov edx, dword [esi + 0x160]
mov dword [esi + 0x168], eax
mov eax, dword [ebp - 0x14]
push ecx
mov ecx, esi
mov dword [esi + 0x16c], eax
call fcn.004912b0
mov edi, eax
add esp, 0xc
cmp edi, dword [esi + 0x50]
je 0x481a7d
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test edi, edi
js 0x481a60
call fcn.00476ab0
mov ecx, 0x8000004
call fcn.00476850
push dword [ebp - 0xc]
push dword [ebp - 0x10]
push str.is_clustalloc:_Error_reading_bitmap_at__llu
call fcn.00476950
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x1c]
mov esi, dword [esi + 0x160]
mov eax, edi
cdq
and edx, 7
add eax, edx
sar eax, 3
and edi, reloc.OLEAUT32.dll_VariantInit
jns 0x481a9e
dec edi
or edi, 0xfffffff8
inc edi
push dword [ebp - 4]
mov ecx, edi
mov edx, 1
shl edx, cl
test byte [eax + esi], dl
setne bl
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
movsx eax, bl
pop ebx
mov esp, ebp
pop ebp
ret