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

Disassembly:
sub esp, 0x28
mov eax, dword [0x5296dc]
push ebx
push ebp
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebp, eax
xor esi, esi
cmp ebp, esi
mov dword [esp + 0x24], ebp
je 0x461fd1
lea ecx, [ebp + 0x14fac]
push ecx
call fcn.004615e0
push eax
call fcn.00461560
mov ecx, dword [ebp + 0x40]
add esp, 8
cmp ecx, esi
jne 0x461d23
cmp eax, esi
jne 0x461d23
mov ebx, dword [ebp + 0x16810]
mov edi, dword [ebp + 0x16814]
sub ebx, 0x10
mov dword [esp + 0x28], 0x10
sbb edi, esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x14], 3
js 0x461fd1
jg 0x461be0
cmp ebx, esi
jb 0x461fd1
mov eax, dword [esp + 0x2c]
test eax, eax
jg 0x461fd1
jl 0x461bfc
cmp dword [esp + 0x28], 0x19000
ja 0x461fd1
mov edx, dword [ebp + 0x3d10]
push 0
push edi
push ebx
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 + 0x14]
mov esi, 0x12
sub esi, ecx
mov byte [esp + 0x3c], al
test esi, esi
jle 0x461c70
call fcn.00469080
cmp byte [esp + 0x13], 0x50
jne 0x461c57
cmp byte [esp + 0x12], 0x4b
jne 0x461c57
cmp byte [esp + 0x3c], 6
jne 0x461c57
cmp al, 7
je 0x461ccb
mov cl, byte [esp + 0x12]
mov dl, byte [esp + 0x3c]
dec esi
mov byte [esp + 0x13], cl
test esi, esi
mov byte [esp + 0x12], dl
mov byte [esp + 0x3c], al
jg 0x461c39
test edi, edi
jl 0x461fd1
jg 0x461c82
test ebx, ebx
jbe 0x461fd1
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
mov ebx, dword [ebp + 0x16810]
mov edi, dword [ebp + 0x16814]
add eax, 0x10
mov dword [esp + 0x14], 0
adc ecx, 0
sub ebx, eax
sbb edi, ecx
mov dword [esp + 0x28], eax
test edi, edi
mov dword [esp + 0x2c], ecx
jg 0x461be0
jl 0x461cc2
test ebx, ebx
jae 0x461be0
xor ebx, ebx
xor edi, edi
jmp 0x461be0
mov ecx, dword [ebp + 0x3d10]
lea eax, [esp + 0x18]
push 0
lea esi, [ebp + 0x4e62]
push eax
push 0x10
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x461fd1
cmp dword [esp + 0x18], 0x10
jne 0x461fd1
mov ecx, dword [ebp + 0x4e6e]
mov eax, dword [ebp + 0x4e66]
mov edx, dword [ebp + 0x4e6a]
mov dword [ebp + 0x4e74], ecx
mov ecx, dword [esi]
pop edi
mov dword [ebp + 0x4e78], ecx
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
mov eax, dword [ebp + 0x16814]
mov ecx, dword [ebp + 0x16810]
cmp eax, esi
jg 0x461d4b
jl 0x461d3d
cmp ecx, 0x19000
jae 0x461d4b
mov esi, ecx
mov edi, eax
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], edi
jmp 0x461d5f
mov dword [esp + 0x30], 0x19000
mov dword [esp + 0x34], esi
mov esi, dword [esp + 0x30]
mov edi, dword [esp + 0x34]
mov edx, dword [ebp + 0x3d10]
sub ecx, esi
sbb eax, edi
push 0
push eax
push ecx
push edx
call fcn.0046e720
add esp, 0x10
push esi
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
mov dword [esp + 0x1c], eax
je 0x461fea
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x20], ebx
je 0x461fdf
mov ecx, dword [ebp + 0x3d10]
lea eax, [esp + 0x18]
push 0
push eax
push esi
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x461fbf
cmp dword [esp + 0x18], esi
jne 0x461fbf
mov edx, 0x10
mov ecx, esi
xor eax, eax
sub ecx, edx
mov ebp, edi
mov dword [esp + 0x28], edx
sbb ebp, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x14], 3
js 0x461f7c
jg 0x461dfd
test ecx, ecx
jb 0x461f7c
jmp 0x461dfd
mov ebx, dword [esp + 0x20]
cmp eax, dword [esp + 0x34]
jg 0x461f7c
jl 0x461e11
cmp edx, esi
ja 0x461f7c
mov dl, byte [ecx + ebx]
mov esi, ecx
add esi, 1
mov edi, ebp
adc edi, 0
mov al, byte [esi + ebx]
mov ebx, dword [esp + 0x14]
mov byte [esp + 0x12], al
add esi, 1
mov eax, 0x10
adc edi, 0
sub eax, ebx
test eax, eax
jle 0x461e70
mov ebx, dword [esp + 0x20]
add esi, 1
adc edi, 0
cmp dl, 0x50
mov bl, byte [esi + ebx - 1]
jne 0x461e63
cmp byte [esp + 0x12], 0x4b
jne 0x461e63
cmp bl, 6
jne 0x461e63
mov edx, dword [esp + 0x20]
cmp byte [esi + edx], 7
je 0x461ec9
mov dl, byte [esp + 0x12]
dec eax
test eax, eax
mov byte [esp + 0x12], bl
jg 0x461e3a
test ebp, ebp
jl 0x461fbf
jg 0x461e82
test ecx, ecx
jbe 0x461fbf
mov edx, dword [esp + 0x28]
mov esi, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
mov ebp, dword [esp + 0x34]
add edx, 0x10
mov ecx, esi
adc eax, 0
sub ecx, edx
sbb ebp, eax
mov dword [esp + 0x28], edx
test ebp, ebp
mov dword [esp + 0x2c], eax
mov dword [esp + 0x14], 0
jg 0x461df9
jl 0x461ec0
test ecx, ecx
jae 0x461df9
xor ecx, ecx
xor ebp, ebp
jmp 0x461df9
mov ebx, dword [esp + 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x24]
mov ebp, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
push 0
mov ebx, dword [eax + 0x16810]
mov ecx, dword [eax + 0x3d10]
sub ebx, ebp
mov ebp, dword [eax + 0x16814]
sbb ebp, edx
add ebx, esi
adc ebp, edi
add ebx, 1
adc ebp, 0
push ebp
push ebx
push ecx
call fcn.0046e720
add esp, 0x10
cmp eax, ebx
jne 0x461fd1
cmp edx, ebp
jne 0x461fd1
mov esi, dword [esp + 0x24]
lea edx, [esp + 0x18]
push 0
push edx
mov eax, dword [esi + 0x3d10]
lea edi, [esi + 0x4e62]
push 0x10
push edi
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x461fd1
cmp dword [esp + 0x18], 0x10
jne 0x461fd1
mov ecx, dword [esi + 0x4e6e]
mov eax, dword [esi + 0x4e66]
mov edx, dword [esi + 0x4e6a]
mov dword [esi + 0x4e74], ecx
mov ecx, dword [edi]
pop edi
mov dword [esi + 0x4e78], ecx
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
mov esi, dword [esp + 0x1c]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x461faf
call fcn.00461670
test eax, eax
je 0x461faf
pop edi
pop esi
pop ebp
mov eax, 0xfffffffd
or edx, 0xffffffff
pop ebx
add esp, 0x28
ret
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
or edx, 0xffffffff
pop ebx
add esp, 0x28
ret
mov esi, dword [esp + 0x1c]
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, 0x28
ret
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
pop ebp
mov eax, 0xfffffffc
or edx, 0xffffffff
pop ebx
add esp, 0x28
ret