Function at 0x180040a80
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 0x20], r9
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xa8
lea eax, [r8 - 6]
mov rdx, rcx
mov dword [rsp + 0x100], eax
cmp r8d, eax
jbe 0x180040fb4
mov r15, qword [rsp + 0xf8]
lea edi, [r8 - 0x33]
movzx r12d, word [rsp + 0x100]
lea r8, [0x180000000]
mov r13, qword [rsp + 0x68]
mov ecx, eax
mov r14d, dword [rsp + 0xf8]
mov dword [rsp + 0x60], edi
nop dword [rax + rax]
cmp edi, 8
ja case.default.0x180040b04
mov ecx, dword [r8 + rdi*4 + 0x40fd0]
add rcx, r8
jmp rcx
mov rax, qword [r9]
mov dword [rsp + 0x58], 0
cmp dword [rax + 0x4c], 0
mov rbx, qword [rax + 0x58]
mov qword [rsp + 0x48], rbx
jle case.0x180040b04.3
xor r11d, r11d
mov qword [rsp + 0x78], r11
nop dword [rax]
mov eax, 0x26
mov dword [rsp + 0x54], eax
nop dword [rax]
sub eax, 0x26
je 0x180040db2
cmp eax, 1
jne 0x180040e1c
mov ecx, dword [rsp + 0x50]
xor edx, edx
mov eax, r14d
div ecx
mov ebp, edx
test edx, edx
jle 0x180040b67
mov ebp, ecx
sub ebp, edx
xor esi, esi
movsxd rdi, ebp
cmp dword [rsp + 0x40], esi
jle 0x180040c6d
mov r14, qword [rsp + 0x90]
mov r13d, dword [rsp + 0xf8]
mov rcx, qword [r9]
lea eax, [rsi*8]
mov rdx, qword [rsp + 0xf0]
mov r15, qword [r14]
mov dword [rsp + 0x30], r13d
mov r9, r15
mov r10, qword [rcx + 0x220]
mov r8, qword [rdx]
mov rdx, rbx
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], eax
mov r8, qword [r11 + r8]
call qword [r10 + OleUIPromptUserA]
test ebp, ebp
jle 0x180040c3f
mov ebx, 0x60
nop dword [rax]
mov eax, ebx
sub eax, 0x60
je 0x180040c25
sub eax, 0x5e
je 0x180040c0a
sub eax, 0x5e
je 0x180040c03
cmp eax, 0x5e
jne 0x180040c2f
test ebp, ebp
jle 0x180040c2f
mov rax, r15
mov rcx, rdi
mov word [rax], r12w
lea rax, [rax + 0x80]
sub rcx, 1
jne 0x180040bf0
jmp 0x180040c2f
movzx r12d, word [r15 - 0x80]
jmp 0x180040c2f
mov rax, rdi
lea rdx, [rsp + 0x70]
shl rax, 7
mov r8, r15
mov qword [rsp + 0x70], rax
call fcn.180017200
jmp 0x180040c2f
mov rax, r13
shl rax, 7
add r15, rax
add ebx, 0x5e
cmp ebx, 0x1d8
jb 0x180040bd0
mov rbx, qword [rsp + 0x48]
mov r11, qword [rsp + 0x78]
inc esi
mov r9, qword [rsp + 0x108]
add r14, 8
cmp esi, dword [rsp + 0x40]
jl 0x180040b86
mov r13, qword [rsp + 0x68]
mov r14d, dword [rsp + 0xf8]
mov ecx, dword [rsp + 0x50]
mov rax, qword [rsp + 0x98]
mov edx, dword [rsp + 0x5c]
cmp dword [rax + 0x10], edx
jne 0x180040e1c
add r14d, ebp
movsxd rbx, ecx
xor edx, edx
mov dword [rsp + 0xf8], r14d
mov eax, r14d
div ecx
movsxd rdx, dword [rsp + 0x40]
mov esi, eax
mov rax, qword [rsp + 0x48]
mov dword [rsp + 0x70], edx
cmp edx, dword [rax + 0xc]
jge 0x180040e1c
mov rcx, qword [rsp + 0x90]
lea r14, [rcx + rdx*8]
nop dword [rax]
mov ebp, dword [rsp + 0xf8]
mov edi, 0x7a
nop dword [rax]
mov eax, edi
sub eax, 0x7a
je 0x180040d58
cmp eax, 0x6c
jne 0x180040d78
test esi, esi
je 0x180040d78
mov r8, rsi
nop
mov edx, 0x13
mov eax, edx
sub eax, 0x11
je 0x180040d3f
sub eax, 1
je 0x180040d33
cmp eax, 1
jne 0x180040d49
mov rax, rbx
shl rax, 7
movzx r12d, word [rax + r13 - 0x80]
test rbx, rbx
jle 0x180040d49
mov rax, r15
mov rcx, rbx
nop
mov word [rax], r12w
lea rax, [rax + 0x80]
sub rcx, 1
jne 0x180040d20
jmp 0x180040d49
mov rax, rbx
shl rax, 7
add r15, rax
jmp 0x180040d49
mov rax, rbx
shl rax, 7
add r13, rax
dec edx
cmp edx, 0x10
ja 0x180040cf5
sub r8, 1
jne 0x180040cf0
jmp 0x180040d78
mov r15, qword [r14]
lea rdx, [rsp + 0x68]
mov r13, qword [r14 - 8]
mov rax, rbp
shl rax, 7
mov r8, r15
mov qword [rsp + 0x68], rax
call fcn.180017200
add edi, 0x6c
cmp edi, 0x152
jb 0x180040cd0
mov ebp, dword [rsp + 0x70]
add r14, 8
mov rax, qword [rsp + 0x48]
inc ebp
mov qword [rsp + 0x68], r13
mov dword [rsp + 0x70], ebp
cmp ebp, dword [rax + 0xc]
jl 0x180040cc0
mov r14d, dword [rsp + 0xf8]
jmp 0x180040e1c
mov rcx, qword [r9]
mov rdi, qword [rsp + 0x98]
mov r9d, dword [rbx + 0xc]
mov r8d, r9d
mov dword [rsp + 0x20], 1
mov rax, qword [rcx + 8]
imul r8d, dword [rdi + 0x10]
mov rdx, qword [rdi + r11 + 0x70]
call qword [rax + 0x40]
mov qword [rsp + 0x90], rax
mov eax, dword [rsp + 0x5c]
cmp dword [rdi + 0x10], eax
jae 0x180040df7
mov eax, dword [rbx + 0xc]
mov dword [rsp + 0x40], eax
jmp 0x180040e09
mov eax, dword [rbx + 0x20]
xor edx, edx
div dword [rbx + 0xc]
test edx, edx
cmove edx, dword [rbx + 0xc]
mov dword [rsp + 0x40], edx
mov r14d, dword [rbx + 0x1c]
mov eax, dword [rbx + 8]
mov dword [rsp + 0xf8], r14d
mov dword [rsp + 0x50], eax
mov eax, dword [rsp + 0x54]
mov rbx, qword [rsp + 0x48]
inc eax
mov r11, qword [rsp + 0x78]
mov r9, qword [rsp + 0x108]
mov dword [rsp + 0x54], eax
cmp eax, 0x28
jb 0x180040b40
mov ecx, dword [rsp + 0x58]
add r11, 8
mov rax, qword [r9]
inc ecx
add rbx, 0x60
mov dword [rsp + 0x58], ecx
mov qword [rsp + 0x78], r11
mov qword [rsp + 0x48], rbx
cmp ecx, dword [rax + 0x4c]
jl 0x180040b30
mov edi, dword [rsp + 0x60]
jmp 0x180040e95
mov rbx, qword [rsp + 0x80]
mov edx, 1
mov r8d, dword [rbx + 0x38]
mov r9, qword [rbx + 0x18]
mov rcx, qword [rbx + 0x30]
call fcn.18007be3c
mov r9, qword [rsp + 0x108]
lea r8, [0x180000000]
mov ecx, dword [rsp + 0x100]
dec edi
mov dword [rsp + 0x60], edi
lea eax, [rdi + 0x33]
cmp eax, ecx
jbe 0x180040fb4
mov rdx, qword [rsp + 0xf0]
jmp 0x180040af0
mov rax, qword [r9]
mov rcx, qword [rax + 0x200]
mov eax, dword [rax + 0x178]
dec eax
mov qword [rsp + 0x98], rcx
mov dword [rsp + 0x5c], eax
jmp case.0x180040b04.3
mov rax, qword [rsp + 0x80]
mov rcx, qword [rax + 0x30]
mov rax, qword [r9]
mov r8d, dword [rax + 0x88]
test r8d, r8d
je 0x180040e95
nop dword [rax]
mov edx, 0x11f
mov eax, edx
sub eax, 0x11e
je 0x180040f23
cmp eax, 1
jne 0x180040f4a
mov rax, qword [rsp + 0x88]
movzx eax, byte [rax + 2]
mov byte [rcx], al
jmp 0x180040f4a
mov r9, qword [rsp + 0x88]
movzx eax, byte [r9 + 1]
mov byte [rcx + 1], al
movzx eax, byte [r9]
add r9, 3
mov byte [rcx + 2], al
add rcx, 3
mov qword [rsp + 0x88], r9
dec edx
cmp edx, 0x11d
ja 0x180040f05
add r8d, 0xffffffff
jne 0x180040f00
jmp 0x180040e8d
mov rax, qword [rdx]
mov qword [rsp + 0x80], rax
mov rax, qword [rax + 0x20]
mov rax, qword [rax]
mov qword [rsp + 0x88], rax
jmp case.0x180040b04.3
mov rax, qword [rdx]
lea rcx, [rsp + 0x80]
mov qword [rsp + 0xf8], rax
lea rdx, [rsp + 0xf8]
mov rax, qword [r9]
mov r8d, 0xc2
xor r9d, r9d
mov qword [rsp + 0x80], rax
call fcn.180023820
jmp 0x180040fbb
mov eax, dword [rsp + 0x100]
add rsp, 0xa8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret