marko001 Posted June 29, 2020 Posted June 29, 2020 Hi @RTFC, I used your tools to encrypt my .au3 and (almost) all was good. My program (a GIS system) must be in 3 languages, ENG,RUS,GER I use a loc.au3 file where I have all phrases in the 3 languages. To use cyricllic I had to switch to File->Encoding->UTF8 BOM When I use Codecrypter it correctly wraps and .au3 works but ONLY in english. When I switch to RUS I can see only ?????????? ?????????? ????? How to solve this? Thanks, Marco
RTFC Posted June 29, 2020 Author Posted June 29, 2020 As I stated before, if people want me to have a look at a particular (potential) issue, then please provide the smallest-possible script that reproduces the error/problem. My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O
marko001 Posted June 29, 2020 Posted June 29, 2020 (edited) hmm is there a log I can provide you? There are no errors in .au3. This is the "trick" I use to switch language: $idOptionsmenu = GUICtrlCreateMenu("&Options") $idLocalization = GUICtrlCreateMenu("Language", $idOptionsmenu) $idLocENG = GUICtrlCreateMenuItem("English", $idLocalization) $idLocRUS = GUICtrlCreateMenuItem("Russian", $idLocalization) $idLocGER = GUICtrlCreateMenuItem("German", $idLocalization) then Case $idLocENG GUICtrlSetState($idLocENG, $GUI_CHECKED) GUICtrlSetState($idLocRUS, $GUI_UNCHECKED) GUICtrlSetState($idLocGER, $GUI_UNCHECKED) RegWrite($RegisterKey, "Language", "REG_SZ", "ENG") _send($dictionary[44]) Case $idLocRUS GUICtrlSetState($idLocENG, $GUI_UNCHECKED) GUICtrlSetState($idLocRUS, $GUI_CHECKED) GUICtrlSetState($idLocGER, $GUI_UNCHECKED) RegWrite($RegisterKey, "Language", "REG_SZ", "RUS") _send($dictionary[44]) Case $idLocGER GUICtrlSetState($idLocENG, $GUI_UNCHECKED) GUICtrlSetState($idLocRUS, $GUI_UNCHECKED) GUICtrlSetState($idLocGER, $GUI_CHECKED) RegWrite($RegisterKey, "Language", "REG_SZ", "GER") _send($dictionary[44]) with #include <Localization.au3> . . . Global $dictionary[120] . . Local $s_language = RegRead($RegisterKey, "Language") . . For $i = 0 To UBound($dictionary) - 1 $dictionary[$i] = Eval($s_language & $i) Next and my localization.au3, just to understand, . . . $ENG115= "Info" $ENG116= "About" $ENG117= "Terms of Use" $ENG118= "Help" . . . $RUS115= "Информация" $RUS116= "О продукте" $RUS117= "Условия использования" $RUS118= "Справка" Edited June 29, 2020 by marko001
marko001 Posted June 29, 2020 Posted June 29, 2020 Well if you want I can create a small program as example, multilanguage, and see how it goes?
RTFC Posted June 29, 2020 Author Posted June 29, 2020 Yeah, I'm not about to spend ages trying to reverse-engineer something that might possibly produce an error that might be similar to the one you're experiencing, or not, without any way of checking. In your case, since this seems to concern localisation-specific strings, maybe adapt the provided HelloWorld example, and avoid GUIs if you can. Please note that the smaller and simpler the reproducer, the easier it is for me to narrow down what might be going wrong, so defintely nothing over a hundred lines in total. Thanks. My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O
marko001 Posted June 29, 2020 Posted June 29, 2020 Here we go: the 2 uncompressed au3 and the final result. I did it so fast so you have to "doubleclick" che checkbox then quit to reload in other language Thanks a lot, Marco MCF0test.au3 TESTGIS.au3 testloc.au3
RTFC Posted June 30, 2020 Author Posted June 30, 2020 Strike 1. So which part of 17 hours ago, RTFC said: provide the smallest-possible script and 15 hours ago, RTFC said: avoid GUIs if you can did you not understand? Especially since the issue can be reproduced in one line: MsgBox(0,"test","Русский текст") Moreover, your GUI reproducer would mess with my registry without my consent (if I had let it), which I consider rather rude. Strike 2. How did you figure that this is a CodeCrypter problem? Did you even read the CodeCrypter FAQ? Especially the part where it describes how to methodically identify where a problem might originate? Just inspecting the CodeScanner output (either in its GUI or the "stringsUsed.txt" files in the output subdirectory would have shown you that this has got nothing to do with encryption. You didn't even have to run a backtranslate (but I suppose you didn't try that first either). Strike 3. How about you try clicking this link, and maybe adopt that strategy as a general first approach before you post. That would have shown you that this is a generic AutoIt limitation that dozens of users have run up against in various contexts (with various solutions as well), for example here, here, and here. So the obvious solution is to not #include your language translations in the script, but keep them in separate files that you load/process at runtime. Nothing prevents you from also encrypting/decrpyting these (at runtime) with regular crypt functions (which will be encrypted by CodeCrypter). Or else maybe store them in binary form, and convert them at runtime. Three strikes, and you're out. I won't be helping you again. [click] My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O
marko001 Posted June 30, 2020 Posted June 30, 2020 Three strikes, and you're out. I won't be helping you again. [click] LOL no problem i don't need any more your help [click][click] (don't loose your precious time in replying, I don't have time to read it)
jchd Posted June 30, 2020 Posted June 30, 2020 You're making your life difficult and Eval isn't needed. Change your localized data file to something like this: expandcollapse popupGlobal Enum $LANG_EN, $LANG_RU, $LANG_DE, $LANG_FR Global $Dictionary = [ _ [ _ ; EN "Close", _ "Standard Checkbox", _ "Quit", _ "The checkbox is checked.", _ "The checkbox is not checked." _ ], _ [ _ ; RU "близко", _ "Стандартный флажок", _ "Уволиться", _ "Флажок отмечен.", _ "Флажок не отмечен." _ ], _ [ _ ; DE "Schließen", _ "Standard Checkbox", _ "Verlassen", _ "Das Kontrollkästchen ist aktiviert.", _ "Das Kontrollkästchen ist nicht aktiviert." _ ], _ [ _ ; FR "Fermer", _ "Case à cocher standard", _ "Quitter", _ "La case est cochée.", _ "La case n'est pas cochée." _ ] _ ] ; language in force Global $Lang ;=========================================================================== ; example use ;--------------------------------------------------------------------------- ; randomly select a language and display some strings For $i = 1 To 3 $Lang = Random($LANG_EN, $LANG_FR, 1) Use_Example() Next Func Use_Example() For $i = 1 To 3 MsgBox(0, "", $Dictionary[$Lang][Random(0, UBound($Dictionary, 2) - 1, 1)]) Next EndFunc This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
marko001 Posted June 30, 2020 Posted June 30, 2020 (edited) @jchd thanks for your great support, dude, I appreciated. Do you think, due the fact dictionary is over 200 phrases, it's better to keep it in a separate au3 or keep it in the main script? Thanks again, Marco [Edit]: Obviously I had to change to UTF-8 to show correctly cyrillic. Could this led to troubles when encoding? Edited June 30, 2020 by marko001
jchd Posted June 30, 2020 Posted June 30, 2020 Having 600+ lines of string data on top of the main source is uneasy to deal with. Keep the data in it's own file and #include it just as you currently do. When modifying the main code you don't have to page down at hell to find code, and if you need to change/add localized strings, it's easy enough to open the separate file. You may also want to give strings a verbose ID instead of just a numeric index. It would make your code easier to read and less error-prone: Global Enum $LANG_EN, $LANG_RU, $LANG_DE, $LANG_FR Global Enum $MSG_Close, $MSG_StdChkBox, $MSG_Quit, $MSG_ChkedBox, MSG_UnChkedBox Global $Dictionary = [ _ [ _ ; EN "Close", _ "Standard Checkbox", _ "Quit", _ "The checkbox is checked.", _ "The checkbox is not checked." _ ], _ ... Of course, giving a short yet meaningful name (enum) matching the actual string index is up to you, but I find MsgBox(0, "", $Dict[$Lang][$MSG_FileReadErr]) more readable than MsgBox(0, "", $Dict[$Lang][98]). Obviously you still have to take care that the number and order of strings are the same for every language. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
marko001 Posted June 30, 2020 Posted June 30, 2020 But the problem still remains. After encoding with Codecrypter I get this. With your hint my code is surely better now but I still can't figure out how to get rid of these ????? on a crypted .au3 when on the contrary cyrillic is correctly shown on unencoded au3s
jchd Posted June 30, 2020 Posted June 30, 2020 I don't know how the things work in CodeCrypter, but I suspect some part isn't handling UTF8 correctly. That sould be relatively easy to fix. RTFC 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
marko001 Posted June 30, 2020 Posted June 30, 2020 1 minute ago, jchd said: I don't know how the things work in CodeCrypter, but I suspect some part isn't handling UTF8 correctly. That sould be relatively easy to fix. "relatively easy" You are the man: 8.820 posts and 1.416++
quimao Posted August 20, 2020 Posted August 20, 2020 Hi RTFC i have tested helloworld.au3 with Obfuscate mode and get this error ???
RTFC Posted August 21, 2020 Author Posted August 21, 2020 This was an oversight in my patching of the CryptoNG lib; fixed in v3.3c, available for download now. quimao 1 My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O
quimao Posted November 28, 2020 Posted November 28, 2020 Hi @RTFC This CryptoNG version works fine with CodeCrypter but doesn't work with encryption hash. Please fix it when you are free
TheXman Posted November 28, 2020 Posted November 28, 2020 (edited) @RTFC I see a few differences between your modified version of CryptoNG and the original version that could be problematic. When comparing the version of CryptotNG.au3 that you distribute, which appears to be my v1.6.1, I think the following differences may need to be corrected. The last correction listed below, is definitely the reason why the hashing result is not being returned in the post above. In __CryptoNG_BCryptCreateHash, the following line should be changed from DllStructSetData($tHMACSecretBuffer,"data",$vHMACSecret) to DllStructSetData($tHMACSecretBuffer,"data",$xHMACSecret) In __CryptoNG_BCryptEncrypt_CBC, the following line should be changed from DllStructSetData($tIVBuffer,"data",$vIV) to DllStructSetData($tIVBuffer,"data",Binary($vIV)) In __CryptoNG_BCryptFinishHash, the following line should be changed from ;All is good DllStructGetData($tDataBuffer,"data") to $xHash = DllStructGetData($tDataBuffer,"data") For the record, as of this evening, CryptoNG is up to v1.7.0. There's not a major difference in functionality between v1.6.1 and v1.7.0. However, it does have several function header corrections and the getting/setting of structure fields was changed back to the object-based way of doing it. There are a few more small additions, modifications, and optimizations, but not really enough to warrant switching to the newest version, unless you wanted to of course. Edited November 28, 2020 by TheXman RTFC and quimao 2 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman
RTFC Posted November 28, 2020 Author Posted November 28, 2020 (edited) @TheXman:Thanks a bunch for scrutinising my patched version! I will implement the fixes soon. I did have a look at your CNG version 1.7, but as you already noted, the improvements you made were not going to impact CodeCrypter performance to any great extent, and I'm still not a fan of object-based notation, but I do appreciate your continuing efforts to make CNG the best it can possibly be. Sorry for the oversights on my part in adapting your work (bit distracted at the moment). @quimao: fix uploaded. Thanks for notifying me. Edited November 28, 2020 by RTFC quimao and TheXman 1 1 My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O
n1kobg Posted December 2, 2020 Posted December 2, 2020 I have a problem with CodeScannerCrypter. When I run Codescanner it usually opens directly in the current folder. That way I know its working. With the latest Windows updates it opens in This PC and when i navigate and find my file it doesnt work properly. It still do some calsulations but its way faster and it incomplete and it doesnt work. Now It doesnt even show the files in the folder. I downloaded v3.3.d from here (although it says its submitted 27 of February, this is the official link. Old versions doesnt work as well. I believe that have something to do with Windows Permissions. They started to make things difficult to run scripts since v1709 and up. And when new version comes out they implement it in lower versions Windows Updates. I have a tweaked WIndows but I try to remove the restrictions so I dont think its from that since on default Windows its the same. Anyone else with similar problem?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now