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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2f4
mov eax, dword [0x56800c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x5689b8]
push ebx
push esi
push edi
shr eax, 1
mov edi, ecx
mov dword [ebp - 0x284], edi
test al, 1
je 0x40764a
mov ecx, dword [edi]
test ecx, ecx
je 0x40764a
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [0x56b084]
xor esi, esi
mov dword [ebp - 0x294], esi
mov ebx, eax
mov dword [ebp - 0x28c], ebx
test ecx, ecx
je 0x406a53
call fcn.0041b750
mov ebx, eax
push esi
mov dword [ebp - 0x28c], ebx
call fcn.004bf8aa
add esp, 4
mov esi, ebx
mov dword [ebp - 0x294], esi
test ebx, ebx
jne 0x406a5b
mov ebx, str.filename
mov dword [ebp - 0x28c], ebx
test ebx, ebx
je 0x406ff7
mov ecx, dword [edi]
test ecx, ecx
je 0x406a81
mov eax, dword [ecx]
call dword [eax + 0x78]
test eax, eax
je 0x406a81
mov ecx, dword [edi]
test ecx, ecx
je 0x406a7a
mov eax, dword [ecx]
call dword [eax + 0x78]
mov ebx, dword [eax + 0x28]
jmp 0x406a83
xor eax, eax
mov ebx, dword [eax + 0x28]
jmp 0x406a83
xor ebx, ebx
test ebx, ebx
je 0x406aa8
mov eax, dword [ebx]
mov ecx, ebx
mov eax, dword [eax + 0x3c]
call eax
test al, al
jne 0x406aa8
mov ecx, dword [edi + 0x58]
call fcn.0046df20
mov byte [ebp - 0x27b], 1
cmp eax, 0xe
jne 0x406aaf
mov byte [ebp - 0x27b], 0
test ebx, ebx
je 0x406aef
mov ecx, dword [edi + 0x58]
call fcn.0046df20
cmp eax, 1
je 0x406aef
mov ecx, dword [edi + 0x58]
mov byte [ebp - 0x27a], 1
call fcn.0046df20
cmp eax, 7
je 0x406af9
mov eax, dword [ebx]
mov ecx, ebx
mov eax, dword [eax + 0x3c]
call eax
neg al
sbb al, al
and al, byte [ebp - 0x27a]
mov byte [ebp - 0x27a], al
jmp 0x406aff
xor al, al
mov byte [ebp - 0x27a], al
jmp 0x406aff
mov al, byte [ebp - 0x27a]
test ebx, ebx
je 0x406b2f
mov eax, dword [ebx]
mov ecx, ebx
mov eax, dword [eax + 0x50]
call eax
neg al
mov ecx, ebx
sbb al, al
and byte [ebp - 0x27b], al
mov eax, dword [ebx]
mov eax, dword [eax + 0x4c]
call eax
neg al
sbb al, al
and al, byte [ebp - 0x27a]
mov byte [ebp - 0x27a], al
cmp byte [ebp - 0x27b], 0
je 0x406b70
test ebx, ebx
je 0x406b70
mov eax, dword [ebx]
mov ecx, ebx
mov eax, dword [eax + 0x3c]
call eax
test al, al
jne 0x406b6a
mov edi, dword [edi + 0x58]
mov ecx, dword [edi + 4]
test ecx, ecx
je 0x406b64
mov eax, dword [ecx]
call dword [eax + 0x78]
test eax, eax
je 0x406b64
mov ecx, dword [edi + 4]
mov eax, dword [ecx]
call dword [eax + 0x78]
mov edi, dword [ebp - 0x284]
mov al, byte [ebp - 0x27a]
test al, al
je 0x406b93
test ebx, ebx
je 0x406b93
mov edi, dword [edi + 0x58]
mov ecx, dword [edi + 4]
test ecx, ecx
je 0x406b93
mov eax, dword [ecx]
call dword [eax + 0x78]
test eax, eax
je 0x406b93
mov ecx, dword [edi + 4]
mov eax, dword [ecx]
call dword [eax + 0x78]
mov eax, dword [ebp - 0x284]
mov ecx, dword [eax]
mov eax, dword [ecx]
call dword [eax + 8]
mov edi, eax
mov dword [ebp - 0x23c], 0x100
lea eax, [ebp - 0x234]
mov dword [ebp - 0x290], edi
mov dword [ebp - 0x238], eax
lea edx, [ebp - 0x244]
xor eax, eax
mov dword [ebp - 0x214], 0
mov dword [ebp - 0x234], eax
mov dword [ebp - 0x230], eax
mov dword [ebp - 0x22c], eax
mov dword [ebp - 0x228], eax
mov dword [ebp - 0x224], eax
mov dword [ebp - 0x220], eax
mov dword [ebp - 0x21c], eax
mov dword [ebp - 0x218], eax
mov eax, dword [ebp - 0x284]
mov dword [ebp - 0x244], 0
mov dword [ebp - 0x240], 0xf
mov ecx, dword [eax]
call fcn.004066e0
test al, al
je 0x406c3a
push edi
lea eax, [ebp - 0x244]
push 0x4ef6c0
push eax
call fcn.0040bfe0
add esp, 0xc
cmp byte [ebp - 0x27b], 0
je 0x406cd0
mov ecx, str.Text_documents
call fcn.00489000
mov dword [ebp - 0x288], eax
test eax, eax
je 0x406c97
mov edi, eax
lea ecx, [edi + 2]
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x406c60
sub edi, ecx
sar edi, 1
je 0x406c97
push ecx
push edi
push dword [ebp - 0x244]
lea ecx, [ebp - 0x244]
call fcn.0040c520
lea ecx, [edi + edi]
push ecx
push dword [ebp - 0x288]
push eax
call fcn.004e0070
add esp, 0xc
push ecx
push 7
push dword [ebp - 0x244]
lea ecx, [ebp - 0x244]
call fcn.0040c520
mov ecx, dword [0x4ef6cc]
mov dword [eax], ecx
mov ecx, dword [0x4ef6d0]
mov dword [eax + 4], ecx
mov ecx, dword [0x4ef6d4]
mov dword [eax + 8], ecx
mov cx, word [0x4ef6d8]
mov word [eax + 0xc], cx
cmp byte [ebp - 0x27a], 0
je 0x406d66
mov ecx, str.PDF_documents
call fcn.00489000
mov dword [ebp - 0x288], eax
test eax, eax
je 0x406d2d
mov edi, eax
lea ecx, [edi + 2]
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x406cf6
sub edi, ecx
sar edi, 1
je 0x406d2d
push ecx
push edi
push dword [ebp - 0x244]
lea ecx, [ebp - 0x244]
call fcn.0040c520
lea ecx, [edi + edi]
push ecx
push dword [ebp - 0x288]
push eax
call fcn.004e0070
add esp, 0xc
push ecx
push 7
push dword [ebp - 0x244]
lea ecx, [ebp - 0x244]
call fcn.0040c520
mov ecx, dword [0x4ef6dc]
mov dword [eax], ecx
mov ecx, dword [0x4ef6e0]
mov dword [eax + 4], ecx
mov ecx, dword [0x4ef6e4]
mov dword [eax + 8], ecx
mov cx, word [0x4ef6e8]
mov word [eax + 0xc], cx
mov ecx, str.All_files
call fcn.00489000
mov dword [ebp - 0x288], eax
test eax, eax
je 0x406db7
mov edi, eax
lea ecx, [edi + 2]
nop
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x406d80
sub edi, ecx
sar edi, 1
je 0x406db7
push ecx
push edi
push dword [ebp - 0x244]
lea ecx, [ebp - 0x244]
call fcn.0040c520
lea ecx, [edi + edi]
push ecx
push dword [ebp - 0x288]
push eax
call fcn.004e0070
add esp, 0xc
push ecx
push 5
push dword [ebp - 0x244]
lea ecx, [ebp - 0x244]
call fcn.0040c520
mov ecx, dword [0x4ef6f8]
mov edx, 0x4ef708
push 0x4ef704
mov dword [eax], ecx
mov ecx, dword [0x4ef6fc]
mov dword [eax + 4], ecx
mov cx, word [0x4ef700]
mov word [eax + 8], cx
mov ecx, dword [ebp - 0x238]
call fcn.0041a040
mov ecx, dword [ebp - 0x28c]
add esp, 4
call fcn.0041cc50
mov edx, eax
test edx, edx
je 0x406e33
mov ecx, edx
lea edi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406e15
sub ecx, edi
sar ecx, 1
cmp ecx, 0x103
jb 0x406e35
mov ecx, 0x103
jmp 0x406e35
xor ecx, ecx
push ecx
push edx
lea eax, [ebp - 0x210]
push 0x104
push eax
call fcn.004cb865
lea eax, [ebp - 0x210]
push 0x3a
push eax
call fcn.004be064
add esp, 0x18
test eax, eax
je 0x406fa3
lea eax, [ebp - 0x210]
push 0x3a
push eax
call fcn.004be064
mov edi, eax
mov edx, 0x4ef710
push 0x4ef70c
mov ecx, edi
call fcn.0041a040
lea eax, [ebp - 0x210]
add esp, 0xc
mov ecx, edi
cmp edi, eax
jbe 0x406ea4
cmp word [ecx], 0x2e
je 0x406ea4
sub ecx, 2
lea eax, [ebp - 0x210]
cmp ecx, eax
ja 0x406e91
lea eax, [ebp - 0x210]
cmp ecx, eax
jne 0x406eb0
mov ecx, edi
test edi, edi
je 0x406ed5
mov edx, edi
lea eax, [edx + 2]
mov dword [ebp - 0x288], eax
nop
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x406ec0
sub edx, dword [ebp - 0x288]
sar edx, 1
jmp 0x406ed7
xor edx, edx
lea eax, [edx*2 + 2]
push eax
push edi
push ecx
call fcn.004bdaf0
add esp, 0xc
push 0x54
lea eax, [ebp - 0x2ec]
push 0
push eax
call fcn.004bef30
mov eax, dword [ebp - 0x284]
add esp, 0xc
mov dword [ebp - 0x2f0], 0x58
mov dword [ebp - 0x2d0], 0x104
mov dword [ebp - 0x2d8], 1
mov eax, dword [eax + 0x5c]
mov dword [ebp - 0x2ec], eax
lea eax, [ebp - 0x210]
mov dword [ebp - 0x2d4], eax
mov eax, dword [ebp - 0x238]
mov dword [ebp - 0x2e4], eax
mov eax, dword [ebp - 0x290]
add eax, 2
mov dword [ebp - 0x2bc], 0x806
mov dword [ebp - 0x2b4], eax
lea eax, [ebp - 0x2f0]
push eax
call dword [sym.imp.COMDLG32.dll_GetSaveFileNameW]
test eax, eax
setne al
mov byte [ebp - 0x279], al
test al, al
jne 0x406ffd
mov ecx, dword [ebp - 0x238]
lea eax, [ebp - 0x234]
cmp ecx, eax
je 0x406ff7
mov edx, dword [ebp - 0x214]
push ecx
test edx, edx
jne 0x406ff0
call fcn.004bf8aa
add esp, 4
push esi
jmp 0x407642
mov edi, dword [ebp - 0x290]
lea ecx, [ebp - 0x210]
mov edx, edi
call fcn.004198b0
test al, al
je 0x406ee9
mov ecx, edi
call fcn.00419500
lea ecx, [ebp - 0x210]
mov edi, eax
call fcn.00419500
sub eax, edi
add eax, eax
cmp eax, 0x208
jae 0x40765b
xor ecx, ecx
mov word [ebp + eax - 0x210], cx
jmp 0x406ee9
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
push esi
jmp 0x407642
cmp byte [ebp - 0x27b], 0
lea edi, [ebp - 0x210]
mov dword [ebp - 0x288], edi
je 0x407029
mov edx, 0x4ef714
mov ecx, edi
call fcn.004198b0
mov byte [ebp - 0x27d], 1
test al, al
jne 0x407030
mov byte [ebp - 0x27d], 0
cmp byte [ebp - 0x27a], 0
je 0x407051
mov edx, 0x4ef36c
lea ecx, [ebp - 0x210]
call fcn.004198b0
test al, al
je 0x407051
mov al, 1
jmp 0x407053
xor al, al
mov esi, dword [ebp - 0x290]
lea ecx, [ebp - 0x210]
mov edx, esi
mov byte [ebp - 0x27c], al
call fcn.004198b0
test al, al
mov al, byte [ebp - 0x27c]
jne 0x4070ec
cmp byte [ebp - 0x27d], 0
jne 0x4070ec
test al, al
jne 0x4070ec
mov dl, byte [ebp - 0x27b]
mov ecx, dword [ebp - 0x2d8]
test dl, dl
je 0x4070a6
cmp ecx, 2
jne 0x4070a6
mov esi, 0x4ef714
mov byte [ebp - 0x27d], 1
jmp 0x4070c9
cmp byte [ebp - 0x27a], 0
je 0x4070c9
xor eax, eax
test dl, dl
setne al
add eax, 2
cmp eax, ecx
jne 0x4070c9
mov esi, 0x4ef36c
mov byte [ebp - 0x27c], 1
push esi
lea eax, [ebp - 0x210]
push eax
push 0x4ef720
call fcn.00419f30
mov edi, eax
add esp, 0xc
mov al, byte [ebp - 0x27c]
mov dword [ebp - 0x288], edi
xor esi, esi
cmp byte [ebp - 0x27d], 0
je 0x4072dd
lea eax, [ebp - 0x268]
mov dword [ebp - 0x270], 0x400
mov dword [ebp - 0x26c], eax
mov edi, 1
xor eax, eax
mov dword [ebp - 0x248], esi
mov dword [ebp - 0x268], eax
mov dword [ebp - 0x264], eax
mov dword [ebp - 0x260], eax
mov dword [ebp - 0x25c], eax
mov dword [ebp - 0x258], eax
mov dword [ebp - 0x254], eax
mov dword [ebp - 0x250], eax
mov dword [ebp - 0x24c], eax
mov eax, dword [ebp - 0x284]
mov dword [ebp - 0x278], esi
mov dword [ebp - 0x274], 0xf
mov dword [ebp - 0x290], edi
mov ecx, dword [eax]
mov eax, dword [ecx]
call dword [eax + 0xc]
cmp eax, edi
jl 0x4071f9
lea esp, [esp]
mov eax, dword [ebx]
mov ecx, ebx
push 2
push 0
push 0x4ef72c
push edi
call dword [eax + 0x30]
mov edi, eax
test edi, edi
je 0x4071d2
mov esi, edi
lea ecx, [esi + 2]
lea esp, [esp]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x4071a0
sub esi, ecx
sar esi, 1
je 0x4071d2
push ecx
push esi
push dword [ebp - 0x278]
lea ecx, [ebp - 0x278]
call fcn.0040c520
lea ecx, [esi + esi]
push ecx
push edi
push eax
call fcn.004e0070
add esp, 0xc
push edi
call fcn.004bf8aa
mov eax, dword [ebp - 0x284]
add esp, 4
mov edi, dword [ebp - 0x290]
inc edi
mov dword [ebp - 0x290], edi
mov ecx, dword [eax]
mov eax, dword [ecx]
call dword [eax + 0xc]
cmp edi, eax
jle 0x407180
mov ecx, dword [ebp - 0x26c]
mov edx, 0xfde9
push 0xffffffffffffffff
call fcn.00419bb0
add esp, 4
mov edi, eax
mov edx, edi
mov ecx, 0x4ef734
push 0
push 0
call fcn.00419950
mov esi, eax
add esp, 8
test esi, esi
je 0x40723b
mov ecx, esi
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x407230
sub ecx, edx
jmp 0x40723d
xor ecx, ecx
push ecx
mov ecx, dword [ebp - 0x288]
mov edx, esi
call fcn.0041d720
add esp, 4
mov byte [ebp - 0x279], al
push esi
call fcn.004bf8aa
add esp, 4
push edi
call fcn.004bf8aa
mov edx, dword [ebp - 0x26c]
lea eax, [ebp - 0x268]
add esp, 4
cmp edx, eax
je 0x407289
mov ecx, dword [ebp - 0x248]
push edx
test ecx, ecx
jne 0x4072d6
call fcn.004bf8aa
add esp, 4
mov edi, dword [ebp - 0x288]
xor esi, esi
mov al, byte [ebp - 0x279]
test al, al
je 0x40755f
mov ecx, dword [ebp - 0x284]
mov ecx, dword [ecx]
test ecx, ecx
je 0x4075c2
mov eax, dword [ecx]
call dword [eax + 0x78]
test eax, eax
je 0x4075c2
mov eax, dword [ebp - 0x284]
mov ecx, dword [eax]
test ecx, ecx
je 0x407484
mov eax, dword [ecx]
call dword [eax + 0x78]
jmp 0x407486
mov eax, dword [ecx]
call dword [eax + 0xc]
jmp 0x407289
test al, al
je 0x40734e
call fcn.0042d740
mov eax, dword [0x56be3c]
mov ecx, ebx
mov edx, dword [ebx]
movzx eax, byte [eax + 0x94]
push eax
mov eax, dword [edx + 0x2c]
push edi
call eax
mov byte [ebp - 0x279], al
test al, al
je 0x40755f
mov eax, dword [0x56be3c]
cmp byte [eax + 0x94], 0
jne 0x407291
mov eax, dword [ebp - 0x284]
mov ecx, dword [eax]
test ecx, ecx
je 0x40733d
mov eax, dword [ecx]
call dword [eax + 0x78]
mov ecx, edi
mov edx, dword [eax + 0xc]
call fcn.0042c620
jmp 0x407291
xor eax, eax
mov ecx, edi
mov edx, dword [eax + 0xc]
call fcn.0042c620
jmp 0x407291
mov ecx, dword [ebp - 0x28c]
call fcn.0041d460
test al, al
jne 0x407383
test ebx, ebx
je 0x407383
mov eax, dword [0x56be3c]
mov ecx, ebx
mov edx, dword [ebx]
movzx eax, byte [eax + 0x94]
push eax
mov eax, dword [edx + 0x28]
push edi
call eax
mov byte [ebp - 0x279], al
jmp 0x407297
mov eax, dword [0x56be3c]
cmp byte [eax + 0x94], 0
je 0x4073bb
test ebx, ebx
je 0x4073bb
mov eax, dword [ebx]
mov ecx, ebx
push 1
mov eax, dword [eax + 0x44]
call eax
test al, al
je 0x4073bb
mov eax, dword [ebx]
mov ecx, ebx
push 1
push edi
mov eax, dword [eax + 0x28]
call eax
mov byte [ebp - 0x279], al
jmp 0x407297
mov ecx, dword [ebp - 0x28c]
mov edx, edi
call fcn.0041cff0
test al, al
jne 0x407291
push 0
push edi
push dword [ebp - 0x28c]
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
setne al
mov byte [ebp - 0x279], al
test al, al
je 0x407416
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x407291
test al, 7
je 0x407291
and eax, 0xfffffff8
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
jmp 0x407291
push 0
push 0
lea eax, [ebp - 0x290]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
test eax, eax
je 0x40755f
push dword [ebp - 0x290]
mov ecx, str.Failed_to_save_a_file
call fcn.00489000
push eax
push str._s_n_n_s
call fcn.00419f30
add esp, 0xc
mov esi, eax
push 0
call fcn.004bf8aa
add esp, 4
push dword [ebp - 0x290]
call dword [sym.imp.KERNEL32.dll_LocalFree]
test esi, esi
je 0x40755f
mov ebx, esi
jmp 0x40756b
xor eax, eax
cmp dword [eax + 0xc], 0
je 0x4075c2
mov eax, dword [ebp - 0x284]
mov ecx, dword [eax]
test ecx, ecx
je 0x4074a3
mov eax, dword [ecx]
call dword [eax + 0x78]
jmp 0x4074a5
xor eax, eax
cmp byte [eax + 0x10], 0
je 0x4075c2
cmp byte [ebp - 0x27d], 0
jne 0x4075c2
mov al, byte [ebp - 0x27c]
test al, al
jne 0x4075c2
mov eax, dword [0x56be3c]
cmp byte [eax + 0x94], 0
je 0x4074eb
test ebx, ebx
je 0x4074eb
mov eax, dword [ebx]
mov ecx, ebx
push 1
mov eax, dword [eax + 0x44]
call eax
test al, al
jne 0x407522
mov ebx, dword [ebp - 0x284]
mov ecx, dword [ebx]
test ecx, ecx
je 0x40750e
mov eax, dword [ecx]
call dword [eax + 0x78]
mov ecx, edi
mov edx, dword [eax + 0xc]
call fcn.0042c620
mov byte [ebp - 0x279], al
jmp 0x40752e
xor eax, eax
mov ecx, edi
mov edx, dword [eax + 0xc]
call fcn.0042c620
mov byte [ebp - 0x279], al
jmp 0x40752e
mov al, byte [ebp - 0x279]
mov ebx, dword [ebp - 0x284]
test al, al
je 0x40755f
mov ecx, dword [ebp - 0x28c]
mov edx, edi
call fcn.0041cff0
test al, al
je 0x4075c2
mov ecx, dword [ebx]
test ecx, ecx
je 0x407558
mov eax, dword [ecx]
call dword [eax + 0x78]
mov byte [eax + 0x10], 0
jmp 0x4075c2
xor eax, eax
mov byte [eax + 0x10], al
jmp 0x4075c2
mov ecx, str.Failed_to_save_a_file
call fcn.00489000
mov ebx, eax
mov eax, dword [ebp - 0x284]
mov ecx, dword [0x56c02c]
mov eax, dword [eax + 0x5c]
mov dword [ebp - 0x28c], eax
cmp ecx, 2
je 0x407598
cmp ecx, 0x17
je 0x407598
cmp ecx, 0x1f
je 0x407598
cmp ecx, 0x27
je 0x407598
xor edi, edi
jmp 0x40759d
mov edi, 0x100000
mov ecx, str.Warning
or edi, 0x30
call fcn.00489000
push edi
push eax
push ebx
push dword [ebp - 0x28c]
call dword [sym.imp.USER32.dll_MessageBoxW]
cmp byte [ebp - 0x279], 0
je 0x4075ee
mov ecx, dword [ebp - 0x284]
mov ecx, dword [ecx]
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, eax
call fcn.004623c0
test al, al
je 0x4075ee
cmp byte [ebp - 0x27d], 0
jne 0x4075ee
mov ecx, dword [ebp - 0x288]
call fcn.0041d980
mov eax, dword [ebp - 0x288]
lea ecx, [ebp - 0x210]
cmp eax, ecx
je 0x407607
push eax
call fcn.004bf8aa
add esp, 4
push esi
call fcn.004bf8aa
mov ecx, dword [ebp - 0x238]
lea eax, [ebp - 0x234]
add esp, 4
cmp ecx, eax
je 0x40763c
mov edx, dword [ebp - 0x214]
push ecx
test edx, edx
jne 0x407635
call fcn.004bf8aa
add esp, 4
jmp 0x40763c
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
push dword [ebp - 0x294]
call fcn.004bf8aa
add esp, 4
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004bcb15
mov esp, ebp
pop ebp
ret
call fcn.004bcc49
int3