Function at 0x408370
Capabilities:
Delete file
Move file
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x414126
push eax
mov eax, 0x1d3c
mov dword fs:[0], esp
call fcn.004133a0
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x1d60]
lea eax, [esp + 0x154c]
push edi
push 0x4199bc
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
mov esi, dword [sym.imp.MSVCRT.dll_fopen]
lea ecx, [esp + 0x1558]
push 0x419924
push ecx
call esi
xor ebx, ebx
add esp, 0x14
cmp eax, ebx
mov dword [esp + 0x1c], eax
jne 0x4083da
mov eax, 0xfffffed4
jmp 0x408b26
push edi
call fcn.00408c30
add esp, 4
test eax, eax
jne 0x4083f8
push edi
call fcn.00408b50
add esp, 4
test eax, eax
je 0x408b0a
mov edx, dword [esp + 0x1d5c]
push 0x419928
push edx
call esi
mov esi, eax
add esp, 8
cmp esi, ebx
mov dword [esp + 0x18], esi
je 0x408b0a
push esi
push 1
push 4
push 0x41a8a8
call dword [sym.imp.MSVCRT.dll_fread]
mov eax, dword [0x41a8a8]
mov ecx, dword [esp + 0x1d74]
add esp, 0x10
push ebx
push eax
push 0x464
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, 0x47
xor eax, eax
lea edi, [esp + 0x28]
push esi
rep stosd dword es:[edi], eax
mov edi, dword [sym.imp.MSVCRT.dll_fread]
push 0x11c
lea edx, [esp + 0x30]
push 1
push edx
call edi
add esp, 0x10
test eax, eax
jbe 0x408b11
mov eax, dword [esp + 0x128]
push eax
call sub.MFC42.DLL_operatornew
mov ecx, dword [esp + 0x12c]
push esi
push ecx
push 1
push eax
mov dword [esp + 0x28], eax
call edi
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x361]
mov byte [esp + 0x360], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x1d74]
lea edx, [esp + 0x3c]
push edx
push eax
lea ecx, [esp + 0x368]
push str._s_s
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x24
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x145]
mov byte [esp + 0x144], bl
mov esi, str.sysoption.ini
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x28]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x408515
cmp cl, bl
je 0x408511
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x408515
add eax, 2
add esi, 2
cmp cl, bl
jne 0x4084f1
xor eax, eax
jmp 0x40851a
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x408556
mov ebp, dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [esp + 0x34c]
push eax
lea ecx, [esp + 0x148]
push str._sRN
push ecx
call ebp
lea edx, [esp + 0x150]
lea eax, [esp + 0x358]
push edx
push eax
call dword [sym.imp.MSVCRT.dll_rename]
add esp, 0x14
jmp 0x40855c
mov ebp, dword [sym.imp.MSVCRT.dll_sprintf]
lea ecx, [esp + 0x34c]
push ecx
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString_1
push ebx
push str..zgx
lea ecx, [esp + 0x18]
mov dword [esp + 0x1d5c], ebx
call sub.MFC42.DLL_CString::Find
cmp eax, ebx
jle 0x4085d4
push eax
lea edx, [esp + 0x28]
push ebx
push edx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::Mid
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x1d58], 1
call sub.MFC42.DLL_CString::operator
lea ecx, [esp + 0x24]
mov byte [esp + 0x1d54], bl
call sub.MFC42.DLL_CString::CString
mov eax, dword [esp + 0x10]
push 0x80
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea edi, [esp + 0x34c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov eax, ecx
dec eax
je 0x4085fe
mov cl, byte [esp + eax + 0x34c]
cmp cl, 0x2f
je 0x4085fe
cmp cl, 0x5c
je 0x4085fe
dec eax
jne 0x4085ea
mov ecx, eax
lea esi, [esp + 0x34c]
mov edx, ecx
lea edi, [esp + 0xb4c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov byte [esp + eax + 0xb4c], bl
lea eax, [esp + 0xb4c]
push eax
call fcn.00408c30
add esp, 4
test eax, eax
jne 0x40864f
lea ecx, [esp + 0xb4c]
push ecx
call fcn.00408b50
add esp, 4
test eax, eax
je 0x408ae2
mov edi, 0x419264
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0xb4c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x34c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x750]
push 0x4198d0
push ecx
call ebp
mov edi, str..tmp
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x358]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x419924
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x35c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 0x14
cmp esi, ebx
je 0x408ae9
mov ecx, dword [esp + 0x128]
mov edx, dword [esp + 0x14]
push esi
push ecx
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
lea eax, [esp + 0xb60]
lea ecx, [esp + 0x1960]
push eax
push str._ssysoption.ini
push ecx
call ebp
add esp, 0x20
mov esi, str.sysoption.ini
lea eax, [esp + 0x28]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40874c
cmp cl, bl
je 0x408748
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40874c
add eax, 2
add esi, 2
cmp cl, bl
jne 0x408728
xor eax, eax
jmp 0x408751
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x408797
cmp dword [esp + 0x1d6c], 3
jne 0x408797
lea eax, [esp + 0x34c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov ecx, dword [esp + 0x14]
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x10]
mov dword [esp + 0x1d54], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov esi, dword [esp + 0x18]
jmp 0x408445
lea edx, [esp + 0xb4c]
lea eax, [esp + 0x34c]
push edx
push eax
xor ebp, ebp
call fcn.00401f60
add esp, 8
test eax, eax
jne 0x40887d
mov ecx, ebp
inc ebp
cmp ecx, 0xa
jge 0x40893a
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x114d]
mov byte [esp + 0x114c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea edx, [esp + 0xb4c]
lea eax, [esp + 0x34c]
push edx
push eax
push ebp
lea ecx, [esp + 0x1158]
push str._r_n
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
push 0x419940
push str.c:PigSetup.log
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 0x1c
cmp esi, ebx
je 0x408854
lea edi, [esp + 0x114c]
or ecx, 0xffffffff
xor eax, eax
push esi
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
lea edx, [esp + 0x1154]
push ecx
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
lea eax, [esp + 0xb4c]
lea ecx, [esp + 0x34c]
push eax
push ecx
call fcn.00401f60
add esp, 8
test eax, eax
je 0x4087b9
cmp ebp, 0xa
jge 0x40893a
lea edi, [esp + 0x74c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, ecx
cmp esi, ebx
jle 0x4088a7
lea eax, [esp + 0x74c]
dec eax
cmp byte [eax + esi], 0x2e
je 0x4088a7
dec esi
cmp esi, ebx
jg 0x40889c
push 3
lea edx, [esp + esi + 0x750]
push 0x41992c
push edx
call dword [sym.imp.MSVCRT.dll__strnicmp]
add esp, 0xc
test eax, eax
jne 0x40891f
lea eax, [esp + 0x74c]
lea ecx, [esp + 0xf4c]
push eax
push 0x4198d0
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea edx, [esp + 0x74c]
lea eax, [esp + 0xf4c]
mov byte [esp + esi + 0x74b], bl
push edx
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileA]
lea ecx, [esp + 0xf4c]
push 0x80
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea edx, [esp + 0xf4c]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov ecx, dword [esp + 0x1d68]
lea eax, [esp + 0x74c]
push eax
push 1
call fcn.00412530
jmp 0x4089d8
mov esi, str.sysoption.ini
lea eax, [esp + 0x28]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x408967
cmp cl, bl
je 0x408963
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x408967
add eax, 2
add esi, 2
cmp cl, bl
jne 0x408943
xor eax, eax
jmp 0x40896c
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x4089d8
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x249]
mov byte [esp + 0x248], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x144]
lea ecx, [esp + 0x248]
push eax
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
lea edi, [esp + 0x250]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x14c]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0x250]
push edx
push eax
mov byte [esp + ecx + 0x257], bl
mov byte [esp + ecx + 0x256], bl
call dword [sym.imp.MSVCRT.dll_rename]
add esp, 0x10
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea ecx, [esp + 0x144]
push ecx
call esi
lea edx, [esp + 0x34c]
push edx
call esi
push ebx
push 0x80
push 3
push ebx
push ebx
lea eax, [esp + 0x760]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call edi
lea ecx, [esp + 0x13c]
lea edx, [esp + 0x134]
push ecx
lea eax, [esp + 0x130]
push edx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
call edi
lea edi, [esp + 0x74c]
or ecx, 0xffffffff
xor eax, eax
mov ebp, dword [esp + 0x1c]
repne scasb al, byte es:[edi]
mov edi, dword [sym.imp.MSVCRT.dll_fwrite]
push ebp
not ecx
dec ecx
push 1
mov dword [esp + 0x28], ecx
lea ecx, [esp + 0x28]
push 4
push ecx
call edi
mov edx, dword [esp + 0x30]
push ebp
push 1
lea eax, [esp + 0x764]
push edx
push eax
call edi
add esp, 0x20
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edi, [esp + 0x74c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
call sub.MFC42.DLL_operatornew
mov edx, eax
lea edi, [esp + 0x750]
or ecx, 0xffffffff
xor eax, eax
add esp, 4
lea esi, [esp + 0x74c]
repne scasb al, byte es:[edi]
not ecx
mov eax, ecx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebx
and ecx, 3
push edx
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x1d6c]
push 0x465
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
mov edx, dword [esp + 0x14]
push edx
jmp 0x408772
mov eax, dword [esp + 0x14]
push eax
jmp 0x408aee
mov ecx, dword [esp + 0x14]
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x10]
mov dword [esp + 0x1d54], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov eax, 0x64
jmp 0x408b26
push esi
mov esi, dword [sym.imp.MSVCRT.dll_fclose]
call esi
mov edx, dword [esp + 0x20]
push edx
call esi
add esp, 8
xor eax, eax
mov ecx, dword [esp + 0x1d4c]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x1d48
ret 0x14