Function at 0x10017d90
Capabilities:
Check if file exists
Check mutex on windows
Get file attributes
Get file size
Write file on windows

Disassembly:
mov eax, 0x40a8
call fcn.10038740
mov eax, dword [0x100638a4]
xor eax, esp
mov dword [esp + 0x40a4], eax
mov eax, dword [esp + 0x40b0]
push edi
mov edi, dword [esp + 0x40b0]
cmp eax, 0xffffffff
jne 0x10017dd6
mov byte [edi + 4], 1
pop edi
mov ecx, dword [esp + 0x40a4]
xor ecx, esp
call fcn.10038723
add esp, 0x40a8
ret
cmp eax, 0xfffffffe
jne 0x10017df5
mov byte [edi + 4], 0
pop edi
mov ecx, dword [esp + 0x40a4]
xor ecx, esp
call fcn.10038723
add esp, 0x40a8
ret
push ebx
xor ebx, ebx
cmp byte [edi + 4], bl
je 0x1001807e
cmp eax, ebx
je 0x1001807e
cmp dword [edi + 0x41c], 2
je 0x1001807e
mov eax, dword [edi + 0x420]
cmp eax, 2
je 0x1001807e
push ebp
lea ebp, [ebx + 1]
cmp eax, ebx
jne 0x10017e33
mov dword [edi + 0x420], ebp
cmp dword [edi + 0x424], ebp
jge 0x1001807d
push 0x1ffe
lea ecx, [esp + 0x36]
xor eax, eax
push ebx
push ecx
mov word [esp + 0x3c], ax
call fcn.10038ae0
push 0x207e
lea eax, [esp + 0x2042]
xor edx, edx
push ebx
push eax
mov word [esp + 0x2048], dx
call fcn.10038ae0
mov edx, dword [esp + 0x40d8]
add esp, 0x18
lea ecx, [esp + 0x40c4]
push ecx
push edx
push 0xfff
lea eax, [esp + 0x3c]
push eax
call dword [sym.imp.SHLWAPI.dll_wvnsprintfW]
lea ecx, [esp + 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [esp + 0x2c]
movzx ecx, word [esp + 0x2a]
lea edx, [esp + 0x30]
push edx
movzx edx, word [esp + 0x2c]
push eax
movzx eax, word [esp + 0x2e]
push ecx
movzx ecx, word [esp + 0x2e]
push edx
movzx edx, word [esp + 0x30]
push eax
push ecx
push edx
push str._04d__02d__02d__02d:_02d:_02d__s_r_n
lea eax, [esp + 0x2050]
push 0x103f
push eax
call fcn.1003abf8
xor ecx, ecx
add esp, 0x28
mov word [esp + 0x40ae], cx
cmp dword [edi], ebx
jne 0x10017f05
push str.LOCALLOG
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [edi], eax
cmp eax, ebx
je 0x10017f41
mov edx, dword [edi]
push 0xbb8
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x10017f41
mov eax, dword [edi]
add dword [edi + 0x424], ebp
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop ebp
pop ebx
pop edi
mov ecx, dword [esp + 0x40a4]
xor ecx, esp
call fcn.10038723
add esp, 0x40a8
ret
cmp word [edi + 6], bx
push esi
lea esi, [edi + 6]
jne 0x10017f6a
mov ecx, dword [0x100652e0]
push ecx
lea edx, [edi + 0x210]
push esi
push edx
call fcn.10017c30
add esp, 0xc
test al, al
je 0x1001806f
mov eax, dword [edi + 0x41c]
cmp eax, ebx
jne 0x10017fa4
lea eax, [edi + 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x10017f95
test al, 0x10
je 0x10017f95
mov dword [edi + 0x41c], ebp
jmp 0x1001806f
mov dword [edi + 0x41c], 2
jmp 0x1001806f
cmp eax, ebp
jne 0x1001806f
push ebx
push ebx
push 4
push ebx
push ebp
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x1001806f
lea ecx, [esp + 0x14]
push ecx
push esi
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov ecx, dword [esp + 0x18]
cmp ecx, ebx
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x14]
jl 0x10018009
jg 0x10017ff8
cmp eax, 0x800000
jbe 0x10018009
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], ebx
jmp 0x1001800d
or eax, ecx
jne 0x1001802b
push ebx
lea edx, [esp + 0x24]
push edx
push 2
lea eax, [esp + 0x1c]
push eax
push esi
mov byte [esp + 0x24], 0xff
mov byte [esp + 0x25], 0xfe
mov dword [esp + 0x34], ebx
call ebp
push 2
push ebx
push ebx
push esi
mov dword [esp + 0x2c], ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x2034]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10018044
sub eax, edx
push ebx
sar eax, 1
lea ecx, [esp + 0x20]
push ecx
lea edx, [eax + eax]
push edx
lea eax, [esp + 0x2040]
push eax
push esi
call ebp
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [edi]
cmp edi, ebx
je 0x1001807c
push edi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
pop esi
pop ebp
mov ecx, dword [esp + 0x40ac]
pop ebx
pop edi
xor ecx, esp
call fcn.10038723
add esp, 0x40a8
ret