Function at 0x47a970
Capabilities:
Get file size
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xfc
mov eax, dword [0x538a60]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
lea eax, [ebp - 0x58]
mov edi, ecx
push eax
mov bl, dl
push edi
mov byte [ebp - 0x59], bl
call fcn.004bf4a1
add esp, 8
test eax, eax
jns 0x47aada
test bl, bl
je 0x47aa64
cmp dword [0x561618], 0
je 0x47a9ca
push edi
push str.raw_open:_ignoring_stat_result_on_Windows_device__S_n
call fcn.004bdd06
add eax, 0x40
push eax
call fcn.00479b20
add esp, 0xc
push 0
push 0
push 3
push 0
push 3
push 1
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x47abd2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call fcn.00476ab0
mov eax, dword [0x56161c]
push eax
mov dword [ebp - 0x60], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x47aa30
push 0xc08
call fcn.004bb5d5
push 0xc08
mov esi, eax
push 0
push esi
call fcn.004c13c0
add esp, 0x10
push esi
push dword [ebp - 0x60]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [esi], 0x2000004
cmp ebx, 5
jne 0x47ab56
push edi
push str.raw_open:_file___S____access_denied
call fcn.004768f0
add esp, 8
lea eax, [ebx - 7]
or edx, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bae74
mov esp, ebp
pop ebp
ret
call fcn.00476ab0
mov ebx, dword [0x56161c]
push ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x47aaa0
push 0xc08
call fcn.004bb5d5
push 0xc08
mov esi, eax
push 0
push esi
call fcn.004c13c0
add esp, 0x10
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [esi], 0x2000005
call fcn.004bf304
push dword [eax]
call fcn.004bf268
push eax
push edi
push str.raw_open:_image___S_____s
call fcn.004768f0
add esp, 0x10
mov eax, 0xfffffffe
or edx, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bae74
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x52]
and eax, 0xf000
cmp eax, 0x4000
jne 0x47a9ca
call fcn.00476ab0
mov ebx, dword [0x56161c]
push ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x47ab29
push 0xc08
call fcn.004bb5d5
push 0xc08
mov esi, eax
push 0
push esi
call fcn.004c13c0
add esp, 0x10
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edi
push str.raw_open:_image___S____is_a_directory
mov dword [esi], 0x200000a
call fcn.004768f0
add esp, 8
mov eax, 0xfffffffd
or edx, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bae74
mov esp, ebp
pop ebp
ret
cmp ebx, 0x20
jne 0x47ab80
push edi
push str.raw_open:_file___S____sharing_violation
call fcn.004768f0
add esp, 8
lea eax, [ebx - 0x22]
or edx, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bae74
mov esp, ebp
pop ebp
ret
cmp ebx, 2
jne 0x47abaa
push edi
push str.raw_open:_file___S____file_not_found
call fcn.004768f0
add esp, 8
lea eax, [ebx - 4]
or edx, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bae74
mov esp, ebp
pop ebp
ret
push ebx
push edi
push str.raw_open:_file___S_____error__d_
call fcn.004768f0
add esp, 0xc
mov eax, 0xfffffffe
or edx, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bae74
mov esp, ebp
pop ebp
ret
cmp byte [ebp - 0x59], 0
jne 0x47ac24
lea eax, [ebp - 0x64]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
jne 0x47ac18
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call fcn.00476ab0
mov ecx, 0x2000004
call fcn.00476850
push esi
push edi
push str.raw_open:_file___S____GetFileSize:__d
call fcn.004768f0
or esi, 0xffffffff
add esp, 0xc
or edi, esi
jmp 0x47acc5
mov edi, dword [ebp - 0x64]
xor esi, esi
or esi, eax
jmp 0x47acc5
mov esi, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
lea eax, [ebp - 0x60]
push 0
push eax
push 0x90
lea eax, [ebp - 0xf8]
push eax
push 0
push 0
push 0x70048
push ebx
call esi
test eax, eax
jne 0x47acb9
push eax
lea eax, [ebp - 0x60]
push eax
push 0x18
lea eax, [ebp - 0x20]
push eax
push 0
push 0
push 0x70000
push ebx
call esi
test eax, eax
jne 0x47ac94
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call fcn.00476ab0
mov ecx, 0x2000004
call fcn.00476850
push esi
push edi
push str.raw_open:_file___S____DeviceIoControl:__d
call fcn.004768f0
or esi, 0xffffffff
add esp, 0xc
or edi, esi
jmp 0x47acc5
mov eax, dword [ebp - 0xc]
mul dword [ebp - 0x10]
push 0
push dword [ebp - 0x14]
push edx
push eax
call fcn.004c2160
push dword [ebp - 0x1c]
push dword [ebp - 0x20]
push edx
push eax
call fcn.004c2160
mov esi, eax
mov edi, edx
jmp 0x47acc5
mov esi, dword [ebp - 0xe8]
mov edi, dword [ebp - 0xe4]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov edx, edi
pop edi
mov eax, esi
xor ecx, ebp
pop esi
pop ebx
call fcn.004bae74
mov esp, ebp
pop ebp
ret