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?
Printable View
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?
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;
}
Thanks.
This would word in Windows.
How can I do this in linux, without the use of MS Word's API?
My dear friend, you are on a wrong way.
Try wasting your energy for a better cause! ;)
Yet, any ideas?
There is no good reason to encourage password crackers.
[ Thread closed ]
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.Quote:
Originally Posted by tepez
This is neither a hacking/cracking site, nor "rent-a-coder" sort of place.