Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

MD5 Hash Plug-in SHA-1


  • Please log in to reply
110 replies to this topic

#1 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,690 posts

Posted 31 January 2006 - 01:58 PM

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
Attached File  FSHash.dll   69.35KB   2320 downloads (217 Total Previous Downloads)
Attached File  MD5Hash.dll   56.36KB   3936 downloadsAttached File  SHAHash.dll   60.46KB   1812 downloads
Example Files
Attached File  FSHash_Example.au3   330bytes   2722 downloads (369 Total Previous Downloads)
Attached File  MD5Hash_Example.au3   291bytes   4750 downloadsAttached File  SHAHash_Example.au3   291bytes   2126 downloads
Source Files
Attached File  FSHash.zip   125.09KB   3246 downloads (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, 02 April 2008 - 09:04 PM.

AutoIt LinksFile-String Hash Plugin Updated! 04-02-08ComputerGetInfo UDF's Updated! 11-23-06External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)







#2 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 31 January 2006 - 02:22 PM

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, 31 January 2006 - 02:41 PM.

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

#3 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,550 posts

Posted 31 January 2006 - 02:26 PM

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:

#4 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,690 posts

Posted 31 January 2006 - 02:49 PM

@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)
AutoIt LinksFile-String Hash Plugin Updated! 04-02-08ComputerGetInfo UDF's Updated! 11-23-06External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

#5 MSLx Fanboy

MSLx Fanboy

    Local $Clue = 0

  • Active Members
  • PipPipPipPipPipPip
  • 1,046 posts

Posted 31 January 2006 - 04:06 PM

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.
Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

#6 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,690 posts

Posted 31 January 2006 - 05:00 PM

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
AutoIt LinksFile-String Hash Plugin Updated! 04-02-08ComputerGetInfo UDF's Updated! 11-23-06External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

#7 jaenster

jaenster

    There is no spoon.

  • Active Members
  • PipPipPipPipPipPip
  • 670 posts

Posted 31 January 2006 - 06:01 PM

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

#8 Dickb

Dickb

    Adventurer

  • Active Members
  • PipPip
  • 135 posts

Posted 31 January 2006 - 06:02 PM

@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, 31 January 2006 - 06:07 PM.


#9 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,690 posts

Posted 31 January 2006 - 06:43 PM

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
AutoIt LinksFile-String Hash Plugin Updated! 04-02-08ComputerGetInfo UDF's Updated! 11-23-06External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

#10 Dickb

Dickb

    Adventurer

  • Active Members
  • PipPip
  • 135 posts

Posted 31 January 2006 - 06:57 PM

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, 31 January 2006 - 06:58 PM.


#11 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,690 posts

Posted 31 January 2006 - 08:06 PM

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
AutoIt LinksFile-String Hash Plugin Updated! 04-02-08ComputerGetInfo UDF's Updated! 11-23-06External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

#12 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,690 posts

Posted 31 January 2006 - 08:48 PM

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
AutoIt LinksFile-String Hash Plugin Updated! 04-02-08ComputerGetInfo UDF's Updated! 11-23-06External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

#13 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 31 January 2006 - 10:17 PM

autoit still hard-craches here.
My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

#14 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,690 posts

Posted 31 January 2006 - 10:28 PM

autoit still hard-craches here.


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

Thanks,
JS
AutoIt LinksFile-String Hash Plugin Updated! 04-02-08ComputerGetInfo UDF's Updated! 11-23-06External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

#15 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 31 January 2006 - 10:58 PM

yup.

-> pluginopen
-> stringhash
-> autoit tries to free your string or something & hardcrashes
My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

#16 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,690 posts

Posted 31 January 2006 - 11:15 PM

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
AutoIt LinksFile-String Hash Plugin Updated! 04-02-08ComputerGetInfo UDF's Updated! 11-23-06External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

#17 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,550 posts

Posted 01 February 2006 - 07:36 AM

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:

#18 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,690 posts

Posted 01 February 2006 - 10:08 PM

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
AutoIt LinksFile-String Hash Plugin Updated! 04-02-08ComputerGetInfo UDF's Updated! 11-23-06External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

#19 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,550 posts

Posted 02 February 2006 - 11:32 PM

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. ;)

#20 JSThePatriot

JSThePatriot

    carpe diem. vita brevis.

  • MVPs
  • 3,690 posts

Posted 02 February 2006 - 11:43 PM

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
AutoIt LinksFile-String Hash Plugin Updated! 04-02-08ComputerGetInfo UDF's Updated! 11-23-06External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users