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

Disassembly:
sub esp, 0x28
mov eax, dword [0x6c24b8]
push ebx
push ebp
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebp, eax
xor esi, esi
cmp ebp, esi
mov dword [esp + 0x24], ebp
je 0x47bf61
lea ecx, [ebp + 0x14fac]
push ecx
call fcn.0047b570
push eax
call fcn.0047b4f0
mov ecx, dword [ebp + 0x40]
add esp, 8
cmp ecx, esi
jne 0x47bcb3
cmp eax, esi
jne 0x47bcb3
mov ebx, dword [ebp + 0x16810]
mov edi, dword [ebp + 0x16814]
sub ebx, 0x10
mov dword [esp + 0x28], 0x10
sbb edi, esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x14], 3
js 0x47bf61
jg 0x47bb70
cmp ebx, esi
jb 0x47bf61
mov eax, dword [esp + 0x2c]
test eax, eax
jg 0x47bf61
jl 0x47bb8c
cmp dword [esp + 0x28], 0x19000
ja 0x47bf61
mov edx, dword [ebp + 0x3d10]
push 0
push edi
push ebx
push edx
call fcn.00487a80
add esp, 0x10
call fcn.004825d0
mov byte [esp + 0x13], al
call fcn.004825d0
mov byte [esp + 0x12], al
call fcn.004825d0
mov ecx, dword [esp + 0x14]
mov esi, 0x12
sub esi, ecx
mov byte [esp + 0x3c], al
test esi, esi
jle 0x47bc00
call fcn.004825d0
cmp byte [esp + 0x13], 0x50
jne 0x47bbe7
cmp byte [esp + 0x12], 0x4b
jne 0x47bbe7
cmp byte [esp + 0x3c], 6
jne 0x47bbe7
cmp al, 7
je 0x47bc5b
mov cl, byte [esp + 0x12]
mov dl, byte [esp + 0x3c]
dec esi
mov byte [esp + 0x13], cl
test esi, esi
mov byte [esp + 0x12], dl
mov byte [esp + 0x3c], al
jg 0x47bbc9
test edi, edi
jl 0x47bf61
jg 0x47bc12
test ebx, ebx
jbe 0x47bf61
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
mov ebx, dword [ebp + 0x16810]
mov edi, dword [ebp + 0x16814]
add eax, 0x10
mov dword [esp + 0x14], 0
adc ecx, 0
sub ebx, eax
sbb edi, ecx
mov dword [esp + 0x28], eax
test edi, edi
mov dword [esp + 0x2c], ecx
jg 0x47bb70
jl 0x47bc52
test ebx, ebx
jae 0x47bb70
xor ebx, ebx
xor edi, edi
jmp 0x47bb70
mov ecx, dword [ebp + 0x3d10]
lea eax, [esp + 0x18]
push 0
lea esi, [ebp + 0x4e62]
push eax
push 0x10
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47bf61
cmp dword [esp + 0x18], 0x10
jne 0x47bf61
mov ecx, dword [ebp + 0x4e6e]
mov eax, dword [ebp + 0x4e66]
mov edx, dword [ebp + 0x4e6a]
mov dword [ebp + 0x4e74], ecx
mov ecx, dword [esi]
pop edi
mov dword [ebp + 0x4e78], ecx
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
mov eax, dword [ebp + 0x16814]
mov ecx, dword [ebp + 0x16810]
cmp eax, esi
jg 0x47bcdb
jl 0x47bccd
cmp ecx, 0x19000
jae 0x47bcdb
mov esi, ecx
mov edi, eax
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], edi
jmp 0x47bcef
mov dword [esp + 0x30], 0x19000
mov dword [esp + 0x34], esi
mov esi, dword [esp + 0x30]
mov edi, dword [esp + 0x34]
mov edx, dword [ebp + 0x3d10]
sub ecx, esi
sbb eax, edi
push 0
push eax
push ecx
push edx
call fcn.00487a80
add esp, 0x10
push esi
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
mov dword [esp + 0x1c], eax
je 0x47bf7a
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x20], ebx
je 0x47bf6f
mov ecx, dword [ebp + 0x3d10]
lea eax, [esp + 0x18]
push 0
push eax
push esi
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47bf4f
cmp dword [esp + 0x18], esi
jne 0x47bf4f
mov edx, 0x10
mov ecx, esi
xor eax, eax
sub ecx, edx
mov ebp, edi
mov dword [esp + 0x28], edx
sbb ebp, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x14], 3
js 0x47bf0c
jg 0x47bd8d
test ecx, ecx
jb 0x47bf0c
jmp 0x47bd8d
mov ebx, dword [esp + 0x20]
cmp eax, dword [esp + 0x34]
jg 0x47bf0c
jl 0x47bda1
cmp edx, esi
ja 0x47bf0c
mov dl, byte [ecx + ebx]
mov esi, ecx
add esi, 1
mov edi, ebp
adc edi, 0
mov al, byte [esi + ebx]
mov ebx, dword [esp + 0x14]
mov byte [esp + 0x12], al
add esi, 1
mov eax, 0x10
adc edi, 0
sub eax, ebx
test eax, eax
jle 0x47be00
mov ebx, dword [esp + 0x20]
add esi, 1
adc edi, 0
cmp dl, 0x50
mov bl, byte [esi + ebx - 1]
jne 0x47bdf3
cmp byte [esp + 0x12], 0x4b
jne 0x47bdf3
cmp bl, 6
jne 0x47bdf3
mov edx, dword [esp + 0x20]
cmp byte [esi + edx], 7
je 0x47be59
mov dl, byte [esp + 0x12]
dec eax
test eax, eax
mov byte [esp + 0x12], bl
jg 0x47bdca
test ebp, ebp
jl 0x47bf4f
jg 0x47be12
test ecx, ecx
jbe 0x47bf4f
mov edx, dword [esp + 0x28]
mov esi, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
mov ebp, dword [esp + 0x34]
add edx, 0x10
mov ecx, esi
adc eax, 0
sub ecx, edx
sbb ebp, eax
mov dword [esp + 0x28], edx
test ebp, ebp
mov dword [esp + 0x2c], eax
mov dword [esp + 0x14], 0
jg 0x47bd89
jl 0x47be50
test ecx, ecx
jae 0x47bd89
xor ecx, ecx
xor ebp, ebp
jmp 0x47bd89
mov ebx, dword [esp + 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x24]
mov ebp, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
push 0
mov ebx, dword [eax + 0x16810]
mov ecx, dword [eax + 0x3d10]
sub ebx, ebp
mov ebp, dword [eax + 0x16814]
sbb ebp, edx
add ebx, esi
adc ebp, edi
add ebx, 1
adc ebp, 0
push ebp
push ebx
push ecx
call fcn.00487a80
add esp, 0x10
cmp eax, ebx
jne 0x47bf61
cmp edx, ebp
jne 0x47bf61
mov esi, dword [esp + 0x24]
lea edx, [esp + 0x18]
push 0
push edx
mov eax, dword [esi + 0x3d10]
lea edi, [esi + 0x4e62]
push 0x10
push edi
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47bf61
cmp dword [esp + 0x18], 0x10
jne 0x47bf61
mov ecx, dword [esi + 0x4e6e]
mov eax, dword [esi + 0x4e66]
mov edx, dword [esi + 0x4e6a]
mov dword [esi + 0x4e74], ecx
mov ecx, dword [edi]
pop edi
mov dword [esi + 0x4e78], ecx
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
mov esi, dword [esp + 0x1c]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x47bf3f
call fcn.0047b600
test eax, eax
je 0x47bf3f
pop edi
pop esi
pop ebp
mov eax, 0xfffffffd
or edx, 0xffffffff
pop ebx
add esp, 0x28
ret
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
or edx, 0xffffffff
pop ebx
add esp, 0x28
ret
mov esi, dword [esp + 0x1c]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
or eax, 0xffffffff
pop ebp
or edx, 0xffffffff
pop ebx
add esp, 0x28
ret
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
pop ebp
mov eax, 0xfffffffc
or edx, 0xffffffff
pop ebx
add esp, 0x28
ret