Jump to content

MD5,SHA1,CRC32,RC4,BASE64,XXTEA machine code version


Ward
 Share

Recommended Posts

Is it just me, or do some of these functions like sha1 crash on windows server 2003?

EDIT: Yes, I am right, they all crash on windows server 2003. Tested using current release of autoit and tested using newest beta, they all crash.

WARD, or someone else with access to server 2003, id really appreciate it if you could fix this.

It may be bacause windows server 2003 add some check to CallWindowProc API used in the script. Here may be a solution: replace all "user32.dll" in script to "warp.dll", and put the attachment to the same folder. The scirpts become impure in this way, but the warp.dll is really small. You can create warp.dll before using it to make the scripts look pure again (See SQLite3.dll.au3).

If warp.dll don't resolve your problem, please let me know.

By the way, Have anyone tested these scripts in vista? I only have tested them in Windows XP.

warp.zip

新版 _ArrayAdd 的白痴作者,不管是誰,去死一死好了

 

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

Hi,

This is great and thank you for sharing it...

I was wondering if there is a way to make a progress bar of md5sum check?

Edit: And I have one more question why did you use all _MD5Init(),MD5Input,_MD5Result($MD5CTX) in md5filetest.au3 instead of just

$FileMain = FileRead($File1)
        $FileCopied = FileRead($File2)
        $FileMainMD5Hash = _MD5($FileMain)
        $FileCopiedMD5Hash = _MD5($FileCopied)

?

Edit2:

Ok I've spend time trying and now I have this

ProgressSet($i/Ceiling(FileGetSize($Filename) / $BufferSize)*100,Int($i/Ceiling(FileGetSize($Filename) / $BufferSize)*100) & "%")

Is this a retarded solution? And can I say that you have used all those three function instead of only md5() because: only with those three functions you can make a progress bar?

Thanks in advance

Tip

Edited by tip

[center]MsgBox_Tipped: Eye candy msgboxes/inputboxes/loginboxes. | CreateBlankBox: Semi-transparent layers with borders and rounded corners.[/center]

Link to comment
Share on other sites

Edit: And I have one more question why did you use all _MD5Init(),MD5Input,_MD5Result($MD5CTX) in md5filetest.au3 instead of just

What if you will have, for example, 4 Gb file? Read it whole in memory?

This is the way MD5 is works. For big files, you need to calculate digest for every block being read, so variable that have been ininialized with Init function keep an intermediate values.

ProgressSet($i/Ceiling(FileGetSize($Filename) / $BufferSize)*100,Int($i/Ceiling(FileGetSize($Filename) / $BufferSize)*100) & "%")

Is this a retarded solution? And can I say that you have used all those three function instead of only md5() because: only with those three functions you can make a progress bar?

This is ok, I think. The only tip - calculate file size once, before loop.
Link to comment
Share on other sites

  • 3 weeks later...

Thank you very much for your answer...

Can anyone explain briefly how these 3 functions -_MD5Init(),MD5Input,_MD5Result($MD5CTX) - work. I'm not very experienced in dll stuff...

Regards

Tip

_MD5Init() just initialize a data struct, usually we call it CTX

_MD5Input() accept data input and update the CTX

_MD5Result() convert CTX to real hash

Almost all hash algorithm use similarly steps and function names.

新版 _ArrayAdd 的白痴作者,不管是誰,去死一死好了

 

Link to comment
Share on other sites

  • 4 weeks later...

EDIT: Request retracted

Nevermind, I was lead to believe Yahoo64/MAC64 was different in some form than Base64 - but for all intents and purposes it doesn't seem to be.

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

  • 2 weeks later...

Wow this is just awesome !!!

BTW - what's the difference between running:

$CTX = _MD5Init()
_MD5Input($CTX, "stuff")
$My_MD5 = StringTrimLeft(_MD5Result($CTX), 2)ƒoÝŠ÷ Ø   ÝjëhŠ×6$My_MD5 = _MD5("stuff")oÝ÷ Øw²äØbKaË!¢é]mç!jxu«­¢+ÙÕ¹}   ÍØѽ ÀÌØíѤ(%1½°ÀÌØí=Á½ôÅÕ½ÐìÁáàÄÀÀÀÀÀÔÌÔØÔÜàÌØÕàÀÁàÔÀÀÀÀÀÀÀÍÍÌÐÌÔÌØÌÜÌàÌäÍÍÍÍÀÁÀÀÀÄÀÈÀÌÀÐÀÔÀØÀÜÀàÀäÁÁÁÁÁÁÄÀÄÄÄÈÄÌÄÐÄÔÄØÄÜÄàÄåÅÅÅÅÅÅÈÀÈÄÈÈÈÌÈÐÈÔÈØÈÜÈàÈäÉÉÉÉÉÉÌÀÌÄÌÈÌÌáÐÕÀáÝÁáÕÀàÌÅÉääÄÀÀÀÀÀÀàÌØÕÀÀàÌÝÀÐÝÔÐáÀÌÐÌàÑÀÜÔÀÌàÍÀÌÍÍÜÔÀäÑàÀÍÍÜÔÀÄÑÀÀÀàÑÀÜÔÅàÌÝÀÐÝÁáÜÕ
ØÐÐÌÕÐÀÁÐÕ
    ÙÀÄáÐÕáÅÍÉÜÈÄäÍÝÜÜÄÔÁÙÀàÍÉÀÌÜÕÀáÀØáÜÕààÐÐÌÕÑÐÕ
    ØáÜÕÐØØáÀÙÁÀÀÉÁÀÐÀáÀààÀÜØØáÐØÀÅÁÀÀÑÁÀÈÀáÀààÐÜÀÄáÐØÀÉÁÀÀØÈÑÀÁÐØÀÌààÐÜÀÈáÝÀÌáÔÈÀÌàÌÝàÀÀÁàÐØÕàåÀÕÕÕ    åÈÄÀÀÀÅÕ½Ðì($(%1½°ÀÌØí
½  ÕÈô±±MÑÉÕÑ
ÉÑ ÅÕ½ÐíåÑlÅÕ½ÐìµÀì    ¥¹Éå1¸ ÀÌØí=Á½¤µÀìÅÕ½ÐítÅÕ½Ðì¤(%±±MÑÉÕÑMÑÑ ÀÌØí
½  ÕÈ°Ä°ÀÌØí=Á½¤((%1½°ÀÌØí=ÕÁÕÐô±±MÑÉÕÑ
ÉÑ ÅÕ½ÐíåÑlÅÕ½ÐìµÀì    ¥¹Éå1¸ ÀÌØíѤµÀìÅÕ½ÐítÅÕ½Ðì¤(%1½°ÀÌØíIÐô±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½Ðí
±±]¥¹½ÝAɽÅÕ½Ðì°ÅÕ½ÐíÁÑÈÅÕ½Ðì°±±MÑÉÕÑÑAÑÈ ÀÌØí
½  ÕȤ°|($$$$$$$$$$$$$ÅÕ½ÐíÍÑÈÅÕ½Ðì°ÀÌØíÑ°|($$$$$$$$$$$$$ÅÕ½ÐíÁÑÈÅÕ½Ðì°±±MÑÉÕÑÑAÑÈ ÀÌØí=ÕÁÕФ°|($$$$$$$$$$$$$ÅÕ½Ðí¥¹ÐÅÕ½Ðì°À°|($$$$$$$$$$$$$ÅÕ½Ðí¥¹ÐÅÕ½Ðì°À¤((%IÑÕɸ  ¥¹ÉåQ½MÑÉ¥¹¡  ¥¹Éå5¥¡±±MÑÉÕÑÑÑ ÀÌØí=ÕÁÕаĤ°Ä°ÀÌØíIÑlÁt¤¤)¹Õ¹oÝ÷ Ù(§qì"¶.¶Ø^)Ú¯$èJÚâ­­ën®{-ꮢڮ¢Ü+¢x*ºjº]yÊyÛ-®)àz®¶­sbb33c´ÖRÒô&6ScDVæ6öFRgV÷CµF226×ÆRFWBgV÷C²¤6öç6öÆUw&FRgV÷C´ÖSÒgV÷C²fײb33c´ÖRf×´5$Äb¢b33c´ÖRÒô&6ScDFV6öFRb33c´ÖR¤6öç6öÆUw&FRgV÷C´ÖSÒgV÷C²fײb33c´ÖRf×´5$Äb

That'd be all for this moment...

Edited by Armand

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Link to comment
Share on other sites

Hey BOSS... i think this should be changed:

Func _Base64Decode($Data)
    Local $Opcode = "0xC81000005356578365F800E8500000003EFFFFFF3F3435363738393A3B3C3DFFFFFF00FFFFFF000102030405060708090A0B0C0D0E0F10111213141516171819FFFFFFFFFFFF1A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132338F45F08B7D0C8B5D0831D2E9910000008365FC00837DFC047D548A034384C0750383EA033C3D75094A803B3D75014AB00084C0751A837DFC047D0D8B75FCC64435F400FF45FCEBED6A018F45F8EB1F3C2B72193C7A77150FB6F083EE2B0375F08A068B75FC884435F4FF45FCEBA68D75F4668B06C0E002C0EC0408E08807668B4601C0E004C0EC0208E08847018A4602C0E00624C00A46038847028D7F038D5203837DF8000F8465FFFFFF89D05F5E5BC9C21000"
   
    Local $CodeBuffer = DllStructCreate("byte[" & BinaryLen($Opcode) & "]")
    DllStructSetData($CodeBuffer, 1, $Opcode)

    Local $Ouput = DllStructCreate("byte[" & BinaryLen($Data) & "]")
    Local $Ret = DllCall("user32.dll", "int", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer), _
                                                    "str", $Data, _
                                                    "ptr", DllStructGetPtr($Ouput), _
                                                    "int", 0, _
                                                    "int", 0)

    Return BinaryToString(BinaryMid(DllStructGetData($Ouput, 1), 1, $Ret[0]))
EndFuncoÝ÷ Ù(§qì"¶.¶Ø^)Ú¯$èJÚâ­­ën®{-ꮢڮ¢Ü+¢x*ºjº]yÊyÛ-®)àz®¶­sbb33c´ÖRÒô&6ScDVæ6öFRgV÷CµF226×ÆRFWBgV÷C²¤6öç6öÆUw&FRgV÷C´ÖSÒgV÷C²fײb33c´ÖRf×´5$Äb¢b33c´ÖRÒô&6ScDFV6öFRb33c´ÖR¤6öç6öÆUw&FRgV÷C´ÖSÒgV÷C²fײb33c´ÖRf×´5$Äb

That'd be all for this moment...

Strings are null terminated, so returning binary data is more appropriate.

Ward tend to vanish from time to time so I hope you dont mind me answering that for him.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

@trancexx

Well... don't mind me... i just like it better when my funcs are returning the same input after they where Decoded....

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Link to comment
Share on other sites

Well bossss... it's been like half an hour to realize that these dll calls are what preventing my project from loading... it shouldn't try and work an empty data boss....

Func _Base64Decode($Data)
    If StringLen($Data) = 0 Then Return
    Local $Opcode = "0xC81000005356578365F800E8500000003EFFFFFF3F3435363738393A3B3C3DFFFFFF00FFFFFF000102030405060708090A0B0C0D0E0F10111213141516171819FFFFFFFFFFFF1A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132338F45F08B7D0C8B5D0831D2E9910000008365FC00837DFC047D548A034384C0750383EA033C3D75094A803B3D75014AB00084C0751A837DFC047D0D8B75FCC64435F400FF45FCEBED6A018F45F8EB1F3C2B72193C7A77150FB6F083EE2B0375F08A068B75FC884435F4FF45FCEBA68D75F4668B06C0E002C0EC0408E08807668B4601C0E004C0EC0208E08847018A4602C0E00624C00A46038847028D7F038D5203837DF8000F8465FFFFFF89D05F5E5BC9C21000"
    
    Local $CodeBuffer = DllStructCreate("byte[" & BinaryLen($Opcode) & "]")
    DllStructSetData($CodeBuffer, 1, $Opcode)

    Local $Ouput = DllStructCreate("byte[" & BinaryLen($Data) & "]")
    Local $Ret = DllCall("user32.dll", "int", "CallWindowProc", "ptr", DllStructGetPtr($CodeBuffer), _
                                                    "str", $Data, _
                                                    "ptr", DllStructGetPtr($Ouput), _
                                                    "int", 0, _
                                                    "int", 0)

    Return BinaryToString(BinaryMid(DllStructGetData($Ouput, 1), 1, $Ret[0]))
EndFunc

Great script though... i love it...

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Link to comment
Share on other sites

  • 4 weeks later...

Well bossss... it's been like half an hour to realize that these dll calls are what preventing my project from loading... it shouldn't try and work an empty data boss....

Let me guess... you're obfuscating your program :). Obfuscator can't handle this long lines, break the $Opcode like this:

Local $Opcode = "0xC81000005356578365F800E8500000003EFFFFFF3F3435363738393A3B3C3DFFF"
$Opcode &= "FFF00FFFFFF000102030405060708090A0B0C0D0E0F10111213141516171819FFFF"
$Opcode &= "FFFFFFFF1A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132338F45F08"
$Opcode &= "B7D0C8B5D0831D2E9910000008365FC00837DFC047D548A034384C0750383EA033C"
$Opcode &= "3D75094A803B3D75014AB00084C0751A837DFC047D0D8B75FCC64435F400FF45FCE"
$Opcode &= "BED6A018F45F8EB1F3C2B72193C7A77150FB6F083EE2B0375F08A068B75FC884435"
$Opcode &= "F4FF45FCEBA68D75F4668B06C0E002C0EC0408E08807668B4601C0E004C0EC0208E"
$Opcode &= "08847018A4602C0E00624C00A46038847028D7F038D5203837DF8000F8465FFFFFF"
$Opcode &= "89D05F5E5BC9C21000"
Edited by KaFu
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...