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

Disassembly:
sub esp, 0x28
mov eax, dword [0x6edbc0]
push ebx
push ebp
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
xor ebx, ebx
cmp esi, ebx
mov dword [esp + 0x18], esi
je 0x5a9f88
lea ecx, [esi + 0x8cfc]
push ecx
call fcn.005a9c30
push eax
call fcn.005a9bd0
add esp, 8
test eax, eax
je 0x5aa00c
mov eax, dword [esi + 0x9074]
mov ecx, dword [esi + 0x9070]
cmp eax, ebx
jg 0x5a9d96
jl 0x5a9d8a
cmp ecx, 0x1002b
jae 0x5a9d96
mov edi, ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x30], edi
jmp 0x5a9da3
mov edi, 0x1002b
mov dword [esp + 0x34], ebx
mov dword [esp + 0x30], edi
mov edx, dword [esp + 0x34]
sub ecx, edi
sbb eax, edx
mov edx, dword [esi + 0x97e]
push ebx
push eax
push ecx
push edx
call fcn.005bfdc0
add esp, 0x10
push edi
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebp, eax
cmp ebp, ebx
mov dword [esp + 0x20], ebp
je 0x5a9ffc
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x1c], ebx
je 0x5a9ff5
mov ecx, dword [esi + 0x97e]
lea eax, [esp + 0x24]
push 0
push eax
push edi
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5a9fd9
cmp dword [esp + 0x24], edi
jne 0x5a9fd9
mov ecx, dword [esi + 0x9070]
mov edx, 0x12
xor eax, eax
cmp ecx, 0x16
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], eax
jne 0x5a9e42
mov ecx, dword [esi + 0x9074]
test ecx, ecx
jne 0x5a9e42
mov edx, 0x16
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], edx
mov ebp, dword [esp + 0x34]
mov ecx, edi
sub ecx, edx
mov dword [esp + 0x14], 3
sbb ebp, eax
js 0x5a9f96
jg 0x5a9e6a
test ecx, ecx
jb 0x5a9f96
jmp 0x5a9e6a
mov ebx, dword [esp + 0x1c]
cmp eax, dword [esp + 0x34]
jg 0x5a9f96
jl 0x5a9e7e
cmp edx, edi
ja 0x5a9f96
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 + 0x13], al
add esi, 1
mov eax, 0x12
adc edi, 0
sub eax, ebx
test eax, eax
jle 0x5a9edd
mov ebx, dword [esp + 0x1c]
add esi, 1
adc edi, 0
cmp dl, 0x50
mov bl, byte [esi + ebx - 1]
jne 0x5a9ed0
cmp byte [esp + 0x13], 0x4b
jne 0x5a9ed0
cmp bl, 5
jne 0x5a9ed0
mov edx, dword [esp + 0x1c]
cmp byte [esi + edx], 6
je 0x5a9f36
mov dl, byte [esp + 0x13]
dec eax
test eax, eax
mov byte [esp + 0x13], bl
jg 0x5a9ea7
test ebp, ebp
jl 0x5a9f76
jg 0x5a9eef
test ecx, ecx
jbe 0x5a9f76
mov edx, dword [esp + 0x28]
mov edi, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
mov ebp, dword [esp + 0x34]
add edx, 0x12
mov ecx, edi
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 0x5a9e66
jl 0x5a9f2d
test ecx, ecx
jae 0x5a9e66
xor ecx, ecx
xor ebp, ebp
jmp 0x5a9e66
mov ebx, dword [esp + 0x20]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x30]
mov eax, dword [ecx + 0x9070]
sub eax, edx
mov edx, dword [ecx + 0x9074]
mov ecx, dword [esp + 0x34]
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, 0x28
ret
mov esi, dword [esp + 0x20]
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 esi, dword [esp + 0x20]
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 0x5a9fc9
call fcn.005a9cc0
test eax, eax
je 0x5a9fc9
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
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
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
push ebp
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
mov ebp, dword [esi + 0x9070]
mov edi, dword [esi + 0x9074]
sub ebp, 0x12
mov dword [esp + 0x28], 0x12
sbb edi, ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x14], 3
js 0x5a9f88
jg 0x5aa047
cmp ebp, ebx
jb 0x5a9f88
jmp 0x5aa047
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x2c]
test eax, eax
jg 0x5a9f88
jl 0x5aa063
cmp dword [esp + 0x28], 0x1002b
ja 0x5a9f88
mov eax, dword [esi + 0x97e]
push 0
push edi
push ebp
push eax
call fcn.005bfdc0
add esp, 0x10
call fcn.005aeff0
mov byte [esp + 0x13], al
call fcn.005aeff0
mov bl, al
call fcn.005aeff0
mov ecx, dword [esp + 0x14]
mov esi, 0x12
sub esi, ecx
mov byte [esp + 0x3c], al
test esi, esi
jle 0x5aa0cb
call fcn.005aeff0
cmp byte [esp + 0x13], 0x50
jne 0x5aa0ba
cmp bl, 0x4b
jne 0x5aa0ba
cmp byte [esp + 0x3c], 5
jne 0x5aa0ba
cmp al, 6
je 0x5aa12a
dec esi
mov byte [esp + 0x13], bl
mov bl, byte [esp + 0x3c]
mov byte [esp + 0x3c], al
test esi, esi
jg 0x5aa09e
test edi, edi
jl 0x5a9f88
jg 0x5aa0dd
test ebp, ebp
jbe 0x5a9f88
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x2c]
add eax, 0x12
mov ebp, dword [edx + 0x9070]
mov edi, dword [edx + 0x9074]
adc ecx, 0
sub ebp, eax
sbb edi, ecx
mov dword [esp + 0x28], eax
test edi, edi
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x14], 0
jg 0x5aa043
jl 0x5aa121
test ebp, ebp
jae 0x5aa043
xor ebp, ebp
xor edi, edi
jmp 0x5aa043
mov ecx, dword [esp + 0x18]
push 1
push 0
push 0
mov edx, dword [ecx + 0x97e]
push edx
call fcn.005bfdc0
add esp, 0x10
sub eax, 4
sbb edx, 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret