Function at 0x401560
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push rbp
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0xc8
lea rbp, [rsp + 0x80]
mov dword [rbp + 0x80], ecx
mov qword [rbp + 0x88], rdx
call dbg.__main
mov rax, rsp
mov rbx, rax
mov qword [rbp + 0x30], 0
mov qword [rbp + 0x28], 0
mov dword [rbp + 0x24], 0x440
mov dword [rbp + 0x20], 0x90c
mov eax, dword [rbp + 0x24]
imul eax, dword [rbp + 0x20]
mov edx, eax
mov eax, edx
add eax, eax
add eax, edx
add eax, 0x36
mov dword [rbp + 0x1c], eax
cmp dword [rbp + 0x80], 4
je 0x4015f1
mov rax, qword [rbp + 0x88]
mov rax, qword [rax]
mov rdx, rax
lea rcx, str.Usage:_s_W_H__filename__n
call sym.printf
mov eax, 0
mov rsp, rbx
jmp 0x4019ff
mov rax, qword [rbp + 0x88]
add rax, 8
mov rax, qword [rax]
mov rcx, rax
call sym.atoi
mov dword [rbp + 0x24], eax
mov rax, qword [rbp + 0x88]
add rax, 0x10
mov rax, qword [rax]
mov rcx, rax
call sym.atoi
mov dword [rbp + 0x20], eax
mov eax, dword [rbp + 0x24]
imul eax, dword [rbp + 0x20]
mov edx, eax
mov eax, edx
add eax, eax
add eax, edx
add eax, 0x36
mov dword [rbp + 0x1c], eax
mov eax, dword [rbp + 0x24]
imul eax, dword [rbp + 0x20]
shl eax, 2
cdqe
mov rcx, rax
call sym.malloc
mov qword [rbp + 0x30], rax
mov eax, dword [rbp + 0x24]
imul eax, dword [rbp + 0x20]
mov edx, eax
mov eax, edx
add eax, eax
add eax, edx
cdqe
mov rcx, rax
call sym.malloc
mov qword [rbp + 0x28], rax
mov rax, qword [rbp + 0x88]
add rax, 0x18
mov rax, qword [rax]
lea rdx, [0x00405019]
mov rcx, rax
call sym.fopen
mov qword [rbp + 0x10], rax
mov eax, dword [rbp + 0x24]
imul eax, dword [rbp + 0x20]
shl eax, 2
movsxd rdx, eax
mov rcx, qword [rbp + 0x10]
mov rax, qword [rbp + 0x30]
mov r9, rcx
mov r8, rdx
mov edx, 1
mov rcx, rax
call sym.fread
mov eax, dword [rbp + 0x24]
imul eax, dword [rbp + 0x20]
mov dword [rbp + 0xc], eax
mov dword [rbp + 0x38], 0
mov eax, dword [rbp + 0x38]
cmp eax, dword [rbp + 0xc]
jge 0x401763
mov eax, dword [rbp + 0x38]
shl eax, 2
cdqe
lea rdx, [rax + 2]
mov rax, qword [rbp + 0x30]
lea rcx, [rdx + rax]
mov edx, dword [rbp + 0x38]
mov eax, edx
add eax, eax
add eax, edx
movsxd rdx, eax
mov rax, qword [rbp + 0x28]
add rdx, rax
movzx eax, byte [rcx]
mov byte [rdx], al
mov eax, dword [rbp + 0x38]
shl eax, 2
cdqe
lea rdx, [rax + 1]
mov rax, qword [rbp + 0x30]
lea rcx, [rdx + rax]
mov edx, dword [rbp + 0x38]
mov eax, edx
add eax, eax
add eax, edx
cdqe
lea rdx, [rax + 1]
mov rax, qword [rbp + 0x28]
add rdx, rax
movzx eax, byte [rcx]
mov byte [rdx], al
mov eax, dword [rbp + 0x38]
shl eax, 2
movsxd rdx, eax
mov rax, qword [rbp + 0x30]
lea rcx, [rdx + rax]
mov edx, dword [rbp + 0x38]
mov eax, edx
add eax, eax
add eax, edx
cdqe
lea rdx, [rax + 2]
mov rax, qword [rbp + 0x28]
add rdx, rax
movzx eax, byte [rcx]
mov byte [rdx], al
add dword [rbp + 0x38], 1
jmp 0x4016c7
mov rax, qword [rbp + 0x10]
mov rcx, rax
call sym.fclose
mov qword [rbp - 0x1e], 0x4d42
mov dword [rbp - 0x16], 0x360000
mov word [rbp - 0x12], 0
mov eax, 0x28
movabs rdx, 0x18000100000000
mov qword [rbp - 0x50], rax
mov qword [rbp - 0x48], rdx
mov qword [rbp - 0x40], 0
mov qword [rbp - 0x38], 0
mov qword [rbp - 0x30], 0
mov word [rbp - 0x53], 0
mov byte [rbp - 0x51], 0
mov eax, dword [rbp + 0x1c]
mov byte [rbp - 0x1c], al
mov eax, dword [rbp + 0x1c]
sar eax, 8
mov byte [rbp - 0x1b], al
mov eax, dword [rbp + 0x1c]
sar eax, 0x10
mov byte [rbp - 0x1a], al
mov eax, dword [rbp + 0x1c]
sar eax, 0x18
mov byte [rbp - 0x19], al
mov eax, dword [rbp + 0x24]
mov byte [rbp - 0x4c], al
mov eax, dword [rbp + 0x24]
sar eax, 8
mov byte [rbp - 0x4b], al
mov eax, dword [rbp + 0x24]
sar eax, 0x10
mov byte [rbp - 0x4a], al
mov eax, dword [rbp + 0x24]
sar eax, 0x18
mov byte [rbp - 0x49], al
mov eax, dword [rbp + 0x20]
mov byte [rbp - 0x48], al
mov eax, dword [rbp + 0x20]
sar eax, 8
mov byte [rbp - 0x47], al
mov eax, dword [rbp + 0x20]
sar eax, 0x10
mov byte [rbp - 0x46], al
mov eax, dword [rbp + 0x20]
sar eax, 0x18
mov byte [rbp - 0x45], al
mov rax, qword [rbp + 0x88]
add rax, 0x18
mov rax, qword [rax]
mov rcx, rax
call sym.strlen
mov dword [rbp + 8], eax
mov eax, dword [rbp + 8]
add eax, 1
cdqe
sub rax, 1
mov qword [rbp], rax
mov rdx, rax
add rdx, 1
mov r12, rdx
mov r13d, 0
mov rdx, rax
add rdx, 1
mov rsi, rdx
mov edi, 0
add rax, 1
add rax, 0xf
shr rax, 4
shl rax, 4
call fcn.00402f40
sub rsp, rax
lea rax, [rsp + 0x20]
add rax, 0
mov qword [rbp - 8], rax
mov rax, qword [rbp + 0x88]
add rax, 0x18
mov rdx, qword [rax]
mov rax, qword [rbp - 8]
mov rcx, rax
call sym.strcpy
mov eax, dword [rbp + 8]
sub eax, 3
mov rdx, qword [rbp - 8]
cdqe
mov byte [rdx + rax], 0x62
mov eax, dword [rbp + 8]
sub eax, 2
mov rdx, qword [rbp - 8]
cdqe
mov byte [rdx + rax], 0x6d
mov eax, dword [rbp + 8]
sub eax, 1
mov rdx, qword [rbp - 8]
cdqe
mov byte [rdx + rax], 0x70
mov rdx, qword [rbp - 8]
mov eax, dword [rbp + 8]
cdqe
mov byte [rdx + rax], 0
mov rax, qword [rbp - 8]
lea rdx, [0x0040501b]
mov rcx, rax
call sym.fopen
mov qword [rbp - 0x10], rax
mov rdx, qword [rbp - 0x10]
lea rax, [rbp - 0x1e]
mov r9, rdx
mov r8d, 0xe
mov edx, 1
mov rcx, rax
call sym.fwrite
mov rdx, qword [rbp - 0x10]
lea rax, [rbp - 0x50]
mov r9, rdx
mov r8d, 0x28
mov edx, 1
mov rcx, rax
call sym.fwrite
mov dword [rbp + 0x3c], 0
mov eax, dword [rbp + 0x3c]
cmp eax, dword [rbp + 0x20]
jge 0x4019df
mov eax, dword [rbp + 0x24]
movsxd rcx, eax
mov eax, dword [rbp + 0x20]
sub eax, dword [rbp + 0x3c]
sub eax, 1
imul eax, dword [rbp + 0x24]
mov edx, eax
mov eax, edx
add eax, eax
add eax, edx
movsxd rdx, eax
mov rax, qword [rbp + 0x28]
add rax, rdx
mov rdx, qword [rbp - 0x10]
mov r9, rdx
mov r8, rcx
mov edx, 3
mov rcx, rax
call sym.fwrite
mov edx, dword [rbp + 0x24]
mov eax, edx
add eax, eax
add edx, eax
mov eax, edx
sar eax, 0x1f
shr eax, 0x1e
add edx, eax
and edx, 3
sub edx, eax
mov eax, edx
mov edx, 4
sub edx, eax
mov eax, edx
sar eax, 0x1f
shr eax, 0x1e
add edx, eax
and edx, 3
sub edx, eax
mov eax, edx
movsxd rdx, eax
mov rcx, qword [rbp - 0x10]
lea rax, [rbp - 0x53]
mov r9, rcx
mov r8, rdx
mov edx, 1
mov rcx, rax
call sym.fwrite
add dword [rbp + 0x3c], 1
jmp 0x40193e
mov rax, qword [rbp - 0x10]
mov rcx, rax
call sym.fclose
mov rax, qword [rbp + 0x30]
mov rcx, rax
call sym.free
mov rsp, rbx
mov eax, 0
lea rsp, [rbp + 0x48]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop rbp
ret