Function at 0x1400511e0
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 - 0x4d0]
sub rsp, 0x5d0
mov rax, qword [0x1401f5698]
xor rax, rsp
mov qword [rbp + 0x4c0], rax
mov qword [rsp + 0x60], r8
lea rcx, [rbp + 0x1b0]
mov rbx, rdx
mov qword [rsp + 0x68], r9
xor eax, eax
xor edx, edx
mov r8d, 0x208
mov r14d, eax
call fcn.14012d4b0
mov edi, 0x100
lea rcx, [rbp - 0x60]
mov r8d, edi
xor edx, edx
call fcn.14012d4b0
mov r8d, edi
lea rcx, [rbp + 0x3c0]
xor edx, edx
call fcn.14012d4b0
xor edx, edx
lea r8d, [rdi + 4]
lea rcx, [rbp + 0xa0]
call fcn.14012d4b0
or rax, 0xffffffffffffffff
xor edi, edi
mov qword [rsp + 0x30], rdi
xor r9d, r9d
mov dword [rsp + 0x28], edi
mov edx, 0x80000000
mov rcx, rbx
mov dword [rsp + 0x54], eax
lea r8d, [rax + 2]
mov dword [rsp + 0x50], eax
mov r15d, eax
mov dword [rsp + 0x4c], eax
mov r12d, eax
mov dword [rsp + 0x20], 3
mov r13d, eax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x140051753
lea r9, [rsp + 0x40]
mov dword [rsp + 0x40], edi
lea r8d, [rdi + 0xc]
mov qword [rsp + 0x20], rdi
lea rdx, [rbp - 0x70]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140051740
cmp dword [rsp + 0x40], 0xc
jne 0x140051740
movzx ecx, byte [rbp - 0x6c]
lea r8d, [rdi + 4]
movzx eax, word [rbp - 0x6c]
lea rdx, str.OTTO
shl cx, 8
shr ax, 8
or cx, ax
mov word [rbp - 0x6c], cx
lea rcx, [rbp - 0x70]
call fcn.140113edc
test eax, eax
jne 0x140051740
cmp di, word [rbp - 0x6c]
movzx ebx, di
jae 0x140051740
lea r9, [rsp + 0x40]
mov dword [rsp + 0x40], edi
mov r8d, 0x10
mov qword [rsp + 0x20], rdi
lea rdx, [rbp - 0x80]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140051371
cmp dword [rsp + 0x40], edi
je 0x140051371
mov r8d, 4
lea rdx, [0x140188a34]
lea rcx, [rbp - 0x80]
call fcn.140113edc
test eax, eax
je 0x14005137a
inc bx
cmp bx, word [rbp - 0x6c]
jmp 0x140051326
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, rsi
shl edx, 8
or edx, eax
mov dword [rbp - 0x78], edx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x140051740
lea r9, [rsp + 0x40]
mov dword [rsp + 0x40], edi
mov r8d, 6
mov qword [rsp + 0x20], rdi
lea rdx, [rsp + 0x44]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140051740
cmp dword [rsp + 0x40], edi
je 0x140051740
movzx edx, byte [rsp + 0x44]
movzx eax, word [rsp + 0x44]
movzx r8d, byte [rsp + 0x46]
movzx ecx, byte [rsp + 0x48]
shr ax, 8
shl dx, 8
or dx, ax
shl r8w, 8
movzx eax, word [rsp + 0x46]
shr ax, 8
or r8w, ax
shl cx, 8
movzx eax, word [rsp + 0x48]
shr ax, 8
or cx, ax
mov word [rsp + 0x44], dx
mov word [rsp + 0x46], r8w
mov word [rsp + 0x48], cx
test dx, dx
jne 0x140051740
cmp r8w, di
je 0x140051740
mov ebx, edi
jbe 0x14005157c
mov r14d, 1
lea r9, [rsp + 0x40]
mov dword [rsp + 0x40], edi
mov r8d, 0xc
mov qword [rsp + 0x20], rdi
lea rdx, [rsp + 0x70]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140051557
cmp dword [rsp + 0x40], edi
je 0x140051557
movzx ecx, byte [rsp + 0x76]
movzx eax, word [rsp + 0x76]
movzx r8d, byte [rsp + 0x78]
shr ax, 8
shl cx, 8
or cx, ax
shl r8w, 8
movzx eax, word [rsp + 0x7a]
movzx edx, cx
movzx ecx, byte [rsp + 0x7a]
shr ax, 8
shl cx, 8
or cx, ax
mov word [rsp + 0x76], dx
movzx eax, word [rsp + 0x78]
shr ax, 8
or r8w, ax
mov word [rsp + 0x7a], cx
mov word [rsp + 0x78], r8w
sub edx, r14d
je 0x14005154b
sub edx, r14d
je 0x14005153d
cmp edx, 2
jne 0x140051557
movzx eax, r8w
mov dword [rsp + 0x54], eax
movzx r15d, cx
jmp 0x140051557
movzx eax, r8w
mov dword [rsp + 0x4c], eax
movzx r13d, cx
jmp 0x140051557
movzx eax, r8w
mov dword [rsp + 0x50], eax
movzx r12d, cx
cmp r12d, 0xffffffff
je 0x140051569
cmp r13d, 0xffffffff
je 0x140051569
cmp r15d, 0xffffffff
jne 0x140051579
movzx eax, word [rsp + 0x46]
add ebx, r14d
cmp ebx, eax
jl 0x140051497
mov r14d, edi
test edi, edi
je 0x1400515ab
cmp edi, 1
je 0x140051598
cmp r13d, 0xffffffff
je 0x14005172d
mov ebx, dword [rsp + 0x4c]
mov eax, r13d
jmp 0x1400515bc
cmp r12d, 0xffffffff
je 0x14005172d
mov ebx, dword [rsp + 0x50]
mov eax, r12d
jmp 0x1400515bc
cmp r15d, 0xffffffff
je 0x14005172d
mov ebx, dword [rsp + 0x54]
mov eax, r15d
movzx edx, word [rsp + 0x48]
xor r9d, r9d
add edx, eax
xor r8d, r8d
add edx, dword [rbp - 0x78]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x140051659
mov eax, 0x103
lea r9, [rsp + 0x40]
cmp ebx, 0x104
lea rdx, [rbp + 0xa0]
mov rcx, rsi
cmovge ebx, eax
and dword [rsp + 0x40], 0
and qword [rsp + 0x20], 0
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140051659
cmp dword [rsp + 0x40], ebx
jne 0x140051659
mov ecx, edi
test edi, edi
je 0x1400516fe
sub ecx, 1
je 0x1400516f0
cmp ecx, 1
jne 0x14005172d
lea rax, [rbp + 0x3c0]
mov dword [rsp + 0x28], 0x7f
mov r9d, ebx
mov qword [rsp + 0x20], rax
lea r8, [rbp + 0xa0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
xor ebx, ebx
test r14d, r14d
je 0x140051740
cmp word [rbp + 0x1b0], bx
jne 0x1400516b5
lea rdx, [rbp - 0x60]
lea rcx, [rbp + 0x1b0]
call fcn.1400047d8
cmp word [rbp + 0x3c0], bx
je 0x1400516b5
mov edi, 0x104
lea r8, [0x14017669c]
mov edx, edi
lea rcx, [rbp + 0x1b0]
call fcn.140001e48
lea r8, [rbp + 0x3c0]
mov edx, edi
lea rcx, [rbp + 0x1b0]
call fcn.140001e48
mov word [rbp + 0x1ee], bx
mov word [rbp - 0x22], bx
cmp word [rbp - 0x60], bx
je 0x1400516d4
mov rcx, qword [rsp + 0x60]
lea rdx, [rbp - 0x60]
call fcn.14000129c
cmp word [rbp + 0x1b0], bx
je 0x14005173d
mov rcx, qword [rsp + 0x68]
lea rdx, [rbp + 0x1b0]
call fcn.14000129c
jmp 0x140051740
mov dword [rsp + 0x28], 0x7f
lea rax, [rbp - 0x60]
jmp 0x14005170e
mov eax, 0x103
mov dword [rsp + 0x28], eax
lea rax, [rbp + 0x1b0]
mov r9d, ebx
mov qword [rsp + 0x20], rax
lea r8, [rbp + 0xa0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov r14d, 1
inc edi
cmp edi, 3
jge 0x140051659
jmp 0x14005157c
mov r14d, ebx
lea rcx, [rsi - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x140051753
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, r14d
mov rcx, qword [rbp + 0x4c0]
xor rcx, rsp
call fcn.14012bda0
mov rbx, qword [rsp + 0x610]
add rsp, 0x5d0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret