Function at 0x401040
Capabilities:
Check if file exists
Create process on windows
Get file attributes
Move file
Set file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x37c
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x378], eax
cmp dword [ebp + 8], 2
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov dword [esp + 0x14], esi
jge 0x401134
mov ebx, dword [sym.imp.USER32.dll_FindWindowW]
xor esi, esi
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
nop dword [eax]
push str.Vo_Lam_Truyen_Ky
push str.Sword3_Class
call ebx
test eax, eax
jne 0x40109f
push 0x3e8
call edi
inc esi
cmp esi, 0xf
jl 0x401080
jmp 0x4010ab
push str.Vo_Lam_Lau
push eax
call dword [sym.imp.USER32.dll_SetWindowTextW]
xor esi, esi
nop dword [eax]
push str.VAuto_2.1.56e
push 0
call ebx
test eax, eax
jne 0x4010cc
push 0x3e8
call edi
inc esi
cmp esi, 0xf
jl 0x4010b0
jmp 0x4010d8
push str.AutoPlay
push eax
call dword [sym.imp.USER32.dll_SetWindowTextW]
xor esi, esi
nop word [eax + eax]
push str.VAutoPK_1.2.56b
push 0
call ebx
test eax, eax
jne 0x401111
push 0x3e8
call edi
inc esi
cmp esi, 0xf
jl 0x4010e0
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x378]
xor ecx, esp
call fcn.00401400
mov esp, ebp
pop ebp
ret
push str.AutoPK
push eax
call dword [sym.imp.USER32.dll_SetWindowTextW]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x378]
xor ecx, esp
call fcn.00401400
mov esp, ebp
pop ebp
ret
push pe_nt_image_headers32
lea eax, [esp + 0x184]
mov dword [esp + 0x10], 0
push 0
push eax
call fcn.00402310
add esp, 0xc
lea eax, [esp + 0x80]
push pe_nt_image_headers32
push 0
push eax
call fcn.00402310
add esp, 0xc
lea eax, [esp + 0x280]
push pe_nt_image_headers32
push 0
push eax
call fcn.00402310
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, 1
add esp, 0xc
mov dword [esp + 0x10], ecx
mov edi, dword [esi + ecx*4]
push 0x23
push edi
call dword [sym.imp.SHLWAPI.dll_StrChrW]
mov esi, eax
test esi, esi
je 0x4011c9
lea ecx, [esi + 2]
push ecx
lea eax, [esp + 0x284]
push eax
call dword [sym.imp.SHLWAPI.dll_StrCpyW]
sub esi, edi
lea eax, [esp + 0x180]
sar esi, 1
inc esi
push esi
push edi
push eax
call dword [sym.imp.SHLWAPI.dll_StrCpyNW]
push 0x5c
lea eax, [esp + 0x184]
push eax
call dword [sym.imp.SHLWAPI.dll_StrChrW]
test eax, eax
je 0x4011e2
add eax, 2
jmp 0x4011e9
lea eax, [esp + 0x180]
push eax
lea eax, [esp + 0x84]
push eax
call dword [sym.imp.SHLWAPI.dll_StrCpyW]
lea eax, [esp + 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401221
test al, 1
je 0x401221
and eax, 0xfffffffe
push eax
lea eax, [esp + 0x84]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
xor esi, esi
push 1
lea eax, [esp + 0x84]
push eax
lea eax, [esp + 0x188]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
jne 0x40124e
push 0x3e8
call ebx
inc esi
cmp esi, 0x1e
jl 0x401223
jmp 0x4012c0
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x288]
push str._lu:_lu
push eax
call fcn.00401010
add esp, 0x10
cmp eax, 2
jne 0x4012c0
push 0
push 0x80
push 3
push 0
push 1
push pe_nt_image_headers32
lea eax, [esp + 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x4012c0
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x20]
push eax
push 0
push 0
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x28]
push edi
mov dword [esp + 0x34], ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0xc]
cmp esi, 0x1e
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
lea eax, [edx + 1]
cmovge eax, edx
inc ecx
mov edx, eax
mov dword [esp + 0x10], ecx
mov eax, dword [ebp + 8]
mov dword [esp + 0xc], edx
cmp ecx, eax
jl 0x401190
dec eax
cmp edx, eax
jne 0x4013e6
mov ecx, 0x44
lea eax, [esp + 0x38]
nop dword [eax]
mov byte [eax], 0
lea eax, [eax + 1]
sub ecx, 1
jne 0x401300
mov dword [esp + 0x38], 0x44
lea eax, [esp + 0x28]
mov ecx, 0x10
nop dword [eax]
mov byte [eax], 0
lea eax, [eax + 1]
sub ecx, 1
jne 0x401320
mov edi, esi
push 0x23
mov edi, dword [edi + 4]
push edi
call dword [sym.imp.SHLWAPI.dll_StrChrW]
mov ebx, dword [sym.imp.SHLWAPI.dll_StrCpyW]
mov esi, eax
test esi, esi
je 0x401368
lea ecx, [esi + 2]
push ecx
lea eax, [esp + 0x84]
push eax
call ebx
sub esi, edi
lea eax, [esp + 0x180]
sar esi, 1
inc esi
push esi
push edi
push eax
call dword [sym.imp.SHLWAPI.dll_StrCpyNW]
push 0x5c
lea eax, [esp + 0x184]
push eax
call dword [sym.imp.SHLWAPI.dll_StrChrW]
test eax, eax
je 0x401381
add eax, 2
jmp 0x401388
lea eax, [esp + 0x180]
push eax
lea eax, [esp + 0x84]
push eax
call ebx
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x3c]
push eax
push 0
push 0
push 0x20
push 0
push 0
push 0
lea eax, [esp + 0xa0]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x4013e6
push dword [esp + 0x28]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebx
push dword [esp + 0x2c]
call ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x378]
xor ecx, esp
call fcn.00401400
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x384]
mov eax, 1
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00401400
mov esp, ebp
pop ebp
ret