Sign in to follow this  
Followers 0

MD5 Hash Plug-in SHA-1

111 posts in this topic

Posted (edited)

I just wanted to make a note that Plugins are no longer included in AutoIt. Some have managed to export the functionality for a DllCall'able functionality, but I do not have a need to do this at this time so I will let this post die. Thanks to all those who used and found this useful. -JS 20140825

This plugin has been an on going project for sometime now. This post was originally created in January 06, but it was thought about long before that. I had originally tried to get these functions included in the source code of AutoIt in a couple of different threads in the Developers forum, but due to restrictions in some countries this was not a possibility. I am completely re-writing the entire post to better structure it for long term stability, and updates. (8/28/2006)

First Thread Encryption and AutoIt (Should be Hashes and AutoIt)
Second Thread TCP and Encryption Included? (started by layer asking which features would be included)

Due to the responses to the above two listed threads I decided that a plugin would be the best plan of action when they came out in late 05. I didnt release anything until this thread was started.

The first goal of this plugin was to include MD5, SHA-1, and a couple of others. I have added MD5, and SHA-1...what other hashes would you like to see as a part of the main DLL?

Requires: AutoIt v3.2.1.0 + (not recommended due to memory leak)
Requires: AutoIt v3.2.1.1 + (recommended)

I have had a request for the SHA and/or MD5 to be broken out so that the DLL files are smaller. I have re-written my project, and have now made it available that if you only want one or the other you can download just those .dll files.

I have changed the name of the f-shash.dll due to the forum renaming it to f_shash.dll. The new main dll file will now be FSHash.dll.

DLL Files
FSHash.dll (217 Total Previous Downloads)
MD5Hash.dllSHAHash.dll
Example Files
FSHash_Example.au3 (369 Total Previous Downloads)
MD5Hash_Example.au3SHAHash_Example.au3
Source Files
FSHash.zip (1626 Total Previous Downloads)
(Note: All files are included in source including the Code::Blocks project files.)

Further edits to this post will be noted.

Edit01: Released all DLL's and source code under the LGPL license.

If you have any questions, comments, or critisisms please let me know by responding to this thread.

Thanks,
JS

Edited by JSThePatriot

Share this post


Link to post
Share on other sites



Posted (edited)

it craches autoit (with an tell microsoft error) when it tries to free your string from the heap...

code:

00440E67 FF15 C4E94600 CALL NEAR DWORD PTR DS:[46E9C4] ; ntdll.RtlFreeHeap

stack:

0012F920 003D0000 |Arg1 = 003D0000

0012F924 00000000 |Arg2 = 00000000

0012F928 003353D0 \Arg3 = 003353D0 ASCII "120EA8A25E5D487BF68B5F7096440019"

maby a bug in autoits plugin code ?

WINXP HOME SP2

Edited by w0uter

Share this post


Link to post
Share on other sites

Posted

I know I stated some time ago that I would make my efforts to include MD5 Hash into an AutoIt plugin after it didnt make inclusion into the main stream of things. I have finally gotten around to it. Please let me know of any errors you have or any comments and suggestions you have to further enable it.

I do plan on in the future adding SHA-1 to the same plugin as that would make it more useful, and wouldnt bloat the size by much.

Files:

Source:

Let me know what you think. The .zip file also includes the .dll and .au3 example file.

Thanks,

JS

Fine, but you get a autoit/plugin crash when the file is not found :lmao:

Share this post


Link to post
Share on other sites

Posted

@jpm & @w0uter

I appreciate the feedback. I knew there were things I was missing.

I cant believe I missed the error checking. I had actually worked on this a while back, and I thought it was finished (my tests worked hehe)

Share this post


Link to post
Share on other sites

Posted

I can't wait to see how it performs against the VBCode and AU3 converted code! Thanks for your hard work, I hope whatever bugs you have left to fix won't be that hard to find.

Share this post


Link to post
Share on other sites

Posted

I can't wait to see how it performs against the VBCode and AU3 converted code! Thanks for your hard work, I hope whatever bugs you have left to fix won't be that hard to find.

I doubt they will be hard to find, but with my limited C++ :lmao: it may just take me a bit to figure out the best way I know how to absolve the problem.

I have already added error checking to my .dll now, but I still need to check to see if the string passed to the file is indeed a file. That is my next step.

Please let me know how it all compares. I want to make sure I am 100% accurate. Which with all of my tests thus far I have been.

Thanks for the rapid input,

JS

Share this post


Link to post
Share on other sites

Posted

i got error he dont know what PluginOpen() is in example ... i has do some stupids? ^^ forgot to make that ? wtf is pluginopen /

Share this post


Link to post
Share on other sites

Posted (edited)

@JSThePatriot, a simple way to get it working is to replace

return NULL;
wth
return "";
in FileMD5Encrypt(char* sFilename).

This is in the module JSmd5.cpp

The original line returns a NULL as address. If you try to copy the string later then it tries to copy from address NULL and that generates a trap.

The second option returns a pointer to an empty string ('\0' character), then the copy function just copies the empty string and that works.

I have tested your code with Dev-C++.

Nice work :lmao:

Fixed a number of typo's

Edited by Dickb

Share this post


Link to post
Share on other sites

Posted

i got error he dont know what PluginOpen() is in example ... i has do some stupids? ^^ forgot to make that ? wtf is pluginopen /

You must be using the AutoIt Beta. I am sorry I didnt mention that in my first post. I will make sure I go back and do that.

@JSThePatriot, a simple way to get it working is to replace

return NULL;
wth
return "";
in FileMD5Encrypt(char* sFilename).

This is in the module JSmd5.cpp

The original line returns a NULL as address. If you try to copy the string later then it tries to copy from address NULL and that generates a trap.

The second option returns a pointer to an empty string ('\0' character), then the copy function just copies the empty string and that works.

I have tested your code with Dev-C++.

Nice work :lmao:

Fixed a number of typo's

Thank you for letting me know that. I was working on trying to make sure it had a valid path. I hadnt even worked back into my JSmd5.cpp code yet. I wrote that code quite some time ago.

I will get that fixed right away and repost in the first post the updated version.

Thanks,

JS

Share this post


Link to post
Share on other sites

Posted (edited)

This is just a quick solution to keep Dr Watson away.

You probably should return a @error code when the file is not found.

But I leave that up to you. :lmao:

(Oops, another typo fixed)

Edited by Dickb

Share this post


Link to post
Share on other sites

Posted

This is just a quick solution to keep Dr Watson away.

You probably should return a @error code when the file is not found.

But I leave that up to you. :lmao:

(Oops, another typo fixed)

Yea that is what I have been trying to work on, but it doesnt seem to want to work for me. I'll keep hacking at it until it I get something working the way it should.

JS

Share this post


Link to post
Share on other sites

Posted

Updated original post with updated plugin that doesnt crash on no file.

Next step is to generate error codes... I cant seem to get it working yet. I wont give up though :lmao:. I need to finish this up so I can then proceed to write a tutorial on Plug-in's. I think more people would write useful plugins if they had the knowledge.

Please continue to let me know of bugs, comments, suggestions.

JS

Share this post


Link to post
Share on other sites

Posted

autoit still hard-craches here.

Share this post


Link to post
Share on other sites

Posted

autoit still hard-craches here.

What is it you are doing when it hard crashes? Just running my Example script?

Thanks,

JS

Share this post


Link to post
Share on other sites

Posted

yup.

-> pluginopen

-> stringhash

-> autoit tries to free your string or something & hardcrashes

Share this post


Link to post
Share on other sites

Posted

yup.

-> pluginopen

-> stringhash

-> autoit tries to free your string or something & hardcrashes

What beta version are you running? I cant get it to recreate the problem on my system :-/ I am using version .100.

JS

Share this post


Link to post
Share on other sites

Posted

What beta version are you running? I cant get it to recreate the problem on my system :-/ I am using version .100.

JS

I am in the same situation as w0uter hard crash with the lastest version.can you include the .dsw .dsp you use to compile the dll so I can try to help you :lmao:

Share this post


Link to post
Share on other sites

Posted

I am in the same situation as w0uter hard crash with the lastest version.can you include the .dsw .dsp you use to compile the dll so I can try to help you ;)

Sure thing :lmao:... I appreciate that. I will have to wait until I get home. I just got a new laptop, and I have yet to transfer my files.

I am using Dev's C++ so it will be a .dev.

Thanks,

JS

Share this post


Link to post
Share on other sites

Posted

Sure thing :lmao:... I appreciate that. I will have to wait until I get home. I just got a new laptop, and I have yet to transfer my files.

I am using Dev's C++ so it will be a .dev.

Thanks,

JS

here is my contribution to fix the crash with the first source you delivered. it has been compiled with VC6 as I am not an expert in dll building it has a bigger size. ;)

Share this post


Link to post
Share on other sites

Posted

here is my contribution to fix the crash with the first source you delivered. it has been compiled with VC6 as I am not an expert in dll building it has a bigger size. :lmao:

I looked at the code. That looks good. I tried to come up with something similiar before, but I couldnt figure out how to be sure it was a real file that was being input. I apprecaite it. I am still in process of changing laptops, so hopefully I will make the changes on my release. Thanks for the help as always. I am always learning from your input.

I will update when I get all the programs and files on this laptop.

Thanks everyone...

JS

Share this post


Link to post
Share on other sites

Posted

here is my contribution to fix the crash with the first source you delivered. it has been compiled with VC6 as I am not an expert in dll building it has a bigger size. :lmao:

It works. I hope JSThePatriot will update as soon. Thanx to both of you.

Share this post


Link to post
Share on other sites

Posted

It works. I hope JSThePatriot will update as soon. Thanx to both of you.

It is in the list of stuff to finish tomorrow. I am finishing up the setup of this laptop.

I hope everyone finds this useful.

Also how many people are interested in me adding SHA-1 to it?

JS

Share this post


Link to post
Share on other sites

Posted

Having trouble...

The reason I orginally changed the i_Hash from int to char* is because I get an error message everytime I try and use the GetInt32() function. Jon told me something that should fix it, but never really worked out. For some reason his example works, but I dont think his example (SDK example that is) uses that function.

Please keep in mind I dont have VC++. I am using Bloodshed's Dev-C++.

Error Message:

dllHash.cpp: In function `int FileHash(int, const AU3_PLUGIN_VAR*, AU3_PLUGIN_VAR**, int*, int*)':

dllHash.cpp:137: error: invalid conversion from `const AU3_PLUGIN_VAR*' to `AU3_PLUGIN_VAR*'

dllHash.cpp:137: error: initializing argument 1 of `int AU3_GetInt32(AU3_PLUGIN_VAR*)'

dllHash.cpp: In function `int StringHash(int, const AU3_PLUGIN_VAR*, AU3_PLUGIN_VAR**, int*, int*)':

dllHash.cpp:197: error: invalid conversion from `const AU3_PLUGIN_VAR*' to `AU3_PLUGIN_VAR*'

dllHash.cpp:197: error: initializing argument 1 of `int AU3_GetInt32(AU3_PLUGIN_VAR*)'

make.exe: *** [dllHash.o]Error 1

I really dont understand why this wouldnt work on Dev-C++, but would work on VC++. Does VC++ do that conversion automatically?

Thanks for everything,

JS

Share this post


Link to post
Share on other sites

Posted

Are we up and running with the UDF?

Share this post


Link to post
Share on other sites

Posted (edited)

Having trouble...

The reason I orginally changed the i_Hash from int to char* is because I get an error message everytime I try and use the GetInt32() function. Jon told me something that should fix it, but never really worked out. For some reason his example works, but I dont think his example (SDK example that is) uses that function.

Please keep in mind I dont have VC++. I am using Bloodshed's Dev-C++.

Error Message:

I really dont understand why this wouldnt work on Dev-C++, but would work on VC++. Does VC++ do that conversion automatically?

Thanks for everything,

JS

I don't understand the problem. I have compiled jpm's version with Dev-C++ and CodeBlocks, both C compilers using GCC. No problems at all, the dll compiled with no errors at all and works just fine. The only difference is that CodeBlocks produces a dll that is 4KB smaller than Dev-C++.

Good luck, Dick

Edited by Dickb

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0