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

Disassembly:
mov eax, dword [0x6c24b8]
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 0x47d031
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 0x47d19b
mov ecx, dword [ebp + 0x4e5e]
mov edx, dword [ebp + 0x4e5a]
mov eax, dword [ebp + 0x3d10]
push ecx
push edx
push eax
call fcn.00487a80
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
jne 0x47d074
mov dword [esp + 0x14], 1
push ebp
call fcn.0047cec0
add esp, 4
test eax, eax
je 0x47d317
push ebp
call fcn.0047cf60
add esp, 4
test eax, eax
je 0x47d317
mov ecx, 9
xor eax, eax
lea edi, [ebp + 0x15fd0]
mov dword [ebp + 0x4e7c], ebx
mov byte [ebp + 0x157ac], 0
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x14]
mov dword [ebp + 0x3d08], ebx
cmp eax, ebx
mov dword [ebp + 0x3d0c], ebx
jne 0x47d317
cmp dword [ebp + 0x4ed0], ebx
je 0x47d317
cmp dword [ebp + 0x4ed8], ebx
je 0x47d317
mov edx, dword [ebp + 0x3d0c]
mov eax, dword [ebp + 0x4e4e]
cmp edx, eax
jg 0x47d317
jl 0x47d10c
mov eax, dword [ebp + 0x3d08]
mov ecx, dword [ebp + 0x4e4a]
cmp eax, ecx
jae 0x47d317
mov edx, dword [ebp + 0x3d10]
lea ecx, [esp + 0x18]
push ebx
lea esi, [ebp + 0x4e80]
push ecx
push 0x2e
push esi
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, 1
jne 0x47d317
cmp dword [esp + 0x18], 0x2e
jne 0x47d317
cmp dword [esi], 0x2014b50
jne 0x47d2ec
xor ebx, ebx
xor eax, eax
mov bx, word [ebp + 0x4ea0]
mov ax, word [ebp + 0x4e9e]
mov edi, dword [ebp + 0x4ee0]
xor ecx, ecx
mov cx, word [ebp + 0x4e9c]
add ebx, eax
mov eax, dword [ebp + 0x4ed0]
add ebx, ecx
push eax
lea edx, [ebx + 0x2e]
add edi, edx
mov dword [ebp + 0x4ee0], edi
call dword [sym.imp.KERNEL32.dll_GlobalSize]
cmp edi, eax
jbe 0x47d1bf
mov ecx, dword [ebp + 0x4ed0]
push 2
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalReAlloc]
jmp 0x47d1c5
mov ecx, dword [ebp + 0x3d10]
push ebx
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x47d0ca
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov eax, dword [ebp + 0x4ed0]
test eax, eax
je 0x47d2d2
push eax
mov dword [ebp + 0x4ed0], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
test eax, eax
mov dword [ebp + 0x4ed4], eax
je 0x47d2be
mov edx, dword [ebp + 0x3d08]
mov eax, dword [ebp + 0x4ed8]
push edx
push eax
call fcn.0047c340
mov edi, dword [ebp + 0x4ed4]
mov ecx, 0xb
add edi, eax
add esp, 8
mov dword [ebp + 0x4ed4], edi
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edx, dword [ebp + 0x4ed4]
xor esi, esi
add edx, 0x2e
lea ecx, [esp + 0x18]
push esi
mov dword [ebp + 0x4ed4], edx
mov eax, edx
mov edx, dword [ebp + 0x3d10]
push ecx
push ebx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47d28c
cmp dword [esp + 0x18], ebx
jne 0x47d28c
mov ecx, dword [esp + 0x10]
mov eax, dword [ebp + 0x3d08]
inc ecx
add eax, 1
mov dword [ebp + 0x3d08], eax
mov ebx, dword [ebp + 0x3d0c]
mov eax, dword [ebp + 0x4ee0]
mov dword [esp + 0x10], ecx
adc ebx, esi
push eax
mov dword [ebp + 0x3d0c], ebx
mov ecx, dword [ebp + 0x3d08]
lea eax, [ebp + 0x4ed8]
push ecx
push eax
call fcn.0047c370
add esp, 0xc
jmp 0x47d29c
mov dword [esp + 0x10], 0xffffffff
mov dword [esp + 0x14], 1
mov edx, dword [ebp + 0x4ed0]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [esp + 0x14]
mov dword [ebp + 0x4ed4], esi
cmp eax, esi
jne 0x47d317
xor ebx, ebx
jmp 0x47d0e2
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 + 0x4e80], 0x4034b50
jne 0x47d317
cmp dword [ebp + 0x4e4e], 1
jl 0x47d317
jg 0x47d30b
cmp dword [ebp + 0x4e4a], ebx
jb 0x47d317
mov dword [ebp + 0x4e4a], ebx
mov dword [ebp + 0x4e4e], ebx
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret