Function at 0x516b80
Capabilities:
Clear file content
Get file size

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
test byte [rcx + 0x30], 4
mov rbx, rcx
mov rdi, rdx
mov rbp, r8
je 0x516c14
mov eax, dword [0x008de1c0]
test eax, eax
je 0x516d40
sub eax, 1
cdqe
test rax, rdi
je 0x516c14
mov rax, qword [0x008de1d8]
test rax, rax
je 0x516cf0
movzx esi, byte [0x008de1d0]
test sil, sil
jne 0x516d32
mov rcx, qword [rbx + 8]
mov qword [rsp + 0x40], rdi
lea rdx, [rsp + 0x50]
mov r9d, 8
mov dword [rsp + 0x20], 0x14
lea r8, [rsp + 0x40]
call rax
test eax, eax
js 0x516de0
test byte [rbx + 0x30], 8
mov esi, 1
je 0x516cbf
mov eax, esi
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
ret
lea rdx, [rsp + 0x50]
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x516d60
cmp rdi, qword [rsp + 0x50]
mov qword [rsp + 0x40], rdi
je 0x516c66
mov rcx, qword [rbx + 8]
lea r8, [rsp + 0x40]
xor r9d, r9d
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x516d60
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
je 0x516d60
test byte [rbx + 0x30], 8
jne 0x516dc8
mov rax, qword [0x008de1c8]
test rax, rax
je 0x516df5
mov qword [rsp + 0x40], 0
lea rdx, [rsp + 0x3c]
mov dword [rsp + 0x3c], 0
mov rcx, qword [rbx + 0x10]
call rax
mov edx, dword [rsp + 0x3c]
cmp eax, 0xffffffff
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x44], edx
je 0x516e0e
mov rax, qword [rsp + 0x40]
cmp rdi, rax
je 0x516dc8
mov rax, qword [0x008de1e8]
mov rbx, qword [rbx + 8]
test rax, rax
je 0x516d82
mov esi, 1
mov rdx, rdi
mov rcx, rbx
call rax
mov eax, esi
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
ret
cmp byte [0x008de1d0], 0
jne 0x516d32
lea rcx, [0x00816960]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
test rax, rax
je 0x516d2b
lea rdx, [0x00816966]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
mov qword [0x008de1d8], rax
jne 0x516bbf
mov byte [0x008de1d0], 1
xor esi, esi
mov eax, esi
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
ret
call fcn.005f3c10
mov dword [0x008de1c0], eax
sub eax, 1
cdqe
test rax, rdi
jne 0x516baf
jmp 0x516c14
call fcn.004d6fb0
xor esi, esi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov qword [rbp + 8], rbx
mov dword [rbp], eax
mov eax, esi
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
ret
cmp byte [0x008de1e0], 0
jne 0x516cd3
lea rcx, [0x00816946]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
test rax, rax
je 0x516dc1
lea rdx, [0x0081694f]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
mov qword [0x008de1e8], rax
jne 0x516cd3
mov byte [0x008de1e0], 1
mov esi, 1
mov eax, esi
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
ret
call fcn.004d6fb0
mov dword [rbp], 0xffffffff
mov qword [rbp + 8], rax
jmp 0x516d34
cmp byte [0x008de1c5], 0
je 0x516e32
mov qword [rsp + 0x40], 0
xor eax, eax
jmp 0x516cb6
call fcn.004d6fb0
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov qword [rbp + 8], rsi
xor esi, esi
test eax, eax
mov dword [rbp], eax
jne 0x516d34
jmp 0x516cb1
lea rcx, [0x0081697b]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
test rax, rax
je 0x516e74
lea rdx, [0x00816988]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x008de1c8], rax
mov qword [rsp + 0x40], 0
test rax, rax
jne 0x516c89
xor eax, eax
jmp 0x516cb6
mov byte [0x008de1c5], 1
mov rax, qword [0x008de1c8]
jmp 0x516e5b