Function at 0x10045870
Capabilities:
Check if file exists
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10070ff0
mov eax, dword fs:[0]
push eax
mov eax, 0x8890
call fcn.1004e8f0
mov eax, dword [0x10083040]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [0x100b9680]
mov eax, dword [edi + 4]
cmp eax, 3
je 0x10045bd9
test eax, eax
jne 0x10045987
movups xmm0, xmmword [str._pipediscord_ipc_0]
mov eax, dword [0x1007bc64]
mov esi, dword [edi]
push 0
push 0
mov dword [ebp - 0x18], eax
mov ax, word [0x1007bc68]
push 3
movups xmmword [ebp - 0x40], xmm0
push 0
movups xmm0, xmmword [0x1007bc4c]
mov word [ebp - 0x14], ax
mov eax, 0x30
push 0
mov word [ebp - 0x16], ax
lea eax, [ebp - 0x40]
movups xmmword [ebp - 0x30], xmm0
push 0xc0000000
movq xmm0, qword [0x1007bc5c]
push eax
movq qword [ebp - 0x20], xmm0
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi + 4], eax
cmp eax, 0xffffffff
jne 0x10045984
nop dword [eax]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x10045941
mov ax, word [ebp - 0x16]
cmp ax, 0x39
jae 0x10045bd9
inc ax
mov word [ebp - 0x16], ax
jmp 0x10045963
cmp eax, 0xe7
jne 0x10045bd9
push 0x2710
lea eax, [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_WaitNamedPipeW]
test eax, eax
je 0x10045bd9
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi + 4], eax
cmp eax, 0xffffffff
je 0x10045920
mov byte [esi], 1
cmp dword [edi + 4], 1
jne 0x10045b32
push 0x8858
lea eax, [ebp - 0x889c]
push 0
push eax
call fcn.1004f640
add esp, 0xc
lea ecx, [ebp - 0x889c]
call fcn.10043c70
lea eax, [ebp - 0x889c]
mov dword [ebp - 4], 0
push eax
mov ecx, edi
call fcn.10045cf0
test al, al
je 0x10045af3
push 0x1007ae14
lea eax, [ebp - 0x44]
mov dword [ebp - 0x44], 0
push eax
lea ecx, [ebp - 0x889c]
call fcn.100451b0
mov eax, dword [ebp - 0x889c]
mov edx, 0x1000
mov ecx, dword [ebp - 0x44]
shl eax, 5
add eax, dword [ebp - 0x8894]
cmp ecx, eax
je 0x10045a1f
mov ax, word [ecx + 0x1e]
shr ax, 0xa
test al, 1
je 0x10045a1f
test word [ecx + 0x1e], dx
lea esi, [ecx + 0x10]
jne 0x10045a21
mov esi, dword [esi + 8]
jmp 0x10045a21
xor esi, esi
push 0x1007ad74
lea eax, [ebp - 0x44]
mov dword [ebp - 0x44], 0
push eax
lea ecx, [ebp - 0x889c]
call fcn.100451b0
mov eax, dword [ebp - 0x889c]
mov ecx, dword [ebp - 0x44]
shl eax, 5
add eax, dword [ebp - 0x8894]
cmp ecx, eax
je 0x10045a71
mov ax, word [ecx + 0x1e]
shr ax, 0xa
test al, 1
je 0x10045a71
add ecx, 0x10
mov eax, 0x1000
test word [ecx + 0xe], ax
jne 0x10045a73
mov ecx, dword [ecx + 8]
jmp 0x10045a73
xor ecx, ecx
test esi, esi
je 0x10045af3
test ecx, ecx
je 0x10045af3
mov eax, str.DISPATCH
mov dl, byte [esi]
cmp dl, byte [eax]
jne 0x10045aa0
test dl, dl
je 0x10045a9c
mov dl, byte [esi + 1]
cmp dl, byte [eax + 1]
jne 0x10045aa0
add esi, 2
add eax, 2
test dl, dl
jne 0x10045a80
xor eax, eax
jmp 0x10045aa5
sbb eax, eax
or eax, 1
test eax, eax
jne 0x10045af3
mov eax, str.READY
nop
mov dl, byte [ecx]
cmp dl, byte [eax]
jne 0x10045ad0
test dl, dl
je 0x10045acc
mov dl, byte [ecx + 1]
cmp dl, byte [eax + 1]
jne 0x10045ad0
add ecx, 2
add eax, 2
test dl, dl
jne 0x10045ab0
xor eax, eax
jmp 0x10045ad5
sbb eax, eax
or eax, 1
test eax, eax
jne 0x10045af3
mov eax, dword [edi + 8]
mov dword [edi + 4], 3
test eax, eax
je 0x10045af3
lea ecx, [ebp - 0x889c]
push ecx
call eax
add esp, 4
lea ecx, [ebp - 0x860]
call fcn.10045160
mov esi, dword [ebp - 0x8888]
test esi, esi
je 0x10045b1a
mov ecx, esi
call fcn.10045160
push 0x14
push esi
call fcn.1004d526
add esp, 8
push 0x808
push dword [ebp - 0x8880]
call fcn.1004d526
add esp, 8
jmp 0x10045bd9
lea eax, [edi + 0x10]
mov dword [edi + 0x154], 0
push eax
push ecx
lea ecx, [edi + 0x15c]
call fcn.100478b0
add esp, 8
mov dword [edi + 0x158], eax
lea esi, [eax + 8]
test esi, esi
je 0x10045bd2
mov eax, dword [edi]
test eax, eax
je 0x10045b94
mov ecx, dword [eax + 4]
cmp ecx, 0xffffffff
je 0x10045b94
lea eax, [edi + 0x154]
test eax, eax
je 0x10045b94
push 0
lea edx, [ebp - 0x44]
mov dword [ebp - 0x44], 0
push edx
push esi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 1
jne 0x10045b94
cmp dword [ebp - 0x44], esi
je 0x10045bd2
mov ecx, dword [edi + 0xc]
test ecx, ecx
je 0x10045bb4
mov eax, dword [edi + 4]
cmp eax, 3
je 0x10045ba8
cmp eax, 1
jne 0x10045bb4
lea eax, [edi + 0x54]
push eax
push dword [edi + 0x50]
call ecx
add esp, 8
mov esi, dword [edi]
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 4], 0xffffffff
mov byte [esi], 0
mov dword [edi + 4], 0
jmp 0x10045bd9
mov dword [edi + 4], 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.1004d4c5
mov esp, ebp
pop ebp
ret