Function at 0x180040cd0
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 0x20], r9
mov qword [rsp + 0x18], r8
mov dword [rsp + 0x10], edx
mov qword [rsp + 8], rcx
sub rsp, 0x138
mov qword [rsp + 0xd0], 0xfffffffffffffffe
mov rax, qword [0x1800881a0]
xor rax, rsp
mov qword [rsp + 0x128], rax
mov rcx, qword [rsp + 0x158]
call fcn.180019300
movzx eax, al
test eax, eax
je 0x180040d23
xor eax, eax
jmp 0x1800414d4
mov eax, reloc.OLEAUT32.dll_SafeArrayGetDim
mov word [rsp + 0x48], ax
movsx rax, word [rsp + 0x48]
lea rcx, [0x180087e40]
cmp dword [rcx + rax*4], 1
jne 0x180040d62
movsx rax, word [rsp + 0x48]
lea rcx, [0x180087e40]
mov eax, dword [rcx + rax*4]
inc eax
movsx rcx, word [rsp + 0x48]
lea rdx, [0x180087e40]
mov dword [rdx + rcx*4], eax
mov rax, qword [rsp + 0x140]
add rax, 0x30
mov rcx, rax
call fcn.180019300
movzx eax, al
test eax, eax
je 0x180040d84
xor eax, eax
jmp 0x1800414d4
mov rax, qword [rsp + 0x140]
mov rdx, qword [rax + 0x60]
mov rcx, qword [rsp + 0x140]
call fcn.180040a30
movzx eax, al
test eax, eax
jne 0x180040e98
call fcn.180023310
test rax, rax
je 0x180040e1e
call fcn.180023310
cmp qword [rax + 0xd60], 0
je 0x180040e1e
mov rax, qword [rsp + 0x140]
add rax, 0x30
mov rcx, rax
call fcn.1800324c0
mov qword [rsp + 0x98], rax
call fcn.180023310
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 4
xor r9d, r9d
mov r8d, 3
mov edx, 0x40000000
mov rcx, qword [rsp + 0x98]
call qword [rax + 0xd60]
mov qword [rsp + 0x78], rax
jmp 0x180040e27
mov qword [rsp + 0x78], 0
mov rax, qword [rsp + 0x140]
mov rcx, qword [rsp + 0x78]
mov qword [rax + 0x60], rcx
mov rax, qword [rsp + 0x140]
mov rdx, qword [rax + 0x60]
mov rcx, qword [rsp + 0x140]
call fcn.180040a30
movzx eax, al
test eax, eax
jne 0x180040e5f
xor eax, eax
jmp 0x1800414d4
mov rax, qword [rsp + 0x140]
add rax, 0x30
mov rcx, rax
call fcn.1800324c0
mov rcx, rax
call fcn.18001eed0
mov r9d, 2
xor r8d, r8d
xor edx, edx
mov rax, qword [rsp + 0x140]
mov rcx, qword [rax + 0x60]
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
call fcn.180042020
mov rcx, qword [rsp + 0x140]
sub rax, qword [rcx + 0x70]
xor edx, edx
mov ecx, 0x2710
div rcx
mov dword [rsp + 0x6c], eax
mov dword [rsp + 0x54], 0
mov edx, 1
lea rcx, [rsp + 0x110]
call fcn.180019030
lea rcx, [rsp + 0x110]
call fcn.18001bf00
nop
mov dword [rsp + 0x108], 0
mov r9d, 8
mov r8b, reloc.OLEAUT32.dll_SafeArrayGetDim
mov rdx, qword [rsp + 0x150]
lea rcx, [rsp + 0xf0]
call fcn.1800294a0
mov qword [rsp + 0xc0], rax
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0x88], rax
mov eax, dword [rsp + 0x148]
add eax, 0x30
mov dword [rsp + 0x64], eax
mov rcx, qword [rsp + 0x140]
add rcx, 0x18
mov qword [rsp + 0xb8], rcx
mov r9d, 8
mov r8b, reloc.OLEAUT32.dll_SafeArrayGetDim
mov edx, dword [rsp + 0x6c]
lea rcx, [rsp + 0xd8]
call fcn.180029060
mov qword [rsp + 0xa8], rax
mov rax, qword [rsp + 0xa8]
mov qword [rsp + 0xc8], rax
mov rdx, qword [rsp + 0xc8]
lea rcx, [rsp + 0x110]
call fcn.180020f20
mov dx, 0x3a
mov rcx, rax
call fcn.18003c8d0
mov rcx, qword [rsp + 0xb8]
mov rdx, rcx
mov rcx, rax
call fcn.180020f20
mov dx, 0x3a
mov rcx, rax
call fcn.18003c8d0
mov ecx, dword [rsp + 0x64]
movzx edx, cx
mov rcx, rax
call fcn.18003c8d0
mov dx, 0x3a
mov rcx, rax
call fcn.18003c8d0
mov rdx, qword [rsp + 0x88]
mov rcx, rax
call fcn.180020f20
mov dx, 0x3a
mov rcx, rax
call fcn.18003c8d0
mov rdx, qword [rsp + 0x158]
mov rcx, rax
call fcn.180020f20
mov r8, 0xffffffffffffffff
lea rdx, [0x18008cb6c]
mov rcx, rax
call fcn.180020f70
nop
lea rcx, [rsp + 0xd8]
call fcn.180011730
nop
lea rcx, [rsp + 0xf0]
call fcn.180011730
mov r8d, 0x3e8
mov rax, qword [rsp + 0x140]
mov rdx, qword [rax + 0x68]
mov rcx, qword [rsp + 0x140]
call fcn.180041ea0
mov byte [rsp + 0x50], al
mov eax, 4
mov word [rsp + 0x40], ax
movsx rax, word [rsp + 0x40]
lea rcx, [0x180087e40]
cmp dword [rcx + rax*4], 1
jne 0x18004108f
movsx rax, word [rsp + 0x40]
lea rcx, [0x180087e40]
mov eax, dword [rcx + rax*4]
inc eax
movsx rcx, word [rsp + 0x40]
lea rdx, [0x180087e40]
mov dword [rdx + rcx*4], eax
mov r9d, 2
xor r8d, r8d
xor edx, edx
mov rax, qword [rsp + 0x140]
mov rcx, qword [rax + 0x60]
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [rsp + 0x58], eax
cmp dword [rsp + 0x58], 0xffffffff
je 0x1800410ce
cmp dword [rsp + 0x58], 0x2faf080
jbe 0x1800410ce
mov rcx, qword [rsp + 0x140]
call fcn.180041b80
lea rcx, [rsp + 0x110]
call fcn.180007c90
shl rax, 1
mov qword [rsp + 0x90], rax
lea rcx, [rsp + 0x110]
call fcn.1800324e0
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x108]
mov rcx, qword [rsp + 0x90]
mov r8d, ecx
mov rdx, rax
mov rax, qword [rsp + 0x140]
mov rcx, qword [rax + 0x60]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [rsp + 0x54], eax
mov eax, 9
mov word [rsp + 0x44], ax
movsx rax, word [rsp + 0x44]
lea rcx, [0x180087e40]
cmp dword [rcx + rax*4], 1
jne 0x180041167
movsx rax, word [rsp + 0x44]
lea rcx, [0x180087e40]
mov eax, dword [rcx + rax*4]
inc eax
movsx rcx, word [rsp + 0x44]
lea rdx, [0x180087e40]
mov dword [rdx + rcx*4], eax
cmp dword [rsp + 0x54], 0
je 0x1800411f3
mov rax, qword [rsp + 0x140]
mov rcx, qword [rax + 0x60]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov eax, 4
imul rax, rax, 0
lea rcx, [0x180087e40]
mov eax, dword [rcx + rax]
xor edx, edx
mov ecx, SafeArrayGetElement
div rcx
mov rax, rdx
mov dword [rsp + 0x5c], eax
mov eax, 4
imul rax, rax, 0
lea rcx, [0x180087e40]
movsxd rdx, dword [rsp + 0x5c]
lea r8, [0x180087e40]
mov eax, dword [rcx + rax]
mov dword [r8 + rdx*4], eax
mov eax, 4
imul rax, rax, 0
lea rcx, [0x180087e40]
mov eax, dword [rcx + rax]
inc eax
mov ecx, 4
imul rcx, rcx, 0
lea rdx, [0x180087e40]
mov dword [rdx + rcx], eax
cmp dword [rsp + 0x54], 0
je 0x18004121e
mov rax, qword [rsp + 0x140]
mov rdx, qword [rax + 0x60]
mov rcx, qword [rsp + 0x140]
call fcn.180040a30
movzx eax, al
test eax, eax
jne 0x18004142a
mov rax, qword [rsp + 0x140]
mov rdx, qword [rax + 0x60]
mov rcx, qword [rsp + 0x140]
call fcn.180040a30
movzx eax, al
test eax, eax
je 0x180041250
mov rax, qword [rsp + 0x140]
mov rcx, qword [rax + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.180023310
test rax, rax
je 0x1800412c9
call fcn.180023310
cmp qword [rax + 0xd60], 0
je 0x1800412c9
mov rax, qword [rsp + 0x140]
add rax, 0x30
mov rcx, rax
call fcn.1800324e0
mov qword [rsp + 0xa0], rax
call fcn.180023310
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 4
xor r9d, r9d
mov r8d, 3
mov edx, 0x40000000
mov rcx, qword [rsp + 0xa0]
call qword [rax + 0xd60]
mov qword [rsp + 0x80], rax
jmp 0x1800412d5
mov qword [rsp + 0x80], 0
mov rax, qword [rsp + 0x140]
mov rcx, qword [rsp + 0x80]
mov qword [rax + 0x60], rcx
mov eax, 0xa
mov word [rsp + 0x4c], ax
movsx rax, word [rsp + 0x4c]
lea rcx, [0x180087e40]
cmp dword [rcx + rax*4], 1
jne 0x180041328
movsx rax, word [rsp + 0x4c]
lea rcx, [0x180087e40]
mov eax, dword [rcx + rax*4]
inc eax
movsx rcx, word [rsp + 0x4c]
lea rdx, [0x180087e40]
mov dword [rdx + rcx*4], eax
mov r9d, 2
xor r8d, r8d
xor edx, edx
mov rax, qword [rsp + 0x140]
mov rcx, qword [rax + 0x60]
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, 4
imul rax, rax, 0
lea rcx, [0x180087e40]
mov eax, dword [rcx + rax]
xor edx, edx
mov ecx, SafeArrayGetElement
div rcx
mov rax, rdx
mov dword [rsp + 0x60], eax
mov eax, 4
imul rax, rax, 0
lea rcx, [0x180087e40]
movsxd rdx, dword [rsp + 0x60]
lea r8, [0x180087e40]
mov eax, dword [rcx + rax]
mov dword [r8 + rdx*4], eax
mov eax, 4
imul rax, rax, 0
lea rcx, [0x180087e40]
mov eax, dword [rcx + rax]
inc eax
mov ecx, 4
imul rcx, rcx, 0
lea rdx, [0x180087e40]
mov dword [rdx + rcx], eax
mov rax, qword [rsp + 0x140]
add rax, 0x30
mov rcx, rax
call fcn.1800324c0
mov rcx, rax
call fcn.18001eed0
lea rcx, [rsp + 0x110]
call fcn.180007c90
shl rax, 1
mov qword [rsp + 0xb0], rax
lea rcx, [rsp + 0x110]
call fcn.1800324e0
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x108]
mov rcx, qword [rsp + 0xb0]
mov r8d, ecx
mov rdx, rax
mov rax, qword [rsp + 0x140]
mov rcx, qword [rax + 0x60]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [rsp + 0x54], eax
movzx eax, byte [rsp + 0x50]
test eax, eax
je 0x18004144c
mov rax, qword [rsp + 0x140]
mov rdx, qword [rax + 0x68]
mov rcx, qword [rsp + 0x140]
call fcn.180041df0
mov eax, 4
imul rax, rax, 0
lea rcx, [0x180087e40]
mov eax, dword [rcx + rax]
xor edx, edx
mov ecx, SafeArrayGetElement
div rcx
mov rax, rdx
mov dword [rsp + 0x68], eax
mov eax, 4
imul rax, rax, 0
lea rcx, [0x180087e40]
movsxd rdx, dword [rsp + 0x68]
lea r8, [0x180087e40]
mov eax, dword [rcx + rax]
mov dword [r8 + rdx*4], eax
mov eax, 4
imul rax, rax, 0
lea rcx, [0x180087e40]
mov eax, dword [rcx + rax]
inc eax
mov ecx, 4
imul rcx, rcx, 0
lea rdx, [0x180087e40]
mov dword [rdx + rcx], eax
mov eax, dword [rsp + 0x54]
mov dword [rsp + 0x70], eax
lea rcx, [rsp + 0x110]
call fcn.180011730
mov eax, dword [rsp + 0x70]
mov rcx, qword [rsp + 0x128]
xor rcx, rsp
call fcn.18004d370
add rsp, 0x138
ret