Function at 0x418b50
Capabilities:
Check if file exists
Delete file
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4cfee0
mov eax, dword fs:[0]
push eax
sub esp, 0xdc
mov eax, dword [0x5080f4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x90], ecx
mov edi, dword [ebp + 8]
xorps xmm0, xmm0
mov eax, dword [ebp + 0xc]
push 0
push 0x80
push 3
push 0
push 7
mov dword [ebp - 4], 0
mov dword [ebp - 0xd0], edi
push 0x10005
mov dword [ebp - 0x8c], 0
push eax
mov dword [ebp - 0x88], eax
movq qword [edi], xmm0
call dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0x10
mov esi, eax
call fcn.00484da3
mov dword [ebp - 0xa8], eax
xorps xmm0, xmm0
add esp, 4
movq qword [eax], xmm0
lea ecx, [eax + 0xc]
mov dword [eax + 8], 0
mov dword [eax + 4], 1
mov dword [eax + 8], 1
mov dword [eax], vtable.std::_Ref_count_obj2_class_asw::wrappers::basic_handle_void___struct_asw::wrappers::detail::traits_file_handle__.0
mov dword [ecx], esi
movq qword [edi], xmm0
mov dword [edi], ecx
mov dword [edi + 4], eax
mov dword [ebp - 4], 0
mov dword [ebp - 0x8c], 3
test ecx, ecx
je 0x418c4a
cmp dword [ecx], 0xffffffff
je 0x418c4a
lea eax, [ebp - 0x80]
push eax
push dword [ecx]
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
je 0x419110
cmp dword [ebp - 0x58], 1
je 0x418f51
push 0x649
jmp 0x419117
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [ebp - 0x88]
cmp eax, 2
je 0x418ccf
cmp eax, 3
je 0x418c7d
push esi
push str.Failed_to_open_log_file__s
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [ebp - 0xa4]
call fcn.0041b400
jmp 0x419122
sub esp, 8
mov ecx, esi
mov edx, esp
lea eax, [ecx + 2]
mov dword [edx], esi
mov dword [ebp - 0x84], eax
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x418c90
sub ecx, dword [ebp - 0x84]
sar ecx, 1
mov dword [edx + 4], ecx
lea ecx, [ebp - 0xcc]
call fcn.00435e20
add esp, 8
xor edx, edx
mov dword [ebp - 4], 1
mov ecx, eax
call fcn.00436030
lea ecx, [ebp - 0xcc]
call fcn.004127e0
mov dword [ebp - 0xcc], 0
mov ecx, esi
mov dword [ebp - 4], 2
xor eax, eax
mov dword [ebp - 0xbc], 0
mov dword [ebp - 0xb8], 7
mov word [ebp - 0xcc], ax
mov byte [ebp - 4], al
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x418d05
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0xcc]
call fcn.004123e0
push 5
push str..tmp.
lea ecx, [ebp - 0xcc]
mov dword [ebp - 4], 3
call fcn.0040b4c0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x30], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0x20], xmm0
xor ecx, ecx
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 7
mov word [eax], cx
mov dword [ebp - 0x8c], 7
lea ecx, [ebp - 0xcc]
mov byte [ebp - 4], 7
call fcn.004127e0
lea eax, [ebp - 0xa0]
push eax
call fcn.0043ada0
add esp, 4
lea edx, [ebp - 0xb4]
lea ecx, [ebp - 0xe8]
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0xb4], xmm0
call fcn.00411c90
mov byte [ebp - 4], 8
cmp dword [eax + 0x14], 8
mov ecx, dword [eax + 0x10]
jb 0x418dc5
mov eax, dword [eax]
push ecx
push eax
lea ecx, [ebp - 0x30]
call fcn.0040b4c0
lea ecx, [ebp - 0xe8]
mov byte [ebp - 4], 7
call fcn.004127e0
cmp dword [ebp - 0x1c], 8
lea eax, [ebp - 0x30]
push 0
cmovae eax, dword [ebp - 0x30]
push 0x80
push 1
push 0
push 7
push 0x10005
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0x10
mov esi, eax
call fcn.00484da3
mov ecx, eax
xorps xmm0, xmm0
mov dword [ebp - 0xa8], ecx
lea eax, [ecx + 0xc]
add esp, 4
mov dword [ebp - 0x8c], 0xf
movq qword [ecx], xmm0
mov dword [ecx + 8], 0
mov dword [ecx + 4], 1
mov dword [ecx + 8], 1
mov dword [ecx], vtable.std::_Ref_count_obj2_class_asw::wrappers::basic_handle_void___struct_asw::wrappers::detail::traits_file_handle__.0
mov dword [eax], esi
mov edx, dword [edi + 4]
mov dword [edi], eax
mov dword [ebp - 0x84], edx
mov dword [edi + 4], ecx
test edx, edx
je 0x418e9c
or eax, 0xffffffff
lock xadd dword [edx + 4], eax
jne 0x418e9c
mov eax, dword [edx]
mov esi, dword [eax]
mov ecx, esi
call dword [0x4d9444]
mov ecx, dword [ebp - 0x84]
call esi
mov ecx, dword [ebp - 0x84]
or eax, 0xffffffff
lock xadd dword [ecx + 8], eax
jne 0x418e9c
mov eax, dword [ecx]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x4d9444]
mov ecx, dword [ebp - 0x84]
call esi
mov eax, dword [edi]
test eax, eax
je 0x4190ec
cmp dword [eax], 0xffffffff
je 0x4190ec
push 0
lea ecx, [ebp - 0x34]
mov word [ebp - 0x14], 0xbbef
push ecx
push 3
lea ecx, [ebp - 0x14]
mov byte [ebp - 0x12], 0xbf
push ecx
mov dword [ebp - 0x34], 0
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x419110
mov eax, dword [edi]
test eax, eax
je 0x418ee6
mov edx, dword [eax]
jmp 0x418ee9
or edx, 0xffffffff
mov esi, dword [ebp - 0x88]
sub esp, 0xc
mov eax, esp
mov ecx, esi
mov dword [ebp - 0xa8], eax
mov dword [eax], esi
lea eax, [ecx + 2]
mov dword [ebp - 0x84], eax
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x418f07
sub ecx, dword [ebp - 0x84]
mov eax, dword [ebp - 0xa8]
sar ecx, 1
mov dword [eax + 4], ecx
mov ecx, edx
call fcn.00436930
add esp, 0xc
test al, al
jne 0x418f43
cmp dword [ebp - 0x1c], 8
lea eax, [ebp - 0x30]
cmovae eax, dword [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 0
call fcn.004127e0
jmp 0x418f57
mov esi, dword [ebp - 0x88]
xor eax, eax
xorps xmm0, xmm0
mov word [ebp - 0x18], ax
mov byte [ebp - 0x16], al
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x3c], eax
mov eax, dword [edi]
movups xmmword [ebp - 0x4c], xmm0
test eax, eax
je 0x418f77
mov eax, dword [eax]
jmp 0x418f7a
or eax, 0xffffffff
lea ecx, [ebp - 0x4c]
push ecx
lea ecx, [ebp - 0x38]
push ecx
push 3
lea ecx, [ebp - 0x18]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x418fa2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
jne 0x419110
lea ecx, [ebp - 0x18]
mov word [ebp - 0x14], 0xbbef
movzx eax, word [ecx]
lea edx, [ebp - 0x14]
mov byte [ebp - 0x12], 0xbf
cmp ax, word [edx]
jne 0x418fc7
movzx eax, byte [ecx + 2]
cmp al, byte [edx + 2]
je 0x4190cd
cmp byte [ebp + 0x10], 0
je 0x418fe3
push esi
push str.BOM_not_present_in__s
lea ecx, [ebp - 0xa4]
call fcn.0041b490
jmp 0x419122
mov eax, dword [edi]
test eax, eax
je 0x418fed
mov ecx, dword [eax]
jmp 0x418ff0
or ecx, 0xffffffff
mov edx, dword [ebp - 0x90]
add edx, 0x64
call fcn.004183b0
mov ecx, dword [ebp - 0x90]
lea eax, [ebp - 0xac]
push 1
push esi
push eax
call fcn.00418b50
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [eax], 0
mov dword [eax + 4], 0
mov dword [edi], ecx
mov ecx, dword [edi + 4]
mov dword [ebp - 0x84], ecx
mov dword [edi + 4], edx
test ecx, ecx
je 0x41907a
or eax, 0xffffffff
lock xadd dword [ecx + 4], eax
jne 0x41907a
mov eax, dword [ecx]
mov esi, dword [eax]
mov ecx, esi
call dword [0x4d9444]
mov ecx, dword [ebp - 0x84]
call esi
mov ecx, dword [ebp - 0x84]
or eax, 0xffffffff
lock xadd dword [ecx + 8], eax
jne 0x41907a
mov eax, dword [ecx]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x4d9444]
mov ecx, dword [ebp - 0x84]
call esi
mov ecx, dword [ebp - 0xa8]
mov dword [ebp - 0x84], ecx
test ecx, ecx
je 0x4190cd
or eax, 0xffffffff
lock xadd dword [ecx + 4], eax
jne 0x4190cd
mov eax, dword [ecx]
mov esi, dword [eax]
mov ecx, esi
call dword [0x4d9444]
mov ecx, dword [ebp - 0x84]
call esi
mov eax, dword [ebp - 0x84]
or ecx, 0xffffffff
lock xadd dword [eax + 8], ecx
jne 0x4190cd
mov edx, dword [eax]
mov esi, dword [edx + 4]
mov ecx, esi
call dword [0x4d9444]
mov ecx, dword [ebp - 0x84]
call esi
mov eax, edi
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.00484d55
mov esp, ebp
pop ebp
ret 0xc
lea ecx, [ebp - 0x30]
call fcn.00412590
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
push str.Failed_to_create_new_log_file__s
push eax
lea ecx, [ebp - 0xa4]
call fcn.0041b400
jmp 0x419122
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [ebp - 0xa4]
call fcn.0043e050
push 0x5057bc
lea eax, [ebp - 0xa4]
push eax
call fcn.004a0209
int3