Function at 0x140224360
Capabilities:
Read file on windows

Disassembly:
mov r11, rsp
push rbx
push rbp
push rsi
push rdi
sub rsp, 0x1d8
mov rax, qword [0x14042d950]
xor rax, rsp
mov qword [rsp + 0x1c0], rax
xor ebx, ebx
mov rdi, rcx
xor ecx, ecx
mov word [rsp + 0x170], bx
test r8, r8
mov esi, ebx
setne sil
mov rax, r8
mov rbp, rdx
test esi, esi
mov dword [rsp + 0x40], ebx
mov qword [r11 - 0x86], rcx
mov qword [r11 - 0x7e], rcx
mov qword [r11 - 0x76], rcx
mov qword [r11 - 0x6e], rcx
mov qword [r11 - 0x66], rcx
mov qword [r11 - 0x5e], rcx
mov qword [r11 - 0x56], rcx
mov dword [r11 - 0x4e], ecx
mov word [r11 - 0x4a], cx
mov word [rsp + 0x48], cx
mov qword [rsp + 0x4a], rcx
mov qword [rsp + 0x52], rcx
mov word [rsp + 0x5a], cx
jne 0x1402244cc
lea rbp, [0x140c48ec0]
xor edx, edx
mov r8d, 0x80
mov rcx, rbp
call sub.ntdll.dll_memset
lea edx, [rbx + 0x5c]
lea rcx, [0x140372660]
call qword [sym.imp.ntdll.dll_strrchr]
test rax, rax
mov rdi, rax
je 0x1402244a3
xor eax, eax
lea rdx, [0x140372d0c]
lea rcx, [rsp + 0x1b0]
mov r8d, Ordinal_1468
mov byte [rsp + 0x1b0], bl
mov qword [rsp + 0x1b1], rax
mov word [rsp + 0x1b9], ax
mov byte [rsp + reloc.MFC80U.DLL_Ordinal_443], al
call qword [sym.imp.ntdll.dll_sprintf]
lea rdx, [rdi + 1]
mov rcx, rbp
sub rcx, rdx
nop
movzx eax, byte [rdx]
add rdx, 1
test al, al
mov byte [rcx + rdx - 1], al
jne 0x140224460
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, rbp
repne scasb al, byte [rdi]
xor ecx, ecx
lea rdx, [rsp + 0x1b0]
nop
nop
nop
movzx eax, byte [rdx + rcx]
add rcx, 1
test al, al
mov byte [rdi + rcx - 2], al
jne 0x140224490
mov rbx, rbp
call fcn.140049470
lea r8, str.__pPath__NULL_
lea rdx, str._s_return_code:_0x_08X___s.
mov rdi, qword [rax]
xor r9d, r9d
mov rcx, rax
mov qword [rsp + 0x20], rbx
call qword [rdi + 0x10]
jmp 0x140224921
xor r9d, r9d
mov qword [rsp + 0x30], rbx
mov edx, 0x80000000
lea r8d, [r9 + 1]
mov rcx, rax
mov dword [rsp + 0x28], 0x80
mov qword [rsp + 0x1d0], r12
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
cmp rax, 0xffffffffffffffff
mov esi, ebx
mov r12, rax
setne sil
test esi, esi
jne 0x1402245fc
lea rbp, [0x140c48ec0]
xor edx, edx
mov r8d, 0x80
mov rcx, rbp
call sub.ntdll.dll_memset
lea edx, [rsi + 0x5c]
lea rcx, [0x140372688]
call qword [sym.imp.ntdll.dll_strrchr]
test rax, rax
mov rdi, rax
je 0x1402245d3
xor eax, eax
lea rdx, [0x140372d0c]
lea rcx, [rsp + 0x1b0]
mov r8d, Ordinal_1468
mov byte [rsp + 0x1b0], bl
mov qword [rsp + 0x1b1], rax
mov word [rsp + 0x1b9], ax
mov byte [rsp + reloc.MFC80U.DLL_Ordinal_443], al
call qword [sym.imp.ntdll.dll_sprintf]
lea rdx, [rdi + 1]
mov rcx, rbp
sub rcx, rdx
nop
nop
movzx eax, byte [rdx]
add rdx, 1
test al, al
mov byte [rcx + rdx - 1], al
jne 0x140224590
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, rbp
repne scasb al, byte [rdi]
xor ecx, ecx
lea rdx, [rsp + 0x1b0]
nop
nop
nop
movzx eax, byte [rdx + rcx]
add rcx, 1
test al, al
mov byte [rdi + rcx - 2], al
jne 0x1402245c0
mov rbx, rbp
call fcn.140049470
lea r8, str.__hFile__INVALID_HANDLE_VALUE_
lea rdx, str._s_return_code:_0x_08X___s.
mov rdi, qword [rax]
xor r9d, r9d
mov rcx, rax
mov qword [rsp + 0x20], rbx
call qword [rdi + 0x10]
jmp 0x14022490a
lea r9, [rsp + 0x40]
lea rdx, [rsp + 0x170]
mov r8d, 0x40
mov rcx, rax
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
mov esi, eax
jne 0x140224661
lea rcx, [0x1403726c0]
mov edx, 0x5be
call fcn.140223eb0
mov rdi, rax
call fcn.140049470
lea r8, str.ReadFile_hFile__DosHd__sizeof_DosHd___dwByteToRead__NULL_
mov r10, qword [rax]
lea rdx, str._s_return_code:_0x_08X___s.
xor r9d, r9d
mov rcx, rax
mov qword [rsp + 0x20], rdi
call qword [r10 + 0x10]
jmp 0x14022490a
movsxd rdx, dword [rsp + 0x1ac]
xor r9d, r9d
xor r8d, r8d
add rdx, 4
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
mov esi, eax
jne 0x1402246c0
lea rcx, [0x140372710]
mov edx, 0x5c0
call fcn.140223eb0
mov rdi, rax
call fcn.140049470
lea r8, [0x140372720]
mov r10, qword [rax]
lea rdx, str._s_return_code:_0x_08X___s.
xor r9d, r9d
mov rcx, rax
mov qword [rsp + 0x20], rdi
call qword [r10 + 0x10]
jmp 0x14022490a
lea r9, [rsp + 0x40]
lea rdx, [rsp + 0x48]
mov r8d, 0x14
mov rcx, r12
mov dword [rsp + 0x40], ebx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
mov esi, eax
jne 0x140224726
lea rcx, [0x140372758]
mov edx, 0x5c2
call fcn.140223eb0
mov rdi, rax
call fcn.140049470
lea r8, str.ReadFile_hFile__FileHd__sizeof_FileHd___dwByteToRead__NULL_
mov r10, qword [rax]
lea rdx, str._s_return_code:_0x_08X___s.
xor r9d, r9d
mov rcx, rax
mov qword [rsp + 0x20], rdi
call qword [r10 + 0x10]
jmp 0x14022490a
bt word [rsp + 0x5a], 8
jae 0x140224824
lea rcx, [rsp + 0x64]
xor edx, edx
mov r8d, 0xf4
mov dword [rsp + 0x60], ebx
call sub.ntdll.dll_memset
movsxd rdx, dword [rsp + 0x1ac]
xor r9d, r9d
xor r8d, r8d
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
mov esi, eax
jne 0x1402247a4
lea rcx, [0x1403727a8]
mov edx, 0x5ca
call fcn.140223eb0
mov rdi, rax
call fcn.140049470
lea r8, [0x1403727b8]
mov r10, qword [rax]
lea rdx, str._s_return_code:_0x_08X___s.
xor r9d, r9d
mov rcx, rax
mov qword [rsp + 0x20], rdi
call qword [r10 + 0x10]
jmp 0x14022490a
lea r9, [rsp + 0x40]
lea rdx, [rsp + 0x60]
mov r8d, 0xf8
mov rcx, r12
mov dword [rsp + 0x40], ebx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
mov esi, eax
jne 0x14022480a
lea rcx, [0x1403727f0]
mov edx, 0x5cc
call fcn.140223eb0
mov rdi, rax
call fcn.140049470
lea r8, str.ReadFile_hFile__NtHd32__sizeof_NtHd32___dwByteToRead__NULL_
mov r10, qword [rax]
lea rdx, str._s_return_code:_0x_08X___s.
xor r9d, r9d
mov rcx, rax
mov qword [rsp + 0x20], rdi
call qword [r10 + 0x10]
jmp 0x14022490a
movzx eax, word [rsp + 0xa8]
mov dword [rdi], eax
movzx eax, word [rsp + 0xaa]
mov dword [rbp], eax
jmp 0x14022490a
lea rcx, [rsp + 0x64]
xor edx, edx
mov r8d, Ordinal_265
mov dword [rsp + 0x60], ebx
call sub.ntdll.dll_memset
movsxd rdx, dword [rsp + 0x1ac]
xor r9d, r9d
xor r8d, r8d
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
mov esi, eax
jne 0x140224892
lea rcx, [0x140372840]
mov edx, Ordinal_1498
call fcn.140223eb0
mov rdi, rax
call fcn.140049470
lea r8, str.SetFilePointerEx_hFile__FilePointer__NULL__FILE_BEGIN_
mov r10, qword [rax]
lea rdx, str._s_return_code:_0x_08X___s.
xor r9d, r9d
mov rcx, rax
mov qword [rsp + 0x20], rdi
call qword [r10 + 0x10]
jmp 0x14022490a
lea r9, [rsp + 0x40]
lea rdx, [rsp + 0x60]
mov r8d, Ordinal_265
mov rcx, r12
mov dword [rsp + 0x40], ebx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
mov esi, eax
jne 0x1402248f5
lea rcx, [0x140372888]
mov edx, Ordinal_1498
call fcn.140223eb0
mov rdi, rax
call fcn.140049470
lea r8, str.ReadFile_hFile__NtHd64__sizeof_NtHd64___dwByteToRead__NULL_
mov r10, qword [rax]
lea rdx, str._s_return_code:_0x_08X___s.
xor r9d, r9d
mov rcx, rax
mov qword [rsp + 0x20], rdi
call qword [r10 + 0x10]
jmp 0x14022490a
movzx eax, word [rsp + 0xa8]
mov dword [rdi], eax
movzx eax, word [rsp + 0xaa]
mov dword [rbp], eax
cmp r12, 0xffffffffffffffff
je 0x140224919
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r12, qword [rsp + 0x1d0]
mov eax, esi
mov rcx, qword [rsp + 0x1c0]
xor rcx, rsp
call fcn.140161080
add rsp, 0x1d8
pop rdi
pop rsi
pop rbp
pop rbx
ret