[help]tool for translation Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ananthuthilakan
Posts: 188
Joined: 08 Jul 2019, 05:37
Contact:

[help]tool for translation

01 Aug 2019, 02:19

i have a translation map like this

kjhkjhkjhkhjkh#@jkhkkhkh# - single
kjhklhkhjkgjfsdjyafsjfgadjkj - double
uajdfcjkaghdojkagdgadgadg - triple
kaldufgkafdkajhgfkjagfadgfa - abc
kdugaklfgakjghfdajkgdfjagoi - triangle


similarly 100 more saved as text file

This was done for obfuscating the script
i done it manually and created this translation map manually

Is there a tool or any way to translate it back and forth

translating manually is a tiring task

any help would be much appreciated
User avatar
boiler
Posts: 16965
Joined: 21 Dec 2014, 02:44

Re: [help]tool for translation

01 Aug 2019, 10:18

Unless I'm misunderstanding your task, it should be as straightforward as this:

Write a script that reads your obfuscated script into a variable. Preform a series of StringReplace commands (or StrReplace function calls). These can be done within a loop after reading the from/to text segments into array elements from your translation map text file. Write the resulting changed variable contents to another file.

Have another script (or different part of the same script) that performs the string replaces in the other direction to create an obfuscated script file.
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: [help]tool for translation

01 Aug 2019, 10:33

The source code for Digidon's obfuscator is freely available on GitHub. You don't have to "reinvent the wheel", you can see what he has done and modify it or make your own version.
https://github.com/DigiDon34/Autohotkey-Obfuscator-L/blob/master/%40%40SOURCE-CODE/dynamicobfuscator.ahk

And if you do a search of the forum, you will find other obfuscators that came before his.

Obfuscator for Autohotkey Scripts
https://autohotkey.com/board/topic/89357-obfuscator-for-autohotkey-scripts/
User avatar
boiler
Posts: 16965
Joined: 21 Dec 2014, 02:44

Re: [help]tool for translation

11 Aug 2019, 09:18

Yes, there are two posts above that you haven’t replied to or acknowledged. Have you tried to implement anything and/or have any specific questions about trying to do so?
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: [help]tool for translation

11 Aug 2019, 09:30

"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."

We are nudging you to become better. If you have questions on the links or have tried to do some coding and it didn't work, people on the forum will help. We just don't want you to be afraid of experimenting on your own or doing the research.
ananthuthilakan
Posts: 188
Joined: 08 Jul 2019, 05:37
Contact:

Re: [help]tool for translation

11 Aug 2019, 10:34

boiler wrote:
11 Aug 2019, 09:18
Yes, there are two posts above that you haven’t replied to or acknowledged. Have you tried to implement anything and/or have any specific questions about trying to do so?
i have gone through dynamic obfuscator even before making this post
any way thanks for trying to help

first setting up obfuscator will take much longer than manually chnaging each word using search and change feature of notepad++

and the above mentioned words are repeating like hundreds of time


i need a simple translation

could u show a simple string replace function call
User avatar
boiler
Posts: 16965
Joined: 21 Dec 2014, 02:44

Re: [help]tool for translation  Topic is solved

11 Aug 2019, 11:10

Here's a working script. The file to be translated is to be in the same directory as the script and named "obfuscated text.txt". The translated text will be output to "translated text.txt".

Code: Select all

Map := {}

; read translation map and parse into array
FileRead, MapTextRaw, translation map.txt
loop, Parse, MapTextRaw, `n, `r ; loop for each line
{
	MapLine := StrReplace(A_LoopField, " - ", "\") ; replace the separator " - " with a single character "\"
	Parts := StrSplit(MapLine, "\") ; split into parts
	Map[Parts[1]] := Parts[2]
}

/*
; check mapping
For Obfuscated, Translated in Map
	TextOut .= Obfuscated " : " Translated "`n"
MsgBox, % TextOut
*/

FileRead, TextToTranslate, obfuscated text.txt ; read file to translate

For Obfuscated, Translated in Map
	TextToTranslate := StrReplace(TextToTranslate, Obfuscated, Translated)

FileAppend, % TextToTranslate, translated text.txt
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: [help]tool for translation

11 Aug 2019, 12:14

Boiler is a man with a big heart, because in the other post ananthuthilakan, you are mentioning 15,000 line scripts. If you are writing that much code, then I would think you could understand DigiDon's Obfuscator source code. So I'm a bit perplexed by the renewed request and the insistent manner, but not showing any code or research on your part or at least an attempt. I don't think it's good to do such a thing.

It's one thing when a person is a newbie or is really stuck on how to figure out a solution, it's another thing to abuse the charity of other programmers. We are all volunteers here. If you don't want to learn, and just want answers, then you should consider paying a programmer to provide them.

Anyway, cheers Boiler :beer: I devised a solution, but then felt funny about it, so passed. Like what's wrong with DigiDon's and Dave's obfuscator solutions? Just felt that ananthuthilakan should have "put some skin in the game", and at least showed us some kind of coding attempt.
ananthuthilakan
Posts: 188
Joined: 08 Jul 2019, 05:37
Contact:

Re: [help]tool for translation

11 Aug 2019, 12:53

SOTE wrote:
11 Aug 2019, 12:14
Boiler is a man with a big heart, because in the other post ananthuthilakan, you are mentioning 15,000 line scripts. If you are writing that much code, then I would think you could understand DigiDon's Obfuscator source code. So I'm a bit perplexed by the renewed request and the insistent manner, but not showing any code or research on your part or at least an attempt. I don't think it's good to do such a thing.

It's one thing when a person is a newbie or is really stuck on how to figure out a solution, it's another thing to abuse the charity of other programmers. We are all volunteers here. If you don't want to learn, and just want answers, then you should consider paying a programmer to provide them.

Anyway, cheers Boiler :beer: I devised a solution, but then felt funny about it, so passed. Like what's wrong with DigiDon's and Dave's obfuscator solutions? Just felt that ananthuthilakan should have "put some skin in the game", and at least showed us some kind of coding attempt.
first of all i admit that i am newbie at coding ( have no coding background at all)
In this past 10 days my brain is filled with so much of new codes
u can really see my joining date on the forum thats when i started learning coding

and did managed to code a script of 15k lines ( may be an expert wouldnt need that much line) that is also true
(its not any big programs or somthing but a macro and user interfaces)

but never used any string replaces or progress bar thing


i m srry tht i didnt tried on the obscatr thing with much effort as it was not in higher priority


thought some expert coders would have already tried this in the past and could help me out on that

A big thanks to Boiler for the help ( i never thought u would create a full script within no time !!!! u r expert at coding) :bravo:

still i havnt fully understood whats there in the code and how to make it work
:o :o

Thank you
User avatar
boiler
Posts: 16965
Joined: 21 Dec 2014, 02:44

Re: [help]tool for translation

11 Aug 2019, 13:53

SOTE wrote:
11 Aug 2019, 12:14
Anyway, cheers Boiler :beer: I devised a solution, but then felt funny about it, so passed. Like what's wrong with DigiDon's and Dave's obfuscator solutions? Just felt that ananthuthilakan should have "put some skin in the game", and at least showed us some kind of coding attempt.
Thanks, SOTE. I agree that I would have preferred for OP to take the high-level advice we gave him and make an attempt, and we could have helped him further if he got stuck. To follow up our well-intentioned posts with "any help?" as if we didn't even provide any value was actually a little insulting. I gave him the benefit of the doubt when he then responded that he didn't know how to go further based on our posts. So it was easy for me just to show how I would do it, and hopefully he'll use it to learn from rather than just take it and ask for a completed script the next time he comes back to the forum for help.
ananthuthilakan wrote:
11 Aug 2019, 12:53
thought some expert coders would have already tried this in the past and could help me out on that

A big thanks to Boiler for the help ( i never thought u would create a full script within no time !!!! u r expert at coding)

still i havnt fully understood whats there in the code and how to make it work
I don't consider myself an expert, but I'm glad to help where I can because I learned a lot from the people on the forum.

Hopefully you will try to learn from the feedback that is given to you and next time show an attempt at coding it yourself or at least ask about some specific problem you're having. Do this, and you'll find the forum members will always be glad to help. Good luck.
ananthuthilakan
Posts: 188
Joined: 08 Jul 2019, 05:37
Contact:

Re: [help]tool for translation

11 Aug 2019, 14:13

figured out how it works
you know it took me 2 whole hrs to figure out whats going on with the code you gave

i will surely take that feedback


thankyou
working like charm :superhappy:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], metallizer and 154 guests