Function at 0x140051c20
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x20], rsi
mov qword [rsp + 8], rcx
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov r13, r9
mov r15, rcx
mov r9, rcx
mov rsi, r8
mov r12, rdx
mov edi, 1
mov r14d, 2
lea rcx, [rsp + 0x3c]
mov r8d, edi
mov edx, r14d
call fcn.1400fabdc
lea rcx, [rsp + 0x40]
mov r9, r15
mov r8d, edi
mov edx, r14d
call fcn.1400fabdc
lea rcx, [rsp + 0x38]
mov r9, r15
mov r8d, edi
mov edx, r14d
call fcn.1400fabdc
lea rcx, [rsp + 0x30]
mov r9, r15
mov r8d, edi
mov edx, r14d
call fcn.1400fabdc
lea rcx, [rsp + 0x34]
mov r9, r15
mov r8d, edi
mov edx, edi
call fcn.1400fabdc
mov rcx, r15
call fcn.1400fa96c
test eax, eax
jne 0x140052142
mov rcx, r15
call fcn.1400fa994
test eax, eax
jne 0x140052142
movzx eax, word [rsp + 0x3c]
mov qword [rsp + 0x98], rbx
mov qword [rsp + 0xa0], rbp
mov word [r13 + 4], ax
movzx eax, word [rsp + 0x40]
lea ebp, [rdi + 3]
mov word [r13 + 6], ax
mov ecx, dword [r12]
mov eax, edi
shl eax, cl
mov dword [rsp + 0x44], eax
movzx eax, byte [rsp + 0x34]
test al, al
jns 0x140051d5d
movzx ecx, al
and ecx, 7
inc ecx
mov dword [r12], ecx
cmp ecx, edi
je 0x140051d26
mov eax, 8
cmp ecx, ebp
cmovbe eax, ebp
mov dword [r12], eax
mov eax, 0x100
mov ebx, edi
mov r8d, 0x300
shl ebx, cl
mov rcx, rsi
cmp ebx, eax
cmova ebx, eax
xor edx, edx
mov dword [rsp + 0x44], ebx
call fcn.1400f9ab0
lea edx, [rbx + rbx*2]
mov r9, r15
mov r8, rdi
mov rcx, rsi
call fcn.1400fabdc
mov dword [r13 + 0x18], edi
movzx r8d, word [rsp + 0x38]
movzx r9d, word [rsp + 0x30]
mov r11d, dword [r12]
mov eax, r8d
mov ebx, r8d
mov ecx, r9d
mov r10d, r9d
imul eax, r11d
add eax, 0x1f
imul rbx, r9
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
shl eax, 2
movsxd r13, eax
imul rcx, r13
test r8w, r8w
je 0x140051eaf
test r9w, r9w
je 0x140051eaf
cmp r11d, 8
ja 0x140051eaf
test eax, eax
jle 0x140051eaf
test ebx, ebx
jle 0x140051eaf
xor edx, edx
mov rax, rcx
div r10
test eax, eax
jle 0x140051eaf
test ecx, ecx
jle 0x140051eaf
mov edx, 0xffff
cmp r8w, dx
ja 0x140051eaf
cmp r9w, dx
ja 0x140051eaf
cdqe
cmp rax, r13
jb 0x140051eaf
mov eax, 0xfffffbd7
cmp rcx, rax
ja 0x140051eaf
cmp rbx, rax
ja 0x140051eaf
lea rcx, [rbx + 0x300]
mov rdx, rdi
call fcn.1400f97a4
mov r15, rax
test rax, rax
je 0x140051e8f
mov rcx, qword [rsp + 0x90]
mov r8, rbx
mov rdx, rax
call fcn.140051240
test eax, eax
jns 0x140051e55
mov rcx, r15
call fcn.1400f97e8
xor eax, eax
jmp 0x140051fe5
mov ecx, dword [r12]
mov eax, edi
shl eax, cl
movzx ecx, word [rsp + 0x30]
mov dword [rsp + 0x48], eax
add rax, 0xa
imul rcx, r13
lea rdx, [rcx + rax*4]
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov qword [rsp + 0x50], rax
test rax, rax
jne 0x140051eb6
mov rcx, r15
call fcn.1400f97e8
mov r8, qword [rsp + 0xb0]
mov rcx, qword [0x1401fbba0]
mov r9d, 0x80
mov edx, 0x50a
call qword [sym.imp.USER32.dll_LoadStringW]
xor eax, eax
jmp 0x140051fe5
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GlobalLock]
xor ebx, ebx
mov dword [rax], 0x28
movzx ecx, word [rsp + 0x38]
mov r8, rax
mov dword [rax + 4], ecx
movzx ecx, word [rsp + 0x30]
mov word [rax + 0xc], di
mov dword [rax + 8], ecx
movzx ecx, word [r12]
mov qword [rax + 0x10], rbx
mov word [rax + 0xe], cx
mov eax, dword [rsp + 0x48]
mov dword [r8 + 0x24], ebx
mov dword [r8 + 0x20], eax
mov qword [r8 + 0x18], rbx
cmp dword [r12], edi
jne 0x140051f39
movzx edx, byte [rsi]
cmp dl, byte [rsi + 3]
jne 0x140051f39
movzx r9d, byte [rsi + 1]
cmp r9b, byte [rsi + 4]
jne 0x140051f39
movzx r10d, byte [rsi + 2]
cmp r10b, byte [rsi + 5]
jne 0x140051f39
mov ecx, 0xff
mov eax, ecx
sub al, dl
mov byte [rsi + 3], al
mov eax, ecx
sub al, r9b
sub cl, r10b
mov byte [rsi + 5], cl
mov byte [rsi + 4], al
mov eax, dword [rsp + 0x44]
test eax, eax
je 0x140051f75
lea rcx, [r8 + 0x29]
lea rdx, [rsi + 2]
mov r9d, eax
nop dword [rax]
movzx eax, byte [rdx - 2]
lea rcx, [rcx + 4]
lea rdx, [rdx + 3]
mov byte [rcx - 3], al
movzx eax, byte [rdx - 4]
mov byte [rcx - 4], al
movzx eax, byte [rdx - 3]
mov byte [rcx - 2], bl
mov byte [rcx - 5], al
dec r9
jne 0x140051f50
mov ecx, dword [r12]
mov esi, edi
shl esi, cl
add rsi, 0xa
test byte [rsp + 0x34], 0x40
lea rsi, [r8 + rsi*4]
je 0x1400520f5
movzx edx, word [rsp + 0x30]
mov rax, qword [rsp + 0xb8]
mov ecx, 0x40
shl rdx, 2
mov dword [rax], edi
call qword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov qword [rsp + 0x48], rax
test rax, rax
jne 0x14005200b
mov r8, qword [rsp + 0xb0]
mov rcx, qword [0x1401fbba0]
mov r9d, 0x80
mov edx, 0x50a
call qword [sym.imp.USER32.dll_LoadStringW]
mov rcx, r15
call fcn.1400f97e8
mov rax, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x98]
mov rbp, qword [rsp + 0xa0]
mov rsi, qword [rsp + 0xa8]
add rsp, 0x60
pop r15
pop r14
pop r13
pop r12
pop rdi
ret
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GlobalLock]
movzx ecx, word [rsp + 0x30]
mov r8d, ebx
mov rdx, rax
cmp bx, cx
jae 0x140052046
nop dword [rax]
nop dword [rax + rax]
mov ecx, r8d
add r8d, 8
mov dword [rax + rcx*4], ebx
movzx ecx, word [rsp + 0x30]
inc ebx
cmp r8d, ecx
jb 0x140052030
cmp bp, cx
jae 0x140052063
nop dword [rax + rax]
mov eax, ebp
add ebp, 8
mov dword [rdx + rax*4], ebx
movzx ecx, word [rsp + 0x30]
inc ebx
cmp ebp, ecx
jb 0x140052050
cmp r14w, cx
jae 0x140052086
nop dword [rax]
mov eax, r14d
add r14d, 4
mov dword [rdx + rax*4], ebx
movzx ecx, word [rsp + 0x30]
inc ebx
cmp r14d, ecx
jb 0x140052070
cmp di, cx
jae 0x1400520a3
nop dword [rax + rax]
mov eax, edi
add edi, 2
mov dword [rdx + rax*4], ebx
movzx ecx, word [rsp + 0x30]
inc ebx
cmp edi, ecx
jb 0x140052090
movzx ebx, cx
test ebx, ebx
je 0x1400520dd
lea rdi, [rdx + rbx*4]
nop
mov eax, dword [r12]
movzx r9d, word [rsp + 0x38]
mov r8d, dword [rdi - 4]
mov dword [rsp + 0x28], eax
lea rdi, [rdi - 4]
mov rdx, r15
mov rcx, rsi
mov dword [rsp + 0x20], r9d
call fcn.140051650
add rsi, r13
dec ebx
jne 0x1400520b0
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x14005212a
movzx ebx, word [rsp + 0x30]
test ebx, ebx
je 0x14005212a
nop
mov eax, dword [r12]
movzx r9d, word [rsp + 0x38]
dec ebx
mov dword [rsp + 0x28], eax
mov r8d, ebx
mov rdx, r15
mov rcx, rsi
mov dword [rsp + 0x20], r9d
call fcn.140051650
add rsi, r13
test ebx, ebx
jne 0x140052100
mov rcx, r15
call fcn.1400f97e8
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
jmp 0x140051fe0
xor eax, eax
jmp 0x140051ff5