Jump to content

francesco9696

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by francesco9696

  1. Hi I'm trying to replicate a php function that I need: function cripta($data){ return openssl_encrypt($data,'AES-128-CBC',base64_decode("dGVzdHBhc3N3b3JkLi4uLg=="),0,"0102030405060708"); } which is basically a base64encode of an aes encryption. I found some helpful UDF here which has both BASE64.au3 and AES.au3 I tried to write the "cripta" function: #Include "AES.au3" #include "BASE64.au3" Global $mainKey = "dGVzdHBhc3N3b3JkLi4uLg==" Global $mainIV = "0102030405060708" _AES_Startup() ConsoleWrite(cripta("test") & @CRLF) Func cripta($Data) Global $mainKey, $mainIV $Key = _Base64Decode($mainKey) Return BinaryToString(_Base64Encode(_AesEncrypt($Key, $Data, $AES_CBC_MODE, $mainIV))) EndFunc But when I try to execute in php I get: echo cripta('test'); // OUTPUT: CB5j5NHA9vQibaGgmvnNTA== And when I try in execute in autoit: ConsoleWrite(cripta("test") & @CRLF) ;OUTPUT: MDEwMjAzMDQwNTA2MDcwOOSAx7xqqmIcIU5UI4ZDItw= Why are those so different? Can someone please help me, thank you
  2. I tried using #include-once and including every file in every file, but I get "Duplicate function name." errors. Yeah, it I could do like that, but sometimes I don't remember a function and when I need to call it, I need to scroll from the line where I'm coding back to the function I'm calling (also using the search feature) and then back to the original line and it's very annoying and time wasting. I use full SciTE, but I miss the quick goto function list feature that is present on other ide (in other languages).
  3. I started a little autoit project. I didn't think I would make it big, so I putted all of my functions and includes in one unique au3 file (I know it's a bad idea). I have a file that is like #include <lib1> #include <lib2> #include <lib3> ;... Global $var1 = 1 Global $var2 = "df" Func a() ; do thinghs endfunc Func b() ;do things $something = a() endfunc Func c() ;do things $something = a() $else = b() endfunc ;and so on func main() ;... endfunc main() The problem is that the file is now 3000 lines and it became very difficult to move through. I would love to split my project into more files I tried splitting the function "by category", like ;; FILE funcs1.au3 func a() ;... endfunc func b() ;... a() endfunc ;FILE funcs2.au3 Func c() a() b() ;.. endfunc Func d() e() ;... Endfunc ;FILE funcs3.au3 Func e() c() ;... endfunc Func f() a() d() ;... endfunc But you see that when I need to include one another there is a problem: in function "d" (from funcs2.au3) I call function "e" which is in funcs3.au3, but in funcs3.au3 there is function "f" which call "a" and "d", so I need to include funcs1.au3 and funcs2 again. The function I wrote are nested and I can think a way to include all of them from one file to another. How can I achive this? Thank you and sorry for bad English.
  4. I need to make a file downloader in autoit (with a gui, so also get the downlaod status). I thought of using the InetGet function, but I cannot set the HTTP_REFERER header, and the site I need to download from is like "http://site.com/last_download.php" and if HTTP_REFERER is set to "http://site.com" it redirects me to the right download link "http://download.server.site.com/random_name.zip", but if there is no header, then it redirects me to home page "http://site.com". So InteGet is not an option. I then tried WinHttp.au3 UDF and I can make an http call to the page "http://site.com/last_download.php" with the right referer header, but I cannot get the download status, neither set the download location. The file would probably be downloaded in RAM or cache before, then saved to a file via "FileWrite" function. But it's a large file (about 1,7gb). I could make a winhttp call to get the redirect header from "http://site.com/last_download.php" than using InetGet on the download url retrived by headers, but I don't know if it's possible to get just the headers from a winhttp request. I tried, but I always need to wait for the whole file download before being able to read the returned headers. How can I do? Thank you and sorry for bad English.
×
×
  • Create New...