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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push esi
push edi
push dword [0x100c7608]
mov ebx, ecx
mov dword [ebp - 8], ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x10047b2a
lea eax, [esi + 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea edi, [esi + 0x90]
mov dword [ebx + 0x1c], 0
test edi, edi
jne 0x10047b69
mov eax, dword [ebx + 0x14]
lea edx, [edi + 2]
shr eax, 1
lea ecx, [edi + 0x71]
and eax, 1
mov dword [ebx + 0x18], edi
push eax
call fcn.1004f5b0
mov edx, eax
lea ecx, [edi + 0xb]
call fcn.10044c90
add esp, 4
lea eax, [edi + 0xb]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, edi
call fcn.1004b630
mov ebx, eax
test ebx, ebx
je 0x10047bab
mov eax, dword [ebp - 8]
mov edx, 2
mov ecx, dword [eax + 0x14]
shr ecx, 1
and ecx, 1
mov dword [eax + 0x18], 0
push ecx
lea ecx, [edx + 0x6a]
call fcn.1004f5b0
mov edx, eax
mov ecx, ebx
call fcn.10044c90
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x18368]
test eax, eax
je 0x10047bc8
push eax
call fcn.10086818
add esp, 4
mov dword [esi + 0x18368], 0
mov eax, dword [esi + 0x1a3f8]
test eax, eax
je 0x10047be5
push eax
call fcn.10086818
add esp, 4
mov dword [esi + 0x1a3f8], 0
mov ecx, 1
call fcn.1004b840
mov dword [esi + 0x60f4], eax
test eax, eax
je 0x10047c36
mov ebx, dword [ebp - 8]
mov edx, 2
mov eax, dword [ebx + 0x14]
lea ecx, [edx + 0x70]
shr eax, 1
and eax, 1
push eax
call fcn.1004f5b0
mov ecx, dword [esi + 0x60f4]
mov edx, eax
call fcn.10044c90
mov dword [ebx + 0x18], 0
add esp, 4
mov eax, dword [esi + 0x60f4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
or edx, 0xffffffff
mov eax, 0xfffffffe
cmp dword [esi + 0x82a8], 0
je 0x10047d06
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyW]
cmp eax, 0xfffffffe
jne 0x10047cdd
cmp edx, 0xffffffff
jne 0x10047cdd
call fcn.10045da0
mov eax, dword [esi + 0x82ac]
cmp eax, dword [esi + 0x81e2]
je 0x10047c86
lea eax, [esi + 0x1090]
push eax
push edi
call ebx
push edi
lea eax, [esi + 0x18384]
push eax
call ebx
call fcn.10045e20
cmp eax, 0xffffffff
jne 0x10047c9f
mov dword [esi + 0x82ac], eax
mov dword [esi + 0x24], 0
jmp 0x10047c5f
mov ecx, 1
call fcn.10045090
test edx, edx
jl 0x10047cc1
jg 0x10047cb3
test eax, eax
jb 0x10047cc1
mov ecx, dword [esi + 0x81e2]
mov dword [esi + 0x82ac], ecx
jmp 0x10047c51
or edx, 0xffffffff
mov dword [esi + 0x24], 0
or ecx, edx
mov eax, 0xfffffffe
mov dword [esi + 0x82ac], ecx
jmp 0x10047c51
test edx, edx
jl 0x10047d36
jg 0x10047ce7
test eax, eax
jb 0x10047d36
add eax, 0x16
mov ecx, esi
adc edx, 0
push edx
push eax
xor edx, edx
call fcn.100506d0
mov eax, dword [esi + 0x81e2]
mov dword [esi + 0x82ac], eax
jmp 0x10047d33
mov ecx, 1
call fcn.10045090
test edx, edx
jl 0x10047e0a
jg 0x10047d22
test eax, eax
jb 0x10047e0a
add eax, 0x16
mov ecx, esi
adc edx, 0
push edx
push eax
xor edx, edx
call fcn.100506d0
add esp, 8
movzx ebx, word [esi + 0x81d0]
test ebx, ebx
je 0x10047e0a
push ebx
call fcn.1008680d
mov edi, eax
add esp, 4
test edi, edi
je 0x10047e0a
push 0
lea eax, [ebp - 4]
mov dword [ebp - 4], 0
push eax
push ebx
push edi
push dword [esi + 0x18380]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 4]
cmp eax, 8
jbe 0x10047da7
push 8
push str.dopustz:
push edi
call fcn.10086e80
add esp, 0xc
test eax, eax
jne 0x10047da4
push edi
mov dword [ebp - 4], eax
call fcn.10086818
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 4]
test eax, eax
je 0x10047df8
mov ebx, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0
push 0
push eax
movzx eax, word [esi]
push edi
push 0
push eax
call ebx
mov dword [ebp - 0xc], eax
lea ecx, [eax*2 + 2]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, dword [ebp - 8]
mov dword [ecx + 0x1c], eax
test eax, eax
je 0x10047df8
push dword [ebp - 0xc]
push eax
push dword [ebp - 4]
movzx eax, word [esi]
push edi
push 0
push eax
call ebx
mov ecx, dword [ebp - 8]
xor edx, edx
mov ecx, dword [ecx + 0x1c]
mov word [ecx + eax*2], dx
push edi
call fcn.10086818
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
mov dword [eax + 0x18], 0
xor eax, eax
mov esp, ebp
pop ebp
ret