Function at 0x140021530
Capabilities:
Get file size

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r13
push r14
push r15
sub rsp, 0x50
mov rbx, qword [rsp + 0xa0]
xor esi, esi
mov r15, r9
mov rdi, qword [rbx + 8]
mov rbp, r8
mov r13, rdx
mov r14, rcx
mov dword [rbx + 0x38], 0xa0ffffff
test rdi, rdi
je 0x14002159b
mov rax, qword [rbx + 0x10]
lea edx, [rsi + 1]
xor r9d, r9d
mov qword [rsp + 0x30], rax
xor r8d, r8d
xor ecx, ecx
mov dword [rsp + 0x28], esi
mov qword [rsp + 0x20], rsi
call rdi
test eax, eax
jne 0x14002159b
mov dword [rbx + 0x38], 0xa0000001
jmp 0x140021863
mov qword [rsp + 0x80], r12
test rbp, rbp
je 0x1400215bc
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, rbp
repne scasb al, byte [rdi]
not rcx
lea r12, [rcx - 1]
jmp 0x1400215bf
mov r12d, esi
mov edi, dword [rbx + 0x18]
lea r9, [rsp + 0xa0]
lea r8, [rsp + 0x48]
mov edx, 0x28
xor ecx, ecx
mov qword [rsp + 0x48], rsi
mov dword [rsp + 0xa0], 8
call qword [sym.imp.WININET.dll_InternetQueryOptionA]
test eax, eax
je 0x14002160c
cmp dword [rsp + 0xa0], 8
jne 0x14002160c
mov eax, dword [rsp + 0x48]
cmp eax, 4
ja 0x140021612
jne 0x14002160c
cmp dword [rsp + 0x4c], 0x47
jae 0x140021612
and edi, 0xfffcfc0f
mov rax, qword [rbx + 0x10]
mov r9d, r12d
mov r8, rbp
mov qword [rsp + 0x28], rax
mov rdx, r13
mov rcx, r14
mov dword [rsp + 0x20], edi
call qword [sym.imp.WININET.dll_InternetOpenUrlA]
mov r12, rax
test rax, rax
je 0x140021854
mov rax, qword [rbx + 8]
test rax, rax
je 0x14002166f
mov rcx, qword [rbx + 0x10]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x30], rcx
lea edx, [r9 + 2]
mov rcx, r12
mov dword [rsp + 0x28], esi
mov qword [rsp + 0x20], rsi
call rax
test eax, eax
je 0x1400216f2
lea r8, [rsp + 0x40]
mov rdx, r12
mov rcx, rbx
mov dword [rsp + 0x40], esi
call fcn.1400210c0
test al, al
je 0x140021839
test byte [rbx + 0x40], 1
je 0x1400216bf
mov rdi, qword [rbx + 8]
test rdi, rdi
je 0x1400216bf
mov rax, qword [rbx + 0x10]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x30], rax
lea edx, [r9 + 8]
mov rcx, r12
mov dword [rsp + 0x28], esi
mov qword [rsp + 0x20], rsi
call rdi
test eax, eax
je 0x1400216f2
mov r10, qword [rbx + 8]
mov edi, dword [rsp + 0x40]
test r10, r10
je 0x1400216fe
mov rax, qword [rbx + 0x10]
xor r8d, r8d
mov r9d, edi
mov qword [rsp + 0x30], rax
lea edx, [r8 + 3]
mov rcx, r12
mov dword [rsp + 0x28], esi
mov qword [rsp + 0x20], rsi
call r10
test eax, eax
jne 0x1400216fe
mov dword [rbx + 0x38], 0xa0000001
jmp 0x140021839
test r15, r15
je 0x140021825
lea rdx, [rsp + 0x40]
mov rcx, r15
mov dword [rsp + 0x40], esi
call fcn.140021410
mov rbp, rax
cmp rax, 0xffffffffffffffff
je 0x14002181c
mov rax, qword [rbx + 8]
test rax, rax
je 0x140021753
mov rcx, qword [rbx + 0x10]
xor r8d, r8d
mov r9d, edi
mov qword [rsp + 0x30], rcx
lea edx, [r8 + 4]
mov rcx, r12
mov dword [rsp + 0x28], esi
mov qword [rsp + 0x20], rsi
call rax
test eax, eax
je 0x1400217ac
test byte [rbx], 1
je 0x1400217b5
test byte [rbx + 0x40], 1
jne 0x1400217b5
cmp dword [rsp + 0x40], 3
jne 0x1400217b5
xor edx, edx
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
je 0x1400217b5
cmp edi, eax
jne 0x1400217b5
mov dword [rsp + 0x30], esi
mov r9d, eax
mov r8d, 7
mov rdx, r12
mov rcx, rbx
mov qword [rsp + 0x28], rsi
mov dword [rsp + 0x20], edi
call fcn.140021050
test al, al
je 0x1400217ac
mov dword [rbx + 0x38], 0x20000000
mov esi, 1
jmp 0x1400217ef
mov dword [rbx + 0x38], 0xa0000001
jmp 0x140021801
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x1400217fa
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
je 0x1400217fa
mov r9d, edi
mov r8, rbp
mov rdx, r12
mov rcx, rbx
call fcn.140021220
mov esi, eax
test eax, eax
je 0x140021801
test byte [rbx], 2
je 0x140021801
mov qword [rbx + 0x30], rbp
jmp 0x140021839
mov dword [rbx + 0x38], 0xa0000008
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rbp
mov edi, eax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140021839
mov dword [rbx + 0x38], 0xa0000006
jmp 0x140021839
mov r9d, edi
or r8, 0xffffffffffffffff
mov rdx, r12
mov rcx, rbx
call fcn.140021220
mov esi, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, r12
mov edi, eax
call qword [sym.imp.WININET.dll_InternetCloseHandle]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x14002185b
mov dword [rbx + 0x38], 0xa0000002
mov r12, qword [rsp + 0x80]
lea r11, [rsp + 0x50]
mov eax, esi
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop rdi
pop rsi
ret