Function at 0x40d780
Capabilities:
Copy file
Delete file
Get common file path
Read .ini file
Set file attributes

Disassembly:
push 0xffffffffffffffff
push 0x5379ff
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x678
mov eax, dword [0x5ab980]
push ebx
push ebp
xor ebp, ebp
push esi
push edi
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], ebp
mov dword [esp + 0x14], eax
mov dword [esp + 0x690], ebp
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], eax
mov edi, dword [ecx + 0x180]
mov esi, dword [ecx + 0xa8]
push ebp
mov byte [esp + 0x694], 2
mov dword [esp + 0x34], edi
call fcn.0040cdb0
add esp, 4
test eax, eax
je 0x40d826
lea ecx, [esp + 0x10]
mov byte [esp + 0x690], 1
call fcn.005128e4
lea ecx, [esp + 0x18]
mov byte [esp + 0x690], 0
call fcn.005128e4
lea ecx, [esp + 0x14]
mov dword [esp + 0x690], 0xffffffff
call fcn.005128e4
mov eax, 0xffffffa6
jmp 0x40dcc3
lea eax, [esp + 0x374]
push eax
push 0x105
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea ecx, [esp + 0x5c]
lea edx, [esp + 0x374]
push ecx
push 1
push 0x598060
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea eax, [esp + 0x374]
push 0x80
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea ecx, [esp + 0x5c]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea edx, [esp + 0x5c]
push 1
push edx
push esi
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
jne 0x40d8c3
lea ecx, [esp + 0x10]
mov byte [esp + 0x690], 1
call fcn.005128e4
lea ecx, [esp + 0x18]
mov byte [esp + 0x690], 0
call fcn.005128e4
lea ecx, [esp + 0x14]
mov dword [esp + 0x690], 0xffffffff
call fcn.005128e4
mov eax, 0xffffffcd
jmp 0x40dcc3
lea eax, [esp + 0x48]
push eax
push 2
push ebp
push esi
call dword [0x5b07bc]
mov ebx, eax
cmp ebx, ebp
mov dword [esp + 0x24], ebx
jne 0x40d8e9
mov esi, 0xffffff37
or edi, 0xffffffff
jmp 0x40dc84
push ebp
lea ecx, [esp + 0x270]
push 0x105
push ecx
push str.DelFiles
push edi
push ebx
push ebp
call dword [0x5b07b8]
mov edi, eax
cmp edi, ebp
jne 0x40da54
mov eax, dword [0x5ab980]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x28], eax
push esi
lea ecx, [esp + 0x24]
mov byte [esp + 0x694], 5
call fcn.00512952
lea edx, [esp + 0x1c]
lea eax, [esp + 0x2c]
push edx
lea ecx, [esp + 0x24]
push eax
push ecx
mov byte [esp + 0x69c], 6
call fcn.004222e0
add esp, 0xc
lea ecx, [esp + 0x20]
test eax, eax
sete bl
mov byte [esp + 0x690], 5
call fcn.005128e4
test bl, bl
je 0x40da15
push 0x2e
lea ecx, [esp + 0x20]
call fcn.0050e31f
cmp eax, ebp
jle 0x40da15
dec eax
lea edx, [esp + 0x20]
push eax
push edx
lea ecx, [esp + 0x24]
call fcn.0050e2a7
push eax
lea ecx, [esp + 0x2c]
mov byte [esp + 0x694], 7
call fcn.00512a1d
lea ecx, [esp + 0x20]
mov byte [esp + 0x690], 5
call fcn.005128e4
mov eax, dword [esp + 0x28]
cmp dword [eax - 8], ebp
je 0x40da15
mov edx, dword [esp + 0x30]
push esi
lea ecx, [esp + 0x168]
push 0x104
push ecx
push 0x5b0738
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
test eax, eax
jbe 0x40da15
lea eax, [esp + 0x164]
push ebp
lea ecx, [esp + 0x270]
push 0x105
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x2c]
push ecx
lea edx, [esp + 0x170]
push str.DelFiles
push edx
push eax
push ebp
call dword [0x5b07b8]
mov edi, eax
lea ecx, [esp + 0x28]
mov byte [esp + 0x690], 4
call fcn.005128e4
lea ecx, [esp + 0x1c]
mov byte [esp + 0x690], 3
call fcn.005128e4
lea ecx, [esp + 0x2c]
mov byte [esp + 0x690], 2
call fcn.005128e4
mov ebx, dword [esp + 0x24]
cmp edi, ebp
je 0x40dcdc
mov eax, dword [esp + 0x38]
or edi, 0xffffffff
cmp eax, edi
je 0x40dc69
mov bl, 0xb
lea ecx, [esp + 0x10]
call fcn.0051286f
lea ecx, [esp + 0x26c]
push ecx
lea ecx, [esp + 0x24]
call fcn.00512952
lea edx, [esp + 0x38]
push 0x2c
push edx
push eax
lea eax, [esp + 0x38]
mov byte [esp + 0x69c], 8
push eax
call fcn.004229b0
add esp, 0x10
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x694], 9
call fcn.00512a1d
lea ecx, [esp + 0x2c]
mov byte [esp + 0x690], 8
call fcn.005128e4
lea ecx, [esp + 0x20]
mov byte [esp + 0x690], 2
call fcn.005128e4
mov eax, dword [esp + 0x14]
cmp dword [eax - 8], ebp
je 0x40db71
mov edx, dword [esp + 0x24]
push ebp
lea ecx, [esp + 0x584]
push 0x104
push ecx
push eax
push ebp
push edx
call dword [0x5b07c8]
test eax, eax
je 0x40db0d
lea eax, [esp + 0x580]
lea ecx, [esp + 0x10]
push eax
call fcn.00512a6d
mov ecx, dword [esp + 0x10]
cmp dword [ecx - 8], ebp
jne 0x40db5a
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x30]
mov esi, dword [esp + 0x34]
push edx
lea ecx, [esp + 0x60]
push eax
lea edx, [esp + 0x30]
push ecx
push edx
mov ecx, esi
call fcn.0040cf40
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x694], 0xa
call fcn.00512a1d
lea ecx, [esp + 0x28]
mov byte [esp + 0x690], 2
call fcn.005128e4
jmp 0x40db5e
mov esi, dword [esp + 0x34]
lea eax, [esp + 0x10]
push eax
call fcn.0041f9c0
mov eax, dword [esp + 0x18]
add esp, 4
jmp 0x40db75
mov esi, dword [esp + 0x34]
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x4c]
push ecx
push ebp
push eax
push edx
call dword [0x5b07c4]
test eax, eax
je 0x40dc5b
push ebp
lea eax, [esp + 0x480]
push 0x104
push eax
push ebp
push ebp
lea ecx, [esp + 0x60]
push ebp
push ecx
mov dword [esp + 0x38], ebp
call dword [0x5b07b8]
lea edx, [esp + 0x47c]
lea ecx, [esp + 0x40]
push edx
call fcn.00512952
lea ecx, [esp + 0x1c]
push 0x2c
push ecx
lea edx, [esp + 0x44]
push eax
push edx
mov byte [esp + 0x6a0], bl
call fcn.004229b0
add esp, 0x10
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x694], 0xc
call fcn.00512a1d
lea ecx, [esp + 0x3c]
mov byte [esp + 0x690], bl
call fcn.005128e4
lea ecx, [esp + 0x40]
mov byte [esp + 0x690], 2
call fcn.005128e4
mov eax, dword [esp + 0x10]
cmp dword [eax - 8], ebp
je 0x40dc37
lea ecx, [esp + 0x18]
lea edx, [esp + 0x10]
push ecx
push ecx
mov ecx, esp
mov dword [esp + 0x4c], esp
push edx
call fcn.00512659
mov ecx, esi
call fcn.00407eb0
jmp 0x40dc43
lea eax, [esp + 0x18]
mov ecx, esi
push eax
call fcn.00407e10
lea ecx, [esp + 0x4c]
lea edx, [esp + 0x4c]
push ecx
push edx
call dword [0x5b07c0]
test eax, eax
jne 0x40db8f
cmp dword [esp + 0x38], edi
jne 0x40da65
mov ebx, dword [esp + 0x24]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
push eax
push ebx
call fcn.0040d2e0
push ebx
call dword [0x5b07b4]
mov esi, 1
lea ecx, [esp + 0x5c]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea ecx, [esp + 0x10]
mov byte [esp + 0x690], 1
call fcn.005128e4
lea ecx, [esp + 0x18]
mov byte [esp + 0x690], 0
call fcn.005128e4
lea ecx, [esp + 0x14]
mov dword [esp + 0x690], edi
call fcn.005128e4
mov eax, esi
mov ecx, dword [esp + 0x688]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x684
ret
or edi, 0xffffffff
jmp 0x40dc69