Function at 0x140009020
Capabilities:
Encode data using xor
Read file on windows

Disassembly:
push rbp
push rbx
push r12
push r14
push r15
lea rbp, [rsp - 0x390]
sub rsp, 0x490
mov rax, qword [0x140014098]
xor rax, rsp
mov qword [rbp + 0x380], rax
lea rax, [rbp + 0x280]
mov qword [rsp + 0x48], rdx
mov qword [rsp + 0x50], rax
lea rdx, [0x1400114b8]
lea rax, [rbp + 0x80]
mov r15d, 1
mov qword [rsp + 0x58], rax
mov rbx, rcx
lea rax, [rbp + 0x180]
mov r12d, r15d
mov qword [rsp + 0x60], rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov r14, rax
test rax, rax
jne 0x1400090b2
lea ecx, [rax + 2]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov r8, rbx
lea rdx, str.Failed_to_open__s_for_reading____n
mov rcx, rax
call fcn.140002170
xor eax, eax
jmp 0x14000912c
mov qword [rsp + 0x4c8], rsi
mov rcx, r14
mov qword [rsp + 0x4d0], rdi
mov qword [rsp + 0x4d8], r13
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
shl ax, 8
mov ecx, 0x4d42
or ax, bx
cmp ax, cx
je 0x14000914b
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.Error__not_a_BMP_file__n
call fcn.140002170
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
xor eax, eax
mov rdi, qword [rsp + 0x4d0]
mov rsi, qword [rsp + 0x4c8]
mov r13, qword [rsp + 0x4d8]
mov rcx, qword [rbp + 0x380]
xor rcx, rsp
call fcn.14000cdb0
add rsp, 0x490
pop r15
pop r14
pop r12
pop rbx
pop rbp
ret
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov edi, eax
mov rcx, r14
shl edi, 8
or edi, ebx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov ebx, eax
mov rcx, r14
shl ebx, 0x10
or ebx, edi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
shl eax, 0x18
lea rdx, [rsp + 0x70]
or eax, ebx
mov rcx, r14
mov dword [rsp + 0x40], eax
call fcn.1400080b0
test eax, eax
je 0x140009109
movzx ebx, word [rsp + 0x7e]
cmp bx, 8
ja 0x1400092d3
xor edx, edx
lea rcx, [rbp + 0x280]
mov r8d, 0x100
call sub.VCRUNTIME140.dll_memset
xor edx, edx
lea rcx, [rbp + 0x80]
mov r8d, 0x100
call sub.VCRUNTIME140.dll_memset
xor edx, edx
lea rcx, [rbp + 0x180]
mov r8d, 0x100
call sub.VCRUNTIME140.dll_memset
mov eax, dword [rbp - 0x70]
test eax, eax
jne 0x14000923f
movzx ecx, bl
mov eax, r15d
shl eax, cl
cmp eax, 0x100
jbe 0x14000924d
mov eax, 0x100
jmp 0x140009255
test eax, eax
je 0x1400092ec
xor dil, dil
test eax, eax
je 0x1400092ec
xor ebx, ebx
mov esi, eax
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
mov byte [rbp + rbx + 0x180], al
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
mov byte [rbp + rbx + 0x80], al
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov rcx, r14
mov byte [rbp + rbx + 0x280], al
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
movzx eax, byte [rbp + rbx + 0x80]
movzx ecx, al
xor al, byte [rbp + rbx + 0x280]
xor cl, byte [rbp + rbx + 0x180]
inc rbx
or cl, al
or dil, cl
sub rsi, r12
jne 0x140009264
movzx ebx, word [rsp + 0x7e]
test dil, dil
je 0x1400092ec
lea r12d, [rsi + 3]
jmp 0x1400092ec
mov r12d, 3
cmp dword [rbp - 0x80], r12d
jne 0x1400092ec
cmp dword [rbp - 0x5c], 0
mov eax, 4
cmovne r12d, eax
mov ecx, dword [rsp + 0x74]
test ecx, ecx
je 0x140009109
mov r8d, dword [rsp + 0x78]
test r8d, r8d
je 0x140009109
xor edx, edx
movzx esi, bx
mov eax, 0xffffffe0
div ecx
cmp esi, eax
ja 0x140009109
imul esi, ecx
add esi, 0x1f
shr esi, 5
shl esi, 2
cmp bx, 4
jne 0x140009348
cmp dword [rbp - 0x80], 2
jne 0x140009348
cmp eax, 8
jb 0x140009109
lea esi, [rcx*8 + 0x1f]
shr esi, 5
shl esi, 2
xor edx, edx
mov r13d, esi
mov eax, 0xffffffff
mov rcx, r8
div r8
cmp r13, rax
ja 0x140009109
mov edx, r13d
imul rdx, rcx
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
mov r15, rax
test rax, rax
je 0x140009109
xor r8d, r8d
xor edx, edx
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov edx, dword [rsp + 0x40]
xor r8d, r8d
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov eax, dword [rbp - 0x80]
test eax, eax
je 0x1400094e8
sub eax, 1
je 0x1400093ed
sub eax, 1
je 0x1400093d0
cmp eax, 1
je 0x1400094e8
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea rdx, str.Unsupported_BMP_compression_n
jmp 0x140009520
mov eax, dword [rsp + 0x78]
mov r8d, esi
mov r9d, dword [rsp + 0x74]
mov rdx, r15
mov rcx, r14
mov dword [rsp + 0x20], eax
call fcn.1400087a0
jmp 0x140009408
mov eax, dword [rsp + 0x78]
mov r8d, esi
mov r9d, dword [rsp + 0x74]
mov rdx, r15
mov rcx, r14
mov dword [rsp + 0x20], eax
call fcn.1400089d0
test eax, eax
je 0x140009528
mov ecx, dword [rsp + 0x74]
xor eax, eax
mov rbx, qword [rsp + 0x48]
xor r9d, r9d
mov qword [rbp], rax
cmp r12d, 1
mov qword [rbp + 0x24], rax
mov qword [rbp + 0x48], rax
mov r8d, dword [rbx + 0x4714]
mov edx, dword [rbx + 0x4718]
mov dword [rbp - 0x10], r8d
mov dword [rbp + 0x14], r8d
mov dword [rbp + 0x38], r8d
mov dword [rbp + 0x5c], r8d
mov r8d, r9d
sete r8b
mov qword [rbp + 0x6c], rax
mov eax, dword [rsp + 0x78]
inc r8d
mov dword [rbp - 0xc], edx
mov dword [rbp - 8], ecx
mov dword [rbp + 0x18], edx
mov dword [rbp + 0x1c], ecx
mov dword [rbp + 0x3c], edx
mov dword [rbp + 0x40], ecx
mov dword [rbp + 0x60], edx
lea rdx, [rbp - 0x10]
mov dword [rbp + 0x64], ecx
mov ecx, r12d
mov dword [rbp + 8], 8
mov qword [rbp + 0xc], 8
mov dword [rbp - 4], eax
mov dword [rbp + 0x2c], 8
mov qword [rbp + 0x30], 8
mov dword [rbp + 0x20], eax
mov dword [rbp + 0x50], 8
mov qword [rbp + 0x54], 8
mov dword [rbp + 0x44], eax
mov dword [rbp + 0x74], 8
mov qword [rbp + 0x78], 8
mov dword [rbp + 0x68], eax
call sub.openjp2.dll_opj_image_create
mov rdi, rax
test rax, rax
jne 0x140009536
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x140009112
mov eax, esi
mov r9, r14
imul eax, dword [rsp + 0x78]
mov edx, 1
mov rcx, r15
mov r8d, eax
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
cmp rax, rbx
je 0x140009410
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea rdx, str._nError:_fread_return_a_number_of_element_different_from_the_expected._n
mov rcx, rax
call fcn.140002170
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x140009109
cmp r12d, 4
jne 0x14000954c
mov rax, qword [rax + 0x18]
mov ecx, 1
mov word [rax + 0xf8], cx
mov ecx, dword [rbx + 0x470c]
mov dword [rdi], ecx
mov edx, dword [rbx + 0x4710]
mov dword [rdi + 4], edx
mov eax, dword [rsp + 0x74]
dec eax
imul eax, dword [rbx + 0x4714]
inc eax
add eax, ecx
mov dword [rdi + 8], eax
mov eax, dword [rsp + 0x78]
dec eax
imul eax, dword [rbx + 0x4718]
inc eax
add eax, edx
mov dword [rdi + 0xc], eax
movzx eax, word [rsp + 0x7e]
cmp ax, 0x18
jne 0x14000962b
cmp dword [rbp - 0x80], 0
jne 0x14000978b
mov rax, qword [rdi + 0x18]
mov ecx, dword [rax + 0xc]
mov ebx, dword [rax + 8]
lea r10d, [rcx - 1]
imul r10d, esi
add r10, r15
test ecx, ecx
je 0x1400097b5
xor r11d, r11d
mov esi, ecx
xor r9d, r9d
test ebx, ebx
je 0x14000961d
nop word [rax + rax]
lea r8d, [r9 + r9*2]
inc r9d
lea eax, [r8 + 2]
movzx edx, byte [rax + r10]
mov rax, qword [rdi + 0x18]
mov rcx, qword [rax + 0x30]
lea eax, [r8 + 1]
mov dword [rcx + r11*4], edx
movzx edx, byte [rax + r10]
mov rax, qword [rdi + 0x18]
mov rcx, qword [rax + 0x70]
mov dword [rcx + r11*4], edx
mov rax, qword [rdi + 0x18]
movzx edx, byte [r8 + r10]
mov rcx, qword [rax + 0xb0]
mov dword [rcx + r11*4], edx
inc r11
cmp r9d, ebx
jb 0x1400095d0
sub r10, r13
sub rsi, 1
jne 0x1400095c0
jmp 0x1400097b5
cmp ax, 8
jne 0x14000963d
mov eax, dword [rbp - 0x80]
test eax, eax
je 0x14000964d
cmp eax, 1
jmp 0x140009647
cmp ax, 4
jne 0x140009664
cmp dword [rbp - 0x80], 2
jne 0x14000978b
lea r9, [rsp + 0x50]
mov r8, rdi
mov edx, esi
mov rcx, r15
call fcn.140007f30
jmp 0x1400097b5
cmp ax, 0x20
jne 0x1400096fd
mov eax, dword [rbp - 0x80]
test eax, eax
jne 0x1400096a2
mov dword [rsp + 0x30], eax
mov ecx, 0xff00
mov dword [rsp + 0x28], 0xff
mov r9d, 0xff0000
mov dword [rsp + 0x20], ecx
mov r8, rdi
mov rcx, r15
mov edx, esi
call fcn.140008dd0
jmp 0x1400097b5
cmp eax, 3
jne 0x14000978b
mov r9d, dword [rbp - 0x68]
mov ecx, dword [rbp - 0x64]
test r9d, r9d
jne 0x1400096d9
test ecx, ecx
jne 0x1400096d9
cmp dword [rbp - 0x60], ecx
jne 0x1400096d9
mov r9d, 0xff0000
mov dword [rbp - 0x60], 0xff
mov ecx, 0xff00
mov dword [rbp - 0x68], r9d
mov dword [rbp - 0x64], ecx
mov eax, dword [rbp - 0x5c]
mov r8, rdi
mov dword [rsp + 0x30], eax
mov edx, esi
mov eax, dword [rbp - 0x60]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], ecx
mov rcx, r15
call fcn.140008dd0
jmp 0x1400097b5
cmp ax, 0x10
jne 0x14000978b
mov eax, dword [rbp - 0x80]
test eax, eax
jne 0x140009737
mov dword [rsp + 0x30], eax
mov r9d, 0x7c00
mov dword [rsp + 0x28], 0x1f
mov r8, rdi
mov edx, esi
mov dword [rsp + 0x20], 0x3e0
mov rcx, r15
call fcn.140008ba0
jmp 0x1400097b5
cmp eax, 3
jne 0x14000978b
mov r9d, dword [rbp - 0x68]
mov ecx, dword [rbp - 0x64]
test r9d, r9d
jne 0x14000976a
test ecx, ecx
jne 0x14000976a
cmp dword [rbp - 0x60], ecx
jne 0x14000976a
mov r9d, 0xf800
mov dword [rbp - 0x60], 0x1f
mov ecx, 0x7e0
mov dword [rbp - 0x68], r9d
mov dword [rbp - 0x64], ecx
mov eax, dword [rbp - 0x5c]
mov r8, rdi
mov dword [rsp + 0x30], eax
mov edx, esi
mov eax, dword [rbp - 0x60]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], ecx
mov rcx, r15
call fcn.140008ba0
jmp 0x1400097b5
mov rcx, rdi
call sub.openjp2.dll_opj_image_destroy
movzx ebx, word [rsp + 0x7e]
xor edi, edi
lea ecx, [rdi + 2]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov r8d, ebx
lea rdx, str.Other_system_than_24_bits_pixels_or_8_bits__no_RLE_coding__is_not_yet_implemented___d__n
mov rcx, rax
call fcn.140002170
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov rax, rdi
jmp 0x140009114