Function at 0x408690
Capabilities:
Check if file exists
Create directory
Delete file
Get common file path
Get file attributes
Move file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x523fa1
mov eax, dword fs:[0]
push eax
sub esp, 0x224
mov eax, dword [0x56d3f0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [0x57786c]
xor ebx, ebx
push 0x406e40
lea eax, [esi + 0x24]
lea edi, [esi + 4]
push eax
mov dword [edi], 0x30
mov dword [esi + 8], 2
mov dword [esi + 0xc], 3
mov dword [esi + 0x10], ebx
mov dword [esi + 0x14], ebx
mov dword [esi + 0x18], ebx
mov dword [esi + 0x1c], ebx
call dword [sym.imp.ADVAPI32.dll_RegisterServiceCtrlHandlerA]
mov dword [esi + 0x20], eax
cmp eax, ebx
je 0x408e53
push edi
push eax
mov dword [esi + 8], 4
mov dword [esi + 0x18], ebx
mov dword [esi + 0x1c], ebx
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
test eax, eax
je 0x408e53
push ebx
push 0x54ea83
mov ecx, 0x577948
call fcn.00401b40
push 1
push 0x54ecd4
mov ecx, 0x577954
call fcn.00401b40
push ebx
push 0x54ea83
mov ecx, 0x577968
call fcn.00401b40
lea ecx, [ebp - 0x21c]
push ecx
call fcn.00407080
add esp, 4
push eax
mov ecx, 0x577968
mov dword [ebp - 4], ebx
call fcn.00401540
or edi, 0xffffffff
mov dword [ebp - 4], edi
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x408795
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 9
push str.:SmartPC
mov ecx, 0x577968
call fcn.004012a0
push 0x577968
lea ecx, [ebp - 0x21c]
call fcn.004013f0
mov esi, dword [ebp - 0x21c]
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, edi
jne 0x4087cf
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
lea eax, [esi - 0x10]
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4087ea
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x21c]
push ecx
call fcn.00406e50
add esp, 4
mov esi, 1
push eax
mov ecx, 0x5779b8
mov dword [ebp - 4], esi
call fcn.00401540
mov dword [ebp - 4], edi
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x408830
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [0x577854], esi
call fcn.004115d4
mov eax, dword [eax + 8]
push 0x104
lea ecx, [ebp - 0x114]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [ebp - 0x114]
push edx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
lea eax, [ebp - 0x114]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408867
sub eax, edx
push eax
lea eax, [ebp - 0x114]
push eax
mov ecx, 0x577960
call fcn.00401b40
push str.log.txt
lea ecx, [ebp - 0x21c]
push 0x577960
push ecx
call fcn.0040aaa0
add esp, 0xc
push eax
mov ecx, 0x577958
mov dword [ebp - 4], 2
call fcn.00401540
mov dword [ebp - 4], edi
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4088d1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push str.loglist.ini
lea ecx, [ebp - 0x21c]
push 0x577960
push ecx
call fcn.0040aaa0
add esp, 0xc
push eax
mov ecx, 0x57795c
mov dword [ebp - 4], 3
call fcn.00401540
mov dword [ebp - 4], edi
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x408920
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push str.ZeroCastle.exe
lea ecx, [ebp - 0x21c]
push 0x577960
push ecx
call fcn.0040aaa0
add esp, 0xc
push eax
mov ecx, 0x5779c0
mov dword [ebp - 4], 4
call fcn.00401540
mov dword [ebp - 4], edi
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40896f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x54ec14
lea ecx, [ebp - 0x220]
push 0x577960
push ecx
call fcn.0040aaa0
push str.appset.dat
push eax
lea edx, [ebp - 0x21c]
mov ebx, 5
push edx
mov dword [ebp - 4], ebx
call fcn.0040aaa0
add esp, 0x18
push eax
mov ecx, 0x577998
mov byte [ebp - 4], 6
call fcn.00401540
mov byte [ebp - 4], bl
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4089d5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], edi
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4089f9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x54ec14
lea ecx, [ebp - 0x21c]
push 0x577960
push ecx
call fcn.0040aaa0
push str.appset.tmp
push eax
lea edx, [ebp - 0x220]
mov ebx, 7
push edx
mov dword [ebp - 4], ebx
call fcn.0040aaa0
add esp, 0x18
push eax
mov ecx, 0x57799c
mov byte [ebp - 4], 8
call fcn.00401540
mov byte [ebp - 4], bl
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408a5f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], edi
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408a83
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x54ec14
lea ecx, [ebp - 0x21c]
push 0x577960
push ecx
call fcn.0040aaa0
push str.CMPLog
push eax
lea edx, [ebp - 0x220]
push edx
mov dword [ebp - 4], 9
call fcn.0040aaa0
add esp, 0x18
push eax
mov ecx, 0x5779a0
mov byte [ebp - 4], 0xa
call fcn.00401540
mov byte [ebp - 4], 9
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408ae9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], edi
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408b0d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x54ec14
lea ecx, [ebp - 0x21c]
push 0x577960
push ecx
call fcn.0040aaa0
push str.QRT_File
push eax
lea edx, [ebp - 0x220]
mov ebx, 0xb
push edx
mov dword [ebp - 4], ebx
call fcn.0040aaa0
add esp, 0x18
push eax
mov ecx, 0x5779a4
mov byte [ebp - 4], 0xc
call fcn.00401540
mov byte [ebp - 4], bl
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408b73
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], edi
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408b97
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0
push 0x19
lea ecx, [ebp - 0x218]
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
lea edx, [ebp - 0x218]
push edx
lea ecx, [ebp - 0x224]
call fcn.00401880
mov dword [ebp - 4], 0xd
mov eax, dword [ebp - 0x224]
push 0x5c
push eax
call fcn.00501476
add esp, 8
test eax, eax
jne 0x408bdc
mov eax, edi
jmp 0x408be2
sub eax, dword [ebp - 0x224]
push eax
lea ecx, [ebp - 0x220]
push ecx
lea ecx, [ebp - 0x224]
call fcn.0040a970
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 0xe
call fcn.00401540
mov byte [ebp - 4], 0xd
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x408c2a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push str.SmartPC
lea ecx, [ebp - 0x224]
push ecx
lea edx, [ebp - 0x228]
push edx
call fcn.0040aaa0
push str.SmartAD.dll
lea eax, [ebp - 0x22c]
push 0x577960
push eax
mov byte [ebp - 4], 0xf
call fcn.0040aaa0
push str.SmartAD.dll
lea ecx, [ebp - 0x228]
push ecx
lea edx, [ebp - 0x230]
push edx
mov byte [ebp - 4], 0x10
call fcn.0040aaa0
add esp, 0x24
mov bl, 0x11
mov byte [ebp - 4], bl
mov eax, dword [ebp - 0x22c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x408cb2
mov ecx, dword [ebp - 0x230]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov edx, dword [ebp - 0x230]
mov eax, dword [ebp - 0x22c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileA]
lea esi, [ebp - 0x220]
call fcn.00408670
push eax
mov ecx, 0x57796c
mov byte [ebp - 4], 0x12
call fcn.00401540
mov byte [ebp - 4], bl
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408cf0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x228]
push ecx
lea ecx, [ebp - 0x220]
call fcn.004013f0
mov ebx, dword [ebp - 0x220]
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
xor esi, esi
cmp eax, edi
je 0x408d1e
movzx esi, al
shr esi, 4
and esi, 1
lea eax, [ebx - 0x10]
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x408d39
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
jne 0x408d4b
mov ecx, dword [ebp - 0x228]
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov ecx, dword [ebp - 0x228]
mov esi, dword [0x577964]
lea eax, [ecx - 0x10]
add esi, 0xfffffff0
cmp eax, esi
je 0x408dae
cmp dword [esi + 0xc], 0
lea edi, [esi + 0xc]
jl 0x408d9c
mov edx, dword [eax]
cmp edx, dword [esi]
jne 0x408d9c
push eax
call fcn.004014d0
mov ebx, eax
add esp, 4
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
test eax, eax
jg 0x408d91
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
add ebx, 0x10
mov dword [0x577964], ebx
jmp 0x408dab
mov eax, dword [ecx - 0xc]
push eax
push ecx
mov ecx, 0x577964
call fcn.00401b40
or edi, 0xffffffff
push 0
push 0
push 0
push 0
push 0
push 0x408e70
call fcn.004120cd
mov byte [ebp - 4], 0x10
mov eax, dword [ebp - 0x230]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408de7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0xf
mov eax, dword [ebp - 0x22c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408e0c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0xd
mov eax, dword [ebp - 0x228]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408e31
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], edi
mov eax, dword [ebp - 0x224]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edi
dec edi
test edi, edi
jg 0x408e53
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004feee9
mov esp, ebp
pop ebp
ret