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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
xorps xmm0, xmm0
mov dword [ebp - 0xc], edx
push edi
mov ebx, ecx
movlpd qword [ebp - 0x1c], xmm0
call fcn.000ee7f0
test byte [ebp - 0xc], 0xe
jne 0xfa0f1
call fcn.000ee7f0
mov edi, dword [0x1aa224]
push edi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0xfa0d0
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 edi
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push str.fatfs_open
push str._s:_Invalid_FS_Type
mov dword [esi], 0x8000006
call fcn.000ee5f0
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, 0x4410
call fcn.000f2310
mov edi, eax
test edi, edi
je 0xfa399
mov esi, dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea ecx, [edi + 0x9c]
push ecx
call esi
lea ecx, [edi + 0xb8]
push ecx
call esi
mov eax, dword [ebp - 0xc]
lea edx, [edi + 0x41dc]
mov dword [edi + 0xb4], 0
xor esi, esi
mov dword [edi + 0x68], eax
mov dword [edi + 4], ebx
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
mov eax, dword [ebx + 0x10]
mov ebx, dword [ebp - 0x1c]
mov dword [edi + 0x54], eax
mov eax, dword [ebp - 0x18]
mov dword [edi + 0x60], 0
mov dword [edi + 0x64], 0
mov dword [edi], 0x10101010
mov dword [ebp - 0x10], 0xaa55
mov dword [ebp - 8], eax
cmp esi, 1
jne 0xfa182
mov eax, dword [edi + 4]
mov eax, dword [eax + 0x10]
lea ebx, [eax + eax*2]
add ebx, ebx
jmp 0xfa193
cmp esi, 2
jne 0xfa198
mov eax, dword [edi + 4]
mov eax, dword [eax + 0x10]
lea ebx, [eax + eax*2]
shl ebx, 2
xor eax, eax
mov dword [ebp - 8], eax
push 0x200
push eax
push ebx
mov ecx, edi
call fcn.00135350
add esp, 0xc
cmp eax, 0x200
jne 0xfa337
movzx eax, byte [edi + 0x43db]
lea edx, [edi + 0x41dc]
movzx ecx, byte [edx + 0x1fe]
mov dword [ebp - 0x18], eax
shl eax, 8
add eax, ecx
cmp ax, word [ebp - 0x10]
je 0xfa2b8
shl ecx, 8
mov eax, 0xaa55
add ecx, dword [ebp - 0x18]
cmp cx, ax
je 0xfa2ac
movzx ecx, byte [edx + 0x1ff]
mov eax, 0x100
imul ecx, eax
movzx eax, byte [edx + 0x1fe]
add cx, ax
jne 0xfa220
cmp esi, 3
jge 0xfa220
inc esi
cmp esi, 3
jge 0xfa307
mov eax, dword [ebp - 8]
jmp 0xfa170
call fcn.000ee7f0
mov ebx, dword [0x1aa224]
push ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0xfa25f
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]
push str.Not_a_FATFS_file_system__magic_
mov dword [esi], 0x800000a
call fcn.000ee5f0
add esp, 4
cmp dword [0x1aa220], 0
je 0xfa392
push str.fatfs_open
push str._s:_Incorrect_FATFS_magic_n
push 2
call fcn.00158e14
add esp, 4
push eax
call fcn.000a3930
add esp, 0xc
mov ecx, edi
call fcn.000eee80
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [edi + 0x98], 2
jmp 0xfa2c2
mov dword [edi + 0x98], 1
cmp dword [ebp - 8], 0
jl 0xfa2d5
jg 0xfa2ce
test ebx, ebx
je 0xfa2d5
mov eax, 1
jmp 0xfa2d7
xor eax, eax
mov dword [edi + 0x43dc], eax
test eax, eax
je 0xfa307
cmp dword [0x1aa220], 0
je 0xfa307
push str.fatfs_open
push str._s:_Using_backup_boot_sector_n
push 2
call fcn.00158e14
add esp, 4
push eax
call fcn.000a3930
add esp, 0xc
cmp dword [ebp - 0xc], 0xe
jne 0xfa323
mov ecx, edi
call fcn.001382f0
test al, al
je 0xfa32e
mov ecx, edi
call fcn.001365e0
test al, al
je 0xfa32e
mov ecx, edi
call fcn.001382f0
test al, al
jne 0xfa392
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test eax, eax
js 0xfa380
call fcn.000ee7f0
mov ebx, dword [0x1aa224]
push ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0xfa37a
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], 0x8000004
push str.fatfs_open
push str._s:_boot_sector
call fcn.000ee650
add esp, 8
mov ecx, edi
call fcn.000eee80
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret