Function at 0x40d830
Capabilities:
Check if file exists
Get common file path
Get file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x466cb2
mov eax, dword fs:[0]
push eax
sub esp, 0xfd0
mov eax, dword [0x48602c]
xor eax, esp
mov dword [esp + 0xfc8], eax
push ebx
push esi
push edi
mov eax, dword [0x48602c]
xor eax, esp
push eax
lea eax, [esp + 0xfe0]
mov dword fs:[0], eax
xor ebx, ebx
push 0x103
lea eax, [esp + 0x6b1]
push ebx
push eax
mov edi, ecx
mov dword [esp + 0x30], ebx
mov byte [esp + 0x6b8], bl
call sub.MSVCR80.dll_memset
add esp, 0xc
push 0x48
call fcn.0043ae6c
add esp, 4
mov dword [esp + 0x34], eax
cmp eax, ebx
mov dword [esp + 0xfe8], ebx
je 0x40d8ba
push eax
call fcn.00437760
mov dword [esp + 0x1c], eax
jmp 0x40d8be
mov dword [esp + 0x1c], ebx
mov dword [esp + 0xfe8], 0xffffffff
call sub.Encrypt.dll_CreateEncryptObject
mov edx, dword [eax]
mov dword [esp + 0x30], eax
mov ecx, eax
mov eax, dword [edx + 8]
push 2
mov dword [esp + 0x1c], ebx
call eax
lea ecx, [esp + 0x6ac]
push ecx
push ebx
push ebx
push 0x23
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
test eax, eax
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
jl 0x40d951
lea eax, [esp + 0x6ac]
add eax, 0xffffffff
mov cl, byte [eax + 1]
add eax, 1
cmp cl, bl
jne 0x40d908
mov edx, dword [str.AomeiBRNAS.XML]
mov ecx, dword [0x47bb04]
mov dword [eax], edx
mov edx, dword [0x47bb08]
mov dword [eax + 4], ecx
mov ecx, dword [0x47bb0c]
mov dword [eax + 8], edx
mov dl, byte [0x47bb10]
mov dword [eax + 0xc], ecx
mov byte [eax + 0x10], dl
lea eax, [esp + 0x6ac]
push eax
call esi
cmp eax, 0xffffffff
jne 0x40da21
push 0x104
lea ecx, [esp + 0x6b0]
push ebx
push ecx
call sub.MSVCR80.dll_memset
add esp, 0xc
push 0x104
lea edx, [esp + 0x6b0]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x6ac]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
cmp cl, bl
jne 0x40d985
sub eax, edx
cmp eax, ebx
jle 0x40d9af
mov cl, 0x5c
cmp byte [esp + eax + 0x6ac], cl
je 0x40d9a8
sub eax, 1
cmp eax, ebx
jg 0x40d996
jmp 0x40d9af
mov byte [esp + eax + 0x6ac], bl
lea eax, [esp + 0x6ac]
add eax, 0xffffffff
lea esp, [esp]
mov cl, byte [eax + 1]
add eax, 1
cmp cl, bl
jne 0x40d9c0
mov ecx, dword [str.NAS.XML]
mov edx, dword [0x47bb18]
mov dword [eax], ecx
mov cl, byte [0x47bb1c]
mov dword [eax + 4], edx
lea edx, [esp + 0x6ac]
push edx
mov byte [eax + 8], cl
call esi
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov eax, ecx
cmp eax, ebx
jne 0x40da21
push 0x13e
mov dword [esp + 0x28], 0x13e100b
call fcn.0040cbd0
add esp, 4
push eax
push str.::GetFileAttributesA_sCurPath__INVALID_FILE_ATTRIBUTES
push 0x13e100b
jmp 0x40df89
mov eax, dword [esp + 0x1c]
push 1
lea edx, [esp + 0x6b0]
push edx
push eax
call fcn.00437820
movzx eax, al
cmp eax, ebx
jne 0x40da61
push 0x141
mov dword [esp + 0x28], 0x1411004
call fcn.0040cbd0
add esp, 4
push eax
push str.xmlAllTasks__LoadFile_sCurPath__TIXML_ENCODING_UTF8_
push 0x1411004
jmp 0x40df89
lea esi, [edi + 4]
mov dword [esp + 0x34], esi
call fcn.00410480
mov ecx, dword [esp + 0x1c]
call fcn.004077c0
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40da9a
push 0x147
call fcn.0040cbd0
add esp, 4
push eax
push str.__pRoot__NULL_
push ebx
jmp 0x40df89
mov ecx, eax
call fcn.00407780
mov dword [esp + 0x2c], eax
jmp 0x40dab0
push 0x206
lea ecx, [esp + 0x92]
push ebx
push ecx
mov word [esp + 0x98], bx
call sub.MSVCR80.dll_memset
add esp, 0xc
push 0x414
lea edx, [esp + 0x298]
push ebx
push edx
call sub.MSVCR80.dll_memset
add esp, 0xc
push 0x207
lea eax, [esp + 0x7b9]
push ebx
push eax
mov byte [esp + 0x7c0], bl
call sub.MSVCR80.dll_memset
add esp, 0xc
push 0x207
lea ecx, [esp + 0x9c1]
push ebx
push ecx
mov byte [esp + 0x9c8], bl
call sub.MSVCR80.dll_memset
mov eax, dword [esp + 0x24]
add esp, 0xc
cmp eax, ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x14], ebx
je 0x40db3b
push eax
call sub.MSVCR80.dll_void___cdecl_operator_delete___void__
add esp, 4
mov dword [esp + 0x18], ebx
mov esi, dword [esp + 0x2c]
xor eax, eax
cmp esi, ebx
setne al
cmp eax, ebx
je 0x40df69
add esi, 0x2c
push esi
mov ebx, str.password
call fcn.004384c0
test eax, eax
je 0x40df51
lea ecx, [eax + 0x18]
call fcn.00408d70
test eax, eax
je 0x40df51
push esi
mov ebx, str.username
call fcn.004384c0
test eax, eax
je 0x40df51
lea ecx, [eax + 0x18]
call fcn.00408d70
test eax, eax
je 0x40df51
push esi
mov ebx, str.nasipname
call fcn.004384c0
test eax, eax
je 0x40df51
lea ecx, [eax + 0x18]
call fcn.00408d70
test eax, eax
je 0x40df51
push esi
mov ebx, str.password
call fcn.004384c0
test eax, eax
je 0x40dbd3
lea ecx, [eax + 0x18]
call fcn.00408d70
jmp 0x40dbd5
xor eax, eax
push eax
lea ecx, [esp + 0x3c]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
push esi
mov ebx, str.username
mov dword [esp + 0xfec], 1
call fcn.004384c0
test eax, eax
je 0x40dc04
lea ecx, [eax + 0x18]
call fcn.00408d70
jmp 0x40dc06
xor eax, eax
push eax
lea ecx, [esp + 0x58]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
push esi
mov ebx, str.nasipname
mov byte [esp + 0xfec], 2
call fcn.004384c0
test eax, eax
je 0x40dc32
lea ecx, [eax + 0x18]
call fcn.00408d70
jmp 0x40dc34
xor eax, eax
push eax
lea ecx, [esp + 0x74]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov byte [esp + 0xfe8], 3
mov ecx, dword [esp + 0x4c]
mov eax, 0x208
lea edx, [esp + 0x14]
mov dword [esp + 0x28], eax
mov dword [esp + 0x14], eax
push edx
lea eax, [esp + 0x9c0]
push eax
push ecx
lea ecx, [esp + 0x44]
call dword [sym.imp.MSVCP80.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
call sub.Encrypt.dll_StrToHex
mov ecx, dword [esp + 0x30]
mov edx, dword [ecx]
mov edx, dword [edx + 4]
push 0
push 0
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x7c0]
push eax
mov eax, dword [esp + 0x24]
push eax
lea eax, [esp + 0x9d0]
push eax
call edx
push 0
push 0
push 0xffffffffffffffff
lea eax, [esp + 0x7c0]
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, eax
test esi, esi
mov dword [esp + 0x20], esi
jbe 0x40df18
xor ecx, ecx
lea eax, [esi + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0043acf2
mov edi, eax
add esp, 4
lea eax, [esi + esi + 2]
push eax
push 0
push edi
mov dword [esp + 0x24], edi
call sub.MSVCR80.dll_memset
add esp, 0xc
lea ecx, [esp + 0x20]
push ecx
push edi
lea ebx, [esp + 0x7bc]
call fcn.0040f5c0
test eax, eax
je 0x40df18
lea edx, [esp + 0x49c]
mov eax, edi
sub edx, edi
nop
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x40dd20
xor ebx, ebx
cmp edi, ebx
je 0x40dd42
push edi
call sub.MSVCR80.dll_void___cdecl_operator_delete___void__
add esp, 4
mov dword [esp + 0x18], ebx
mov esi, 0x208
push esi
lea edx, [esp + 0x7b8]
push ebx
push edx
call sub.MSVCR80.dll_memset
add esp, 0xc
push esi
lea eax, [esp + 0x9c0]
push ebx
push eax
call sub.MSVCR80.dll_memset
mov eax, dword [esp + 0x74]
add esp, 0xc
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x9c0]
push edx
push eax
lea ecx, [esp + 0x60]
mov dword [esp + 0x34], esi
mov dword [esp + 0x20], esi
call dword [sym.imp.MSVCP80.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
call sub.Encrypt.dll_StrToHex
mov ecx, dword [esp + 0x30]
mov edx, dword [ecx]
mov edx, dword [edx + 4]
push ebx
push ebx
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x7c0]
push eax
mov eax, dword [esp + 0x24]
push eax
lea eax, [esp + 0x9d0]
push eax
call edx
lea eax, [esp + 0x20]
push eax
mov dword [esp + 0x24], ebx
push ebx
lea ebx, [esp + 0x7bc]
call fcn.0040f5c0
mov esi, dword [esp + 0x20]
test esi, esi
jbe 0x40df18
xor ecx, ecx
lea eax, [esi + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0043acf2
mov edi, eax
add esp, 4
lea eax, [esi + esi + 2]
push eax
push 0
push edi
mov dword [esp + 0x24], edi
call sub.MSVCR80.dll_memset
add esp, 0xc
lea ecx, [esp + 0x20]
push ecx
push edi
call fcn.0040f5c0
test eax, eax
je 0x40df18
lea edx, [esp + 0x294]
mov eax, edi
sub edx, edi
mov edi, edi
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x40de30
xor ebx, ebx
cmp edi, ebx
je 0x40de52
push edi
call sub.MSVCR80.dll_void___cdecl_operator_delete___void__
add esp, 4
mov dword [esp + 0x18], ebx
push 0x208
lea edx, [esp + 0x7b8]
push ebx
push edx
call sub.MSVCR80.dll_memset
add esp, 0xc
lea ecx, [esp + 0x70]
call dword [sym.imp.MSVCP80.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
lea edx, [esp + 0x7b4]
lea esp, [esp]
mov cl, byte [eax]
mov byte [edx], cl
add eax, 1
add edx, 1
cmp cl, bl
jne 0x40de80
push 0x40e
lea eax, [esp + 0xbca]
push ebx
push eax
mov word [esp + 0xbd0], bx
call sub.MSVCR80.dll_memset
mov esi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
add esp, 0xc
push ebx
push ebx
push 0xffffffffffffffff
lea ecx, [esp + 0x7c0]
push ecx
push ebx
push 0xfde9
call esi
push eax
lea edx, [esp + 0xbc8]
push edx
push 0xffffffffffffffff
lea eax, [esp + 0x7c0]
push eax
push ebx
push 0xfde9
call esi
xor eax, eax
jmp 0x40def0
movzx ecx, word [esp + eax + 0xbc4]
mov word [esp + eax + 0x8c], cx
add eax, 2
cmp cx, bx
jne 0x40def0
mov esi, dword [esp + 0x34]
lea ebx, [esp + 0x8c]
call fcn.004103d0
lea ecx, [esp + 0x70]
mov byte [esp + 0xfe8], 2
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [esp + 0x54]
mov byte [esp + 0xfe8], 1
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [esp + 0x38]
mov dword [esp + 0xfe8], 0xffffffff
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov ecx, dword [esp + 0x2c]
call fcn.00408eb0
xor ebx, ebx
test eax, eax
mov dword [esp + 0x2c], eax
je 0x40df91
jmp 0x40dab0
push 0x154
mov dword [esp + 0x28], 0x154100c
call fcn.0040cbd0
add esp, 4
push eax
push str.__pItem__NULL_
push 0x154100c
call fcn.00401020
add esp, 0xc
mov eax, dword [esp + 0x1c]
cmp eax, ebx
je 0x40dfc3
mov esi, dword [eax + 0x18]
cmp esi, ebx
je 0x40dfb1
mov ecx, esi
mov edx, dword [ecx]
mov eax, dword [edx]
mov esi, dword [esi + 0x28]
push 1
call eax
cmp esi, ebx
jne 0x40dfa0
mov ecx, dword [esp + 0x1c]
mov dword [ecx + 0x18], ebx
mov dword [ecx + 0x1c], ebx
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
mov ecx, dword [esp + 0x30]
push ecx
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
mov eax, dword [esp + 0x28]
add esp, 4
mov ecx, dword [esp + 0xfe0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xfc8]
xor ecx, esp
call fcn.0043ad38
mov esp, ebp
pop ebp
ret