Function at 0x40ad50
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push 0xffffffffffffffff
push 0x4511c1
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x448
mov al, byte [0x471b14]
push ebx
push ebp
push esi
push edi
mov byte [esp + 0x14c], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x14d]
push 0x104
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [esp + 0x150]
push ecx
push 0
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov dl, byte [0x471b14]
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x251]
mov byte [esp + 0x250], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x14c]
test eax, eax
je 0x40ae43
lea edi, [esp + 0x14c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 1
jb 0x40ae43
mov al, byte [esp + 0x14c]
lea edi, [esp + 0x14c]
test al, al
lea esi, [esp + 0x14c]
je 0x40ae26
mov al, byte [esi]
cmp al, 0x5c
je 0x40ae0b
cmp al, 0x2f
je 0x40ae0b
cmp al, 0x3a
jne 0x40ae16
push esi
call fcn.00431247
add esp, 4
mov edi, eax
push esi
call fcn.00431247
mov esi, eax
add esp, 4
cmp byte [esi], 0
jne 0x40adfd
push 0x104
lea ecx, [esp + 0x254]
push edi
push ecx
call fcn.004311ad
add esp, 0xc
mov eax, 1
jmp 0x40ae45
xor eax, eax
xor edx, edx
test eax, eax
setne dl
mov eax, edx
test eax, eax
jne 0x40ae82
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
call fcn.0041676d
add esp, 4
push eax
push str.GetFileNameFromPath
push str._s_failed_returning__s_n
push 0x471d20
call fcn.00415dff
add esp, 0x10
call esi
jmp 0x40b2fc
mov al, byte [0x471b14]
mov ecx, 0x40
mov byte [esp + 0x48], al
xor eax, eax
lea edi, [esp + 0x49]
push 0x104
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [esp + 0x4c]
lea edx, [esp + 0x150]
push ecx
push edx
stosb byte es:[edi], al
call fcn.0042030d
add esp, 0xc
neg eax
sbb eax, eax
neg eax
mov dword [esp + 0x34], eax
jne 0x40aef1
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
call fcn.0041676d
add esp, 4
push eax
push str.GetDirectoryNameFromPath
push str._s_failed_returning__s_n
push 0x471d20
call fcn.00415dff
add esp, 0x10
call esi
jmp 0x40b2fc
lea eax, [esp + 0x48]
test eax, eax
je 0x40af3e
lea edi, [esp + 0x48]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x40af3e
cmp byte [esp + ecx + 0x47], 0x5c
je 0x40af3e
mov edi, 0x466498
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x48]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x250]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 6
sbb eax, eax
inc eax
mov dword [esp + 0x34], eax
jne 0x40af87
push 0x7b
call fcn.0041676d
add esp, 4
push eax
push str.Filename_too_short
push str._s_failed_returning__s_n
push 0x471d20
call fcn.00415dff
add esp, 0x10
mov eax, 0x7b
jmp 0x40b2fc
mov cl, byte [esp + 0x13]
push 0
mov byte [esp + 0x28], cl
lea ecx, [esp + 0x28]
call fcn.004017f0
mov ebx, dword [esp + 0x474]
mov dword [esp + 0x460], 0
cmp bx, 6
je 0x40b092
mov edx, dword [esp + 0x46c]
lea eax, [esp + 0x256]
and edx, 0xffff
push edx
push ebx
push str._s_4.4d.rtf
push eax
call fcn.0043110a
mov cl, byte [esp + 0x23]
add esp, 0x10
mov byte [esp + 0x14], cl
lea ecx, [esp + 0x14]
push 0
call fcn.004017f0
lea edi, [esp + 0x48]
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
lea ecx, [esp + 0x18]
push ebp
call fcn.00401860
test al, al
je 0x40b02f
mov edi, dword [esp + 0x18]
mov ecx, ebp
mov edx, ecx
lea esi, [esp + 0x48]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x18]
call fcn.00401840
lea eax, [esp + 0x253]
lea ecx, [esp + 0x14]
push eax
lea edx, [esp + 0x3c]
push ecx
push edx
mov byte [esp + 0x46c], 1
call fcn.00406880
add esp, 0xc
mov ecx, dword [0x455554]
mov byte [esp + 0x460], 2
push ecx
push 0
push eax
lea ecx, [esp + 0x30]
call fcn.00404dd0
push 1
lea ecx, [esp + 0x3c]
mov byte [esp + 0x464], 1
call fcn.004017f0
push 1
lea ecx, [esp + 0x18]
mov byte [esp + 0x464], 0
call fcn.004017f0
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40b1a9
mov dl, byte [0x471b14]
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x355]
mov byte [esp + 0x354], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x28]
test eax, eax
jne 0x40b0cb
mov eax, 0x45561c
lea ecx, [esp + 0x354]
push 0
push ecx
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
lea edi, [esp + 0x354]
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
lea ecx, [esp + 0x28]
push ebp
call fcn.00401860
test al, al
je 0x40b129
mov edi, dword [esp + 0x28]
mov ecx, ebp
mov edx, ecx
lea esi, [esp + 0x354]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x28]
call fcn.00401840
lea eax, [esp + 0x354]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40b1a9
mov eax, dword [esp + 0x28]
test eax, eax
jne 0x40b149
mov eax, 0x45561c
push 0
push eax
lea ecx, [esp + 0x40]
call fcn.00449043
mov edx, dword [esp + 0x468]
mov edi, dword [0x471a6c]
lea ecx, [esp + 0x38]
lea eax, [esp + 0x14]
lea esi, [edx + 0x1c]
mov dword [esp + 0x14], ecx
push eax
push 2
mov ecx, dword [esi]
push 0x449
push ecx
mov dword [esp + 0x2c], 0x40abf0
call edi
lea ecx, [esp + 0x38]
call fcn.004490e3
mov eax, dword [esi]
push 0
push 0
push 0xe
push eax
call edi
test eax, eax
je 0x40b2ce
xor esi, esi
jmp 0x40b2d6
cmp bx, 6
jne 0x40b1f4
mov edx, dword [esp + 0x478]
mov dword [esp + 0x14], 0x45561c
mov eax, dword [edx + 4]
test eax, eax
je 0x40b1c9
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x468]
mov dword [esp + 0x1c], 0x40ab50
lea ecx, [esp + 0x14]
lea esi, [eax + 0x1c]
mov edx, dword [esi]
mov edi, dword [0x471a6c]
push ecx
push 2
push 0x449
push edx
call edi
jmp 0x40b18f
mov eax, dword [esp + 0x470]
test eax, eax
je 0x40b27c
test ebx, ebx
je 0x40b27c
push ebx
push eax
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40b25d
push 0x716
call fcn.0041676d
add esp, 4
push eax
push str.Cannot_find_RTF_file
push str._s_failed_returning__s_n
push 0x471d20
call fcn.00415dff
add esp, 0x10
lea ecx, [esp + 0x24]
mov dword [esp + 0x460], 0xffffffff
push 1
call fcn.004017f0
mov eax, 0x716
jmp 0x40b2fc
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x468]
mov dword [esp + 0x1c], 0x40ac40
lea ecx, [esp + 0x14]
lea esi, [eax + 0x1c]
jmp 0x40b1df
push 0x57
call fcn.0041676d
add esp, 4
push eax
push str.Invalid_params_to_CMSIDialog::LoadRichEdit__
push str._s_failed_with__s_n
push 0x471d20
call fcn.00415dff
mov ecx, dword [esp + 0x38]
add esp, 0x10
test ecx, ecx
je 0x40b2c7
mov al, byte [ecx - 1]
test al, al
je 0x40b2bd
cmp al, 0xff
je 0x40b2bd
dec al
mov byte [ecx - 1], al
mov eax, 0x57
jmp 0x40b2fc
dec ecx
push ecx
call fcn.00447dfa
add esp, 4
mov eax, 0x57
jmp 0x40b2fc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, dword [esp + 0x28]
test ecx, ecx
je 0x40b2fa
mov al, byte [ecx - 1]
test al, al
je 0x40b2f0
cmp al, 0xff
je 0x40b2f0
dec al
mov byte [ecx - 1], al
jmp 0x40b2fa
dec ecx
push ecx
call fcn.00447dfa
add esp, 4
mov eax, esi
mov ecx, dword [esp + 0x458]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x454
ret