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

Disassembly:
mov eax, dword [0x10063c04]
sub esp, 0xc
push ebx
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebp, eax
xor ebx, ebx
cmp ebp, ebx
jne 0x1002a5c1
pop ebp
xor eax, eax
pop ebx
add esp, 0xc
ret
mov eax, dword [esp + 0x18]
push esi
push edi
cmp eax, ebx
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], ebx
push ebx
je 0x1002a72b
mov ecx, dword [ebp + 0x4e52]
mov edx, dword [ebp + 0x4e4e]
mov eax, dword [ebp + 0x3d08]
push ecx
push edx
push eax
call fcn.100348d0
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
jne 0x1002a604
mov dword [esp + 0x14], 1
push ebp
call fcn.1002a440
add esp, 4
test eax, eax
je 0x1002a8a7
push ebp
call fcn.1002a4e0
add esp, 4
test eax, eax
je 0x1002a8a7
mov ecx, 9
xor eax, eax
lea edi, [ebp + 0x15f88]
mov dword [ebp + 0x4e70], ebx
mov byte [ebp + 0x15764], 0
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x14]
mov dword [ebp + 0x3d00], ebx
cmp eax, ebx
mov dword [ebp + 0x3d04], ebx
jne 0x1002a8a7
cmp dword [ebp + 0x4ec4], ebx
je 0x1002a8a7
cmp dword [ebp + 0x4ecc], ebx
je 0x1002a8a7
mov edx, dword [ebp + 0x3d04]
mov eax, dword [ebp + 0x4e42]
cmp edx, eax
jg 0x1002a8a7
jl 0x1002a69c
mov eax, dword [ebp + 0x3d00]
mov ecx, dword [ebp + 0x4e3e]
cmp eax, ecx
jae 0x1002a8a7
mov edx, dword [ebp + 0x3d08]
lea ecx, [esp + 0x18]
push ebx
lea esi, [ebp + 0x4e74]
push ecx
push 0x2e
push esi
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, 1
jne 0x1002a8a7
cmp dword [esp + 0x18], 0x2e
jne 0x1002a8a7
cmp dword [esi], 0x2014b50
jne 0x1002a87c
xor ebx, ebx
xor eax, eax
mov bx, word [ebp + 0x4e94]
mov ax, word [ebp + 0x4e92]
mov edi, dword [ebp + 0x4ed4]
xor ecx, ecx
mov cx, word [ebp + 0x4e90]
add ebx, eax
mov eax, dword [ebp + 0x4ec4]
add ebx, ecx
push eax
lea edx, [ebx + 0x2e]
add edi, edx
mov dword [ebp + 0x4ed4], edi
call dword [sym.imp.KERNEL32.dll_GlobalSize]
cmp edi, eax
jbe 0x1002a74f
mov ecx, dword [ebp + 0x4ec4]
push 2
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalReAlloc]
jmp 0x1002a755
mov ecx, dword [ebp + 0x3d08]
push ebx
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x1002a65a
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov eax, dword [ebp + 0x4ec4]
test eax, eax
je 0x1002a862
push eax
mov dword [ebp + 0x4ec4], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
test eax, eax
mov dword [ebp + 0x4ec8], eax
je 0x1002a84e
mov edx, dword [ebp + 0x3d00]
mov eax, dword [ebp + 0x4ecc]
push edx
push eax
call fcn.10029900
mov edi, dword [ebp + 0x4ec8]
mov ecx, 0xb
add edi, eax
add esp, 8
mov dword [ebp + 0x4ec8], edi
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edx, dword [ebp + 0x4ec8]
xor esi, esi
add edx, 0x2e
lea ecx, [esp + 0x18]
push esi
mov dword [ebp + 0x4ec8], edx
mov eax, edx
mov edx, dword [ebp + 0x3d08]
push ecx
push ebx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1002a81c
cmp dword [esp + 0x18], ebx
jne 0x1002a81c
mov ecx, dword [esp + 0x10]
mov eax, dword [ebp + 0x3d00]
inc ecx
add eax, 1
mov edx, dword [ebp + 0x4ecc]
mov dword [ebp + 0x3d00], eax
mov ebx, dword [ebp + 0x3d04]
mov eax, dword [ebp + 0x4ed4]
adc ebx, esi
mov dword [esp + 0x10], ecx
mov dword [ebp + 0x3d04], ebx
mov ecx, dword [ebp + 0x3d00]
push eax
push ecx
push edx
call fcn.10029930
add esp, 0xc
jmp 0x1002a82c
mov dword [esp + 0x10], 0xffffffff
mov dword [esp + 0x14], 1
mov eax, dword [ebp + 0x4ec4]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [esp + 0x14]
mov dword [ebp + 0x4ec8], esi
cmp eax, esi
jne 0x1002a8a7
xor ebx, ebx
jmp 0x1002a672
pop edi
mov dword [esp + 0xc], 0xffffffff
mov eax, dword [esp + 0xc]
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov dword [esp + 0x10], 0xffffffff
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
cmp dword [ebp + 0x4e74], 0x4034b50
jne 0x1002a8a7
cmp dword [ebp + 0x4e42], 1
jl 0x1002a8a7
jg 0x1002a89b
cmp dword [ebp + 0x4e3e], ebx
jb 0x1002a8a7
mov dword [ebp + 0x4e3e], ebx
mov dword [ebp + 0x4e42], ebx
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret