Function at 0x47a1d0
Capabilities:
Get thread local storage value
Read file on windows
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
mov edi, ecx
mov ebx, edx
mov dword [ebp - 0xc], ebx
mov eax, dword [edi + 0x4009c]
mov esi, dword [eax + ebx*4]
cmp esi, 0xffffffff
jne 0x47a341
mov eax, dword [0x561618]
test eax, eax
je 0x47a222
mov eax, dword [edi + 0x20]
push dword [eax + ebx*4]
push dword [edi + 0x40190]
push str.raw_read_segment:_opening_file_into_slot__d:__S_n
call fcn.004bdd06
add eax, 0x40
push eax
call fcn.00479b20
mov eax, dword [0x561618]
add esp, 0x10
mov esi, dword [edi + 0x40190]
add esi, 0x400a
shl esi, 4
add esi, edi
cmp dword [esi], 0
je 0x47a273
test eax, eax
je 0x47a25b
mov ecx, dword [esi + 4]
mov eax, dword [edi + 0x20]
push dword [eax + ecx*4]
push str.raw_read_segment:_closing_file__S_n
call fcn.004bdd06
add eax, 0x40
push eax
call fcn.00479b20
add esp, 0xc
push dword [esi]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esi + 4]
mov eax, dword [edi + 0x4009c]
mov dword [eax + ecx*4], 0xffffffff
mov eax, dword [edi + 0x20]
push 0
push 0
push 3
push 0
push 3
push 1
push dword [eax + ebx*4]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi], eax
cmp eax, 0xffffffff
jne 0x47a306
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
mov dword [esi], 0
call fcn.00476ab0
mov ebx, dword [0x56161c]
push ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x47a2dd
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 ecx, dword [ebp - 0xc]
push dword [ebp - 8]
mov dword [esi], 0x2000004
mov eax, dword [edi + 0x20]
push dword [eax + ecx*4]
push str.raw_read:_file___S_____d
call fcn.004768f0
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 4], ebx
mov dword [esi + 8], 0
mov dword [esi + 0xc], 0
mov ecx, dword [edi + 0x4009c]
mov eax, dword [edi + 0x40190]
mov dword [ecx + ebx*4], eax
inc dword [edi + 0x40190]
cmp dword [edi + 0x40190], 0xf
jne 0x47a34c
mov dword [edi + 0x40190], 0
jmp 0x47a34c
add esi, 0x400a
shl esi, 4
add esi, edi
mov ebx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
cmp dword [esi + 8], ebx
jne 0x47a35c
cmp dword [esi + 0xc], edx
je 0x47a3c8
push 0
lea eax, [ebp - 0x14]
mov dword [ebp - 0x18], ebx
push eax
push ebx
push dword [esi]
mov dword [ebp - 0x14], edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
jne 0x47a3bf
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x47a3bf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call fcn.00476ab0
mov ecx, 0x2000006
call fcn.00476850
mov eax, dword [edi + 0x20]
mov ecx, dword [ebp - 0xc]
push esi
push dword [ebp + 0x14]
push ebx
push dword [eax + ecx*4]
push str.raw_read:_file___S__offset__llu_seek____d
call fcn.004768f0
add esp, 0x14
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 0x14]
mov dword [esi + 8], ebx
mov dword [esi + 0xc], edx
cmp byte [edi + 0x40090], 0
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 8], ecx
je 0x47a3f8
xor eax, eax
mov dword [ebp - 4], ecx
add dword [ebp - 4], ebx
adc eax, edx
cmp eax, dword [edi + 0xc]
jl 0x47a3f8
jg 0x47a3f0
mov eax, dword [ebp - 4]
cmp eax, dword [edi + 8]
jbe 0x47a3f8
mov ecx, dword [edi + 8]
sub ecx, ebx
mov dword [ebp - 8], ecx
push 0
lea eax, [ebp - 0x1c]
push eax
push ecx
push dword [ebp + 8]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x47a487
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x14], eax
call fcn.00476ab0
mov eax, dword [0x56161c]
push eax
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x47a457
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 - 4]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push dword [ebp - 0x14]
mov ecx, dword [ebp - 0xc]
push dword [ebp - 8]
mov dword [esi], 0x2000007
push dword [ebp + 0x14]
mov eax, dword [edi + 0x20]
push ebx
push dword [eax + ecx*4]
push str.raw_read:_file___S__offset:__llu_read_len:__Iu____d
call fcn.004768f0
add esp, 0x18
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x40094]
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x14], ecx
test eax, eax
je 0x47a4ab
push ecx
push dword [ebp + 8]
mov ecx, dword [eax + 0x54]
push dword [ebp + 0x14]
push ebx
push eax
call ecx
mov ecx, dword [ebp - 0x14]
add esp, 0x14
mov eax, ecx
cdq
add dword [esi + 8], eax
mov eax, ecx
pop edi
adc dword [esi + 0xc], edx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret