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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
push dword [0x100c7608]
mov ebx, ecx
mov dword [ebp - 0x14], ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x1004b86a
lea eax, [esi + 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esi + 0x81bc], 0
je 0x1004b87c
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, ebx
mov dword [esi + 0x82a8], 0
mov dword [esi + 0x82ac], 0
mov dword [esi + 0x60e0], 0xffffffff
mov dword [esi + 0x60e4], 0xffffffff
call fcn.10045090
mov ecx, eax
cmp ecx, 0xfffffffd
jne 0x1004b962
cmp edx, 0xffffffff
jne 0x1004b962
or eax, edx
mov dword [esi + 0x81c8], 0
mov word [esi + 0x81c0], ax
xor eax, eax
mov dword [esi + 0x81c2], eax
mov eax, 0xffff
mov word [esi + 0x81c6], ax
xor eax, eax
mov dword [esi + 0x81cc], 0
mov word [esi + 0x81d0], ax
mov dword [esi + 0x81e2], edx
mov dword [esi + 0x81e6], eax
mov dword [esi + 0x81ea], eax
mov dword [esi + 0x81ee], eax
mov dword [esi + 0x81f2], edx
mov dword [esi + 0x81f6], 0x7fffffff
mov dword [esi + 0x81fa], eax
mov dword [esi + 0x81fe], eax
mov dword [esi + 0x8202], eax
mov dword [esi + 0x8206], eax
mov dword [esi + 0x81bc], 1
mov dword [esi + 0x82a8], 1
mov dword [esi + 0x28], eax
mov dword [esi + 0x82ac], eax
call fcn.10046ec0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp ecx, 0xfffffffc
jne 0x1004b97a
cmp edx, 0xffffffff
jne 0x1004b97a
mov edi, 5
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
and eax, edx
cmp eax, 0xffffffff
je 0x1004bdf0
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyW]
jmp 0x1004b990
cmp ecx, 0xfffffffe
jne 0x1004b9e2
cmp edx, 0xffffffff
jne 0x1004b9e2
mov dword [esi + 0x28], 0
call fcn.10045da0
lea eax, [esi + 0x1090]
push eax
lea edi, [esi + 0x90]
push edi
call ebx
push edi
lea eax, [esi + 0x18384]
push eax
call ebx
call fcn.10045e20
cmp eax, 0xffffffff
je 0x1004b9d8
mov ecx, 1
call fcn.10045090
mov ecx, eax
jmp 0x1004b990
mov ecx, 0xfffffffe
or edx, 0xffffffff
jmp 0x1004b990
mov eax, ecx
and eax, edx
cmp eax, 0xffffffff
jne 0x1004b9f0
lea edi, [eax + 4]
jmp 0x1004b9f2
xor edi, edi
test edi, edi
jne 0x1004bdf5
mov dword [esi + 0x60e0], ecx
add ecx, 4
mov dword [esi + 0x60e4], edx
adc edx, edi
push edx
push ecx
xor edx, edx
mov ecx, esi
call fcn.100506d0
add esp, 8
lea eax, [ebp - 4]
lea ebx, [esi + 0x81c0]
push edi
push eax
push 0x12
push ebx
push dword [esi + 0x18380]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1004bddc
cmp dword [ebp - 4], edi
je 0x1004bddc
movsx eax, word [ebx]
movzx edx, word [esi + 0x81c2]
mov dword [ebp - 8], eax
mov eax, 0xffff
cmp dx, ax
je 0x1004bafd
cmp dword [esi + 0x81cc], 0xffffffff
je 0x1004bafd
cmp dword [esi + 0x81c8], 0xffffffff
je 0x1004bafd
movzx eax, word [esi + 0x81c6]
mov ecx, eax
mov dword [ebp - 0x10], ecx
mov ecx, 0xffff
cmp ax, cx
mov ecx, dword [esi + 0x81c8]
je 0x1004bafd
movzx eax, word [esi + 0x81c4]
mov ebx, eax
mov dword [ebp - 0xc], ebx
mov ebx, 0xffff
cmp ax, bx
mov ebx, dword [esi + 0x81cc]
je 0x1004bafd
mov eax, dword [ebp - 8]
mov dword [esi + 0x81e2], eax
mov eax, edx
mov dword [esi + 0x81e6], eax
mov eax, dword [ebp - 0xc]
movzx eax, ax
cdq
mov dword [esi + 0x81ea], eax
mov eax, dword [ebp - 0x10]
movzx eax, ax
mov dword [esi + 0x81ee], edx
cdq
mov dword [esi + 0x81d2], 0x6064b50
mov dword [esi + 0x81f2], eax
mov dword [esi + 0x81fa], ecx
mov dword [esi + 0x8202], ebx
jmp 0x1004bd1d
mov ecx, dword [ebp - 0x14]
call fcn.100455b0
lea ebx, [esi + 0x81d2]
test edx, edx
jl 0x1004bcc3
jg 0x1004bb1d
test eax, eax
jb 0x1004bcc3
push edx
mov dword [esi + 0x60e4], edx
mov ecx, esi
push eax
xor edx, edx
mov dword [esi + 0x60e0], eax
call fcn.100506d0
push 0x38
push 0
push ebx
call fcn.1007cff0
add esp, 0x14
lea eax, [ebp - 4]
push 0
push eax
push 0xc
push ebx
push dword [esi + 0x18380]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1004bca5
cmp dword [ebp - 4], 0xc
jne 0x1004bca5
cmp dword [ebx], 0x6064b50
jne 0x1004bca5
mov edx, dword [esi + 0x81d6]
mov ecx, edx
mov eax, dword [esi + 0x81da]
add ecx, 0xffffffff
adc eax, 0xffffffff
test eax, eax
ja 0x1004bca5
jb 0x1004bb9b
cmp ecx, 0x2b
ja 0x1004bca5
push 0
lea eax, [ebp - 4]
push eax
push edx
lea eax, [esi + 0x81de]
push eax
push dword [esi + 0x18380]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1004bca5
mov eax, dword [ebp - 4]
cmp eax, dword [esi + 0x81d6]
jne 0x1004bca5
mov eax, dword [esi + 0x81e2]
cmp eax, 0xffff
jae 0x1004bbde
movzx eax, ax
jmp 0x1004bbe1
or eax, 0xffffffff
mov word [esi + 0x81c0], ax
mov eax, dword [esi + 0x81e6]
cmp eax, 0xffff
movzx eax, ax
jb 0x1004bbfd
mov eax, 0xffff
mov word [esi + 0x81c2], ax
cmp dword [esi + 0x81ee], 0
mov eax, dword [esi + 0x81ea]
jg 0x1004bc21
jl 0x1004bc1c
cmp eax, 0xffff
jae 0x1004bc21
movzx eax, ax
jmp 0x1004bc26
mov eax, 0xffff
mov word [esi + 0x81c4], ax
cmp dword [esi + 0x81f6], 0
mov eax, dword [esi + 0x81f2]
jg 0x1004bc4a
jl 0x1004bc45
cmp eax, 0xffff
jae 0x1004bc4a
movzx eax, ax
jmp 0x1004bc4f
mov eax, 0xffff
mov word [esi + 0x81c6], ax
cmp dword [esi + 0x81fe], 0
mov eax, dword [esi + 0x81fa]
jg 0x1004bc6c
jl 0x1004bc6f
cmp eax, 0xffffffff
jbe 0x1004bc6f
or eax, 0xffffffff
mov dword [esi + 0x81c8], eax
cmp dword [esi + 0x8206], 0
mov eax, dword [esi + 0x8202]
jg 0x1004bc96
jl 0x1004bc8b
cmp eax, 0xffffffff
jae 0x1004bc96
mov dword [esi + 0x81cc], eax
jmp 0x1004bd55
mov dword [esi + 0x81cc], 0xffffffff
jmp 0x1004bd55
mov dword [esi + 0x60e0], 0xffffffff
mov edi, 3
mov dword [esi + 0x60e4], 0xffffffff
jmp 0x1004bd55
movsx eax, word [esi + 0x81c0]
mov dword [esi + 0x81e2], eax
movzx eax, word [esi + 0x81c2]
mov dword [esi + 0x81e6], eax
movzx eax, word [esi + 0x81c4]
cdq
mov dword [esi + 0x81ea], eax
movzx eax, word [esi + 0x81c6]
mov dword [esi + 0x81ee], edx
cdq
mov dword [esi + 0x81f2], eax
mov eax, dword [esi + 0x81c8]
mov dword [esi + 0x81fa], eax
mov eax, dword [esi + 0x81cc]
mov dword [ebx], 0x6064b50
mov dword [esi + 0x8202], eax
mov dword [esi + 0x8206], 0
mov dword [esi + 0x81fe], 0
mov dword [esi + 0x81f6], edx
mov dword [esi + 0x81de], 0x140014
mov dword [esi + 0x81da], 0
mov dword [esi + 0x81d6], 0x2c
mov ecx, dword [esi + 0x81e2]
mov dword [esi + 0x81bc], 1
test ecx, ecx
je 0x1004bd89
mov dword [esi + 0x28], 0
mov eax, edi
mov dword [esi + 0x82a8], 1
mov dword [esi + 0x82ac], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x82a8], 0
cmp ecx, dword [esi + 0x81e6]
je 0x1004bdcd
mov eax, dword [esi + 0x81ea]
cmp eax, dword [esi + 0x81f2]
jne 0x1004bdcd
mov eax, dword [esi + 0x81ee]
cmp eax, dword [esi + 0x81f6]
jne 0x1004bdcd
mov dword [esi + 0x81e2], 0
xor ecx, ecx
mov dword [esi + 0x81e6], 0
mov dword [esi + 0x82ac], ecx
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x60e0], 0xffffffff
mov dword [esi + 0x60e4], 0xffffffff
mov edi, 3
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret