Function at 0x401681
Capabilities:
Copy file
Create directory
Delete directory
Delete file
Get common file path
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x530
push ebx
push esi
lea eax, [ebp - 0x224]
push edi
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push dword [0x4035e4]
mov esi, dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
xor ebx, ebx
mov edi, 0x403458
push ebx
lea eax, [ebp - 0x224]
push edi
push eax
call esi
push dword [0x4035e4]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push ebx
push dword [0x4035e4]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
push dword [0x4035e4]
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x530]
push eax
push ebx
lea eax, [ebp - 0x224]
push edi
push eax
call esi
lea eax, [ebp - 0x42c]
push eax
push ebx
lea eax, [ebp - 0x224]
push edi
push eax
call esi
mov eax, dword [0x403032]
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
add eax, 0x2bd
push ebx
push eax
push dword [0x4035e8]
call esi
push 1
push ebx
push ebx
push dword [0x4035e8]
call esi
push ebx
mov edi, eax
push dword [0x4035e8]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
sub esi, edi
push esi
call fcn.00401000
pop ecx
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [ebp - 0x10]
push ebx
push ecx
push esi
push eax
mov dword [ebp - 4], eax
push dword [0x4035e8]
call edi
cmp dword [ebp - 0x10], esi
je 0x40178c
push str.Unable_to_read_the_attached_data
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00401196
push dword [ebp - 4]
call fcn.00401014
add esp, 0xc
jmp 0x401b4e
push ebx
push ebx
push 2
push ebx
push 1
lea eax, [ebp - 0x530]
push 0xc0000000
push eax
mov dword [ebp - 0x10], esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 8], eax
je 0x401b29
lea ecx, [ebp - 0x10]
push ebx
push ecx
push esi
push dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebp - 0x10], esi
jne 0x401b29
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 4]
call fcn.00401014
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileA]
pop ecx
lea eax, [ebp - 0x42c]
push eax
call esi
lea eax, [ebp - 0x42c]
push eax
lea eax, [ebp - 0x530]
push eax
call fcn.00401e29
pop ecx
test eax, eax
pop ecx
jne 0x401819
push ebx
push str.GkWare_SFX_Module_V1.90_lz
push str.Unable_to_decompress_data
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
lea eax, [ebp - 0x530]
push eax
call esi
push ebx
push ebx
push 3
push ebx
push 1
lea eax, [ebp - 0x42c]
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 8], eax
jne 0x401876
lea eax, [ebp - 0x42c]
push eax
call esi
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
push str.Unable_to_open_decompressed_data_file
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00401196
pop ecx
pop ecx
call fcn.0040114e
jmp 0x401b50
mov eax, dword [0x4035f4]
cmp dword [eax + 0x2b0], ebx
je 0x401898
lea eax, [ebp - 0x224]
push eax
push dword [0x4035e4]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp 0x4018a4
push dword [0x4035e4]
call fcn.004010bf
pop ecx
lea eax, [ebp - 0xc]
push ebx
push eax
lea eax, [ebp - 0x120]
push 0x10c
push eax
push dword [ebp - 8]
call edi
mov esi, dword [sym.imp.USER32.dll_wsprintfA]
test eax, eax
je 0x401a4e
cmp dword [ebp - 0xc], ebx
je 0x401a4e
lea eax, [ebp - 0x120]
push eax
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x328]
push str._s_s
push eax
call esi
add esp, 0x10
lea eax, [ebp - 0x328]
push ebx
push ebx
push 2
push ebx
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp dword [ebp - 0x1c], ebx
mov dword [ebp - 0x14], eax
je 0x401952
mov eax, 0x104
cmp dword [ebp - 0x1c], eax
jbe 0x40191e
mov eax, dword [ebp - 0x1c]
push eax
call fcn.00401000
cmp eax, ebx
pop ecx
mov dword [ebp - 4], eax
je 0x401a21
lea ecx, [ebp - 0xc]
push ebx
push ecx
push dword [ebp - 0x1c]
push eax
push dword [ebp - 8]
call edi
lea eax, [ebp - 0xc]
push ebx
push eax
push dword [ebp - 0x1c]
push dword [ebp - 4]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x4035f4]
cmp dword [eax + 0x2b0], ebx
jne 0x4019f4
lea eax, [ebp - 0x120]
push eax
push dword [0x4035e4]
push str._s_s
push dword [ebp - 4]
call esi
mov eax, dword [0x4035f4]
add esp, 0x10
movsx eax, byte [eax + 0x2bc]
dec eax
je 0x4019e3
dec eax
je 0x401a1d
dec eax
jne 0x4019f4
push 1
lea eax, [ebp - 0x328]
push dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
jne 0x4019f4
push dword [ebp - 4]
lea eax, [ebp - 0x530]
push str.The_file___s__already_exists._Overwrite_it__
push eax
call esi
add esp, 0xc
lea eax, [ebp - 0x530]
push 0x24
push str.GkWare_SFX_Module_V1.90_lz
push eax
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 6
jne 0x4019f4
push ebx
push dword [ebp - 4]
lea eax, [ebp - 0x328]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
push dword [ebp - 4]
call fcn.00401014
pop ecx
lea eax, [ebp - 0xc]
push ebx
push eax
lea eax, [ebp - 0x120]
push 0x10c
push eax
push dword [ebp - 8]
call edi
test eax, eax
jne 0x4018c8
jmp 0x401a4e
push 1
jmp 0x4019e4
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x42c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
call fcn.00401166
jmp 0x401b50
mov eax, dword [0x4035f4]
cmp byte [eax + 0x15c], bl
je 0x401a6a
lea eax, [ebp - 0x328]
push eax
call fcn.00401537
pop ecx
jmp 0x401a7d
push ebx
push str.GkWare_SFX_Module_V1.90_lz
push dword [0x403014]
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
push ebx
push ebx
push ebx
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 0xc]
push ebx
push eax
lea eax, [ebp - 0x120]
push 0x10c
push eax
push dword [ebp - 8]
call edi
test eax, eax
je 0x401b01
cmp dword [ebp - 0xc], ebx
je 0x401b01
push 1
push ebx
push dword [ebp - 0x1c]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 0x120]
push eax
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x328]
push str._s_s
push eax
call esi
add esp, 0x10
lea eax, [ebp - 0x328]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x401a89
push 0x9c4
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x328]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x401a89
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x42c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
push 1
pop eax
jmp 0x401b50
push str.Unable_to_write_to_temporary_file.
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00401196
push dword [ebp - 4]
call fcn.00401014
add esp, 0xc
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret