|
Post by Roger Cabo on Oct 6, 2022 18:15:46 GMT 1
Hi everyone,
I like to start a project to obfuscate any readable text strings in the code like : Dim Text$ = "I'm afraid of spiders!" or Sub Names of Forms in GB32. If you have some ideas or concerns please feel free add-in here.
The result is to press any Key in the GB32 editor and the result is a compiled exe that does not contain any readable text in the exe. You can test by your own: Compile any of your favorite programs and examine the .exe in a text editor. An enormous pitfall if you write professional applications when used by any external companies or users.
Stage 1: (Updated 06-10-2022) At first it should be possible to recognize all text inside of quotes in the gb32 code. Accepting all styles of comments like // ' /* */ ° Did I miss something? Then pick all text between quotes and crypt the text.
Here is the first example I wrote today to start with -Stage 1-
Insert GFA code in the left textbox and press convert.
|
|
|
Post by Roger Cabo on Oct 7, 2022 19:02:06 GMT 1
Today I continue with Stage 2 and it looks very promising! How it works: When the program found a Text inside a quote, then it simply change the Text to a cryped one eg = "Mytime" into "i(js5*". Also the craziest combinations are possible. Like a$ = """*"#13"'""'"""#10"#10""*""'"#13#10 Issue: I use atm crypt("***",a$) to replace the text. Unfortunately Crypt creates also ascii 0. If this happen, any ocx text boxes ends displaying text at this position. In the end I should use another solution from X or any that build the double length of a crypted string. Crypt is an easy solution because it produce the same size of chars as the original string len. Stage 2: Start and load any .g32 file or paste any text into ed1 then press convert. Obfuscator GB32 V2 Replace Quote Strings.G32 (7.3 KB) Stage 3: Find a proper encryption for replacement with 1 = 2 bytes. Stage 4: Add an option to crypt only single strings instead of all string in the editor. There is a easy solution for this possible. --> /**/ Stage 5: Find a solution to obfuscate all subs used by controls and OCXOCX arrays. Stage 6: Add all this stuff to the GFA extension and test. If you find any conversions that fail please post the code line that fails! Thank you
|
|
|
Post by Roger Cabo on Oct 8, 2022 18:08:00 GMT 1
Today I tried to finish Stage 3 : It requires some research about the editor and possible chars to display inside of a text string. The editor can display exactly 222 form 224 different chars in a text string. Starting from ASCII 32 to 255. There are 2 exceptions: 1) ASCII 34 // Can not be uses because it marks the quotes 2) ASCII 160 // Will be converted to ASCII 32 during any reasons. Means, there are 222 possible chars that must store 255 signs Crypt will produce.
You can paste this line to gb32 and see it works to display all.
Dim a$ = " ! #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
The most chars below 32 will be convert to ASCII 63 and some are using other ASCIIs. So we can completely forget all below 32.
That's all for now and today!
|
|
|
Post by Roger Cabo on Oct 9, 2022 23:13:05 GMT 1
Stage 3: Update
Today I thought about to code 255 chars but with only 222 available chars. I use 215 single chars and 7*7 double chars in one string. And it doesn't affect the security of the obfuscate strings system at all, because it's encrypted prior this step.
That's all for now and have a nice day!
|
|
|
Post by Roger Cabo on Aug 20, 2023 22:05:32 GMT 1
Long time ago.. I'm currently continue on the gb32 Obfuscator. I try to extend the crypt algorithm to get different results on the same quoted "string".
Than I will puzzle all the function into a gll.. then its done.... hopefully... :-)
|
|
|
Post by larrybtoys on Aug 21, 2023 12:04:16 GMT 1
I struggled with this exact problem many years ago when I was writing professional database style programs for businesses back in the late 80s and early 90s using GFA Basic 3.5 for the Atari ST. It was fairly easy at the time to encrypt any text in a number of ways to prevent this however the end result of my struggle was why bother. It does nothing harmful nor does it make my program any less professional looking. 99% or more of any of the 6-7 thousand lines of code were totally unreadable when viewed through a text editor. I did of course continue to encrypt any text that was a hard coded password.
|
|
|
Post by scalion on Aug 21, 2023 21:36:49 GMT 1
If you want use personal crypting text i wrote this 2 functions to encrypt/decrypt. I use permutations + xor and generate a hidden key to encrypt using the gfa function crypt() You juste have to use you personnal value for Ror and Rol bit process, and also A,B,C initialisations.
Even knowing the code I challenge you to make a program to crack an encrypted text with this!
Global String MyText = "I like to start a project to obfuscate any readable text strings in the code" Global MyKey = "1540451"
MyText = NRCrypt(MyText, MyKey) Message "Cripted !" & #13#10 & MyText Message "Uncrypted : " & NRUncrypt(MyText, MyKey) Function NRCrypt(T As String, Key As String) Local Long i, j, P, P2 Local Long A, B, C, K Local Byte ByteSwap Local Long Pass Local String Key2, TSave TSave = T For Pass = 0 To 1 ' Permute For i = 1 To Len(Key) P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = 0 To Len(T) - 1 P2 = Abs(Xor(C, Ror%(A, 1 + j % 7) + Rol%(B, 1 + j % 11))) % Len(T) ByteSwap = Peek(V:T + j) Poke V:T + j , Peek(V:T + P2) Poke V:T + P2, ByteSwap Next j Next i ' Xor For i = 1 To Len(Key) P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = 0 To Len(T) - 1 K = Rol(A + B, 1 + j % 12) + P * j K = Xor(K >> 24, K >> 16 , K >> 8, K) Poke V:T + j, Xor(Peek(V:T + j), And(K, 255)) Next j Next i ' Gfa Crypt If Pass = 0 P = Len(T) For i = 1 To Min(20, Len(T)) P = Ror%(P + Asc(i), 1) Key2 = Key2 & Mkl(P) Next i T = Crypt(Key2, TSave) EndIf Next Pass Return T EndFunc Function NRUncrypt(T As String, Key As String) Local Long i, j, P, P2 Local Long A, B, C, K Local Byte ByteSwap Local String Key2 ' Xor For i = Len(Key) DownTo 1 P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = Len(T) - 1 DownTo 0 K = Rol(A + B, 1 + j % 12) + P * j K = Xor(K >> 24, K >> 16 , K >> 8, K) Poke V:T + j, Xor(Peek(V:T + j), And(K, 255)) Next j Next i ' Inverse permutations For i = Len(Key) DownTo 1 P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = Len(T) - 1 DownTo 0 P2 = Abs(Xor(C, Ror%(A, 1 + j % 7) + Rol%(B, 1 + j % 11))) % Len(T) ByteSwap = Peek(V:T + j) Poke V:T + j , Peek(V:T + P2) Poke V:T + P2, ByteSwap Next j Next i 'Gfa uncrypt P = Len(T) For i = 1 To Min(20, Len(T)) P = Ror%(P + Asc(i), 1) Key2 = Key2 & Mkl(P) Next i T = Crypt(Key2, T) Return T EndFunc
|
|
|
Post by scalion on Aug 21, 2023 21:50:56 GMT 1
Today I tried to finish Stage 3 : It requires some research about the editor and possible chars to display inside of a text string. The editor can display exactly 222 form 224 different chars in a text string. Starting from ASCII 32 to 255. There are 2 exceptions: 1) ASCII 34 // Can not be uses because it marks the quotes 2) ASCII 160 // Will be converted to ASCII 32 during any reasons. Means, there are 222 possible chars that must store 255 signs Crypt will produce.
You can paste this line to gb32 and see it works to display all.
Dim a$ = " ! #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
The most chars below 32 will be convert to ASCII 63 and some are using other ASCIIs. So we can completely forget all below 32.
That's all for now and today! I think you'd better create a file with the encrypted strings, then put it in the :files and you won't have the problem of unprintable ascii characters in the IDE. You create a procedure that loads all the strings into an array by decrypting them and you replace all the literal strings with the array elements.
|
|
|
Post by Roger Cabo on Aug 22, 2023 13:55:07 GMT 1
Yes I understand your solution.. unfortunately I have 2 large programs with about >70000 lines of code. And > 1000 text info with message boxes. These use complex text strings are created of tons of tiny blocks that already exist.. a$ = "Please select : " & SYS_EDIT_DatabaseControl(db_control%) & " for the next " & SYS_EDIT_DatabaseControl(db_control% + ENUM_FUNCTION_ABS) & " to get (x,yZ) as the ABS(" & DB_Result$(db_control%) & ")" This stuff was grown in about 10 years with >5000 text fragments.. Also, when I make changes, I have to modify everything again in the :file and load it again into the code. I'm not really motivated do to this all the time.. for 2 programs manually. I love stuff like, easy click, automated, done, forget and it works 100% And if someone is interesting he can use the gll (contains source)
Your solution would be then as well in the original code?
a$ = InTxt$(ENUM_1473) & SYS_EDIT_DataBaseControl(db_control%) & InTxt$(ENUM_1463) & SYS_EDIT_DataBaseControl(db_control% + ENUM_FUNCTION_ABS) & InTxt$(ENUM_1471) & DB_Result$(db_control%) & InTxt$(ENUM_493)
|
|
|
Post by scalion on Aug 22, 2023 18:00:14 GMT 1
I can try to make a gll who make all this stuff in one click if you want. i come back.
|
|
|
Post by Roger Cabo on Aug 22, 2023 18:39:25 GMT 1
If you want use personal crypting text i wrote this 2 functions to encrypt/decrypt. I use permutations + xor and generate a hidden key to encrypt using the gfa function crypt() You juste have to use you personnal value for Ror and Rol bit process, and also A,B,C initialisations.
Even knowing the code I challenge you to make a program to crack an encrypted text with this!
Global String MyText = "I like to start a project to obfuscate any readable text strings in the code" Global MyKey = "1540451"
MyText = NRCrypt(MyText, MyKey) Message "Cripted !" & #13#10 & MyText Message "Uncrypted : " & NRUncrypt(MyText, MyKey) Function NRCrypt(T As String, Key As String) Local Long i, j, P, P2 Local Long A, B, C, K Local Byte ByteSwap Local Long Pass Local String Key2, TSave TSave = T For Pass = 0 To 1 ' Permute For i = 1 To Len(Key) P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = 0 To Len(T) - 1 P2 = Abs(Xor(C, Ror%(A, 1 + j % 7) + Rol%(B, 1 + j % 11))) % Len(T) ByteSwap = Peek(V:T + j) Poke V:T + j , Peek(V:T + P2) Poke V:T + P2, ByteSwap Next j Next i ' Xor For i = 1 To Len(Key) P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = 0 To Len(T) - 1 K = Rol(A + B, 1 + j % 12) + P * j K = Xor(K >> 24, K >> 16 , K >> 8, K) Poke V:T + j, Xor(Peek(V:T + j), And(K, 255)) Next j Next i ' Gfa Crypt If Pass = 0 P = Len(T) For i = 1 To Min(20, Len(T)) P = Ror%(P + Asc(i), 1) Key2 = Key2 & Mkl(P) Next i T = Crypt(Key2, TSave) EndIf Next Pass Return T EndFunc Function NRUncrypt(T As String, Key As String) Local Long i, j, P, P2 Local Long A, B, C, K Local Byte ByteSwap Local String Key2 ' Xor For i = Len(Key) DownTo 1 P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = Len(T) - 1 DownTo 0 K = Rol(A + B, 1 + j % 12) + P * j K = Xor(K >> 24, K >> 16 , K >> 8, K) Poke V:T + j, Xor(Peek(V:T + j), And(K, 255)) Next j Next i ' Inverse permutations For i = Len(Key) DownTo 1 P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = Len(T) - 1 DownTo 0 P2 = Abs(Xor(C, Ror%(A, 1 + j % 7) + Rol%(B, 1 + j % 11))) % Len(T) ByteSwap = Peek(V:T + j) Poke V:T + j , Peek(V:T + P2) Poke V:T + P2, ByteSwap Next j Next i 'Gfa uncrypt P = Len(T) For i = 1 To Min(20, Len(T)) P = Ror%(P + Asc(i), 1) Key2 = Key2 & Mkl(P) Next i T = Crypt(Key2, T) Return T EndFunc
Cool! The 'Gfa uncrypt and 'Gfa crypt is a cool idea.. But there is a really ugly problem .. NRCrypt() should not create values <32, 34 and 160. Means we must exchange all the resulting values <32, 34 and 160 in NRCrypt() BUT! Uncrypt does not know what values are changed! Because your code is symmetric.. we can use a translation SBOX Or Xlate$ to solve this problem.. I think!
|
|
|
Post by scalion on Aug 22, 2023 20:54:55 GMT 1
To have values <32 or =34,160... i have an idea : use Base() function with Z with alternate set. First 0123456789A...Z Second +-/*()_!?:a...z Example :
Global String MyText = "I like to start a project to obfuscate any readable text strings in the code" Global MyKey = "1540451"
MyText = NRCrypt(MyText, MyKey) Message "Cripted !" & #13#10 & MyText Message "Uncrypted : " & NRUncrypt(MyText, MyKey) Function NRCrypt(T As String, Key As String) Local Long i, j, P, P2 Local Long A, B, C, K Local Byte ByteSwap Local Long Pass Local String Key2, TSave TSave = T For Pass = 0 To 1 ' Permute For i = 1 To Len(Key) P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = 0 To Len(T) - 1 P2 = Abs(Xor(C, Ror%(A, 1 + j % 7) + Rol%(B, 1 + j % 11))) % Len(T) ByteSwap = Peek(V:T + j) Poke V:T + j , Peek(V:T + P2) Poke V:T + P2, ByteSwap Next j Next i ' Xor For i = 1 To Len(Key) P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = 0 To Len(T) - 1 K = Rol(A + B, 1 + j % 12) + P * j K = Xor(K >> 24, K >> 16 , K >> 8, K) Poke V:T + j, Xor(Peek(V:T + j), And(K, 255)) Next j Next i ' Gfa Crypt If Pass = 0 P = Len(T) For i = 1 To Min(20, Len(T)) P = Ror%(P + Asc(i), 1) Key2 = Key2 & Mkl(P) Next i T = Crypt(Key2, TSave) EndIf Next Pass ' Use alternates base Z to convert ascii to editable literal string T = Asc2AltZ(T) Return T EndFunc Function NRUncrypt(T As String, Key As String) Local Long i, j, P, P2 Local Long A, B, C, K Local Byte ByteSwap Local String Key2, Tsave ' Convert base Z to ascii T = AltZ2Asc(T) ' Xor For i = Len(Key) DownTo 1 P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = Len(T) - 1 DownTo 0 K = Rol(A + B, 1 + j % 12) + P * j K = Xor(K >> 24, K >> 16 , K >> 8, K) Poke V:T + j, Xor(Peek(V:T + j), And(K, 255)) Next j Next i ' Inverse permutations For i = Len(Key) DownTo 1 P = Asc(Key, i) A = P B = P * 3 C = Ror%(A + B + P, 11) For j = Len(T) - 1 DownTo 0 P2 = Abs(Xor(C, Ror%(A, 1 + j % 7) + Rol%(B, 1 + j % 11))) % Len(T) ByteSwap = Peek(V:T + j) Poke V:T + j , Peek(V:T + P2) Poke V:T + P2, ByteSwap Next j Next i 'Gfa uncrypt P = Len(T) For i = 1 To Min(20, Len(T)) P = Ror%(P + Asc(i), 1) Key2 = Key2 & Mkl(P) Next i T = Crypt(Key2, T) Return T EndFunc Function Asc2AltZ(T As String) As String Local Long Altern = 0, K, i, j Local String BZ, Tsave Tsave = T T = "" For i = 1 To Len(Tsave) BZ = Trim(Base(Asc(Tsave, i):Z)) If Altern = 1 For j = 1 To Len(BZ) K = Asc(BZ, j) If K >= 48 And K <= 57 Mid(BZ, j, 1) = Mid("+-/*()_!?:", K - 47, 1) Else Mid(BZ, j, 1) = Chr(K + 32) EndIf Next j EndIf T = T & BZ Altern = 1 - Altern Next i Return T EndFunc Function AltZ2Asc(T As String) As String Local String Tsave, BZ Local Long Scan, Altern = 0, K, i, A, M Tsave = T T = "" Scan = 1 Do BZ = "" If Altern = 0 Do K = Asc(Tsave, Scan) If (K >= 48 And K <= 57) Or (K >= 65 And K <= 90) BZ = BZ & Chr(K) Inc Scan If Scan > Len(Tsave) Exit Do Else Exit Do EndIf Loop Else Do K = Asc(Tsave, Scan) If InStr("+-/*()_!?:", Chr(K)) Or (K >= 97 And K <= 122) If K >= 97 And K <= 122 BZ = BZ & Chr(K - 32) Else BZ = BZ + Mid("0123456789", InStr("+-/*()_!?:", Chr(K)), 1) EndIf Inc Scan If Scan > Len(Tsave) Exit Do Else Exit Do EndIf Loop EndIf M = 1 A = 0 For i = Len(BZ) DownTo 1 K = Asc(BZ, i) If K >= 48 And K <= 57 K = K - 48 Else K = K - 55 EndIf A = A + K * M M = M * 36 Next i T = T & Chr(A) Altern = 1 - Altern Loop Until Scan > Len(Tsave) Return T EndFunc
|
|
|
Post by scalion on Aug 22, 2023 21:06:44 GMT 1
Another idea if you want to secure highly data : add the key to the data at a computed position depending of multiple factor (lenght, ascii of character x, etc...). If the key dont correspond, write random data in string !!! it's vicious i know... Go further with an little assembly code inserted in the same way who make an xor !!!
|
|
|
Post by scalion on Aug 23, 2023 13:27:15 GMT 1
I wrote a GLL to perform a "one clic" crypting text :
Try it, and plz tell me if bug and what to improve.
|
|
|
Post by Roger Cabo on Aug 23, 2023 16:18:56 GMT 1
Nice done!
Some tasks to do: 1) First, perform a syntax check and immediately stop if the syntax check fails.
2) The code must be urgently renamed and saved with the suffix "_CrypedVersion" to prevent overwriting when pressing CTRL+S for any reason.
3) Check if the file `CryptedStr.dat` already exists for any reason. If it does, exit with a notification, or ask to continue.
4) Check if any of the strings are already encrypted. If so, display a warning message box with the option [Crypt anyway?]. 4a) Test for existing functions like, DecryptingStrings, NRUncrypt
5) Generally, I would advise against using the GFA_ commands to search through the code and make changes. This could lead to unseen errors, possibly within any folded Proc/Sub on line 35378, and it's unpredictable what might happen.
6) Finding errors can be very challenging if something goes wrong. Consider integrating a test function into NRUNCrypt that writes all numbers and unencrypted strings into a file with a corresponding name and ID.
7) Having a [UnCrypt Code] menu entry would be beneficial, as it would do the opposite of encrypting, allowing the original code to be retrieved from an encrypted version. This would make it easier to compare the original with the encrypted one, as syntax errors aren't the only issues that could arise.
8) Would be great to Undo the whole stuff with CTRL+Z, or copy into the GFA_Undo Buffer. Then on the next attempt 3) Perhaps it's possible to select and and copy, then process crypt, then Undo works?
9) Does the CriptingKey makes sens? because it's a symmetric encryption. it produce always the same results on the same input string. What do you think?
// ____________________________________________________________________________________________________________________________________
1) Commencez d'abord par effectuer une vérification de la syntaxe et arrêtez-vous immédiatement si la vérification échoue.
2) Le code doit être renommé en urgence et enregistré avec le suffixe "_CrypedVersion" pour éviter tout écrasement lors de l'appui sur CTRL+S, quelle qu'en soit la raison.
3) Vérifiez si le fichier `CryptedStr.dat` existe déjà pour une quelconque raison. Si c'est le cas, quittez avec une notification ou demandez de continuer.
4) Vérifiez si l'une des chaînes est déjà cryptée. Si c'est le cas, affichez une boîte de dialogue d'avertissement avec l'option [Crypter quand même ?]. 4a) Testez les fonctions existantes telles que DecryptingStrings, NRUncrypt.
5) En général, je déconseillerais d'utiliser les commandes GFA_ pour parcourir le code et apporter des modifications. Cela pourrait conduire à des erreurs invisibles, éventuellement au sein de n'importe quelle Proc/Sub pliée à la ligne 35378, et il est imprévisible de savoir ce qui pourrait arriver.
6) Trouver des erreurs peut être très difficile si quelque chose tourne mal. Envisagez d'intégrer une fonction de test dans NRUNCrypt qui écrit tous les nombres et les chaînes non cryptées dans un fichier avec un nom et un ID correspondants.
7) Avoir une entrée de menu [UnCrypt Code] serait bénéfique, car elle ferait l'inverse du cryptage, permettant de récupérer le code original à partir d'une version cryptée. Cela faciliterait la comparaison de l'original avec la version cryptée, car les erreurs de syntaxe ne sont pas les seuls problèmes qui pourraient survenir.
8) Il serait formidable d'annuler toute l'opération avec CTRL+Z, ou de la copier dans le tampon GFA_Undo. Ensuite, lors de la prochaine tentative (point 3), il est peut-être possible de sélectionner et copier, puis de crypter, afin que l'annulation fonctionne ?
9) La clé de cryptage a-t-elle du sens ? Car c'est un cryptage symétrique, elle produit toujours les mêmes résultats sur la même chaîne d'entrée. Qu'en pensez-vous ?
Some bugs try these lines: Dim d$ = "" MsgBox "There is anything wrong with the code!"#13#10"Are you sure it's syntax-ed proof?"#13#10"Press SHIFT+F5 in editor to check the code!"#13#10#13#10"" & d$, MB_ICONINFORMATION MsgBox "There is anything wrong with" _ "the code!"#13#10 _ "parhaps not" MsgBox "There is anything wrong with"" the code!"" but it's!" MsgBox "There is anything wrong with"" the code! "/*""*/" but it's! oops"
|
|
|
Post by scalion on Aug 23, 2023 18:31:42 GMT 1
Wow... Ok i make some update to check ascii like #13#10 found before and after to insert a "&" statement, and checking existing entry. I look also for existing proc and func, and rename the source (i think writing a different file is a best way, then open it after confirmation message) i come back
|
|
|
Post by Roger Cabo on Aug 23, 2023 20:58:49 GMT 1
Wow... Ok i make some update to check ascii like #13#10 found before and after to insert a "&" statement, and checking existing entry. I look also for existing proc and func, and rename the source (i think writing a different file is a best way, then open it after confirmation message) i come back thanks :-) it was also a bit difficultly to find all SUB and PROCs and excluding the /* "'"" */ comments and unbreak all lines with _ Here are some test lines: ''' Quirky test Stuff FunctionVar/*A+B(FunctionVarExtention(PI)){ELEMENT+adr%.Long}*/c____(a___, /*____s___*/____x____/*____+___)(*/) As Int 'jdaldjlajdla End Func
Global i, a Sub _ i, a Sub/**/i, a //<--- extremely ugly if you want to remove single comments Sub/*(i, a)*/i, a Sub _ /**/ab(i, a) Sub/**/x(i, a) Sub/*,*/ä(o) // Sub/**/g(a, b)' Sub a, (b + a) Sub _ Sub_ /*Function name */ ( _ a (*Parameter a anything *), _ b (*Parameter b something *), _ c (*Parameter c *) _ ) _ // Description EndSub // _______________________________________________________________________ Sub _ i (*a, b*) , (a * b) This works in GLL and Editor code. perhaps anything is usefull.. GFA_ReadSourceCode_02.G32 (15.65 KB)
|
|
|
Post by scalion on Aug 23, 2023 21:03:57 GMT 1
Ok new update :
That's not work for at this time where there's /**/ or _...
I work on this.
|
|
|
Post by scalion on Aug 24, 2023 6:44:31 GMT 1
This last version work on this :
Dim d$ = "" MsgBox "There is anything wrong with the code!"#13#10"Are you sure it's syntax-ed proof?"#13#10"Press SHIFT+F5 in editor to check the code!"#13#10#13#10"" & d$, MB_ICONINFORMATION MsgBox "There is anything wrong with" _ "the code!"#13#10 _ "parhaps not" MsgBox "There is anything wrong with"" the code!"" but it's!" MsgBox "There is anything wrong with"" the code! "/*""*/" but it's! oops" MsgBox "There is anything wrong with"" the code! "/*""*/, 1, "bof" That's done like this :
Dim d$ = "" MsgBox CryptedText(1) & #13#10 & CryptedText(2) & #13#10 & CryptedText(3) & #13#10#13#10"" & d$, MB_ICONINFORMATION MsgBox CryptedText(4) & #13#10 & CryptedText(5) MsgBox CryptedText(6) MsgBox CryptedText(7) & /*""*/" but it's! oops" MsgBox CryptedText(7) /*""*/, 1, "bof"
|
|
|
Post by Roger Cabo on Aug 24, 2023 13:18:49 GMT 1
Try this code plz to crypt.. link some lines above. GFA_ReadSourceCode_02.G32 ________________________________________________________________________________ Use unique index? When select NO. > It ask me to save anything. This is a bit irritating.
When select YES. > Then is does try to save.. > Coming up with:
Press Yes: > The name is "Ohne Name" and ask me to overwrite the code again.
1) Also creates several entries of :CryptedStr.dat, CryptedStr_1.dat and functions NRDe/Crypt 1/2/ etc.. Should we simply prevent CryptedStr.dat if the file already exist? Because we can't edit anything in a Cryptet version anyway?
There are 2 bugs I think if you Crypt : GFA_ReadSourceCode_02.G32 If your program ask you to reload, select yes..
Now, I see the problems with the Gb32 editor.. A function that ask for an error in the code, if there's an error do not crypt. Function GFA_TestSyntaxErrors() as Int Dim count% = Gfa_LineCnt, i%, GFA_LineOld%, GFA_ColOld% ReDim GFASourceCode$(count%) ReDim GFAProcName$(count%) // It's not necessary to count all Procs previously. gb32 can handle ~500.000.000 elements in an array.. enough! GFA_LineOld = Gfa_Line GFA_ColOld = Gfa_Col Gfa_Line = 0 Gfa_Col = 0 Dim GFA_SyntaxCheck% For i = 1 To count Gfa_Line = i% GFA_SyntaxCheck% += Gfa_Error Gfa_SelCol = _maxInt If Gfa_IsFold Gfa_Fold 0 EndIf GFASourceCode$(i) = Gfa_Selection GFAProcName$(i) = Gfa_Proc Debug GFASourceCode$(i) Next i
// Could be possible the result has more or less error lines.. anyway break the encrypting Gfa_Line = GFA_LineOld Gfa_Col = GFA_ColOld If GFA_SyntaxCheck MsgBox Abs(GFA_SyntaxCheck) & "Syntax Error's in source code! GFA + L"#13#10"Fix the errors first!", MB_ICONEXCLAMATION return -1 Endif
return 0 EndFunc
|
|
|
Post by scalion on Aug 24, 2023 20:45:19 GMT 1
Give me the link to GFA_ReadSourceCode_02.G32, in your post is not active...
|
|
|
Post by scalion on Aug 25, 2023 11:26:51 GMT 1
Je n'avais pas compris que tu voulais pouvoir continuer à modifier le code avec les chaines cryptées.Dans ce cas ce n'est pas une bonne idée d'utiliser un fichier inline, il vaut mieux créer des DATA dans le code afin de savoir à quoi correspondent les index avec un commentaire généré.
Exemple :
DATA "d645'è-0 e6/*èè*5dct4" // index=1 : "Welcome to the program"
Qu'en pense-tu ?
US : I didn't understand that you wanted to be able to continue modifying the code with encrypted strings. In this case it's not a good idea to use an inline file, it's better to create DATA in the code in order to know What are the indexes using generated comments ?
Example :
DATA "d645'è-0 e6/*èè*5dct4" // index=1: "Welcome to the program"
What do you think ?
|
|
|
Post by Roger Cabo on Aug 29, 2023 15:27:25 GMT 1
Sorry for the late reply..
This is a great idea to use DATA: "kMw0Jf" // comment If anything broke, then you have a chance to search for errors a lot easier.
|
|
|
Post by Roger Cabo on Aug 29, 2023 15:28:44 GMT 1
|
|