Function at 0x404020
Capabilities:
Delete file
Get common file path
Move file

Disassembly:
sub esp, 0x608
mov dl, byte [0x409338]
push ebx
push ebp
push esi
push edi
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x515]
mov byte [esp + 0x514], dl
mov byte [esp + 0x10], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x11]
xor ebp, ebp
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
cmp byte [0x408ad4], 0x31
jne 0x40445b
push ebp
push str.WININIT.INI
call dword [sym.imp.MSVCRT.dll__access]
add esp, 8
test eax, eax
je 0x404090
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x608
ret
mov ecx, dword [esp + 0x61c]
lea eax, [esp + 0x10]
push 0x104
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
test eax, eax
je 0x40445b
cmp eax, 0x104
ja 0x40445b
mov edi, dword [sym.imp.MSVCRT.dll_fopen]
push 0x408388
push str.WININIT.INI
call edi
mov esi, eax
add esp, 8
test esi, esi
je 0x40445b
lea edx, [esp + 0x514]
push edx
push 0
push 0x408454
push 0x408c08
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
je 0x404437
lea eax, [esp + 0x514]
push 0x408524
push eax
call edi
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x404437
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x114]
rep stosd dword es:[edi], eax
test byte [esi + 0xc], 0x10
jne 0x4041a1
mov edi, str._rename_
or ecx, 0xffffffff
xor eax, eax
mov ebx, dword [sym.imp.MSVCRT.dll__strnicmp]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
lea ecx, [esp + 0x118]
push str._rename_
push ecx
call ebx
add esp, 0xc
test eax, eax
je 0x4041a7
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x114]
push esi
lea edx, [esp + 0x118]
push 0x400
rep stosd dword es:[edi], eax
push edx
call dword [sym.imp.MSVCRT.dll_fgets]
add esp, 0xc
lea eax, [esp + 0x114]
push eax
push 0x408500
push ebp
call dword [sym.imp.MSVCRT.dll_fprintf]
mov al, byte [esi + 0xc]
add esp, 0xc
test al, 0x10
je 0x40412e
jmp 0x4041a7
mov ebx, dword [sym.imp.MSVCRT.dll__strnicmp]
test byte [esi + 0xc], 0x10
jne 0x404437
mov eax, dword [esp + 0x620]
mov ecx, eax
and ecx, 1
cmp cl, 1
jne 0x4042ae
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x114]
push esi
lea edx, [esp + 0x118]
push 0x400
rep stosd dword es:[edi], eax
push edx
call dword [sym.imp.MSVCRT.dll_fgets]
lea edi, [esp + 0x120]
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
mov al, byte [esp + 0x114]
not ecx
dec ecx
cmp al, 0x5b
jne 0x404221
cmp byte [esp + ecx + 0x112], 0x5d
jne 0x404221
cmp byte [esp + ecx + 0x113], 0xa
je 0x40438a
lea eax, [esp + 0x114]
push 0x3d
push eax
call dword [sym.imp.MSVCRT.dll_strchr]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x404244
lea ecx, [esp + 0x114]
push ecx
jmp 0x404290
lea edi, [esp + 0x10]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x10]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [ebx + 1]
push ecx
push edx
push eax
call dword [sym.imp.MSVCRT.dll__strnicmp]
add esp, 0xc
test eax, eax
je 0x404273
lea ecx, [esp + 0x114]
push ecx
jmp 0x404290
lea edi, [esp + 0x10]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [ecx + ebx + 1], 0xa
je 0x40429f
lea edx, [esp + 0x114]
push edx
push 0x408500
push ebp
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0xc
test byte [esi + 0xc], 0x10
je 0x4041c6
jmp 0x40438a
and eax, 0x10
cmp al, 0x10
jne 0x40438a
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x114]
push esi
rep stosd dword es:[edi], eax
lea eax, [esp + 0x118]
push 0x400
push eax
call dword [sym.imp.MSVCRT.dll_fgets]
lea edi, [esp + 0x120]
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
mov al, byte [esp + 0x114]
not ecx
dec ecx
cmp al, 0x5b
jne 0x404310
cmp byte [esp + ecx + 0x112], 0x5d
jne 0x404310
cmp byte [esp + ecx + 0x113], 0xa
je 0x40438a
lea edi, [esp + 0x10]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x114]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
lea ecx, [esp + 0x14]
push ecx
push edx
call ebx
add esp, 0xc
test eax, eax
je 0x40433f
lea eax, [esp + 0x114]
push eax
jmp 0x404370
lea edi, [esp + 0x10]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + ecx + 0x114]
mov cl, byte [esp + ecx + 0x114]
cmp cl, 0x3d
jne 0x404368
push eax
push str.NUL_s
jmp 0x404375
lea ecx, [esp + 0x114]
push ecx
push 0x408500
push ebp
call dword [sym.imp.MSVCRT.dll_fprintf]
mov al, byte [esi + 0xc]
add esp, 0xc
test al, 0x10
je 0x4042b9
mov ebx, dword [sym.imp.MSVCRT.dll_fprintf]
lea edx, [esp + 0x114]
push edx
push 0x408500
push ebp
call ebx
mov al, byte [esi + 0xc]
add esp, 0xc
test al, 0x10
jne 0x4043eb
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x114]
push esi
rep stosd dword es:[edi], eax
lea eax, [esp + 0x118]
push 0x400
push eax
call dword [sym.imp.MSVCRT.dll_fgets]
add esp, 0xc
lea ecx, [esp + 0x114]
push ecx
push 0x408500
push ebp
call ebx
mov al, byte [esi + 0xc]
add esp, 0xc
test al, 0x10
je 0x4043aa
push ebp
call dword [sym.imp.MSVCRT.dll_fflush]
mov edi, dword [sym.imp.MSVCRT.dll_fclose]
push ebp
call edi
push esi
call edi
add esp, 0xc
push str.WININIT.INI
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
je 0x40445b
lea edx, [esp + 0x514]
push str.WININIT.INI
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
je 0x40445b
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x608
ret
push esi
mov esi, dword [sym.imp.MSVCRT.dll_fclose]
call esi
add esp, 4
test ebp, ebp
je 0x40445b
push ebp
call esi
add esp, 4
lea eax, [esp + 0x514]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x608
ret