-
February 24th, 2008, 01:30 AM
#1
Password check for DOC files
I need to write a program which, given a password protected DOC file and a string, checks whether the string is the password of the file.
Any ideas on how to approach this problem?
-
February 24th, 2008, 05:42 AM
#2
Re: Password check for DOC files
You did not say what version what framework etc. !!! .NET or MFC ???
Assuming the latest VC version and default framework ( VS2008 and .NET)
Code:
using namespace System;
using namespace Reflection;
int main(array<System::String ^> ^args){
Word::Application^ wdApp = gcnew Word::Application();
Object^% file = gcnew String("c:\\Test\\doc1.doc");
Object^% pwd = gcnew String("opensesame");
Word::Document^ wdDoc;
wdApp->Visible = true;
try {
wdDoc = wdApp->Documents->Open( file , Missing::Value,
Missing::Value, Missing::Value,
pwd, Missing::Value,
Missing::Value, Missing::Value,
Missing::Value, Missing::Value,
Missing::Value, Missing::Value,
Missing::Value, Missing::Value,
Missing::Value, Missing::Value
);
}
catch(Exception^ e) {
Console::WriteLine(e->Message);
}
if(wdDoc != nullptr) {
Console::WriteLine("The document was opened successfully!");
}
Console::ReadLine();
return 0;
}
Last edited by Sahir; February 24th, 2008 at 06:00 AM.
-
February 25th, 2008, 01:33 AM
#3
Re: Password check for DOC files
Thanks.
This would word in Windows.
How can I do this in linux, without the use of MS Word's API?
-
February 25th, 2008, 01:55 AM
#4
Re: Password check for DOC files
My dear friend, you are on a wrong way.
Try wasting your energy for a better cause!
Last edited by ovidiucucu; February 25th, 2008 at 02:20 AM.
-
February 25th, 2008, 07:01 AM
#5
Re: Password check for DOC files
-
February 25th, 2008, 07:48 AM
#6
Re: Password check for DOC files
There is no good reason to encourage password crackers.
[ Thread closed ]
-
February 25th, 2008, 07:49 AM
#7
Re: Password check for DOC files
Originally Posted by tepez
Yet, any ideas?
For more ideas, you need to provide more information. What you are intended to do ( and why since I do smell something weird, like Ovidiu ), for what platform, which complier, anything you done so far and if you found any problems, what were they.
This is neither a hacking/cracking site, nor "rent-a-coder" sort of place.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|