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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
mov esi, dword [ebp + 8]
mov ebx, edx
push edi
mov edi, ecx
mov ecx, dword [ebp + 0xc]
mov edx, dword [edi + 0x417c]
mov eax, dword [edi + 0x4178]
cmp ecx, edx
jb 0xfa780
ja 0xfa6b1
cmp esi, eax
jbe 0xfa780
add eax, 1
adc edx, 0
cmp esi, eax
jne 0xfa720
cmp ecx, edx
jne 0xfa720
push dword [edi + 0x4174]
movzx eax, byte [edi + 0x4194]
push dword [edi + 0x4170]
cdq
push edx
push eax
call fcn.00171bf0
add eax, dword [edi + 0x4168]
adc edx, dword [edi + 0x416c]
add eax, 0xffffffff
adc edx, 0xffffffff
cmp eax, dword [edi + 0x40]
jne 0xfa6f6
cmp edx, dword [edi + 0x44]
je 0xfa720
cmp dword [0x1aa220], 0
je 0xfa717
push str.fatfs_getFAT:_Ignoring_request_for_non_clustered_sector_n
push 2
call fcn.00158e14
add esp, 4
push eax
call fcn.000f0dc0
add esp, 8
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.000ee7f0
mov ebx, dword [0x1aa224]
push ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0xfa75f
push 0xc08
call fcn.0015c8ae
add esp, 4
mov edi, eax
push 0xc08
push 0
push edi
call fcn.00153d90
add esp, 0xc
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, dword [ebp + 0xc]
push eax
push esi
push str.fatfs_getFAT:_invalid_cluster_address:__llu
mov dword [edi], 0x8000006
call fcn.000ee5f0
add esp, 0xc
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x68]
add eax, 0xfffffffe
cmp eax, 8
ja case.0xfa796.3
movzx eax, byte [eax + 0xfad20]
jmp dword [eax*4 + 0xfad10]
mov eax, esi
and eax, 0xf000
or eax, 0
je 0xfa7d3
call fcn.000ee7f0
mov ecx, 0x8000006
call fcn.000ee550
mov eax, dword [ebp + 0xc]
push eax
push esi
push str.fatfs_getFAT:_TSK_FS_TYPE_FAT12_Cluster__llu_too_large
call fcn.000ee5f0
add esp, 0xc
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, ecx
mov eax, esi
shrd eax, edx, 1
shr edx, 1
add eax, esi
mov dword [ebp - 0x14], eax
adc edx, ecx
movzx ecx, word [edi + 0x4192]
mov dword [ebp - 0x10], edx
call fcn.00171dc0
add eax, dword [edi + 0x4158]
mov ecx, edx
mov dword [ebp - 4], eax
lea eax, [edi + 0x118]
adc ecx, dword [edi + 0x415c]
push eax
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [ebp - 8]
mov ecx, edi
push dword [ebp - 4]
call fcn.000fa3b0
add esp, 8
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
jne 0xfa842
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 8]
add eax, 0x826
lea ecx, [edi + eax*8]
mov eax, dword [ebp - 4]
sub eax, dword [ecx]
mov dword [ebp - 0x24], ecx
sbb edx, dword [ecx + 4]
movzx ecx, word [edi + 0x4192]
call fcn.00171da0
mov dword [ebp - 0x1c], eax
movzx eax, word [edi + 0x4190]
mov dword [ebp - 0x20], edx
cdq
push edx
push eax
push dword [ebp - 0x10]
push dword [ebp - 0x14]
call fcn.00171fe0
mov ecx, dword [ebp - 0x1c]
add ecx, eax
mov eax, dword [ebp - 0x20]
adc eax, edx
cmp ecx, 0xfff
jne 0xfa936
test eax, eax
jne 0xfa936
mov esi, dword [ebp - 0x18]
push 0x1000
push dword [ebp - 8]
shl esi, 0xc
push dword [ebp - 4]
push eax
push dword [edi + 0x50]
call fcn.00171bf0
push edx
lea edx, [esi + 0x130]
mov ecx, edi
push eax
add edx, edi
call fcn.00135350
mov esi, eax
add esp, 0xc
cmp esi, 0x1000
je 0xfa90e
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
js 0xfa8f2
call fcn.000ee7f0
mov ecx, 0x8000004
call fcn.000ee550
push dword [ebp - 8]
push dword [ebp - 4]
push str.fatfs_getFAT:_TSK_FS_TYPE_FAT12_FAT_overlap:__llu
call fcn.000ee650
add esp, 0xc
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 4]
mov dword [ecx], eax
mov eax, dword [ebp - 8]
mov dword [ecx + 4], eax
movzx eax, word [edi + 0x4190]
cdq
push edx
push eax
push dword [ebp - 0x10]
push dword [ebp - 0x14]
call fcn.00171fe0
mov esi, dword [ebp + 8]
mov ecx, eax
mov edx, dword [ebp - 0x18]
mov eax, 0x100
shl edx, 0xc
add edx, ecx
add edx, edi
cmp dword [edi + 0x98], 1
jne 0xfa961
movzx ecx, byte [edx + 0x131]
imul ecx, eax
movzx eax, byte [edx + 0x130]
jmp 0xfa972
movzx ecx, byte [edx + 0x130]
imul ecx, eax
movzx eax, byte [edx + 0x131]
add cx, ax
movzx eax, cx
mov dword [ebp - 8], eax
mov dword [ebp - 0x18], eax
lea eax, [edi + 0x118]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
and eax, 1
or eax, 0
je 0xfa99f
shr word [ebp - 8], 4
mov eax, dword [ebp - 8]
jmp 0xfa9a2
mov eax, dword [ebp - 0x18]
and eax, 0xfff
cdq
mov ecx, edx
mov dword [ebx], eax
mov dword [ebx + 4], edx
cmp ecx, dword [edi + 0x417c]
jb 0xfaa03
ja 0xfa9c1
cmp eax, dword [edi + 0x4178]
jbe 0xfaa03
test ecx, ecx
ja 0xfaa03
jb 0xfa9ce
cmp eax, 0xff7
jae 0xfaa03
cmp dword [0x1aa220], 0
je 0xfa9f6
push ecx
push eax
mov eax, dword [ebp + 0xc]
push eax
push esi
push str.fatfs_getFAT:_TSK_FS_TYPE_FAT12_cluster___llu__too_large___llu____resetting_n
push 2
call fcn.00158e14
add esp, 4
push eax
call fcn.000f0dc0
add esp, 0x18
mov dword [ebx], 0
mov dword [ebx + 4], 0
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, ecx
mov eax, esi
movzx ecx, word [edi + 0x4192]
shld edx, eax, 1
add eax, eax
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x20], eax
call fcn.00171dc0
add eax, dword [edi + 0x4158]
lea esi, [edi + 0x118]
mov ecx, edx
mov dword [ebp - 0x18], eax
adc ecx, dword [edi + 0x415c]
push esi
mov dword [ebp - 0x14], ecx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [ebp - 0x14]
mov ecx, edi
push dword [ebp - 0x18]
call fcn.000fa3b0
mov ecx, eax
add esp, 8
mov dword [ebp - 0x1c], ecx
cmp ecx, 0xffffffff
jne 0xfaa73
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x18]
sub eax, dword [edi + ecx*8 + 0x4130]
mov edx, dword [ebp - 0x14]
sbb edx, dword [edi + ecx*8 + 0x4134]
movzx ecx, word [edi + 0x4192]
call fcn.00171da0
mov esi, eax
movzx eax, word [edi + 0x4190]
cdq
push edx
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x20]
call fcn.00171fe0
mov ecx, dword [ebp - 0x1c]
add eax, edi
shl ecx, 0xc
add eax, esi
add eax, ecx
cmp dword [edi + 0x98], 1
jne 0xfaacf
movzx ecx, byte [eax + 0x131]
movzx eax, byte [eax + 0x130]
jmp 0xfaadd
movzx ecx, byte [eax + 0x130]
movzx eax, byte [eax + 0x131]
shl ecx, 8
add ecx, eax
movzx eax, cx
cdq
mov dword [ebx], eax
lea eax, [edi + 0x118]
push eax
mov dword [ebx + 4], edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebx + 4]
mov eax, dword [ebx]
cmp ecx, dword [edi + 0x417c]
jb 0xfab52
ja 0xfab0f
cmp eax, dword [edi + 0x4178]
jbe 0xfab52
test ecx, ecx
ja 0xfab52
jb 0xfab1c
cmp eax, 0xfff7
jae 0xfab52
cmp dword [0x1aa220], 0
je 0xfab45
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
push eax
push str.fatfs_getFAT:_contents_of_TSK_FS_TYPE_FAT16_entry__llu_too_large___resetting_n
push 2
call fcn.00158e14
add esp, 4
push eax
call fcn.000f0dc0
add esp, 0x10
mov dword [ebx], 0
mov dword [ebx + 4], 0
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, ecx
mov eax, esi
movzx ecx, word [edi + 0x4192]
shld edx, eax, 2
shl eax, 2
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x20], eax
call fcn.00171dc0
add eax, dword [edi + 0x4158]
lea esi, [edi + 0x118]
mov ecx, edx
mov dword [ebp - 0x18], eax
adc ecx, dword [edi + 0x415c]
push esi
mov dword [ebp - 0x14], ecx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [ebp - 0x14]
mov ecx, edi
push dword [ebp - 0x18]
call fcn.000fa3b0
mov ecx, eax
add esp, 8
mov dword [ebp - 0x1c], ecx
cmp ecx, 0xffffffff
je 0xfaa63
mov eax, dword [ebp - 0x18]
sub eax, dword [edi + ecx*8 + 0x4130]
mov edx, dword [ebp - 0x14]
sbb edx, dword [edi + ecx*8 + 0x4134]
movzx ecx, word [edi + 0x4192]
call fcn.00171da0
mov esi, eax
movzx eax, word [edi + 0x4190]
cdq
push edx
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x20]
call fcn.00171fe0
mov ecx, dword [ebp - 0x1c]
shl ecx, 0xc
add ecx, 0x130
lea edx, [edi + eax]
add edx, esi
add edx, ecx
cmp dword [edi + 0x98], 1
jne 0xfac25
movzx ecx, byte [edx + 3]
movzx eax, byte [edx + 2]
shl ecx, 8
add ecx, eax
movzx eax, byte [edx + 1]
shl ecx, 8
add ecx, eax
movzx eax, byte [edx]
jmp 0xfac3e
movzx ecx, byte [edx]
movzx eax, byte [edx + 1]
shl ecx, 8
add ecx, eax
movzx eax, byte [edx + 2]
shl ecx, 8
add ecx, eax
movzx eax, byte [edx + 3]
shl ecx, 8
add ecx, eax
mov dword [ebx + 4], 0
lea eax, [edi + 0x118]
and ecx, 0xfffffff
push eax
mov dword [ebx], ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebx + 4]
mov eax, dword [ebx]
cmp ecx, dword [edi + 0x417c]
jb 0xfab52
ja 0xfac7e
cmp eax, dword [edi + 0x4178]
jbe 0xfab52
test ecx, ecx
ja 0xfab52
jb 0xfac93
cmp eax, 0xffffff7
jae 0xfab52
cmp dword [0x1aa220], 0
je 0xfab45
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
push eax
push str.fatfs_getFAT:_contents_of_entry__llu_too
jmp 0xfab32
call fcn.000ee7f0
mov ebx, dword [0x1aa224]
push ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0xfacf1
push 0xc08
call fcn.0015c8ae
add esp, 4
mov esi, eax
push 0xc08
push 0
push esi
call fcn.00153d90
add esp, 0xc
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [esi], 0x8000006
push dword [edi + 0x68]
push 0x191014
call fcn.000ee5f0
add esp, 8
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret