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

Disassembly:
mov eax, dword [0x10063c04]
sub esp, 0xc
push ebx
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
xor edi, edi
cmp esi, edi
jne 0x1002f016
pop edi
pop esi
mov eax, 4
pop ebx
add esp, 0xc
ret
cmp dword [esi + 0x4e08], edi
je 0x1002f027
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0xc
ret
mov ecx, dword [esp + 0x1c]
or ebx, 0xffffffff
mov dword [esi + 0x3cf8], ebx
push ecx
mov dword [esi + 0x4ed8], edi
mov dword [esi + 0x4edc], edi
mov dword [esi + 0x3cfc], ebx
call fcn.10028c50
add esp, 4
cmp eax, 0xfffffffd
jne 0x1002f0f4
cmp edx, ebx
jne 0x1002f0f4
mov eax, 1
mov dword [esi + 0x4e36], edi
mov dword [esi + 0x4e3e], ebx
mov dword [esi + 0x4e46], edi
mov dword [esi + 0x4e4e], edi
mov word [esi + 0x4e0c], bx
mov word [esi + 0x4e0e], di
mov word [esi + 0x4e10], di
mov word [esi + 0x4e12], 0xffff
mov dword [esi + 0x4e14], edi
mov dword [esi + 0x4e18], edi
mov word [esi + 0x4e1c], di
mov dword [esi + 0x4e2e], ebx
mov dword [esi + 0x4e32], edi
mov dword [esi + 0x4e3a], edi
mov dword [esi + 0x4e42], 0x7fffffff
mov dword [esi + 0x4e4a], edi
mov dword [esi + 0x4e52], edi
mov dword [esi + 0x4e08], eax
mov dword [esi + 0x4ed8], eax
mov dword [esi + 0x4edc], edi
call fcn.1002a150
pop edi
pop esi
pop ebx
add esp, 0xc
ret
cmp eax, 0xfffffffc
push ebp
jne 0x1002f112
cmp edx, ebx
jne 0x1002f112
pop ebp
mov dword [esp + 0xc], 5
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebx
add esp, 0xc
ret
mov ecx, eax
and ecx, edx
cmp ecx, ebx
je 0x1002f622
cmp eax, 0xfffffffe
jne 0x1002f190
cmp edx, ebx
jne 0x1002f190
call fcn.10029710
cmp dword [esi + 0x38], edi
je 0x1002f13e
push esi
push ebx
push edi
call fcn.10031d20
add esp, 0xc
jmp 0x1002f150
push 0x1006161c
push ebx
push edi
push 1
push edi
call fcn.1002fa40
add esp, 0x14
cmp eax, 1
jne 0x1002f17c
call fcn.100297a0
test eax, eax
jne 0x1002f173
call fcn.10029750
test eax, eax
je 0x1002f173
push 1
call fcn.10028c50
add esp, 4
jmp 0x1002f11e
mov eax, 0xfffffffe
mov edx, ebx
jmp 0x1002f11e
pop ebp
mov dword [esp + 0xc], 0x30
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebx
add esp, 0xc
ret
mov ecx, eax
and ecx, edx
cmp ecx, ebx
je 0x1002f622
mov dword [esi + 0x3cf8], eax
add eax, 4
mov dword [esi + 0x3cfc], edx
push edi
adc edx, edi
mov dword [esp + 0x14], edi
push edx
mov edx, dword [esi + 0x3d08]
push eax
push edx
call fcn.100348d0
mov ecx, dword [esi + 0x3d08]
add esp, 0x10
lea eax, [esp + 0x14]
lea ebp, [esi + 0x4e0c]
push edi
push eax
push 0x12
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1002f616
cmp dword [esp + 0x14], edi
je 0x1002f616
movsx eax, word [ebp]
cmp eax, 0xffff
mov dword [esp + 0x18], eax
je 0x1002f2e6
mov cx, word [esi + 0x4e0e]
cmp cx, 0xffff
je 0x1002f2e6
mov ebp, dword [esi + 0x4e18]
cmp ebp, ebx
je 0x1002f2e6
mov ebx, dword [esi + 0x4e14]
cmp ebx, 0xffffffff
je 0x1002f2e6
mov di, word [esi + 0x4e12]
cmp di, 0xffff
je 0x1002f2e4
mov ax, word [esi + 0x4e10]
cmp ax, 0xffff
je 0x1002f2e4
mov edx, 0x14
and eax, 0xffff
mov word [esi + 0x4e2a], dx
mov word [esi + 0x4e2c], dx
mov edx, dword [esp + 0x18]
and ecx, 0xffff
mov dword [esi + 0x4e2e], edx
mov dword [esi + 0x4e22], 0x2c
cdq
mov dword [esi + 0x4e36], eax
mov eax, edi
and eax, 0xffff
mov dword [esi + 0x4e3a], edx
cdq
mov dword [esi + 0x4e3e], eax
xor eax, eax
mov dword [esi + 0x4e46], ebx
mov dword [esi + 0x4e4e], ebp
mov dword [esi + 0x4e1e], 0x6064b50
mov dword [esi + 0x4e26], 0
mov dword [esi + 0x4e32], ecx
mov dword [esi + 0x4e42], edx
mov dword [esi + 0x4e4a], eax
mov dword [esi + 0x4e52], eax
xor edi, edi
jmp 0x1002f573
xor edi, edi
mov eax, dword [esp + 0x20]
push eax
call fcn.100290d0
add esp, 4
cmp edx, edi
jl 0x1002f4da
jg 0x1002f305
cmp eax, edi
jb 0x1002f4da
mov ecx, dword [esi + 0x3d08]
push edi
push edx
push eax
mov dword [esi + 0x3cf8], eax
push ecx
mov dword [esi + 0x3cfc], edx
call fcn.100348d0
add esp, 0x10
lea ebx, [esi + 0x4e1e]
xor eax, eax
mov ecx, 0xe
mov edi, ebx
lea edx, [esp + 0x14]
push eax
push edx
rep stosd dword es:[edi], eax
mov eax, dword [esi + 0x3d08]
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0xc
push ebx
push eax
call edi
test eax, eax
je 0x1002f4bc
cmp dword [esp + 0x14], 0xc
jne 0x1002f4bc
cmp dword [ebx], 0x6064b50
jne 0x1002f4bc
mov eax, dword [esi + 0x4e26]
mov ecx, dword [esi + 0x4e22]
test eax, eax
jl 0x1002f4bc
jg 0x1002f389
test ecx, ecx
jbe 0x1002f4bc
test eax, eax
jg 0x1002f4bc
jl 0x1002f39c
cmp ecx, 0x2c
ja 0x1002f4bc
mov edx, dword [esi + 0x4e22]
lea ecx, [esp + 0x14]
push 0
push ecx
mov ecx, dword [esi + 0x3d08]
lea eax, [esi + 0x4e2a]
push edx
push eax
push ecx
call edi
test eax, eax
je 0x1002f4bc
mov edx, dword [esp + 0x14]
mov eax, dword [esi + 0x4e22]
cmp edx, eax
jne 0x1002f4bc
mov ecx, dword [esi + 0x4e2e]
mov eax, 0xffff
cmp ecx, eax
jae 0x1002f3ef
mov word [esi + 0x4e0c], cx
or ecx, 0xffffffff
jmp 0x1002f3f9
or ecx, 0xffffffff
mov word [esi + 0x4e0c], cx
mov edx, dword [esi + 0x4e32]
cmp edx, eax
jae 0x1002f40c
mov word [esi + 0x4e0e], dx
jmp 0x1002f413
mov word [esi + 0x4e0e], ax
mov edx, dword [esi + 0x4e3a]
test edx, edx
jg 0x1002f437
jl 0x1002f427
cmp dword [esi + 0x4e36], eax
jae 0x1002f437
mov dx, word [esi + 0x4e36]
mov word [esi + 0x4e10], dx
jmp 0x1002f43e
mov word [esi + 0x4e10], ax
mov edx, dword [esi + 0x4e42]
test edx, edx
jg 0x1002f459
jl 0x1002f452
cmp dword [esi + 0x4e3e], eax
jae 0x1002f459
mov ax, word [esi + 0x4e3e]
mov word [esi + 0x4e12], ax
mov eax, dword [esi + 0x4e4a]
test eax, eax
jg 0x1002f482
jl 0x1002f474
cmp dword [esi + 0x4e46], ecx
ja 0x1002f482
mov edx, dword [esi + 0x4e46]
mov dword [esi + 0x4e14], edx
jmp 0x1002f488
mov dword [esi + 0x4e14], ecx
mov eax, dword [esi + 0x4e52]
test eax, eax
jg 0x1002f4af
jl 0x1002f49c
cmp dword [esi + 0x4e4e], ecx
jae 0x1002f4af
mov eax, dword [esi + 0x4e4e]
xor edi, edi
mov dword [esi + 0x4e18], eax
jmp 0x1002f573
mov dword [esi + 0x4e18], ecx
xor edi, edi
jmp 0x1002f573
or eax, 0xffffffff
mov dword [esp + 0x10], 3
mov dword [esi + 0x3cf8], eax
mov dword [esi + 0x3cfc], eax
xor edi, edi
jmp 0x1002f573
mov edx, 0x14
xor eax, eax
mov ax, word [esi + 0x4e10]
mov word [esi + 0x4e2a], dx
mov word [esi + 0x4e2c], dx
xor edx, edx
mov dx, word [esi + 0x4e0e]
mov dword [esi + 0x4e22], 0x2c
movsx ecx, word [esi + 0x4e0c]
mov dword [esi + 0x4e32], edx
mov dword [esi + 0x4e2e], ecx
cdq
mov dword [esi + 0x4e36], eax
xor eax, eax
mov ax, word [esi + 0x4e12]
mov ecx, dword [esi + 0x4e18]
mov dword [esi + 0x4e3a], edx
mov dword [esi + 0x4e4e], ecx
cdq
mov dword [esi + 0x4e3e], eax
mov eax, dword [esi + 0x4e14]
mov dword [esi + 0x4e46], eax
mov dword [esi + 0x4e1e], 0x6064b50
mov dword [esi + 0x4e26], edi
mov dword [esi + 0x4e42], edx
mov dword [esi + 0x4e4a], edi
mov dword [esi + 0x4e52], edi
mov eax, dword [esi + 0x4e2e]
mov ebx, 1
cmp eax, edi
mov dword [esi + 0x4e08], ebx
je 0x1002f5c2
lea edx, [esi + 0x14f64]
mov dword [esi + 0x4ed8], ebx
push edx
call fcn.10028b50
push eax
call fcn.10028ad0
add esp, 8
test eax, eax
jne 0x1002f5aa
mov dword [esi + 0x38], ebx
mov eax, dword [esi + 0x4e2e]
pop ebp
mov dword [esi + 0x4edc], eax
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebx
add esp, 0xc
ret
mov eax, dword [esi + 0x4e32]
mov dword [esi + 0x4ed8], edi
cmp eax, edi
je 0x1002f5fe
mov ecx, dword [esi + 0x4e36]
mov eax, dword [esi + 0x4e3e]
cmp ecx, eax
jne 0x1002f5fe
mov edx, dword [esi + 0x4e3a]
mov eax, dword [esi + 0x4e42]
cmp edx, eax
jne 0x1002f5fe
mov dword [esi + 0x4e2e], edi
mov dword [esi + 0x4e32], edi
mov eax, dword [esi + 0x4e2e]
pop ebp
mov dword [esi + 0x4edc], eax
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebx
add esp, 0xc
ret
mov dword [esi + 0x3cf8], ebx
mov dword [esi + 0x3cfc], ebx
pop ebp
mov dword [esp + 0xc], 3
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebx
add esp, 0xc
ret