Function at 0x401747
Capabilities:
Check if file exists
Create directory
Delete file
Read .ini file
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x85c
push ebx
push esi
push edi
push 0x40
xor ebx, ebx
pop ecx
xor eax, eax
lea edi, [ebp - 0x457]
mov byte [ebp - 0x458], bl
push 0x104
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x458]
mov dword [ebp - 8], ebx
push eax
push ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0xc], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x458]
push 0x40e118
push eax
call fcn.00405c39
mov edi, eax
pop ecx
cmp edi, ebx
pop ecx
je 0x401c78
push 2
push ebx
push edi
call fcn.00405e85
push edi
call fcn.00405d2d
push edi
mov esi, eax
call fcn.00405cd9
push ebx
push dword [0x40e040]
push edi
call fcn.00405e85
push edi
push 1
lea eax, [ebp - 0x10]
push 4
push eax
mov dword [ebp - 0x10], ebx
call fcn.00405b31
add esp, 0x30
cmp dword [ebp - 0x10], 0x50555241
jne 0x40182e
push edi
push 1
lea eax, [ebp - 4]
push 4
push eax
mov dword [ebp - 4], ebx
call fcn.00405b31
sub esi, dword [0x40e040]
add esp, 0x10
cmp esi, dword [ebp - 4]
jb 0x40182e
mov esi, dword [ebp - 4]
push esi
call fcn.00405ccb
cmp eax, ebx
pop ecx
mov dword [ebp - 0x14], eax
je 0x401831
push esi
push ebx
push eax
call fcn.00405910
push edi
push 1
push esi
push dword [ebp - 0x14]
call fcn.00405b31
add esp, 0x1c
jmp 0x401831
mov esi, dword [ebp - 0xc]
push edi
call fcn.00405adb
cmp dword [ebp - 0x14], ebx
pop ecx
je 0x401c78
cmp esi, ebx
je 0x401c78
push ebx
push esi
push dword [ebp - 0x14]
call fcn.004057e4
add esp, 0xc
cmp eax, ebx
mov dword [ebp - 4], eax
je 0x401c6a
push 0x4a
xor eax, eax
pop ecx
lea edi, [ebp - 0x24c]
mov dword [ebp - 0x250], ebx
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x250]
push eax
push 0xffffffffffffffff
push dword [ebp - 4]
call fcn.004057fb
add esp, 0xc
test eax, eax
jne 0x401c61
mov eax, dword [ebp - 0x250]
mov dword [ebp - 8], 1
cmp eax, ebx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x10], ebx
jle 0x401c61
mov esi, 0x80
cmp dword [ebp - 8], ebx
je 0x401c61
push 0x12c
lea eax, [ebp - 0x250]
push ebx
push eax
call fcn.00405910
lea eax, [ebp - 0x250]
push eax
push dword [ebp - 0x10]
push dword [ebp - 4]
call fcn.004057fb
add esp, 0x18
test eax, eax
jne 0x401c52
push 0x40
lea edi, [ebp - 0x123]
pop ecx
mov byte [ebp - 0x124], bl
rep stosd dword es:[edi], eax
push dword [ebp + 8]
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x124]
push eax
call fcn.00405970
lea eax, [ebp - 0x124]
push eax
call fcn.00405a60
add esp, 0xc
cmp byte [ebp + eax - 0x125], 0x5c
je 0x401937
lea eax, [ebp - 0x124]
push 0x40e0c0
push eax
call fcn.00405980
pop ecx
pop ecx
lea eax, [ebp - 0x24c]
push eax
lea eax, [ebp - 0x124]
push eax
call fcn.00405980
cmp byte [ebp - 0x124], bl
pop ecx
pop ecx
lea eax, [ebp - 0x124]
je 0x401967
cmp byte [eax], 0x2f
jne 0x401962
mov byte [eax], 0x5c
inc eax
cmp byte [eax], bl
jne 0x40195a
test byte [ebp - 0x148], 0x10
je 0x401983
lea eax, [ebp - 0x124]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
jmp 0x401c52
lea eax, [ebp - 0x24c]
push str.arswp.ini
push eax
call fcn.0040a760
pop ecx
test eax, eax
pop ecx
jne 0x401b9c
cmp dword [0x40ecfc], ebx
jne 0x401b9c
lea eax, [ebp - 0x124]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x401b9c
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x353]
mov byte [ebp - 0x354], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x124]
push eax
lea eax, [ebp - 0x354]
push eax
call fcn.00405970
lea eax, [ebp - 0x354]
push str..new
push eax
call fcn.00405980
add esp, 0x10
lea eax, [ebp - 0x354]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea eax, [ebp - 0x354]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea eax, [ebp - 0x354]
push eax
push dword [ebp - 0x250]
push dword [ebp - 4]
call fcn.00405874
add esp, 0xc
test eax, eax
je 0x401ab2
mov edi, dword [ebp - 0x128]
mov dword [ebp - 0x18], edi
add edi, 0x400
push edi
call fcn.00405c57
cmp eax, ebx
pop ecx
mov dword [ebp - 0xc], eax
je 0x401aaf
push edi
push ebx
push eax
call fcn.00405910
push edi
push dword [ebp - 0xc]
push dword [ebp - 0x250]
push dword [ebp - 4]
call fcn.0040588d
add esp, 0x1c
test eax, eax
jne 0x401aaf
push ebx
push esi
push 2
push ebx
push 1
lea eax, [ebp - 0x354]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x401aaf
lea eax, [ebp - 0x1c]
push ebx
push eax
mov dword [ebp - 0x1c], ebx
push dword [ebp - 0x18]
push dword [ebp - 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x401ab2
mov dword [ebp - 8], ebx
cmp dword [ebp - 8], ebx
je 0x401c52
mov ecx, 0x100
xor eax, eax
lea edi, [ebp - 0x85b]
mov byte [ebp - 0x85c], bl
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x354]
mov edi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
push eax
lea eax, [ebp - 0x85c]
push 0x400
push eax
push 0x40ed00
push str.updateurl
push str.option
call edi
lea eax, [ebp - 0x85c]
push eax
call fcn.00405a60
test eax, eax
pop ecx
jbe 0x401b29
lea eax, [ebp - 0x124]
push eax
lea eax, [ebp - 0x85c]
push eax
push str.updateurl
push str.option
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
lea eax, [ebp - 0x354]
push eax
lea eax, [ebp - 0x85c]
push 0x400
push eax
push 0x40ed00
push 0x40e19c
push str.customscan
call edi
lea eax, [ebp - 0x85c]
push eax
call fcn.00405a60
test eax, eax
pop ecx
jbe 0x401b7c
lea eax, [ebp - 0x124]
push eax
lea eax, [ebp - 0x85c]
push eax
push 0x40e19c
push str.customscan
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
lea eax, [ebp - 0x354]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea eax, [ebp - 0x354]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x401c52
lea eax, [ebp - 0x124]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea eax, [ebp - 0x124]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea eax, [ebp - 0x124]
push eax
push dword [ebp - 0x250]
push dword [ebp - 4]
call fcn.00405874
add esp, 0xc
test eax, eax
je 0x401c52
mov edi, dword [ebp - 0x128]
mov dword [ebp - 0x1c], edi
add edi, 0x400
push edi
call fcn.00405c57
cmp eax, ebx
pop ecx
mov dword [ebp - 0xc], eax
je 0x401c4f
push edi
push ebx
push eax
call fcn.00405910
push edi
push dword [ebp - 0xc]
push dword [ebp - 0x250]
push dword [ebp - 4]
call fcn.0040588d
add esp, 0x1c
test eax, eax
jne 0x401c4f
push ebx
push esi
push 2
push ebx
push 1
lea eax, [ebp - 0x124]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x401c4f
lea eax, [ebp - 0x18]
push ebx
push eax
mov dword [ebp - 0x18], ebx
push dword [ebp - 0x1c]
push dword [ebp - 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x401c52
mov dword [ebp - 8], ebx
inc dword [ebp - 0x10]
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x20]
jl 0x4018b0
push dword [ebp - 4]
call fcn.004058a8
pop ecx
push dword [ebp - 0x14]
call fcn.00405c4c
mov eax, dword [ebp - 8]
pop ecx
jmp 0x401c7a
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret