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

Disassembly:
sub esp, 0x2c
mov eax, dword [0x6c24b8]
push ebx
push ebp
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
xor esi, esi
cmp ebx, esi
mov dword [esp + 0x20], ebx
jne 0x47b69d
pop edi
pop esi
or eax, 0xffffffff
pop ebp
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret
lea ecx, [ebx + 0x14fac]
push ecx
call fcn.0047b570
push eax
call fcn.0047b4f0
mov ecx, dword [ebx + 0x40]
add esp, 8
cmp ecx, esi
jne 0x47b808
cmp eax, esi
jne 0x47b808
mov ebp, dword [ebx + 0x16810]
mov edi, dword [ebx + 0x16814]
sub ebp, 0x12
mov dword [esp + 0x24], 0x12
sbb edi, esi
mov dword [esp + 0x28], esi
mov dword [esp + 0x18], 3
js 0x47babc
jg 0x47b6fa
cmp ebp, esi
jb 0x47babc
mov eax, dword [esp + 0x28]
test eax, eax
jg 0x47babc
jl 0x47b716
cmp dword [esp + 0x24], 0x1002b
ja 0x47babc
mov edx, dword [ebx + 0x3d10]
push 0
push edi
push ebp
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 + 0x18]
mov esi, 0x12
sub esi, ecx
mov byte [esp + 0x40], al
test esi, esi
jle 0x47b78a
call fcn.004825d0
cmp byte [esp + 0x13], 0x50
jne 0x47b771
cmp byte [esp + 0x12], 0x4b
jne 0x47b771
cmp byte [esp + 0x40], 5
jne 0x47b771
cmp al, 6
je 0x47b7e5
mov cl, byte [esp + 0x12]
mov dl, byte [esp + 0x40]
dec esi
mov byte [esp + 0x13], cl
test esi, esi
mov byte [esp + 0x12], dl
mov byte [esp + 0x40], al
jg 0x47b753
test edi, edi
jl 0x47babc
jg 0x47b79c
test ebp, ebp
jbe 0x47babc
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov ebp, dword [ebx + 0x16810]
mov edi, dword [ebx + 0x16814]
add eax, 0x12
mov dword [esp + 0x18], 0
adc ecx, 0
sub ebp, eax
sbb edi, ecx
mov dword [esp + 0x24], eax
test edi, edi
mov dword [esp + 0x28], ecx
jg 0x47b6fa
jl 0x47b7dc
test ebp, ebp
jae 0x47b6fa
xor ebp, ebp
xor edi, edi
jmp 0x47b6fa
mov eax, dword [ebx + 0x3d10]
push 1
push 0
push 0
push eax
call fcn.00487a80
add esp, 0x10
sub eax, 4
sbb edx, 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov eax, dword [ebx + 0x16814]
mov ecx, dword [ebx + 0x16810]
cmp eax, esi
jg 0x47b82e
jl 0x47b822
cmp ecx, 0x1002b
jae 0x47b82e
mov esi, ecx
mov dword [esp + 0x30], eax
mov dword [esp + 0x2c], esi
jmp 0x47b83e
mov dword [esp + 0x2c], 0x1002b
mov dword [esp + 0x30], esi
mov esi, dword [esp + 0x2c]
mov edx, dword [esp + 0x30]
xor ebp, ebp
sub ecx, esi
push ebp
sbb eax, edx
push eax
push ecx
mov ecx, dword [ebx + 0x3d10]
push ecx
call fcn.00487a80
add esp, 0x10
push esi
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
cmp edi, ebp
mov dword [esp + 0x14], edi
je 0x47bad1
push edi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
cmp eax, ebp
mov dword [esp + 0x18], eax
je 0x47baca
lea edx, [esp + 0x1c]
push ebp
push edx
push esi
push eax
mov eax, dword [ebx + 0x3d10]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47baae
cmp dword [esp + 0x1c], esi
jne 0x47baae
mov ecx, dword [ebx + 0x16810]
mov eax, 0x16
cmp ecx, eax
mov dword [esp + 0x24], 0x12
mov dword [esp + 0x28], ebp
jne 0x47b8d6
cmp dword [ebx + 0x16814], ebp
jne 0x47b8d6
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x28]
mov ebp, esi
sub ebp, edx
mov ebx, 3
sbb eax, ecx
mov dword [esp + 0x38], eax
js 0x47ba6f
jg 0x47b90b
test ebp, ebp
jb 0x47ba6f
jmp 0x47b90b
mov edi, dword [esp + 0x14]
mov esi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x28]
cmp eax, ecx
jg 0x47ba6f
jl 0x47b927
cmp dword [esp + 0x24], esi
ja 0x47ba6f
mov edx, dword [esp + 0x18]
mov edi, dword [esp + 0x38]
mov esi, ebp
add esi, 1
mov cl, byte [edx + ebp]
adc edi, 0
mov al, byte [esi + edx]
add esi, 1
mov byte [esp + 0x12], al
mov eax, 0x12
adc edi, 0
sub eax, ebx
test eax, eax
jle 0x47b9a6
mov dl, byte [esi + edx]
mov bl, dl
mov edx, dword [esp + 0x18]
add esi, 1
adc edi, 0
cmp cl, 0x50
mov dl, byte [esi + edx]
jne 0x47b999
cmp byte [esp + 0x12], 0x4b
jne 0x47b999
movsx ecx, bl
dec ecx
je 0x47b987
sub ecx, 2
je 0x47b987
sub ecx, 2
jne 0x47b999
cmp dl, 6
je 0x47ba01
jmp 0x47b999
cmp dl, 2
je 0x47ba41
cmp dl, 4
je 0x47ba41
mov cl, byte [esp + 0x12]
dec eax
test eax, eax
mov byte [esp + 0x12], bl
jg 0x47b955
mov eax, dword [esp + 0x38]
test eax, eax
jl 0x47ba4f
jg 0x47b9bc
test ebp, ebp
jbe 0x47ba4f
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov ebp, dword [esp + 0x2c]
add eax, 0x12
adc ecx, 0
mov dword [esp + 0x24], eax
sub ebp, eax
mov eax, dword [esp + 0x30]
sbb eax, ecx
xor ebx, ebx
test eax, eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x38], eax
jg 0x47b903
jl 0x47b9f6
test ebp, ebp
jae 0x47b903
xor ebp, ebp
mov dword [esp + 0x38], ebp
jmp 0x47b903
mov ebx, dword [esp + 0x14]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x2c]
mov eax, dword [ecx + 0x16810]
sub eax, edx
mov edx, dword [ecx + 0x16814]
mov ecx, dword [esp + 0x30]
sbb edx, ecx
add eax, esi
adc edx, edi
pop edi
sub eax, 3
pop esi
pop ebp
pop ebx
sbb edx, 0
add esp, 0x2c
ret
mov esi, dword [esp + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
jmp 0x47ba77
mov esi, dword [esp + 0x14]
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, 0x2c
ret
push edi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x40]
test eax, eax
jne 0x47ba9e
call fcn.0047b600
test eax, eax
je 0x47ba9e
pop edi
pop esi
pop ebp
mov eax, 0xfffffffd
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret
push edi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
or eax, 0xffffffff
pop ebp
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
pop ebp
mov eax, 0xfffffffc
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret