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

Disassembly:
sub esp, 0x28
mov eax, dword [0x10063c04]
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 0x10029541
lea ecx, [ebp + 0x14f64]
push ecx
call fcn.10028b50
push eax
call fcn.10028ad0
mov ecx, dword [ebp + 0x38]
add esp, 8
cmp ecx, esi
jne 0x10029293
cmp eax, esi
jne 0x10029293
mov ebx, dword [ebp + 0x167c8]
mov edi, dword [ebp + 0x167cc]
sub ebx, 0x10
mov dword [esp + 0x28], 0x10
sbb edi, esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x14], 3
js 0x10029541
jg 0x10029150
cmp ebx, esi
jb 0x10029541
mov eax, dword [esp + 0x2c]
test eax, eax
jg 0x10029541
jl 0x1002916c
cmp dword [esp + 0x28], 0x19000
ja 0x10029541
mov edx, dword [ebp + 0x3d08]
push 0
push edi
push ebx
push edx
call fcn.100348d0
add esp, 0x10
call fcn.1002f640
mov byte [esp + 0x13], al
call fcn.1002f640
mov byte [esp + 0x12], al
call fcn.1002f640
mov ecx, dword [esp + 0x14]
mov esi, 0x12
sub esi, ecx
mov byte [esp + 0x3c], al
test esi, esi
jle 0x100291e0
call fcn.1002f640
cmp byte [esp + 0x13], 0x50
jne 0x100291c7
cmp byte [esp + 0x12], 0x4b
jne 0x100291c7
cmp byte [esp + 0x3c], 6
jne 0x100291c7
cmp al, 7
je 0x1002923b
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 0x100291a9
test edi, edi
jl 0x10029541
jg 0x100291f2
test ebx, ebx
jbe 0x10029541
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
mov ebx, dword [ebp + 0x167c8]
mov edi, dword [ebp + 0x167cc]
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 0x10029150
jl 0x10029232
test ebx, ebx
jae 0x10029150
xor ebx, ebx
xor edi, edi
jmp 0x10029150
mov ecx, dword [ebp + 0x3d08]
lea eax, [esp + 0x18]
push 0
lea esi, [ebp + 0x4e56]
push eax
push 0x10
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10029541
cmp dword [esp + 0x18], 0x10
jne 0x10029541
mov ecx, dword [ebp + 0x4e62]
mov eax, dword [ebp + 0x4e5a]
mov edx, dword [ebp + 0x4e5e]
mov dword [ebp + 0x4e68], ecx
mov ecx, dword [esi]
pop edi
mov dword [ebp + 0x4e6c], ecx
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
mov eax, dword [ebp + 0x167cc]
mov ecx, dword [ebp + 0x167c8]
cmp eax, esi
jg 0x100292bb
jl 0x100292ad
cmp ecx, 0x19000
jae 0x100292bb
mov esi, ecx
mov edi, eax
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], edi
jmp 0x100292cf
mov dword [esp + 0x30], 0x19000
mov dword [esp + 0x34], esi
mov esi, dword [esp + 0x30]
mov edi, dword [esp + 0x34]
mov edx, dword [ebp + 0x3d08]
sub ecx, esi
sbb eax, edi
push 0
push eax
push ecx
push edx
call fcn.100348d0
add esp, 0x10
push esi
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
mov dword [esp + 0x1c], eax
je 0x1002955a
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x20], ebx
je 0x1002954f
mov ecx, dword [ebp + 0x3d08]
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 0x1002952f
cmp dword [esp + 0x18], esi
jne 0x1002952f
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 0x100294ec
jg 0x1002936d
test ecx, ecx
jb 0x100294ec
jmp 0x1002936d
mov ebx, dword [esp + 0x20]
cmp eax, dword [esp + 0x34]
jg 0x100294ec
jl 0x10029381
cmp edx, esi
ja 0x100294ec
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 0x100293e0
mov ebx, dword [esp + 0x20]
add esi, 1
adc edi, 0
cmp dl, 0x50
mov bl, byte [esi + ebx - 1]
jne 0x100293d3
cmp byte [esp + 0x12], 0x4b
jne 0x100293d3
cmp bl, 6
jne 0x100293d3
mov edx, dword [esp + 0x20]
cmp byte [esi + edx], 7
je 0x10029439
mov dl, byte [esp + 0x12]
dec eax
test eax, eax
mov byte [esp + 0x12], bl
jg 0x100293aa
test ebp, ebp
jl 0x1002952f
jg 0x100293f2
test ecx, ecx
jbe 0x1002952f
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 0x10029369
jl 0x10029430
test ecx, ecx
jae 0x10029369
xor ecx, ecx
xor ebp, ebp
jmp 0x10029369
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 + 0x167c8]
mov ecx, dword [eax + 0x3d08]
sub ebx, ebp
mov ebp, dword [eax + 0x167cc]
sbb ebp, edx
add ebx, esi
adc ebp, edi
add ebx, 1
adc ebp, 0
push ebp
push ebx
push ecx
call fcn.100348d0
add esp, 0x10
cmp eax, ebx
jne 0x10029541
cmp edx, ebp
jne 0x10029541
mov esi, dword [esp + 0x24]
lea edx, [esp + 0x18]
push 0
push edx
mov eax, dword [esi + 0x3d08]
lea edi, [esi + 0x4e56]
push 0x10
push edi
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10029541
cmp dword [esp + 0x18], 0x10
jne 0x10029541
mov ecx, dword [esi + 0x4e62]
mov eax, dword [esi + 0x4e5a]
mov edx, dword [esi + 0x4e5e]
mov dword [esi + 0x4e68], ecx
mov ecx, dword [edi]
pop edi
mov dword [esi + 0x4e6c], 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 0x1002951f
call fcn.10028be0
test eax, eax
je 0x1002951f
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