Function at 0x401540
Capabilities:
Check if file exists
Get file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x41758d
mov eax, dword fs:[0]
push eax
sub esp, 0x6cc
mov eax, dword [0x4352dc]
xor eax, esp
mov dword [esp + 0x6c4], eax
push esi
push edi
mov eax, dword [0x4352dc]
xor eax, esp
push eax
lea eax, [esp + 0x6d8]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x18], eax
xor eax, eax
mov byte [esp + 0x20], 0
mov dword [esp + 0x1c], eax
push 0x206
push eax
lea edx, [esp + 0x4ce]
xor ecx, ecx
mov dword [esp + 0x6e8], eax
push edx
mov word [esp + 0x4d0], cx
call fcn.0040ab60
add esp, 0xc
lea edi, [esp + 0x4c4]
call fcn.00401210
test al, al
jne 0x4015db
lea ecx, [esp + 0x1c]
call fcn.00403640
mov eax, 2
jmp 0x40182b
lea edi, [esp + 0x39c]
call fcn.004039b0
push str.sgrepairbackupupexd.dll
lea eax, [esp + 0x4c8]
push eax
push str._s_s
call fcn.00403d30
add esp, 0xc
cmp byte [esp + 0x4b8], 0
lea esi, [esp + 0x3a8]
jne 0x401619
mov esi, dword [esp + 0x3a4]
lea edi, [esp + 0x14c]
call fcn.004039b0
lea eax, [esi + 4]
mov edx, edi
call fcn.00403b60
mov byte [esp + 0x6e0], 3
cmp byte [esp + 0x268], 0
lea eax, [esp + 0x158]
jne 0x40164f
mov eax, dword [esp + 0x154]
add eax, 4
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401675
shr eax, 4
not al
and al, 1
je 0x401675
push 0
lea ecx, [esp + 0x150]
call fcn.00403190
lea edi, [esp + 0x274]
call fcn.004039b0
push 0x425854
lea ecx, [esp + 0x4c8]
push ecx
push str._s_s
call fcn.00403d30
add esp, 0xc
cmp byte [esp + 0x390], 0
lea esi, [esp + 0x280]
jne 0x4016b3
mov esi, dword [esp + 0x27c]
lea edi, [esp + 0x24]
call fcn.004039b0
lea eax, [esi + 4]
mov edx, edi
call fcn.00403b60
lea edx, [esp + 0x10]
mov byte [esp + 0x6e0], 6
push edx
mov dword [esp + 0x14], 0
call fcn.00401900
mov ecx, ebx
call fcn.00401c50
mov esi, eax
test esi, esi
je 0x40176a
mov edi, dword [esp + 0x10]
test edi, edi
je 0x40176a
lea ecx, [esp + 0x24]
call fcn.00403160
test al, al
je 0x40170d
push 0
lea ecx, [esp + 0x28]
call fcn.00403190
cmp byte [esp + 0x140], 0
mov dword [esp + 0x10], 0
lea eax, [esp + 0x30]
jne 0x401727
mov eax, dword [esp + 0x2c]
add eax, 4
push 0x425818
push eax
lea eax, [esp + 0x18]
push eax
call fcn.004074d6
add esp, 0xc
test eax, eax
jne 0x40175e
mov ecx, dword [esp + 0x10]
push ecx
push edi
push 1
push esi
call fcn.004079db
mov edx, dword [esp + 0x20]
push edx
call fcn.00407e2c
add esp, 0x14
jmp 0x401774
mov eax, dword [esp + 0x18]
mov dword [eax], 3
jmp 0x401774
mov ecx, dword [esp + 0x18]
mov dword [ecx], 2
cmp byte [esp + 0x140], 0
mov esi, vtable.t_str.0
mov dword [esp + 0x24], esi
jne 0x40179c
mov eax, dword [esp + 0x2c]
lea edx, [esp + 0x30]
cmp eax, edx
je 0x40179c
push eax
call fcn.00407568
add esp, 4
cmp byte [esp + 0x390], 0
mov dword [esp + 0x274], esi
jne 0x4017c8
mov eax, dword [esp + 0x27c]
lea ecx, [esp + 0x280]
cmp eax, ecx
je 0x4017c8
push eax
call fcn.00407568
add esp, 4
cmp byte [esp + 0x268], 0
mov dword [esp + 0x14c], esi
jne 0x4017f4
mov eax, dword [esp + 0x154]
lea edx, [esp + 0x158]
cmp eax, edx
je 0x4017f4
push eax
call fcn.00407568
add esp, 4
cmp byte [esp + 0x4b8], 0
mov dword [esp + 0x39c], esi
jne 0x401820
mov eax, dword [esp + 0x3a4]
lea ecx, [esp + 0x3a8]
cmp eax, ecx
je 0x401820
push eax
call fcn.00407568
add esp, 4
lea ecx, [esp + 0x1c]
call fcn.00403640
xor eax, eax
mov ecx, dword [esp + 0x6d8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [esp + 0x6c4]
xor ecx, esp
call fcn.00407401
mov esp, ebp
pop ebp
ret