Function at 0x408350
Capabilities:
Check if file exists
Copy file
Get file attributes
Set file attributes

Disassembly:
sub esp, 0xc58
test byte [0x460c7c], 1
mov dword [esp + 4], ecx
mov dword [esp + 8], 0
jne 0x408389
mov ecx, dword [0x460c7c]
mov eax, dword [0x440c6c]
or ecx, 1
test eax, eax
setne al
mov dword [0x460c7c], ecx
mov byte [0x460c78], al
push ebp
mov ebp, dword [esp + 0xc64]
push edi
mov edi, dword [esp + 0xc64]
push ebx
push esi
jmp 0x4083a0
lea ecx, [esp + 0x328]
push ecx
push ebp
xor bl, bl
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
je 0x4083e8
test byte [esp + 0x328], 0x10
jne 0x4083c2
mov bl, 1
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
test bl, bl
je 0x4083e8
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x4083e8
test al, 1
je 0x4083e8
and eax, 0xfffffffe
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esp + 0xc78]
test eax, eax
jne 0x40840b
push eax
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_CopyFileA]
mov esi, eax
jmp 0x408493
mov ebx, dword [esp + 0xc7c]
mov edx, dword [ebx + 0x10]
mov cl, byte [0x460c78]
test cl, cl
mov dword [edx], 0
mov dword [edx + 4], 0
je 0x408470
mov ecx, dword [esp + 0xc74]
push 0
push ecx
push ebx
push eax
push ebp
push edi
call dword [0x440c6c]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x78
mov dword [esp + 0x18], eax
jne 0x408460
push 0
mov byte [0x460c78], 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov al, byte [0x460c78]
test al, al
jne 0x408493
mov eax, dword [esp + 0xc78]
mov edx, dword [esp + 0xc74]
mov ecx, dword [esp + 0x14]
push 0
push edx
push ebx
push eax
push ebp
push edi
call fcn.004081b0
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x18], eax
test esi, esi
jne 0x408565
cmp dword [esp + 0x18], 0x4d3
je 0x408563
mov ebx, dword [esp + 0xc74]
cmp dword [ebx], 0
jne 0x408563
push 0x400
lea eax, [esp + 0x46c]
push eax
push 0x30
call fcn.00402870
push edi
lea ecx, [esp + 0x478]
push ecx
lea edx, [esp + 0x87c]
push edx
call fcn.0040e8d4
add esp, 0x18
push 5
push 0x42ddd2
lea eax, [esp + 0x870]
push eax
push esi
call dword [0x43c2f8]
mov esi, eax
cmp esi, 2
jne 0x408546
push 0x400
lea ecx, [esp + 0x86c]
push ecx
push 0x2e
xor esi, esi
call fcn.00402870
add esp, 0xc
push 0x124
push 0x42ddd2
lea edx, [esp + 0x870]
push edx
push esi
call dword [0x43c2f8]
cmp eax, 6
jne 0x4083a0
mov dword [ebx], 1
jmp 0x408563
cmp esi, 5
je 0x40855e
cmp esi, 4
je 0x4083a0
test esi, esi
je 0x4083a0
jmp 0x408563
mov esi, 1
test esi, esi
lea edx, [esp + 0x224]
setne byte [esp + 0x13]
mov eax, ebp
sub edx, ebp
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x408575
mov esi, dword [esp + 0x14]
lea eax, [esp + 0x224]
push eax
lea ecx, [esp + 0x32c]
push ecx
mov ecx, esi
call fcn.004076b0
lea edx, [esp + 0x328]
push edx
lea eax, [esp + 0x124]
push eax
mov ecx, esi
call fcn.00407660
lea ecx, [esp + 0x120]
push ecx
call fcn.0041d7e4
add esp, 4
mov edi, 0x42e7d0
lea esi, [esp + 0x120]
mov ecx, 4
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x4085f3
mov edi, 0x42e7cc
lea esi, [esp + 0x120]
mov ecx, 4
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x408681
lea ecx, [esp + 0x224]
push ecx
lea edx, [esp + 0x20]
push str.__s_
push edx
call fcn.0040e8d4
mov ebx, dword [esp + 0x20]
add esp, 0xc
lea eax, [esp + 0x224]
push eax
mov ecx, ebx
call fcn.00407a80
test al, al
je 0x408685
push 0
lea ecx, [esp + 0x20]
push ecx
push 0x42e2b8
push 0x440b68
push 0x440b68
push 0
call fcn.00410ada
mov al, byte [ebx]
add esp, 0x18
test al, al
je 0x408685
lea edx, [esp + 0x1c]
push edx
push 0x440b68
lea eax, [esp + 0x470]
push str.exec:__s__s__s
push eax
call fcn.0040e8d4
add esp, 0x10
push 0
push str.MyCopyFile
lea ecx, [esp + 0x470]
push ecx
push 0
call fcn.00401ee0
jmp 0x408685
mov ebx, dword [esp + 0x14]
mov edi, 0x42e7a4
lea esi, [esp + 0x120]
mov ecx, 4
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x40870e
lea eax, [esp + 0x224]
push eax
lea ecx, [esp + 0x20]
push str.__s_
push ecx
call fcn.0040e8d4
push 0
lea edx, [esp + 0x2c]
push edx
push str._s__regserver
push 0x440b68
push 0x440b68
push 0
call fcn.00410ada
mov al, byte [ebx]
add esp, 0x24
test al, al
je 0x40870e
lea eax, [esp + 0x1c]
push eax
push 0x440b68
lea ecx, [esp + 0x470]
push str.exec:__s__s__regserver__s
push ecx
call fcn.0040e8d4
add esp, 0x10
push 0
push str.MyCopyFile
lea edx, [esp + 0x470]
push edx
push 0
call fcn.00401ee0
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
pop esi
pop ebx
je 0x40872b
test al, 1
je 0x40872b
and eax, 0xfffffffe
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov al, byte [esp + 0xb]
pop edi
pop ebp
add esp, 0xc58
ret 0x14