Code: Alles auswählen
; Homoglyphic Confusion
; Purpose: Let robots not find a search term
; Replaces some latin characters in UTF-8 text files by cyrillic, greek and armenian look-alikes.
; Output: A UTF-8 text file named 'homoglyphed.txt' on the users desktop (tested only under Windows 10).
; A UTF-8 text file is expected as parameter (under Windows 10, notepad.exe saves this format).
; Compiler options -> Executable format: Console
; Simply drag and drop the text file onto the .exe
;
EnableExplicit
#InFile= 0
#OutFile= 1
Define.s Parameter$, InStrings$, Latins$, LookAlikes$
Define.b i
Latins$= "aceopxyCBHJKMSTijsAEINOPXYZghnoqu3" ; original latin characters
LookAlikes$= "асеорхуСВНЈКМЅТіјѕΑΕΙΝΟΡΧΥΖցհոօզսЗ" ; cyrillic, greek and armenian look-alikes
Parameter$ = ProgramParameter( 0)
If ReadFile( #InFile, Parameter$)
OpenConsole( "Homoglyphic Confusion")
CreateFile( #OutFile, GetUserDirectory(#PB_Directory_Desktop)+"homoglyphed.txt", #PB_UTF8)
While Eof( #InFile) = 0
InStrings$= ReadString( #InFile)
For i=1 To Len( LookAlikes$)
InStrings$= ReplaceString( InStrings$, Mid(Latins$, i, 1), Mid(LookAlikes$, i, 1))
Next i
PrintN( InStrings$)
WriteStringN( #OutFile, InStrings$)
Wend
CloseFile( #InFile)
CloseFile( #OutFile)
MessageRequester( "", "A file named 'homoglyphed.txt' should have been created on your desktop.")
Else
MessageRequester( "Error","UTF-8 text file expected as parameter")
EndIf