Function at 0x40e1c0
Capabilities:
Check if file exists
Copy file
Delete file
Move file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42f436
mov eax, dword fs:[0]
push eax
sub esp, 0x84
mov eax, dword [0x43a050]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
push str.TWEAKCUBE3_PROTECTOR_COMPAREANDCOPY_WINGUARD
push 0
push 0x1f0003
mov byte [ebp - 0x4c], 1
call dword [sym.imp.KERNEL32.dll_OpenEventW]
test eax, eax
je 0x40e219
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
jmp 0x40eb1e
push str.TWEAKCUBE3_PROTECTOR_COMPAREANDCOPY_WINGUARD
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
lea ecx, [ebp - 0x8c]
mov dword [ebp - 0x68], eax
mov dword [ebp - 4], 0
call fcn.0040ba30
lea eax, [ebp - 0x24]
push eax
mov ecx, str.winguard.dll
mov byte [ebp - 4], 1
call fcn.004012d0
lea ecx, [ebp - 0x20]
push ecx
mov ecx, 0x434878
mov byte [ebp - 4], 2
call fcn.004012d0
lea edx, [ebp - 0x1c]
push edx
mov ecx, str.winguard_x64.dll
mov byte [ebp - 4], 3
call fcn.004012d0
lea eax, [ebp - 0x18]
push eax
mov ecx, str.winguard_x64.exe
mov byte [ebp - 4], 4
call fcn.004012d0
xor eax, eax
mov byte [ebp - 4], 5
mov dword [ebp - 0x54], eax
cmp eax, 4
jae 0x40ea6a
mov esi, dword [ebp + eax*4 - 0x24]
lea ebx, [ebp + eax*4 - 0x24]
push ecx
mov ecx, dword [esi - 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
mov dword [ebp - 0x40], esp
mov dword [ebp - 0x3c], esp
call eax
cmp dword [esi - 4], 0
lea ecx, [esi - 4]
jl 0x40e2ce
cmp eax, dword [esi - 0x10]
jne 0x40e2ce
lea edi, [esi - 0x10]
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x40e307
mov ecx, dword [esi - 0xc]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
jne 0x40e2e7
call fcn.00401990
mov eax, dword [esi - 0xc]
mov dword [edi + 4], eax
mov eax, dword [esi - 0xc]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [edi + 0x10]
push eax
call fcn.00418e5a
add esp, 0x10
mov ecx, dword [ebp - 0x3c]
add edi, 0x10
mov dword [ecx], edi
push ecx
mov byte [ebp - 4], 6
mov edi, esp
mov dword [ebp - 0x3c], esp
call fcn.0040c560
lea esi, [ebp - 0x48]
mov byte [ebp - 4], 5
call fcn.0040c590
push ecx
mov byte [ebp - 4], 7
mov edx, esp
mov dword [ebp - 0x40], esp
push str._appdata__tweakcube3_
push edx
mov ecx, ebx
call fcn.00415fb0
add esp, 8
lea esi, [ebp - 0x44]
call fcn.0040c840
mov byte [ebp - 4], 8
mov eax, dword [ebp - 0x48]
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
push eax
call esi
test eax, eax
jne 0x40e370
cmp byte [ebp - 0x4c], al
jne 0x40e734
lea esp, [esp]
mov ecx, dword [ebp - 0x48]
push ecx
call esi
test eax, eax
jne 0x40e387
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40e370
mov edx, dword [ebp - 0x48]
lea ecx, [ebp - 0x64]
call fcn.0040cd20
mov byte [ebp - 4], 9
mov edx, dword [ebp - 0x44]
lea ecx, [ebp - 0x60]
call fcn.0040cd20
mov byte [ebp - 4], 0xa
mov ecx, dword [ebp - 0x60]
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x40e3bd
push 0x80004005
call fcn.00401000
mov edx, dword [ebp - 0x64]
push ecx
push edx
call fcn.0041912a
add esp, 8
test eax, eax
jle 0x40e6ee
push str.TWEAKCUBE3_WINGUARD_EVENT_NAME
push 0
push 0x1f0003
call dword [sym.imp.KERNEL32.dll_OpenEventW]
mov esi, eax
test esi, esi
je 0x40e3f8
push esi
call dword [sym.imp.KERNEL32.dll_SetEvent]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x58], 0
nop
cmp dword [ebp - 0x58], 0xa
jge 0x40e6ee
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x48]
push 0
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x40ea55
mov esi, dword [ebp - 0x44]
push ecx
mov dword [ebp - 0x40], esp
mov ebx, esp
push ecx
mov ecx, dword [esi - 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
mov dword [ebp - 0x40], esp
mov dword [ebp - 0x3c], esp
call eax
cmp dword [esi - 4], 0
lea ecx, [esi - 4]
jl 0x40e460
cmp eax, dword [esi - 0x10]
jne 0x40e460
lea edi, [esi - 0x10]
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x40e499
mov ecx, dword [esi - 0xc]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
jne 0x40e479
call fcn.00401990
mov eax, dword [esi - 0xc]
mov dword [edi + 4], eax
mov eax, dword [esi - 0xc]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [edi + 0x10]
push eax
call fcn.00418e5a
add esp, 0x10
mov ecx, dword [ebp - 0x3c]
add edi, 0x10
mov dword [ecx], edi
mov ecx, ebx
call fcn.0040c2b0
lea esi, [ebp - 0x38]
call fcn.0040c900
mov byte [ebp - 4], 0xb
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x40e4cf
push 4
push eax
mov eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
push 4
push str..dll
lea ebx, [ebp - 0x38]
call fcn.00401820
mov edi, edi
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40e68f
mov esi, dword [ebp - 0x44]
push ecx
mov dword [ebp - 0x40], esp
mov edi, esp
push ecx
mov ecx, dword [esi - 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
mov dword [ebp - 0x40], esp
mov dword [ebp - 0x3c], esp
call eax
cmp dword [esi - 4], 0
lea ecx, [esi - 4]
jl 0x40e528
cmp eax, dword [esi - 0x10]
jne 0x40e528
lea ebx, [esi - 0x10]
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x40e561
mov ecx, dword [esi - 0xc]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov ebx, eax
test ebx, ebx
jne 0x40e541
call fcn.00401990
mov eax, dword [esi - 0xc]
mov dword [ebx + 4], eax
mov eax, dword [esi - 0xc]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [ebx + 0x10]
push eax
call fcn.00418e5a
add esp, 0x10
mov ecx, dword [ebp - 0x3c]
add ebx, 0x10
mov dword [ecx], ebx
mov ecx, edi
call fcn.0040c2b0
lea esi, [ebp - 0x70]
call fcn.0040c900
push eax
lea edx, [ebp - 0x6c]
push edx
mov ebx, str..dll
mov byte [ebp - 4], 0xc
call fcn.00415ed0
add esp, 8
mov byte [ebp - 4], 0xd
mov eax, dword [eax]
mov edi, dword [ebp - 0x38]
lea esi, [eax - 0x10]
add edi, 0xfffffff0
cmp esi, edi
je 0x40e640
cmp dword [edi + 0xc], 0
jl 0x40e633
mov ecx, dword [esi]
cmp ecx, dword [edi]
jne 0x40e633
mov eax, dword [ecx]
mov edx, dword [eax + 0x10]
call edx
cmp dword [esi + 0xc], 0
lea ecx, [esi + 0xc]
jl 0x40e5d6
cmp eax, dword [esi]
jne 0x40e5d6
mov ebx, esi
mov eax, 1
lock xadd dword [ecx], eax
jmp 0x40e612
mov ecx, dword [esi + 4]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov ebx, eax
test ebx, ebx
jne 0x40e5ef
call fcn.00401990
mov eax, dword [esi + 4]
mov dword [ebx + 4], eax
mov eax, dword [esi + 4]
lea ecx, [eax + eax + 2]
push ecx
add esi, 0x10
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [ebx + 0x10]
push eax
call fcn.00418e5a
add esp, 0x10
lea eax, [edi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40e62b
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
add ebx, 0x10
mov dword [ebp - 0x38], ebx
jmp 0x40e640
mov ebx, dword [eax - 0xc]
push eax
lea ecx, [ebp - 0x38]
push ecx
call fcn.004018e0
mov byte [ebp - 4], 0xc
mov eax, dword [ebp - 0x6c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40e663
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0xb
mov eax, dword [ebp - 0x70]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e4e0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x40e4e0
mov ecx, dword [ebp - 0x38]
mov edx, dword [ebp - 0x44]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
je 0x40e785
mov eax, dword [ebp - 0x38]
push 4
push 0
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp - 0x48]
push 0
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x40ea32
mov byte [ebp - 4], 0xa
mov eax, dword [ebp - 0x38]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e6ee
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 9
mov eax, dword [ebp - 0x60]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e711
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 8
mov eax, dword [ebp - 0x64]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e734
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 7
mov eax, dword [ebp - 0x44]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e757
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 5
mov eax, dword [ebp - 0x48]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e77a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
inc dword [ebp - 0x54]
mov eax, dword [ebp - 0x54]
jmp 0x40e290
lea ecx, [ebp - 0x34]
push ecx
mov byte [ebp - 4], 0xe
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov edx, dword [section..data]
mov eax, dword [edx + 0xc]
mov ecx, section..data
call eax
add eax, 0x10
mov dword [ebp - 0x5c], eax
lea esi, [ebp - 0x74]
mov byte [ebp - 4], 0xf
call fcn.0040c240
mov byte [ebp - 4], 0x10
movzx ecx, word [ebp - 0x28]
movzx edx, word [ebp - 0x2a]
mov eax, dword [eax]
push ecx
movzx ecx, word [ebp - 0x2c]
push edx
movzx edx, word [ebp - 0x2e]
push ecx
movzx ecx, word [ebp - 0x32]
push edx
movzx edx, word [ebp - 0x34]
push ecx
push edx
push eax
push str._slogwinguard__04d__02d__02d__02d__02d__02d.log
lea edi, [ebp - 0x5c]
call fcn.00418480
mov byte [ebp - 4], 0xf
mov eax, dword [ebp - 0x74]
add eax, 0xfffffff0
add esp, 0x20
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e80d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebx, dword [ebp - 0x5c]
push ecx
mov ecx, dword [ebx - 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
add ebx, 0xfffffff0
mov dword [ebp - 0x40], esp
mov edi, esp
call eax
cmp dword [ebx + 0xc], 0
lea ecx, [ebx + 0xc]
jl 0x40e83d
cmp eax, dword [ebx]
jne 0x40e83d
mov esi, ebx
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x40e879
mov ecx, dword [ebx + 4]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov esi, eax
test esi, esi
jne 0x40e856
call fcn.00401990
mov eax, dword [ebx + 4]
mov dword [esi + 4], eax
mov eax, dword [ebx + 4]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [ebx + 0x10]
push edx
lea eax, [eax + eax + 2]
push eax
lea ecx, [esi + 0x10]
push ecx
call fcn.00418e5a
add esp, 0x10
add esi, 0x10
lea ecx, [ebp - 0x50]
mov dword [edi], esi
call fcn.0040c2b0
mov byte [ebp - 4], 0x11
mov edx, dword [ebp - 0x50]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40e914
mov esi, dword [ebp - 0x50]
push ecx
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
mov edx, dword [eax + 0x10]
mov dword [ebp - 0x40], esp
mov dword [ebp - 0x3c], esp
call edx
cmp dword [esi - 4], 0
lea ecx, [esi - 4]
jl 0x40e8c8
cmp eax, dword [esi - 0x10]
jne 0x40e8c8
lea edi, [esi - 0x10]
mov eax, 1
lock xadd dword [ecx], eax
jmp 0x40e901
mov ecx, dword [esi - 0xc]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
jne 0x40e8e1
call fcn.00401990
mov eax, dword [esi - 0xc]
mov dword [edi + 4], eax
mov eax, dword [esi - 0xc]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [edi + 0x10]
push eax
call fcn.00418e5a
add esp, 0x10
mov ecx, dword [ebp - 0x3c]
add edi, 0x10
mov dword [ecx], edi
lea ecx, [ebp - 0x90]
call fcn.0040c6e0
mov edx, dword [section..data]
mov eax, dword [edx + 0xc]
mov ecx, section..data
call eax
add eax, 0x10
mov dword [ebp - 0x3c], eax
mov byte [ebp - 4], 0x12
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x38]
mov edx, dword [ebp - 0x44]
push eax
push ecx
push edx
push str.MoveFile_Faild____s____s____d_
lea edi, [ebp - 0x3c]
call fcn.00418480
mov esi, dword [ebp - 0x3c]
add esp, 0x10
push ecx
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
mov edx, dword [eax + 0x10]
add esi, 0xfffffff0
mov dword [ebp - 0x40], esp
mov dword [ebp - 0x40], esp
call edx
cmp dword [esi + 0xc], 0
lea ecx, [esi + 0xc]
jl 0x40e97e
cmp eax, dword [esi]
jne 0x40e97e
mov edi, esi
mov eax, 1
lock xadd dword [ecx], eax
jmp 0x40e9ba
mov ecx, dword [esi + 4]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
jne 0x40e997
call fcn.00401990
mov eax, dword [esi + 4]
mov dword [edi + 4], eax
mov eax, dword [esi + 4]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [esi + 0x10]
push edx
lea eax, [eax + eax + 2]
push eax
lea ecx, [edi + 0x10]
push ecx
call fcn.00418e5a
add esp, 0x10
mov eax, dword [ebp - 0x5c]
mov edx, dword [ebp - 0x40]
add edi, 0x10
push eax
mov dword [edx], edi
call fcn.0040cc00
add esp, 8
mov byte [ebp - 4], 0x11
lea ecx, [esi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e9eb
mov ecx, dword [esi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push esi
call edx
mov byte [ebp - 4], 0xf
mov eax, dword [ebp - 0x50]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ea0e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0xe
lea ecx, [ebx + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ea2b
mov ecx, dword [ebx]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push ebx
call edx
mov dword [ebp - 4], 0xb
mov byte [ebp - 4], 0xa
mov eax, dword [ebp - 0x38]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ea55
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
inc dword [ebp - 0x58]
jmp 0x40e400
push fcn.00401380
push 4
push 4
lea ecx, [ebp - 0x24]
push ecx
mov byte [ebp - 4], 1
call fcn.0041a071
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x7c]
cmp dword [eax - 0xc], 0
mov esi, dword [eax - 0x10]
lea edx, [eax - 0x10]
je 0x40eae5
cmp dword [edx + 0xc], 0
lea ecx, [edx + 0xc]
jge 0x40eac0
cmp dword [eax - 8], 0
jge 0x40eaac
push 0x80070057
call fcn.00401000
mov dword [eax - 0xc], 0
mov eax, dword [ebp - 0x7c]
xor edx, edx
mov word [eax], dx
mov eax, dword [ebp - 0x7c]
jmp 0x40eae5
or eax, 0xffffffff
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x40ead6
mov ecx, dword [edx]
mov eax, dword [ecx]
push edx
mov edx, dword [eax + 4]
call edx
mov eax, dword [esi]
mov edx, dword [eax + 0xc]
mov ecx, esi
call edx
add eax, 0x10
mov dword [ebp - 0x7c], eax
add eax, 0xfffffff0
mov dword [ebp - 0x84], SysReAllocString
mov dword [ebp - 0x80], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40eb12
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0x68]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00418cd4
mov esp, ebp
pop ebp
ret