Function at 0x140051780
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x5a0]
sub rsp, 0x6a0
mov rax, qword [0x1401f5698]
xor rax, rsp
mov qword [rbp + 0x590], rax
mov rbx, rdx
mov qword [rsp + 0x50], r8
xor r15d, r15d
mov qword [rsp + 0x58], r9
mov r13, r8
mov rcx, rbx
mov esi, r15d
lea r14d, [r15 + 1]
mov r8b, r14b
mov dl, r14b
call fcn.1400296e4
mov rcx, qword [0x14022ab50]
mov edx, r14d
call fcn.14007f158
test eax, eax
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], r15d
mov r8d, r14d
setne r12b
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov edx, 0x80000000
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x140051e32
lea r9, [rsp + 0x40]
mov dword [rsp + 0x40], r15d
lea r8d, [r15 + 0xc]
mov qword [rsp + 0x20], r15
lea rdx, [rsp + 0x70]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140051e1f
cmp dword [rsp + 0x40], 0xc
jne 0x140051e1f
movzx r8d, byte [rsp + 0x74]
movzx eax, word [rsp + 0x74]
movzx ecx, byte [rsp + 0x70]
movzx edx, byte [rsp + 0x72]
shr ax, 8
shl r8w, 8
or r8w, ax
shl cx, 8
movzx eax, word [rsp + 0x70]
shr ax, 8
or cx, ax
shl dx, 8
movzx eax, word [rsp + 0x72]
shr ax, 8
or dx, ax
mov word [rsp + 0x74], r8w
mov word [rsp + 0x70], cx
mov word [rsp + 0x72], dx
cmp cx, r14w
jne 0x140051e1f
test dx, dx
jne 0x140051e1f
mov ebx, r15d
cmp r15w, r8w
jae 0x140051e1f
lea r9, [rsp + 0x40]
mov dword [rsp + 0x40], r15d
mov r8d, 0x10
mov qword [rsp + 0x20], r15
lea rdx, [rbp - 0x80]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x14005190d
cmp dword [rsp + 0x40], r15d
je 0x14005190d
mov r8d, 4
lea rdx, [0x140188a34]
lea rcx, [rbp - 0x80]
call fcn.140113edc
test eax, eax
je 0x14005191f
movzx eax, word [rsp + 0x74]
add ebx, r14d
cmp ebx, eax
jge 0x140051e1f
jmp 0x1400518c6
movzx eax, byte [rbp - 0x74]
xor r9d, r9d
mov edx, dword [rbp - 0x74]
xor r8d, r8d
shl ax, 8
movzx ecx, ax
movzx eax, word [rbp - 0x74]
shr eax, 8
or ecx, eax
shr edx, 0x10
movzx eax, dl
shl ecx, 8
or ecx, eax
mov eax, edx
shr eax, 8
shl ecx, 8
or ecx, eax
movzx eax, byte [rbp - 0x78]
shl ax, 8
movzx edx, ax
movzx eax, word [rbp - 0x78]
shr eax, 8
or edx, eax
mov dword [rbp - 0x74], ecx
mov ecx, dword [rbp - 0x78]
shr ecx, 0x10
shl edx, 8
movzx eax, cl
or edx, eax
mov eax, ecx
shr eax, 8
mov rcx, rdi
shl edx, 8
or edx, eax
mov dword [rbp - 0x78], edx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x140051e1f
lea r9, [rsp + 0x40]
mov dword [rsp + 0x40], r15d
mov r8d, 6
mov qword [rsp + 0x20], r15
lea rdx, [rsp + 0x44]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140051e1f
cmp dword [rsp + 0x40], r15d
je 0x140051e1f
movzx edx, byte [rsp + 0x46]
mov r14d, r15d
movzx eax, word [rsp + 0x46]
movzx ecx, byte [rsp + 0x48]
shr ax, 8
shl dx, 8
or dx, ax
shl cx, 8
movzx eax, word [rsp + 0x48]
shr ax, 8
or cx, ax
mov word [rsp + 0x46], dx
mov word [rsp + 0x48], cx
cmp r15w, dx
jae 0x140051e1f
mov ebx, 1
lea r9, [rsp + 0x40]
mov dword [rsp + 0x40], r15d
mov r8d, 0xc
mov qword [rsp + 0x20], r15
lea rdx, [rsp + 0x60]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140051dc4
cmp dword [rsp + 0x40], r15d
je 0x140051dc4
movzx ecx, byte [rsp + 0x66]
movzx eax, word [rsp + 0x66]
shl cx, 8
shr ax, 8
or cx, ax
mov word [rsp + 0x66], cx
cmp cx, bx
jne 0x140051dc4
movzx ecx, byte [rsp + 0x68]
mov r9d, ebx
movzx eax, word [rsp + 0x68]
xor r8d, r8d
shl cx, 8
xor edx, edx
shr ax, 8
or cx, ax
movzx eax, word [rsp + 0x6a]
mov word [rsp + 0x68], cx
movzx ecx, byte [rsp + 0x6a]
shl cx, 8
shr ax, 8
or cx, ax
mov word [rsp + 0x6a], cx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
movzx r8d, word [rsp + 0x6a]
xor r9d, r9d
add r8d, dword [rbp - 0x78]
mov rcx, rdi
movzx edx, word [rsp + 0x48]
mov r15d, eax
add edx, r8d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x140051daf
cmp word [rsp + 0x68], 0x40
ja 0x140051daf
xor edx, edx
lea rcx, [rbp - 0x70]
lea r8d, [rdx + 0x46]
call fcn.14012d4b0
movzx r8d, word [rsp + 0x68]
lea r9, [rsp + 0x40]
and dword [rsp + 0x40], 0
lea rdx, [rbp - 0x70]
and qword [rsp + 0x20], 0
add r8d, 2
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
xor r9d, r9d
test eax, eax
je 0x140051daf
cmp dword [rsp + 0x40], r9d
je 0x140051daf
movzx eax, word [rsp + 0x68]
cmp rax, 0x46
jae 0x140051e5e
lea rdx, [rax + 1]
mov byte [rbp + rax - 0x70], r9b
mov r10d, eax
mov ecx, eax
cmp rdx, 0x46
jae 0x140051e5e
add rcx, 2
mov byte [rbp + rdx - 0x70], r9b
cmp rcx, 0x46
jae 0x140051e5e
mov byte [rbp + rcx - 0x70], r9b
mov ebx, r9d
test r12b, r12b
je 0x140051c2a
movzx eax, word [rsp + 0x64]
lea rdx, str.__Platf:__u_Enc:__u_Lang:__u_Len:__u__
movzx r9d, word [rsp + 0x62]
lea rcx, [rbp - 0x20]
movzx r8d, word [rsp + 0x60]
mov dword [rsp + 0x28], r10d
mov dword [rsp + 0x20], eax
call fcn.14000c8bc
lea rcx, [rbp - 0x20]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov r8d, dword [rsp + 0x40]
xor r9d, r9d
test r8d, r8d
je 0x140051bff
movsxd rcx, eax
lea rdx, [rbp - 0x20]
add eax, r8d
xor r13d, r13d
lea rdx, [rdx + rcx*2]
lea rcx, [rbp - 0x70]
cmp byte [rcx], r13b
je 0x140051be0
movsx r9d, byte [rcx]
jmp 0x140051be6
mov r9d, 0x2e
mov word [rdx], r9w
inc rcx
add rdx, 2
sub r8, 1
jne 0x140051bd5
mov r13, qword [rsp + 0x50]
xor r9d, r9d
cdqe
mov ecx, 0x22
mov word [rbp + rax*2 - 0x20], cx
lea rax, [rax*2 + 2]
cmp rax, 0x190
jae 0x140051e5e
mov word [rbp + rax - 0x20], r9w
movzx eax, word [rsp + 0x68]
movzx edx, word [rsp + 0x60]
mov r10d, 0x300
mov r8, qword [rbp - 0x70]
mov r11d, 0x100
movzx ecx, word [rsp + 0x62]
cmp dx, r10w
jne 0x140051c50
cmp cx, r11w
je 0x140051c64
test dx, dx
jne 0x140051cc7
test cx, cx
je 0x140051c64
cmp cx, r10w
jne 0x140051d3f
test r8w, r8w
je 0x140051cc7
movzx r8d, ax
mov rdx, r9
test r8, r8
je 0x140051c97
movzx eax, byte [rbp + rdx*2 - 0x70]
movzx ecx, byte [rbp + rdx*2 - 0x6f]
shl ax, 8
or cx, ax
mov word [rbp + rdx*2 + 0x170], cx
inc rdx
cmp rdx, r8
jl 0x140051c76
add rdx, rdx
cmp rdx, 0x208
jae 0x140051e5e
mov word [rbp + rdx + 0x170], r9w
cmp word [rbp + 0x170], r9w
je 0x140051d3f
lea rbx, [rbp + 0x170]
jmp 0x140051d3a
cmp dx, r11w
jne 0x140051d3f
test cx, cx
jne 0x140051d3f
test r8b, r8b
je 0x140051d3f
movzx ecx, ax
mov eax, ecx
cmp byte [rbp + rax - 0x70], 0x20
jne 0x140051cf8
cmp rax, 0x46
jae 0x140051e5e
mov byte [rbp + rax - 0x70], r9b
sub rax, 1
jns 0x140051cdc
cmp rcx, 0x46
jae 0x140051e5e
mov byte [rbp + rcx - 0x70], r9b
cmp byte [rbp - 0x70], r9b
je 0x140051d3f
lea rax, [rbp + 0x380]
mov dword [rsp + 0x28], 0x21
or r9d, 0xffffffff
mov qword [rsp + 0x20], rax
lea r8, [rbp - 0x70]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea rbx, [rbp + 0x380]
mov esi, 1
test r12b, r12b
je 0x140051daa
test rbx, rbx
je 0x140051d78
lea r8, [0x140188a90]
mov edx, 0xc8
lea rcx, [rbp - 0x20]
call fcn.140001e48
mov r8, rbx
lea rcx, [rbp - 0x20]
mov edx, 0xc8
call fcn.140001e48
lea r8, [0x140179218]
jmp 0x140051d7f
lea r8, str.___UNKNOWN_FORMAT
mov edx, 0xc8
lea rcx, [rbp - 0x20]
call fcn.140001e48
mov rcx, qword [0x14022a9e0]
lea rdx, [rbp - 0x20]
mov ebx, 1
mov r9b, bl
mov r8b, bl
call fcn.1400157d0
jmp 0x140051daf
mov ebx, 1
xor r9d, r9d
xor r8d, r8d
mov edx, r15d
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
xor r15d, r15d
movzx eax, word [rsp + 0x46]
add r14d, ebx
cmp r14d, eax
jl 0x140051a11
test esi, esi
je 0x140051e1f
cmp word [rbp + 0x380], r15w
lea rax, [rbp + 0x170]
lea rdx, [rbp + 0x380]
mov rcx, r13
cmove rdx, rax
call fcn.14000129c
cmp word [rbp + 0x170], r15w
lea rax, [rbp + 0x380]
mov rcx, qword [rsp + 0x58]
lea rdx, [rbp + 0x170]
cmove rdx, rax
call fcn.14000129c
lea rcx, [rdi - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x140051e32
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
mov rcx, qword [rbp + 0x590]
xor rcx, rsp
call fcn.14012bda0
mov rbx, qword [rsp + 0x6e0]
add rsp, 0x6a0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
call fcn.14012c3e0
int3