Function at 0x18001a470
Capabilities:
Get file size
Read file on windows

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 8]
sub rsp, 0x108
mov qword [rbp - 0x50], 0xfffffffffffffffe
mov rax, qword [0x1800c5470]
xor rax, rsp
mov qword [rbp - 8], rax
mov qword [rbp - 0x70], r9
mov qword [rbp - 0x78], r8
mov rax, rdx
mov r12, rcx
mov qword [rbp - 0x68], rcx
xor ebx, ebx
mov qword [r8], rbx
mov qword [r9], rbx
mov edi, ebx
mov r14b, bl
mov qword [rsp + 0x30], rbx
mov r15d, 0x80
mov dword [rsp + 0x28], r15d
mov dword [rsp + 0x20], 3
xor r9d, r9d
lea r13d, [rbx + 1]
mov r8d, r13d
mov edx, 0x80000000
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x18001a54e
lea rdx, [rsp + 0x78]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x18001a54e
mov rax, qword [rsp + 0x78]
cmp rax, 0x4000000
jg 0x18001a54e
cmp rax, r15
jb 0x18001a54e
mov ecx, eax
call qword [sym.imp.msvcrt.dll_void____ptr64___cdecl_operator_new___unsigned_long_long_unsigned___int64__]
mov rdi, rax
mov qword [rsp + 0x20], rbx
lea r9, [rbp - 0x60]
mov r8d, dword [rsp + 0x78]
mov rdx, rax
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x18001a54e
mov r15d, dword [rsp + 0x78]
mov r14b, r13b
jmp 0x18001a55e
mov rcx, rdi
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void____ptr64_]
mov rdi, rbx
mov r15, qword [rbp - 0x68]
cmp rsi, 0xffffffffffffffff
je 0x18001a56d
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test r14b, r14b
jne 0x18001a579
xor al, al
jmp 0x18001ac32
mov rsi, rbx
mov qword [rsp + 0x40], rbx
mov rcx, r12
call fcn.18001ac54
cmp dword [rdi], 0x33363044
jne 0x18001ac18
cmp dword [rdi + 8], 0xa
jb 0x18001ac18
cmp dword [rdi + 4], 0x7c
jne 0x18001ac18
mov eax, 7
cmp dword [rbp + 0x70], ebx
cmovne eax, dword [rbp + 0x70]
mov ecx, 0x200
cmp dword [rbp + 0x78], ebx
cmovne ecx, dword [rbp + 0x78]
mov edx, 2
cmp dword [rbp + 0x80], ebx
cmovne edx, dword [rbp + 0x80]
mov r8d, r13d
cmp dword [rbp + 0x88], ebx
cmovne r8d, dword [rbp + 0x88]
mov r9d, r13d
cmp dword [rbp + 0x90], ebx
cmovne r9d, dword [rbp + 0x90]
test eax, eax
je 0x18001a602
test dword [rdi + 0x5c], eax
je 0x18001ac18
test ecx, ecx
je 0x18001a612
movzx eax, word [rdi + 0x60]
cmp ecx, eax
jne 0x18001ac18
test edx, edx
je 0x18001a622
movzx eax, word [rdi + 0x62]
cmp edx, eax
jne 0x18001ac18
test r8d, r8d
je 0x18001a634
movzx eax, word [rdi + 0x64]
cmp r8d, eax
jne 0x18001ac18
test r9d, r9d
je 0x18001a646
movzx eax, word [rdi + 0x66]
cmp r9d, eax
jne 0x18001ac18
movzx ecx, word [rdi + 0x74]
mov eax, dword [rdi + 0x6c]
add rcx, 0x7c
add rcx, rax
cmp rcx, r15
jne 0x18001ac18
mov rsi, qword [0x1801692b0]
lea r14, [0x18016b318]
test rsi, rsi
jne 0x18001a6c7
mov qword [rbp - 0x48], r14
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov rsi, qword [0x1801692b0]
test rsi, rsi
jne 0x18001a6be
mov eax, dword [0x1801692a8]
test r13b, al
jne 0x18001a6b0
or eax, r13d
mov dword [0x1801692a8], eax
call fcn.180065438
lea rcx, [0x180085300]
call fcn.18006f680
nop
lea rsi, [0x180169220]
mov qword [0x1801692b0], rsi
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov qword [rsi + 0x40], rbx
mov eax, dword [rdi + 0x5c]
mov edx, 2
test dl, al
je 0x18001a956
mov ecx, dword [rdi + 0x78]
mov eax, dword [rdi + 0x6c]
add rax, 0x7c
cmp rcx, rax
jne 0x18001ac13
cmp word [rdi + 0x74], bx
je 0x18001ac13
cmp ecx, 0x7c
jb 0x18001ac13
cmp word [rdi + 0x62], dx
jne 0x18001ac13
cmp word [rdi + 0x64], r13w
jne 0x18001ac13
movzx eax, word [rdi + 0x74]
sub r15, rax
mov qword [rsp + 0x68], rbx
mov rsi, qword [0x1801692b0]
test rsi, rsi
jne 0x18001a785
mov qword [rbp - 0x40], r14
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov rsi, qword [0x1801692b0]
test rsi, rsi
jne 0x18001a77c
mov eax, dword [0x1801692a8]
test r13b, al
jne 0x18001a76e
or eax, r13d
mov dword [0x1801692a8], eax
call fcn.180065438
lea rcx, [0x180085300]
call fcn.18006f680
nop
lea rsi, [0x180169220]
mov qword [0x1801692b0], rsi
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea r8, [rsp + 0x68]
lea rdx, [0x18008b2f0]
mov rcx, rsi
call fcn.180065be4
test eax, eax
jne 0x18001a7ed
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x18001a7ed
mov qword [rbp - 0x58], ILCombine
mov rax, qword [rcx]
lea rdx, [rbp - 0x58]
mov qword [rsp + 0x28], rdx
lea rdx, [rbp - 0x20]
mov qword [rsp + 0x20], rdx
mov r9d, 2
mov r8, r15
mov rdx, rdi
call qword [rax + ILCombine]
mov esi, ebx
test eax, eax
sete sil
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x18001a7ff
mov rax, qword [rcx]
call qword [rax + ILClone]
jmp 0x18001a7ff
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x18001a7fd
mov rax, qword [rcx]
call qword [rax + ILClone]
mov esi, ebx
test esi, esi
je 0x18001ac13
movzx eax, word [rdi + 0x74]
mov dword [rsp + 0x70], eax
mov r14d, dword [rdi + 0x78]
add r14, rdi
mov r13d, dword [r12 + 0x20]
mov r12, qword [r12 + 0x28]
mov qword [rsp + 0x58], rbx
mov r15d, ebx
test r12, r12
je 0x18001a936
test r14, r14
je 0x18001a936
mov rsi, qword [0x1801692b0]
test rsi, rsi
jne 0x18001a8a9
lea rax, [0x18016b318]
mov qword [rbp - 0x38], rax
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov rsi, qword [0x1801692b0]
test rsi, rsi
jne 0x18001a89c
mov eax, dword [0x1801692a8]
lea ecx, [rsi + 1]
test cl, al
jne 0x18001a88e
or eax, ecx
mov dword [0x1801692a8], eax
call fcn.180065438
lea rcx, [0x180085300]
call fcn.18006f680
nop
lea rsi, [0x180169220]
mov qword [0x1801692b0], rsi
lea rcx, [0x18016b318]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea r8, [rsp + 0x58]
lea rdx, [0x1800900f0]
mov rcx, rsi
call fcn.180065be4
cmp qword [rsp + 0x58], rbx
jne 0x18001a8dd
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x18001ac13
mov rax, qword [rcx]
call qword [rax + ILClone]
jmp 0x18001ac13
mov edx, r13d
mov rcx, r12
call fcn.18006616c
mov rsi, rax
test rax, rax
je 0x18001a936
mov rcx, qword [rsp + 0x58]
mov rax, qword [rcx]
mov dword [rsp + 0x38], 0x40
mov edx, dword [rsp + 0x70]
mov dword [rsp + 0x30], edx
mov qword [rsp + 0x28], r14
mov dword [rsp + 0x20], ILCombine
lea r9, [rbp - 0x20]
xor r8d, r8d
mov rdx, rsi
call qword [rax + 0x20]
test eax, eax
mov eax, 1
cmove r15d, eax
mov rcx, rsi
call fcn.1800662ac
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x18001a946
mov rax, qword [rcx]
call qword [rax + ILClone]
test r15d, r15d
je 0x18001ac13
mov eax, dword [rdi + 0x5c]
mov r12, qword [rbp - 0x68]
test al, 4
je 0x18001aad6
mov eax, 0x200
cmp word [rdi + 0x60], ax
jne 0x18001ac13
cmp dword [r12], 0x10
jne 0x18001ac13
mov eax, dword [rdi + 0x6c]
add eax, 0x10
mov r14d, eax
mov ecx, eax
call qword [sym.imp.msvcrt.dll_void____ptr64___cdecl_operator_new___unsigned_long_long_unsigned___int64__]
mov qword [rsp + 0x40], rax
mov r12, qword [r12 + 8]
mov r13d, dword [rdi + 0x6c]
mov r15d, dword [rdi + 0x70]
add r15, rdi
mov qword [rsp + 0x48], rbx
mov rsi, qword [0x1801692b0]
test rsi, rsi
jne 0x18001aa12
lea rax, [0x18016b318]
mov qword [rbp - 0x30], rax
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov rsi, qword [0x1801692b0]
test rsi, rsi
jne 0x18001aa05
mov eax, dword [0x1801692a8]
lea ecx, [rsi + 1]
test cl, al
jne 0x18001a9f7
or eax, ecx
mov dword [0x1801692a8], eax
call fcn.180065438
lea rcx, [0x180085300]
call fcn.18006f680
nop
lea rsi, [0x180169220]
mov qword [0x1801692b0], rsi
lea rcx, [0x18016b318]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea r8, [rsp + 0x48]
lea rdx, [0x18008b2d0]
mov rcx, rsi
call fcn.180065be4
mov rcx, qword [rsp + 0x48]
test rcx, rcx
jne 0x18001aa3a
mov rcx, qword [rsp + 0x48]
jmp 0x18001a8c9
mov rax, qword [rcx]
mov dword [rsp + 0x30], 0x100
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rbx
mov r9d, ILClone
mov r8, r12
mov edx, 0x200
call qword [rax + ILCombine]
mov rsi, rbx
mov r12, qword [rsp + 0x40]
test eax, eax
jne 0x18001aab9
mov qword [rsp + 0x60], r14
mov rcx, qword [rsp + 0x48]
mov rax, qword [rcx]
mov r8, r13
lea rdx, [rsp + 0x60]
mov qword [rsp + 0x20], rdx
mov r9, r12
mov rdx, r15
call qword [rax + 0x20]
test eax, eax
jne 0x18001aab9
mov rsi, qword [rsp + 0x60]
lea rdx, [rsi + r12]
sub r14, rsi
mov qword [rsp + 0x60], r14
mov rcx, qword [rsp + 0x48]
mov rax, qword [rcx]
lea r8, [rsp + 0x60]
call qword [rax + 0x28]
add rsi, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x48]
test rcx, rcx
je 0x18001aac9
mov rax, qword [rcx]
call qword [rax + ILClone]
test esi, esi
je 0x18001ac13
mov eax, dword [rdi + 0x5c]
jmp 0x18001aae5
mov r12d, dword [rdi + 0x70]
add r12, rdi
mov qword [rsp + 0x40], r12
mov esi, dword [rdi + 0x6c]
mov ecx, 1
test cl, al
je 0x18001abe6
cmp word [rdi + 0x66], cx
jne 0x18001ac13
mov ecx, dword [rdi + 0x68]
mov r13, qword [rbp - 0x70]
mov qword [r13], rcx
call qword [sym.imp.msvcrt.dll_void____ptr64___cdecl_operator_new___unsigned_long_long_unsigned___int64__]
mov r15, rax
mov rcx, qword [rbp - 0x78]
mov qword [rcx], rax
mov eax, dword [r13]
mov dword [rsp + 0x50], eax
mov qword [rbp - 0x80], rbx
mov r14, qword [0x1801692b0]
test r14, r14
jne 0x18001ab93
lea rax, [0x18016b318]
mov qword [rbp - 0x28], rax
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov r14, qword [0x1801692b0]
test r14, r14
jne 0x18001ab86
mov eax, dword [0x1801692a8]
lea ecx, [r14 + 1]
test cl, al
jne 0x18001ab78
or eax, ecx
mov dword [0x1801692a8], eax
call fcn.180065438
lea rcx, [0x180085300]
call fcn.18006f680
nop
lea r14, [0x180169220]
mov qword [0x1801692b0], r14
lea rcx, [0x18016b318]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea r8, [rbp - 0x80]
mov edx, 2
mov rcx, r14
call fcn.180065c40
cmp qword [rbp - 0x80], rbx
je 0x18001abbd
mov r9d, esi
mov r8, r12
lea rdx, [rsp + 0x50]
mov rcx, r15
call qword [rbp - 0x80]
jmp 0x18001abc2
mov eax, 0xfffffffa
test eax, eax
je 0x18001abdc
mov rsi, qword [rbp - 0x78]
mov rcx, qword [rsi]
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void____ptr64_]
mov qword [rsi], rbx
mov qword [r13], rbx
jmp 0x18001ac13
mov eax, dword [rsp + 0x50]
mov qword [r13], rax
jmp 0x18001ac0c
mov ebx, esi
mov ecx, esi
call qword [sym.imp.msvcrt.dll_void____ptr64___cdecl_operator_new___unsigned_long_long_unsigned___int64__]
mov rcx, qword [rbp - 0x78]
mov qword [rcx], rax
mov r8d, esi
mov rdx, r12
mov rcx, rax
call sub.msvcrt.dll_memcpy
mov rax, qword [rbp - 0x70]
mov qword [rax], rbx
mov eax, 1
mov bl, al
mov rsi, qword [rsp + 0x40]
test byte [rdi + 0x5c], 4
je 0x18001ac27
mov rcx, rsi
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void____ptr64_]
mov rcx, rdi
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void____ptr64_]
mov al, bl
mov rcx, qword [rbp - 8]
xor rcx, rsp
call fcn.1800782d0
add rsp, 0x108
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret