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

Disassembly:
sub esp, 0x2c
mov eax, dword [0x5296dc]
push ebx
push ebp
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
xor esi, esi
cmp ebx, esi
mov dword [esp + 0x20], ebx
jne 0x46170d
pop edi
pop esi
or eax, 0xffffffff
pop ebp
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret
lea ecx, [ebx + 0x14fac]
push ecx
call fcn.004615e0
push eax
call fcn.00461560
mov ecx, dword [ebx + 0x40]
add esp, 8
cmp ecx, esi
jne 0x461878
cmp eax, esi
jne 0x461878
mov ebp, dword [ebx + 0x16810]
mov edi, dword [ebx + 0x16814]
sub ebp, 0x12
mov dword [esp + 0x24], 0x12
sbb edi, esi
mov dword [esp + 0x28], esi
mov dword [esp + 0x18], 3
js 0x461b2c
jg 0x46176a
cmp ebp, esi
jb 0x461b2c
mov eax, dword [esp + 0x28]
test eax, eax
jg 0x461b2c
jl 0x461786
cmp dword [esp + 0x24], 0x1002b
ja 0x461b2c
mov edx, dword [ebx + 0x3d10]
push 0
push edi
push ebp
push edx
call fcn.0046e720
add esp, 0x10
call fcn.00469080
mov byte [esp + 0x13], al
call fcn.00469080
mov byte [esp + 0x12], al
call fcn.00469080
mov ecx, dword [esp + 0x18]
mov esi, 0x12
sub esi, ecx
mov byte [esp + 0x40], al
test esi, esi
jle 0x4617fa
call fcn.00469080
cmp byte [esp + 0x13], 0x50
jne 0x4617e1
cmp byte [esp + 0x12], 0x4b
jne 0x4617e1
cmp byte [esp + 0x40], 5
jne 0x4617e1
cmp al, 6
je 0x461855
mov cl, byte [esp + 0x12]
mov dl, byte [esp + 0x40]
dec esi
mov byte [esp + 0x13], cl
test esi, esi
mov byte [esp + 0x12], dl
mov byte [esp + 0x40], al
jg 0x4617c3
test edi, edi
jl 0x461b2c
jg 0x46180c
test ebp, ebp
jbe 0x461b2c
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov ebp, dword [ebx + 0x16810]
mov edi, dword [ebx + 0x16814]
add eax, 0x12
mov dword [esp + 0x18], 0
adc ecx, 0
sub ebp, eax
sbb edi, ecx
mov dword [esp + 0x24], eax
test edi, edi
mov dword [esp + 0x28], ecx
jg 0x46176a
jl 0x46184c
test ebp, ebp
jae 0x46176a
xor ebp, ebp
xor edi, edi
jmp 0x46176a
mov eax, dword [ebx + 0x3d10]
push 1
push 0
push 0
push eax
call fcn.0046e720
add esp, 0x10
sub eax, 4
sbb edx, 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov eax, dword [ebx + 0x16814]
mov ecx, dword [ebx + 0x16810]
cmp eax, esi
jg 0x46189e
jl 0x461892
cmp ecx, 0x1002b
jae 0x46189e
mov esi, ecx
mov dword [esp + 0x30], eax
mov dword [esp + 0x2c], esi
jmp 0x4618ae
mov dword [esp + 0x2c], 0x1002b
mov dword [esp + 0x30], esi
mov esi, dword [esp + 0x2c]
mov edx, dword [esp + 0x30]
xor ebp, ebp
sub ecx, esi
push ebp
sbb eax, edx
push eax
push ecx
mov ecx, dword [ebx + 0x3d10]
push ecx
call fcn.0046e720
add esp, 0x10
push esi
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
cmp edi, ebp
mov dword [esp + 0x14], edi
je 0x461b41
push edi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
cmp eax, ebp
mov dword [esp + 0x18], eax
je 0x461b3a
lea edx, [esp + 0x1c]
push ebp
push edx
push esi
push eax
mov eax, dword [ebx + 0x3d10]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x461b1e
cmp dword [esp + 0x1c], esi
jne 0x461b1e
mov ecx, dword [ebx + 0x16810]
mov eax, 0x16
cmp ecx, eax
mov dword [esp + 0x24], 0x12
mov dword [esp + 0x28], ebp
jne 0x461946
cmp dword [ebx + 0x16814], ebp
jne 0x461946
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x28]
mov ebp, esi
sub ebp, edx
mov ebx, 3
sbb eax, ecx
mov dword [esp + 0x38], eax
js 0x461adf
jg 0x46197b
test ebp, ebp
jb 0x461adf
jmp 0x46197b
mov edi, dword [esp + 0x14]
mov esi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x28]
cmp eax, ecx
jg 0x461adf
jl 0x461997
cmp dword [esp + 0x24], esi
ja 0x461adf
mov edx, dword [esp + 0x18]
mov edi, dword [esp + 0x38]
mov esi, ebp
add esi, 1
mov cl, byte [edx + ebp]
adc edi, 0
mov al, byte [esi + edx]
add esi, 1
mov byte [esp + 0x12], al
mov eax, 0x12
adc edi, 0
sub eax, ebx
test eax, eax
jle 0x461a16
mov dl, byte [esi + edx]
mov bl, dl
mov edx, dword [esp + 0x18]
add esi, 1
adc edi, 0
cmp cl, 0x50
mov dl, byte [esi + edx]
jne 0x461a09
cmp byte [esp + 0x12], 0x4b
jne 0x461a09
movsx ecx, bl
dec ecx
je 0x4619f7
sub ecx, 2
je 0x4619f7
sub ecx, 2
jne 0x461a09
cmp dl, 6
je 0x461a71
jmp 0x461a09
cmp dl, 2
je 0x461ab1
cmp dl, 4
je 0x461ab1
mov cl, byte [esp + 0x12]
dec eax
test eax, eax
mov byte [esp + 0x12], bl
jg 0x4619c5
mov eax, dword [esp + 0x38]
test eax, eax
jl 0x461abf
jg 0x461a2c
test ebp, ebp
jbe 0x461abf
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov ebp, dword [esp + 0x2c]
add eax, 0x12
adc ecx, 0
mov dword [esp + 0x24], eax
sub ebp, eax
mov eax, dword [esp + 0x30]
sbb eax, ecx
xor ebx, ebx
test eax, eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x38], eax
jg 0x461973
jl 0x461a66
test ebp, ebp
jae 0x461973
xor ebp, ebp
mov dword [esp + 0x38], ebp
jmp 0x461973
mov ebx, dword [esp + 0x14]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x2c]
mov eax, dword [ecx + 0x16810]
sub eax, edx
mov edx, dword [ecx + 0x16814]
mov ecx, dword [esp + 0x30]
sbb edx, ecx
add eax, esi
adc edx, edi
pop edi
sub eax, 3
pop esi
pop ebp
pop ebx
sbb edx, 0
add esp, 0x2c
ret
mov esi, dword [esp + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
jmp 0x461ae7
mov esi, dword [esp + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
or eax, 0xffffffff
pop ebp
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret
push edi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x40]
test eax, eax
jne 0x461b0e
call fcn.00461670
test eax, eax
je 0x461b0e
pop edi
pop esi
pop ebp
mov eax, 0xfffffffd
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret
push edi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
or eax, 0xffffffff
pop ebp
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
pop ebp
mov eax, 0xfffffffc
or edx, 0xffffffff
pop ebx
add esp, 0x2c
ret