├── .gitattributes ├── .gitignore ├── images ├── Obfuscate.png ├── OpenScript.png ├── SaveObfuscatedScript.png └── exit.png ├── ob.ico ├── ob.lpi ├── ob.lps ├── ob.pas ├── ob.res ├── ob_analyzer.pas ├── ob_main.lfm ├── ob_main.pas └── ob_obfuscator.pas /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | -------------------------------------------------------------------------------- /images/Obfuscate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CynicRus/Obfuscator/19a6907ce70b9b14be2beb23d7b1196bd3245c89/images/Obfuscate.png -------------------------------------------------------------------------------- /images/OpenScript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CynicRus/Obfuscator/19a6907ce70b9b14be2beb23d7b1196bd3245c89/images/OpenScript.png -------------------------------------------------------------------------------- /images/SaveObfuscatedScript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CynicRus/Obfuscator/19a6907ce70b9b14be2beb23d7b1196bd3245c89/images/SaveObfuscatedScript.png -------------------------------------------------------------------------------- /images/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CynicRus/Obfuscator/19a6907ce70b9b14be2beb23d7b1196bd3245c89/images/exit.png -------------------------------------------------------------------------------- /ob.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CynicRus/Obfuscator/19a6907ce70b9b14be2beb23d7b1196bd3245c89/ob.ico -------------------------------------------------------------------------------- /ob.lpi: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | <ResourceType Value="res"/> 11 | <UseXPManifest Value="True"/> 12 | <Icon Value="0"/> 13 | </General> 14 | <i18n> 15 | <EnableI18N LFM="False"/> 16 | </i18n> 17 | <VersionInfo> 18 | <StringTable ProductVersion=""/> 19 | </VersionInfo> 20 | <BuildModes Count="1"> 21 | <Item1 Name="Default" Default="True"/> 22 | </BuildModes> 23 | <PublishOptions> 24 | <Version Value="2"/> 25 | <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> 26 | <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/> 27 | </PublishOptions> 28 | <RunParams> 29 | <local> 30 | <FormatVersion Value="1"/> 31 | </local> 32 | </RunParams> 33 | <RequiredPackages Count="2"> 34 | <Item1> 35 | <PackageName Value="SynEdit"/> 36 | </Item1> 37 | <Item2> 38 | <PackageName Value="LCL"/> 39 | </Item2> 40 | </RequiredPackages> 41 | <Units Count="4"> 42 | <Unit0> 43 | <Filename Value="ob.pas"/> 44 | <IsPartOfProject Value="True"/> 45 | <UnitName Value="ob"/> 46 | </Unit0> 47 | <Unit1> 48 | <Filename Value="ob_main.pas"/> 49 | <IsPartOfProject Value="True"/> 50 | <ComponentName Value="Form1"/> 51 | <ResourceBaseClass Value="Form"/> 52 | <UnitName Value="ob_main"/> 53 | </Unit1> 54 | <Unit2> 55 | <Filename Value="ob_analyzer.pas"/> 56 | <IsPartOfProject Value="True"/> 57 | <UnitName Value="ob_analyzer"/> 58 | </Unit2> 59 | <Unit3> 60 | <Filename Value="ob_obfuscator.pas"/> 61 | <IsPartOfProject Value="True"/> 62 | <UnitName Value="ob_obfuscator"/> 63 | </Unit3> 64 | </Units> 65 | </ProjectOptions> 66 | <CompilerOptions> 67 | <Version Value="11"/> 68 | <PathDelim Value="\"/> 69 | <Target> 70 | <Filename Value="ob"/> 71 | </Target> 72 | <SearchPaths> 73 | <IncludeFiles Value="$(ProjOutDir)"/> 74 | <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 75 | </SearchPaths> 76 | <Linking> 77 | <Options> 78 | <Win32> 79 | <GraphicApplication Value="True"/> 80 | </Win32> 81 | </Options> 82 | </Linking> 83 | <Other> 84 | <CompilerMessages> 85 | <MsgFileName Value=""/> 86 | </CompilerMessages> 87 | <CompilerPath Value="$(CompPath)"/> 88 | </Other> 89 | </CompilerOptions> 90 | <Debugging> 91 | <Exceptions Count="3"> 92 | <Item1> 93 | <Name Value="EAbort"/> 94 | </Item1> 95 | <Item2> 96 | <Name Value="ECodetoolError"/> 97 | </Item2> 98 | <Item3> 99 | <Name Value="EFOpenError"/> 100 | </Item3> 101 | </Exceptions> 102 | </Debugging> 103 | </CONFIG> 104 | -------------------------------------------------------------------------------- /ob.lps: -------------------------------------------------------------------------------- 1 | <?xml version="1.0"?> 2 | <CONFIG> 3 | <ProjectSession> 4 | <PathDelim Value="\"/> 5 | <Version Value="9"/> 6 | <BuildModes Active="Default"/> 7 | <Units Count="4"> 8 | <Unit0> 9 | <Filename Value="ob.pas"/> 10 | <IsPartOfProject Value="True"/> 11 | <UnitName Value="ob"/> 12 | <IsVisibleTab Value="True"/> 13 | <EditorIndex Value="3"/> 14 | <WindowIndex Value="0"/> 15 | <TopLine Value="1"/> 16 | <CursorPos X="3" Y="16"/> 17 | <UsageCount Value="20"/> 18 | <Loaded Value="True"/> 19 | </Unit0> 20 | <Unit1> 21 | <Filename Value="ob_main.pas"/> 22 | <IsPartOfProject Value="True"/> 23 | <ComponentName Value="Form1"/> 24 | <ResourceBaseClass Value="Form"/> 25 | <UnitName Value="ob_main"/> 26 | <EditorIndex Value="0"/> 27 | <WindowIndex Value="0"/> 28 | <TopLine Value="1"/> 29 | <CursorPos X="17" Y="10"/> 30 | <UsageCount Value="20"/> 31 | <Loaded Value="True"/> 32 | <LoadedDesigner Value="True"/> 33 | </Unit1> 34 | <Unit2> 35 | <Filename Value="ob_analyzer.pas"/> 36 | <IsPartOfProject Value="True"/> 37 | <UnitName Value="ob_analyzer"/> 38 | <EditorIndex Value="1"/> 39 | <WindowIndex Value="0"/> 40 | <TopLine Value="1"/> 41 | <CursorPos X="3" Y="16"/> 42 | <UsageCount Value="20"/> 43 | <Loaded Value="True"/> 44 | </Unit2> 45 | <Unit3> 46 | <Filename Value="ob_obfuscator.pas"/> 47 | <IsPartOfProject Value="True"/> 48 | <UnitName Value="ob_obfuscator"/> 49 | <EditorIndex Value="2"/> 50 | <WindowIndex Value="0"/> 51 | <TopLine Value="1"/> 52 | <CursorPos X="3" Y="16"/> 53 | <UsageCount Value="20"/> 54 | <Loaded Value="True"/> 55 | </Unit3> 56 | </Units> 57 | <General> 58 | <ActiveWindowIndexAtStart Value="0"/> 59 | </General> 60 | <JumpHistory Count="30" HistoryIndex="29"> 61 | <Position1> 62 | <Filename Value="ob_obfuscator.pas"/> 63 | <Caret Line="481" Column="1" TopLine="461"/> 64 | </Position1> 65 | <Position2> 66 | <Filename Value="ob_obfuscator.pas"/> 67 | <Caret Line="483" Column="1" TopLine="461"/> 68 | </Position2> 69 | <Position3> 70 | <Filename Value="ob_obfuscator.pas"/> 71 | <Caret Line="323" Column="1" TopLine="308"/> 72 | </Position3> 73 | <Position4> 74 | <Filename Value="ob_obfuscator.pas"/> 75 | <Caret Line="324" Column="1" TopLine="308"/> 76 | </Position4> 77 | <Position5> 78 | <Filename Value="ob_obfuscator.pas"/> 79 | <Caret Line="325" Column="1" TopLine="308"/> 80 | </Position5> 81 | <Position6> 82 | <Filename Value="ob_obfuscator.pas"/> 83 | <Caret Line="326" Column="1" TopLine="308"/> 84 | </Position6> 85 | <Position7> 86 | <Filename Value="ob_obfuscator.pas"/> 87 | <Caret Line="327" Column="1" TopLine="308"/> 88 | </Position7> 89 | <Position8> 90 | <Filename Value="ob_obfuscator.pas"/> 91 | <Caret Line="328" Column="1" TopLine="308"/> 92 | </Position8> 93 | <Position9> 94 | <Filename Value="ob_obfuscator.pas"/> 95 | <Caret Line="329" Column="1" TopLine="308"/> 96 | </Position9> 97 | <Position10> 98 | <Filename Value="ob_obfuscator.pas"/> 99 | <Caret Line="330" Column="1" TopLine="308"/> 100 | </Position10> 101 | <Position11> 102 | <Filename Value="ob_obfuscator.pas"/> 103 | <Caret Line="484" Column="1" TopLine="471"/> 104 | </Position11> 105 | <Position12> 106 | <Filename Value="ob_obfuscator.pas"/> 107 | <Caret Line="481" Column="1" TopLine="452"/> 108 | </Position12> 109 | <Position13> 110 | <Filename Value="ob_obfuscator.pas"/> 111 | <Caret Line="431" Column="1" TopLine="417"/> 112 | </Position13> 113 | <Position14> 114 | <Filename Value="ob_obfuscator.pas"/> 115 | <Caret Line="484" Column="1" TopLine="471"/> 116 | </Position14> 117 | <Position15> 118 | <Filename Value="ob_obfuscator.pas"/> 119 | <Caret Line="481" Column="1" TopLine="471"/> 120 | </Position15> 121 | <Position16> 122 | <Filename Value="ob_obfuscator.pas"/> 123 | <Caret Line="483" Column="1" TopLine="471"/> 124 | </Position16> 125 | <Position17> 126 | <Filename Value="ob_obfuscator.pas"/> 127 | <Caret Line="323" Column="1" TopLine="308"/> 128 | </Position17> 129 | <Position18> 130 | <Filename Value="ob_obfuscator.pas"/> 131 | <Caret Line="494" Column="34" TopLine="473"/> 132 | </Position18> 133 | <Position19> 134 | <Filename Value="ob_obfuscator.pas"/> 135 | <Caret Line="431" Column="1" TopLine="417"/> 136 | </Position19> 137 | <Position20> 138 | <Filename Value="ob_obfuscator.pas"/> 139 | <Caret Line="479" Column="1" TopLine="466"/> 140 | </Position20> 141 | <Position21> 142 | <Filename Value="ob_obfuscator.pas"/> 143 | <Caret Line="431" Column="1" TopLine="416"/> 144 | </Position21> 145 | <Position22> 146 | <Filename Value="ob_obfuscator.pas"/> 147 | <Caret Line="479" Column="1" TopLine="466"/> 148 | </Position22> 149 | <Position23> 150 | <Filename Value="ob_obfuscator.pas"/> 151 | <Caret Line="431" Column="1" TopLine="416"/> 152 | </Position23> 153 | <Position24> 154 | <Filename Value="ob_obfuscator.pas"/> 155 | <Caret Line="479" Column="1" TopLine="466"/> 156 | </Position24> 157 | <Position25> 158 | <Filename Value="ob_obfuscator.pas"/> 159 | <Caret Line="336" Column="13" TopLine="311"/> 160 | </Position25> 161 | <Position26> 162 | <Filename Value="ob_obfuscator.pas"/> 163 | <Caret Line="333" Column="18" TopLine="315"/> 164 | </Position26> 165 | <Position27> 166 | <Filename Value="ob_main.pas"/> 167 | <Caret Line="82" Column="15" TopLine="66"/> 168 | </Position27> 169 | <Position28> 170 | <Filename Value="ob_main.pas"/> 171 | <Caret Line="78" Column="21" TopLine="66"/> 172 | </Position28> 173 | <Position29> 174 | <Filename Value="ob_main.pas"/> 175 | <Caret Line="77" Column="21" TopLine="65"/> 176 | </Position29> 177 | <Position30> 178 | <Filename Value="ob_main.pas"/> 179 | <Caret Line="89" Column="77" TopLine="61"/> 180 | </Position30> 181 | </JumpHistory> 182 | </ProjectSession> 183 | </CONFIG> 184 | -------------------------------------------------------------------------------- /ob.pas: -------------------------------------------------------------------------------- 1 | program ob; 2 | {** 3 | * This file is part of the Obfuscator for PascalScript. 4 | * Simba Obfuscator. is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Simba Obfuscator. is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Simba Obfuscator. If not, see <http://www.gnu.org/licenses/>. 16 | *} 17 | {$mode objfpc}{$H+} 18 | 19 | uses 20 | {$IFDEF UNIX}{$IFDEF UseCThreads} 21 | cthreads, 22 | {$ENDIF}{$ENDIF} 23 | Interfaces, // this includes the LCL widgetset 24 | Forms, ob_main, ob_obfuscator, ob_analyzer 25 | { you can add units after this }; 26 | 27 | {$R *.res} 28 | 29 | begin 30 | RequireDerivedFormResource := True; 31 | Application.Initialize; 32 | Application.CreateForm(TForm1, Form1); 33 | Application.Run; 34 | end. 35 | 36 | -------------------------------------------------------------------------------- /ob.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CynicRus/Obfuscator/19a6907ce70b9b14be2beb23d7b1196bd3245c89/ob.res -------------------------------------------------------------------------------- /ob_analyzer.pas: -------------------------------------------------------------------------------- 1 | unit ob_analyzer; 2 | {** 3 | * This file is part of the Obfuscator for PascalScript. 4 | * Simba Obfuscator. is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Simba Obfuscator. is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Simba Obfuscator. If not, see <http://www.gnu.org/licenses/>. 16 | *} 17 | {$mode objfpc}{$H+} 18 | 19 | interface 20 | 21 | uses 22 | StrUtils, SysUtils; 23 | const 24 | {$WARNINGS OFF} 25 | IdentifierFirstSymbols: 26 | set of Char = ['A' .. 'Z', 'a' .. 'z', '_']; 27 | IdentifierSymbols: 28 | set of Char = ['A' .. 'Z', 'a' .. 'z', '0' .. '9', '_']; 29 | Digits: 30 | set of Char = ['0' .. '9']; 31 | HexDigits: 32 | set of Char = ['A' .. 'F', 'a' .. 'f', '0' .. '9']; 33 | ExponentDot = '.'; 34 | ExponentE: 35 | set of Char = ['E', 'e']; 36 | Signs: set of Char = ['+', '-']; 37 | {$WARNINGS ON} 38 | CharLineEnd = ';'; 39 | CommentsLine = '//'; 40 | CommentsOpen = '{'; 41 | CommentsClose = '}'; 42 | 43 | type 44 | TStringQuote = 45 | ( 46 | sqSingle, 47 | sqDouble, 48 | sqSingleAndDouble 49 | ); 50 | 51 | const 52 | StringQuote = sqSingle; 53 | 54 | type 55 | 56 | TCharSet = set of Char; 57 | 58 | PLexem = ^TLexem; 59 | 60 | TLexem = record 61 | Lexem: string; 62 | TextPos: integer; 63 | LexType: Byte; 64 | end; 65 | TLexems = array of TLexem; 66 | 67 | TLexicalAnalyzer = class(TObject) 68 | private 69 | CurrPos: Integer; 70 | CurrChar: Char; 71 | CurrLexem: string; 72 | FLexemsList: TLexems; 73 | FLexemsCount: Integer; 74 | FSource: string; 75 | 76 | procedure GetNextChar; 77 | procedure Add(Lexem: string; Pos: Integer; LType: Byte); 78 | procedure GetNumber; 79 | procedure GetIdentifier; 80 | procedure GetOthers; 81 | function NextChar: Char; 82 | { function GenerateAnsi(const Str: string): string;} 83 | function GetLexem(ind: Integer): TLexem; 84 | procedure SetSource(src: String); 85 | public 86 | constructor Create; 87 | destructor Destroy; override; 88 | procedure Analyze; 89 | property Lexem[ind: Integer]: TLexem read GetLexem; 90 | property LexemsCount: Integer read FLexemsCount; 91 | property Source: string read FSource write SetSource; 92 | end; 93 | 94 | implementation 95 | {Small helper} 96 | function Eq(aValue1, aValue2: string): boolean; 97 | //-------------------------------------------------------- 98 | begin 99 | Result := AnsiCompareText(Trim(aValue1),Trim(aValue2))=0; 100 | end; 101 | 102 | procedure DeleteSpaces(var S: String); 103 | var 104 | I, C: Integer; 105 | begin 106 | I := 1; 107 | C := 0; 108 | while I <= Length(S) do 109 | begin 110 | if S[I] = #9 then S[I] := #32; 111 | if S[I] = #32 then Inc(C) else 112 | if C <> 0 then 113 | begin 114 | if C > 1 then Delete(S, I - C, C - 1); 115 | C := 0; 116 | Dec(I, C - 2); 117 | end; 118 | Inc(I); 119 | end; 120 | end; 121 | 122 | function CharInSet(const Ch: Char; const Chars: TCharSet): Boolean; 123 | begin 124 | Result := Ch in Chars; 125 | end; 126 | 127 | function GenerateAnsi(const Str: string): string; 128 | var 129 | I: Integer; 130 | s: string; 131 | begin 132 | s := ''; 133 | for I := 1 to Length(Str) do 134 | if not (Ord(Str[I]) = 39) then 135 | s := s + '#' + inttostr(Ord(Str[I])); 136 | Result:=s; 137 | end; 138 | 139 | function PrepareLongLines(const Str: string): string; 140 | var 141 | i,j,ch: integer; 142 | tmp: string; 143 | begin 144 | tmp:=str; 145 | DeleteSpaces(tmp); 146 | j:=Length(tmp); 147 | for I:=0 to j do 148 | begin 149 | Ch:=pos('+',tmp); 150 | if (tmp[Ch-1] = #39) or (tmp[Ch+1] = #39) then 151 | Delete(tmp,Ch,1); 152 | end; 153 | result:=tmp; 154 | end; 155 | function PrepareStrValue(const Str: string): string; 156 | var 157 | i,j,ch: integer; 158 | tmp: string; 159 | begin 160 | tmp:=str; 161 | j:=Length(Str); 162 | tmp:=PrepareLongLines(tmp); 163 | for I:=0 to j do 164 | begin 165 | Ch:=pos(#39,tmp); 166 | Delete(tmp,Ch,1); 167 | end; 168 | if not eq(tmp,'') then 169 | result:=GenerateAnsi(tmp) 170 | else 171 | result:=#39+#39; 172 | end; 173 | 174 | { TLexicalAnalyzer } 175 | 176 | procedure TLexicalAnalyzer.Add(Lexem: string; Pos: Integer; LType: Byte); 177 | begin 178 | if Lexem = '' then 179 | Exit; 180 | Inc(FLexemsCount); 181 | SetLength(FLexemsList, FLexemsCount); 182 | FLexemsList[FLexemsCount - 1].Lexem := Lexem; 183 | FLexemsList[FLexemsCount - 1].TextPos := Pos; 184 | FLexemsList[FLexemsCount - 1].LexType := LType; 185 | end; 186 | 187 | procedure TLexicalAnalyzer.Analyze; 188 | var 189 | ctype: Byte; 190 | begin 191 | SetLength(FLexemsList, 0); 192 | GetNextChar; 193 | while CurrChar <> #0 do 194 | begin 195 | if CurrPos > Length(FSource) then 196 | Break; 197 | case CurrChar of 198 | 'A' .. 'Z', 'a' .. 'z', '_': 199 | begin 200 | CurrLexem := ''; 201 | GetIdentifier; 202 | ctype := 0; 203 | if CurrLexem <> '' then 204 | Add(CurrLexem, CurrPos - Length(CurrLexem), ctype); 205 | CurrLexem := ''; 206 | end; 207 | '0' .. '9': 208 | begin 209 | CurrLexem := ''; 210 | GetNumber; 211 | ctype := 1; 212 | if CurrLexem <> '' then 213 | Add(CurrLexem, CurrPos - Cardinal(Length(CurrLexem)), ctype); 214 | CurrLexem := ''; 215 | end; 216 | #1 .. #20, ' ': 217 | begin 218 | GetNextChar; 219 | end; 220 | else 221 | begin 222 | CurrLexem := ''; 223 | GetOthers; 224 | ctype := 2; 225 | if CurrLexem <> '' then 226 | Add(CurrLexem, CurrPos - Cardinal(Length(CurrLexem)), ctype); 227 | CurrLexem := ''; 228 | end; 229 | end; 230 | end; 231 | end; 232 | 233 | constructor TLexicalAnalyzer.Create; 234 | begin 235 | inherited; 236 | FLexemsList := nil; 237 | FLexemsCount := 0; 238 | CurrPos := 0; 239 | CurrChar := #0; 240 | CurrLexem := ''; 241 | end; 242 | 243 | destructor TLexicalAnalyzer.Destroy; 244 | begin 245 | SetLength(FLexemsList, 0); 246 | inherited; 247 | end; 248 | 249 | procedure TLexicalAnalyzer.GetIdentifier; 250 | begin 251 | CurrLexem := CurrChar; 252 | GetNextChar; 253 | while CharInSet(CurrChar, IdentifierSymbols) do 254 | begin 255 | CurrLexem := CurrLexem + CurrChar; 256 | GetNextChar; 257 | end; 258 | end; 259 | 260 | function TLexicalAnalyzer.GetLexem(ind: integer): TLexem; 261 | begin 262 | if ind > (FLexemsCount - 1) then 263 | Exit; 264 | Result := FLexemsList[ind]; 265 | end; 266 | 267 | procedure TLexicalAnalyzer.GetNextChar; 268 | begin 269 | Inc(CurrPos); 270 | if CurrPos > Length(FSource) then 271 | CurrChar := #0 272 | else 273 | CurrChar := FSource[CurrPos]; 274 | end; 275 | 276 | procedure TLexicalAnalyzer.GetNumber; 277 | begin 278 | CurrLexem := CurrChar; 279 | GetNextChar; 280 | 281 | while CharInSet(CurrChar, Digits) do 282 | begin 283 | CurrLexem := CurrLexem + CurrChar; 284 | GetNextChar; 285 | end; 286 | if CurrChar <> ExponentDot then 287 | Exit; 288 | 289 | if not CharInSet(NextChar, Digits) then 290 | Exit; 291 | 292 | CurrLexem := CurrLexem + ExponentDot; 293 | GetNextChar; 294 | 295 | while CharInSet(CurrChar, Digits) do 296 | begin 297 | CurrLexem := CurrLexem + CurrChar; 298 | GetNextChar; 299 | end; 300 | 301 | if not CharInSet(CurrChar, ExponentE) then 302 | Exit; 303 | 304 | CurrLexem := CurrLexem + 'E'; 305 | GetNextChar; 306 | 307 | if CharInSet(CurrChar, Signs) then 308 | CurrLexem := CurrLexem + CurrChar; 309 | GetNextChar; 310 | 311 | while CharInSet(CurrChar, Digits) do 312 | begin 313 | CurrLexem := CurrLexem + CurrChar; 314 | GetNextChar; 315 | end; 316 | 317 | end; 318 | 319 | procedure TLexicalAnalyzer.GetOthers; 320 | var 321 | i: integer; 322 | begin 323 | case CurrChar of 324 | '+', '-', '*', '/', ';', '=', ')', '[', ']', ',', '@': 325 | begin 326 | CurrLexem := CurrChar; 327 | GetNextChar; 328 | Exit; 329 | end; 330 | ':': 331 | begin 332 | if NextChar = '=' then 333 | begin 334 | GetNextChar; 335 | GetNextChar; 336 | CurrLexem := ':='; 337 | end 338 | else 339 | begin 340 | GetNextChar; 341 | CurrLexem := ':'; 342 | end; 343 | Exit; 344 | end; 345 | 346 | '.': 347 | begin 348 | if NextChar = '.' then 349 | begin 350 | GetNextChar; 351 | GetNextChar; 352 | CurrLexem := '..'; 353 | end 354 | else if NextChar = ')' then 355 | begin 356 | GetNextChar; 357 | GetNextChar; 358 | CurrLexem := '.)'; 359 | end 360 | else 361 | begin 362 | GetNextChar; 363 | CurrLexem := '.'; 364 | end; 365 | Exit; 366 | end; 367 | '(': 368 | begin 369 | if NextChar = '.' then 370 | begin 371 | GetNextChar; 372 | GetNextChar; 373 | CurrLexem := '(.'; 374 | end 375 | else 376 | begin 377 | GetNextChar; 378 | CurrLexem := '('; 379 | end; 380 | Exit; 381 | end; 382 | '<', '>': 383 | begin 384 | if NextChar = '=' then 385 | begin 386 | CurrLexem := CurrChar + '='; 387 | GetNextChar; 388 | GetNextChar; 389 | end 390 | else if NextChar = '>' then 391 | begin 392 | CurrLexem := CurrChar + '>'; 393 | GetNextChar; 394 | GetNextChar; 395 | end 396 | else 397 | begin 398 | CurrLexem := CurrChar; 399 | GetNextChar; 400 | end; 401 | Exit; 402 | end; 403 | '#': 404 | begin 405 | GetNextChar; 406 | CurrLexem := '#'; 407 | while CharInSet(CurrChar, Digits) do 408 | begin 409 | CurrLexem := CurrLexem + CurrChar; 410 | GetNextChar; 411 | end; 412 | end; 413 | '$': 414 | begin 415 | GetNextChar; 416 | CurrLexem := '$'; 417 | while CharInSet(CurrChar, HexDigits) do 418 | begin 419 | CurrLexem := CurrLexem + CurrChar; 420 | GetNextChar; 421 | end; 422 | end; 423 | '''': 424 | begin 425 | if (StringQuote = sqSingle) or (StringQuote = sqSingleAndDouble) then 426 | begin 427 | // Add('''', CurrPos, 2); 428 | GetNextChar; 429 | while CurrChar <> '''' do 430 | begin 431 | CurrLexem := CurrLexem + CurrChar; 432 | GetNextChar; 433 | end; 434 | if (CurrLexem <> '') then 435 | begin 436 | CurrLexem := PrepareStrValue(CurrLexem); 437 | Add(CurrLexem, CurrPos - Cardinal(Length(CurrLexem)), 2); 438 | CurrLexem := ''; 439 | end 440 | else 441 | begin 442 | CurrLexem := PrepareStrValue(#39+CurrLexem+#39); 443 | Add(CurrLexem, CurrPos - Cardinal(Length(CurrLexem)), 2); 444 | CurrLexem := ''; 445 | end; 446 | // CurrLexem := ''''; 447 | GetNextChar; 448 | { Add('''', CurrPos, 2); 449 | GetNextChar; } 450 | end; 451 | end; 452 | '"': 453 | begin 454 | if (StringQuote = sqDouble) or (StringQuote = sqSingleAndDouble) then 455 | begin 456 | Add('"', CurrPos, 2); 457 | GetNextChar; 458 | while CurrChar <> '"' do 459 | begin 460 | CurrLexem := CurrLexem + CurrChar; 461 | GetNextChar; 462 | end; 463 | if CurrLexem <> '' then 464 | Add(CurrLexem, CurrPos - Cardinal(Length(CurrLexem)), 2); 465 | CurrLexem := '"'; 466 | GetNextChar; 467 | { Add('"', CurrPos, 2); 468 | GetNextChar; } 469 | end; 470 | end; 471 | '{': 472 | begin 473 | if NextChar = '$' then 474 | begin 475 | GetNextChar; 476 | CurrLexem := '{'; 477 | while CurrChar <> '}' do 478 | begin 479 | CurrLexem := CurrLexem + CurrChar; 480 | GetNextChar; 481 | end; 482 | CurrLexem := CurrLexem + '}'; 483 | GetNextChar; 484 | end 485 | else 486 | begin 487 | CurrLexem := ''; 488 | while CurrChar <> '}' do 489 | GetNextChar; 490 | GetNextChar; 491 | end; 492 | end 493 | else 494 | Exit; 495 | end; 496 | end; 497 | 498 | function TLexicalAnalyzer.NextChar: Char; 499 | begin 500 | if CurrPos + 1 > Length(FSource) then 501 | Result := #0 502 | else 503 | Result := FSource[CurrPos + 1]; 504 | end; 505 | 506 | procedure TLexicalAnalyzer.SetSource(src: String); 507 | var 508 | I, j: Integer; 509 | tmp: string; 510 | begin 511 | try 512 | tmp := src; 513 | 514 | j := PosEx(CommentsLine, tmp, 1); 515 | while j > 0 do 516 | begin 517 | I := j + 2; 518 | while (tmp[I] <> #10) and (I <= Length(tmp)) do 519 | Inc(I); 520 | Delete(tmp, j, I - j); 521 | j := PosEx(CommentsLine, tmp, 1); 522 | end; 523 | 524 | 525 | I := 1; 526 | while CharInSet(tmp[I], [' ', #00 .. #13]) do 527 | Inc(I); 528 | Delete(tmp, 1, I - 1); 529 | I := Length(tmp); 530 | while CharInSet(tmp[I], [' ', #00 .. #13]) do 531 | Dec(I); 532 | Delete(tmp, I + 1, Length(tmp) - I + 1); 533 | finally 534 | Self.FSource := tmp; 535 | tmp := ''; 536 | end; 537 | end; 538 | 539 | end. 540 | 541 | -------------------------------------------------------------------------------- /ob_main.lfm: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 251 3 | Height = 588 4 | Top = 143 5 | Width = 586 6 | Caption = 'Form1' 7 | ClientHeight = 588 8 | ClientWidth = 586 9 | OnCreate = FormCreate 10 | LCLVersion = '1.0.4.0' 11 | object ToolBar1: TToolBar 12 | Left = 0 13 | Height = 26 14 | Top = 0 15 | Width = 586 16 | Caption = 'ToolBar1' 17 | Images = BtnList 18 | TabOrder = 0 19 | object ToolButton1: TToolButton 20 | Left = 1 21 | Hint = 'Exit' 22 | Top = 2 23 | Caption = 'ToolButton1' 24 | ImageIndex = 0 25 | OnClick = ToolButton1Click 26 | ParentShowHint = False 27 | ShowHint = True 28 | end 29 | object ToolButton2: TToolButton 30 | Left = 24 31 | Top = 2 32 | Width = 10 33 | Caption = 'ToolButton2' 34 | Style = tbsSeparator 35 | end 36 | object ToolButton3: TToolButton 37 | Left = 34 38 | Hint = 'Load script' 39 | Top = 2 40 | Caption = 'ToolButton3' 41 | ImageIndex = 1 42 | OnClick = ToolButton3Click 43 | ParentShowHint = False 44 | ShowHint = True 45 | end 46 | object ToolButton4: TToolButton 47 | Left = 57 48 | Hint = 'Show obfuscated script' 49 | Top = 2 50 | Caption = 'ToolButton4' 51 | ImageIndex = 2 52 | ParentShowHint = False 53 | ShowHint = True 54 | end 55 | object ToolButton5: TToolButton 56 | Left = 80 57 | Top = 2 58 | Width = 10 59 | Caption = 'ToolButton5' 60 | Style = tbsSeparator 61 | end 62 | object ToolButton6: TToolButton 63 | Left = 90 64 | Hint = 'Obfuscate' 65 | Top = 2 66 | Caption = 'ToolButton6' 67 | ImageIndex = 3 68 | OnClick = ToolButton6Click 69 | end 70 | object ToolButton7: TToolButton 71 | Left = 113 72 | Top = 2 73 | Width = 10 74 | Caption = 'ToolButton7' 75 | Style = tbsSeparator 76 | end 77 | object ToolButton8: TToolButton 78 | Left = 123 79 | Top = 2 80 | Caption = 'ToolButton8' 81 | end 82 | end 83 | object PageControl1: TPageControl 84 | Left = 0 85 | Height = 539 86 | Top = 26 87 | Width = 586 88 | ActivePage = CodeTab 89 | Align = alClient 90 | TabIndex = 0 91 | TabOrder = 1 92 | object CodeTab: TTabSheet 93 | Caption = 'Code' 94 | ClientHeight = 511 95 | ClientWidth = 578 96 | inline CodeMemo: TSynEdit 97 | Left = 0 98 | Height = 511 99 | Top = 0 100 | Width = 578 101 | Align = alClient 102 | Font.Height = -13 103 | Font.Name = 'Courier New' 104 | Font.Pitch = fpFixed 105 | Font.Quality = fqNonAntialiased 106 | ParentColor = False 107 | ParentFont = False 108 | TabOrder = 0 109 | Gutter.Width = 57 110 | Gutter.MouseActions = <> 111 | RightGutter.Width = 0 112 | RightGutter.MouseActions = <> 113 | Highlighter = SynPasSyn1 114 | Keystrokes = < 115 | item 116 | Command = ecUp 117 | ShortCut = 38 118 | end 119 | item 120 | Command = ecSelUp 121 | ShortCut = 8230 122 | end 123 | item 124 | Command = ecScrollUp 125 | ShortCut = 16422 126 | end 127 | item 128 | Command = ecDown 129 | ShortCut = 40 130 | end 131 | item 132 | Command = ecSelDown 133 | ShortCut = 8232 134 | end 135 | item 136 | Command = ecScrollDown 137 | ShortCut = 16424 138 | end 139 | item 140 | Command = ecLeft 141 | ShortCut = 37 142 | end 143 | item 144 | Command = ecSelLeft 145 | ShortCut = 8229 146 | end 147 | item 148 | Command = ecWordLeft 149 | ShortCut = 16421 150 | end 151 | item 152 | Command = ecSelWordLeft 153 | ShortCut = 24613 154 | end 155 | item 156 | Command = ecRight 157 | ShortCut = 39 158 | end 159 | item 160 | Command = ecSelRight 161 | ShortCut = 8231 162 | end 163 | item 164 | Command = ecWordRight 165 | ShortCut = 16423 166 | end 167 | item 168 | Command = ecSelWordRight 169 | ShortCut = 24615 170 | end 171 | item 172 | Command = ecPageDown 173 | ShortCut = 34 174 | end 175 | item 176 | Command = ecSelPageDown 177 | ShortCut = 8226 178 | end 179 | item 180 | Command = ecPageBottom 181 | ShortCut = 16418 182 | end 183 | item 184 | Command = ecSelPageBottom 185 | ShortCut = 24610 186 | end 187 | item 188 | Command = ecPageUp 189 | ShortCut = 33 190 | end 191 | item 192 | Command = ecSelPageUp 193 | ShortCut = 8225 194 | end 195 | item 196 | Command = ecPageTop 197 | ShortCut = 16417 198 | end 199 | item 200 | Command = ecSelPageTop 201 | ShortCut = 24609 202 | end 203 | item 204 | Command = ecLineStart 205 | ShortCut = 36 206 | end 207 | item 208 | Command = ecSelLineStart 209 | ShortCut = 8228 210 | end 211 | item 212 | Command = ecEditorTop 213 | ShortCut = 16420 214 | end 215 | item 216 | Command = ecSelEditorTop 217 | ShortCut = 24612 218 | end 219 | item 220 | Command = ecLineEnd 221 | ShortCut = 35 222 | end 223 | item 224 | Command = ecSelLineEnd 225 | ShortCut = 8227 226 | end 227 | item 228 | Command = ecEditorBottom 229 | ShortCut = 16419 230 | end 231 | item 232 | Command = ecSelEditorBottom 233 | ShortCut = 24611 234 | end 235 | item 236 | Command = ecToggleMode 237 | ShortCut = 45 238 | end 239 | item 240 | Command = ecCopy 241 | ShortCut = 16429 242 | end 243 | item 244 | Command = ecPaste 245 | ShortCut = 8237 246 | end 247 | item 248 | Command = ecDeleteChar 249 | ShortCut = 46 250 | end 251 | item 252 | Command = ecCut 253 | ShortCut = 8238 254 | end 255 | item 256 | Command = ecDeleteLastChar 257 | ShortCut = 8 258 | end 259 | item 260 | Command = ecDeleteLastChar 261 | ShortCut = 8200 262 | end 263 | item 264 | Command = ecDeleteLastWord 265 | ShortCut = 16392 266 | end 267 | item 268 | Command = ecUndo 269 | ShortCut = 32776 270 | end 271 | item 272 | Command = ecRedo 273 | ShortCut = 40968 274 | end 275 | item 276 | Command = ecLineBreak 277 | ShortCut = 13 278 | end 279 | item 280 | Command = ecSelectAll 281 | ShortCut = 16449 282 | end 283 | item 284 | Command = ecCopy 285 | ShortCut = 16451 286 | end 287 | item 288 | Command = ecBlockIndent 289 | ShortCut = 24649 290 | end 291 | item 292 | Command = ecLineBreak 293 | ShortCut = 16461 294 | end 295 | item 296 | Command = ecInsertLine 297 | ShortCut = 16462 298 | end 299 | item 300 | Command = ecDeleteWord 301 | ShortCut = 16468 302 | end 303 | item 304 | Command = ecBlockUnindent 305 | ShortCut = 24661 306 | end 307 | item 308 | Command = ecPaste 309 | ShortCut = 16470 310 | end 311 | item 312 | Command = ecCut 313 | ShortCut = 16472 314 | end 315 | item 316 | Command = ecDeleteLine 317 | ShortCut = 16473 318 | end 319 | item 320 | Command = ecDeleteEOL 321 | ShortCut = 24665 322 | end 323 | item 324 | Command = ecUndo 325 | ShortCut = 16474 326 | end 327 | item 328 | Command = ecRedo 329 | ShortCut = 24666 330 | end 331 | item 332 | Command = ecGotoMarker0 333 | ShortCut = 16432 334 | end 335 | item 336 | Command = ecGotoMarker1 337 | ShortCut = 16433 338 | end 339 | item 340 | Command = ecGotoMarker2 341 | ShortCut = 16434 342 | end 343 | item 344 | Command = ecGotoMarker3 345 | ShortCut = 16435 346 | end 347 | item 348 | Command = ecGotoMarker4 349 | ShortCut = 16436 350 | end 351 | item 352 | Command = ecGotoMarker5 353 | ShortCut = 16437 354 | end 355 | item 356 | Command = ecGotoMarker6 357 | ShortCut = 16438 358 | end 359 | item 360 | Command = ecGotoMarker7 361 | ShortCut = 16439 362 | end 363 | item 364 | Command = ecGotoMarker8 365 | ShortCut = 16440 366 | end 367 | item 368 | Command = ecGotoMarker9 369 | ShortCut = 16441 370 | end 371 | item 372 | Command = ecSetMarker0 373 | ShortCut = 24624 374 | end 375 | item 376 | Command = ecSetMarker1 377 | ShortCut = 24625 378 | end 379 | item 380 | Command = ecSetMarker2 381 | ShortCut = 24626 382 | end 383 | item 384 | Command = ecSetMarker3 385 | ShortCut = 24627 386 | end 387 | item 388 | Command = ecSetMarker4 389 | ShortCut = 24628 390 | end 391 | item 392 | Command = ecSetMarker5 393 | ShortCut = 24629 394 | end 395 | item 396 | Command = ecSetMarker6 397 | ShortCut = 24630 398 | end 399 | item 400 | Command = ecSetMarker7 401 | ShortCut = 24631 402 | end 403 | item 404 | Command = ecSetMarker8 405 | ShortCut = 24632 406 | end 407 | item 408 | Command = ecSetMarker9 409 | ShortCut = 24633 410 | end 411 | item 412 | Command = EcFoldLevel1 413 | ShortCut = 41009 414 | end 415 | item 416 | Command = EcFoldLevel2 417 | ShortCut = 41010 418 | end 419 | item 420 | Command = EcFoldLevel1 421 | ShortCut = 41011 422 | end 423 | item 424 | Command = EcFoldLevel1 425 | ShortCut = 41012 426 | end 427 | item 428 | Command = EcFoldLevel1 429 | ShortCut = 41013 430 | end 431 | item 432 | Command = EcFoldLevel6 433 | ShortCut = 41014 434 | end 435 | item 436 | Command = EcFoldLevel7 437 | ShortCut = 41015 438 | end 439 | item 440 | Command = EcFoldLevel8 441 | ShortCut = 41016 442 | end 443 | item 444 | Command = EcFoldLevel9 445 | ShortCut = 41017 446 | end 447 | item 448 | Command = EcFoldLevel0 449 | ShortCut = 41008 450 | end 451 | item 452 | Command = EcFoldCurrent 453 | ShortCut = 41005 454 | end 455 | item 456 | Command = EcUnFoldCurrent 457 | ShortCut = 41003 458 | end 459 | item 460 | Command = EcToggleMarkupWord 461 | ShortCut = 32845 462 | end 463 | item 464 | Command = ecNormalSelect 465 | ShortCut = 24654 466 | end 467 | item 468 | Command = ecColumnSelect 469 | ShortCut = 24643 470 | end 471 | item 472 | Command = ecLineSelect 473 | ShortCut = 24652 474 | end 475 | item 476 | Command = ecTab 477 | ShortCut = 9 478 | end 479 | item 480 | Command = ecShiftTab 481 | ShortCut = 8201 482 | end 483 | item 484 | Command = ecMatchBracket 485 | ShortCut = 24642 486 | end 487 | item 488 | Command = ecColSelUp 489 | ShortCut = 40998 490 | end 491 | item 492 | Command = ecColSelDown 493 | ShortCut = 41000 494 | end 495 | item 496 | Command = ecColSelLeft 497 | ShortCut = 40997 498 | end 499 | item 500 | Command = ecColSelRight 501 | ShortCut = 40999 502 | end 503 | item 504 | Command = ecColSelPageDown 505 | ShortCut = 40994 506 | end 507 | item 508 | Command = ecColSelPageBottom 509 | ShortCut = 57378 510 | end 511 | item 512 | Command = ecColSelPageUp 513 | ShortCut = 40993 514 | end 515 | item 516 | Command = ecColSelPageTop 517 | ShortCut = 57377 518 | end 519 | item 520 | Command = ecColSelLineStart 521 | ShortCut = 40996 522 | end 523 | item 524 | Command = ecColSelLineEnd 525 | ShortCut = 40995 526 | end 527 | item 528 | Command = ecColSelEditorTop 529 | ShortCut = 57380 530 | end 531 | item 532 | Command = ecColSelEditorBottom 533 | ShortCut = 57379 534 | end> 535 | MouseActions = <> 536 | MouseSelActions = <> 537 | Lines.Strings = ( 538 | '' 539 | ) 540 | VisibleSpecialChars = [vscSpace, vscTabAtLast] 541 | SelectedColor.BackPriority = 50 542 | SelectedColor.ForePriority = 50 543 | SelectedColor.FramePriority = 50 544 | SelectedColor.BoldPriority = 50 545 | SelectedColor.ItalicPriority = 50 546 | SelectedColor.UnderlinePriority = 50 547 | BracketHighlightStyle = sbhsBoth 548 | BracketMatchColor.Background = clNone 549 | BracketMatchColor.Foreground = clNone 550 | BracketMatchColor.Style = [fsBold] 551 | FoldedCodeColor.Background = clNone 552 | FoldedCodeColor.Foreground = clGray 553 | FoldedCodeColor.FrameColor = clGray 554 | MouseLinkColor.Background = clNone 555 | MouseLinkColor.Foreground = clBlue 556 | LineHighlightColor.Background = clNone 557 | LineHighlightColor.Foreground = clNone 558 | inline SynLeftGutterPartList1: TSynGutterPartList 559 | object SynGutterMarks1: TSynGutterMarks 560 | Width = 24 561 | MouseActions = <> 562 | end 563 | object SynGutterLineNumber1: TSynGutterLineNumber 564 | Width = 17 565 | MouseActions = <> 566 | MarkupInfo.Background = clBtnFace 567 | MarkupInfo.Foreground = clNone 568 | DigitCount = 2 569 | ShowOnlyLineNumbersMultiplesOf = 1 570 | ZeroStart = False 571 | LeadingZeros = False 572 | end 573 | object SynGutterChanges1: TSynGutterChanges 574 | Width = 4 575 | MouseActions = <> 576 | ModifiedColor = 59900 577 | SavedColor = clGreen 578 | end 579 | object SynGutterSeparator1: TSynGutterSeparator 580 | Width = 2 581 | MouseActions = <> 582 | end 583 | object SynGutterCodeFolding1: TSynGutterCodeFolding 584 | MouseActions = <> 585 | MarkupInfo.Background = clNone 586 | MarkupInfo.Foreground = clGray 587 | MouseActionsExpanded = <> 588 | MouseActionsCollapsed = <> 589 | end 590 | end 591 | end 592 | end 593 | object ProcCode: TTabSheet 594 | Caption = 'Obfuscated code' 595 | ClientHeight = 511 596 | ClientWidth = 578 597 | inline ObfCode: TSynMemo 598 | Cursor = crIBeam 599 | Left = 0 600 | Height = 511 601 | Top = 0 602 | Width = 578 603 | Align = alClient 604 | Font.Height = -13 605 | Font.Name = 'Courier New' 606 | Font.Pitch = fpFixed 607 | Font.Quality = fqNonAntialiased 608 | ParentColor = False 609 | ParentFont = False 610 | TabOrder = 0 611 | Gutter.Width = 57 612 | Gutter.MouseActions = <> 613 | Highlighter = SynPasSyn1 614 | Keystrokes = < 615 | item 616 | Command = ecUp 617 | ShortCut = 38 618 | end 619 | item 620 | Command = ecSelUp 621 | ShortCut = 8230 622 | end 623 | item 624 | Command = ecScrollUp 625 | ShortCut = 16422 626 | end 627 | item 628 | Command = ecDown 629 | ShortCut = 40 630 | end 631 | item 632 | Command = ecSelDown 633 | ShortCut = 8232 634 | end 635 | item 636 | Command = ecScrollDown 637 | ShortCut = 16424 638 | end 639 | item 640 | Command = ecLeft 641 | ShortCut = 37 642 | end 643 | item 644 | Command = ecSelLeft 645 | ShortCut = 8229 646 | end 647 | item 648 | Command = ecWordLeft 649 | ShortCut = 16421 650 | end 651 | item 652 | Command = ecSelWordLeft 653 | ShortCut = 24613 654 | end 655 | item 656 | Command = ecRight 657 | ShortCut = 39 658 | end 659 | item 660 | Command = ecSelRight 661 | ShortCut = 8231 662 | end 663 | item 664 | Command = ecWordRight 665 | ShortCut = 16423 666 | end 667 | item 668 | Command = ecSelWordRight 669 | ShortCut = 24615 670 | end 671 | item 672 | Command = ecPageDown 673 | ShortCut = 34 674 | end 675 | item 676 | Command = ecSelPageDown 677 | ShortCut = 8226 678 | end 679 | item 680 | Command = ecPageBottom 681 | ShortCut = 16418 682 | end 683 | item 684 | Command = ecSelPageBottom 685 | ShortCut = 24610 686 | end 687 | item 688 | Command = ecPageUp 689 | ShortCut = 33 690 | end 691 | item 692 | Command = ecSelPageUp 693 | ShortCut = 8225 694 | end 695 | item 696 | Command = ecPageTop 697 | ShortCut = 16417 698 | end 699 | item 700 | Command = ecSelPageTop 701 | ShortCut = 24609 702 | end 703 | item 704 | Command = ecLineStart 705 | ShortCut = 36 706 | end 707 | item 708 | Command = ecSelLineStart 709 | ShortCut = 8228 710 | end 711 | item 712 | Command = ecEditorTop 713 | ShortCut = 16420 714 | end 715 | item 716 | Command = ecSelEditorTop 717 | ShortCut = 24612 718 | end 719 | item 720 | Command = ecLineEnd 721 | ShortCut = 35 722 | end 723 | item 724 | Command = ecSelLineEnd 725 | ShortCut = 8227 726 | end 727 | item 728 | Command = ecEditorBottom 729 | ShortCut = 16419 730 | end 731 | item 732 | Command = ecSelEditorBottom 733 | ShortCut = 24611 734 | end 735 | item 736 | Command = ecToggleMode 737 | ShortCut = 45 738 | end 739 | item 740 | Command = ecCopy 741 | ShortCut = 16429 742 | end 743 | item 744 | Command = ecPaste 745 | ShortCut = 8237 746 | end 747 | item 748 | Command = ecDeleteChar 749 | ShortCut = 46 750 | end 751 | item 752 | Command = ecCut 753 | ShortCut = 8238 754 | end 755 | item 756 | Command = ecDeleteLastChar 757 | ShortCut = 8 758 | end 759 | item 760 | Command = ecDeleteLastChar 761 | ShortCut = 8200 762 | end 763 | item 764 | Command = ecDeleteLastWord 765 | ShortCut = 16392 766 | end 767 | item 768 | Command = ecUndo 769 | ShortCut = 32776 770 | end 771 | item 772 | Command = ecRedo 773 | ShortCut = 40968 774 | end 775 | item 776 | Command = ecLineBreak 777 | ShortCut = 13 778 | end 779 | item 780 | Command = ecSelectAll 781 | ShortCut = 16449 782 | end 783 | item 784 | Command = ecCopy 785 | ShortCut = 16451 786 | end 787 | item 788 | Command = ecBlockIndent 789 | ShortCut = 24649 790 | end 791 | item 792 | Command = ecLineBreak 793 | ShortCut = 16461 794 | end 795 | item 796 | Command = ecInsertLine 797 | ShortCut = 16462 798 | end 799 | item 800 | Command = ecDeleteWord 801 | ShortCut = 16468 802 | end 803 | item 804 | Command = ecBlockUnindent 805 | ShortCut = 24661 806 | end 807 | item 808 | Command = ecPaste 809 | ShortCut = 16470 810 | end 811 | item 812 | Command = ecCut 813 | ShortCut = 16472 814 | end 815 | item 816 | Command = ecDeleteLine 817 | ShortCut = 16473 818 | end 819 | item 820 | Command = ecDeleteEOL 821 | ShortCut = 24665 822 | end 823 | item 824 | Command = ecUndo 825 | ShortCut = 16474 826 | end 827 | item 828 | Command = ecRedo 829 | ShortCut = 24666 830 | end 831 | item 832 | Command = ecGotoMarker0 833 | ShortCut = 16432 834 | end 835 | item 836 | Command = ecGotoMarker1 837 | ShortCut = 16433 838 | end 839 | item 840 | Command = ecGotoMarker2 841 | ShortCut = 16434 842 | end 843 | item 844 | Command = ecGotoMarker3 845 | ShortCut = 16435 846 | end 847 | item 848 | Command = ecGotoMarker4 849 | ShortCut = 16436 850 | end 851 | item 852 | Command = ecGotoMarker5 853 | ShortCut = 16437 854 | end 855 | item 856 | Command = ecGotoMarker6 857 | ShortCut = 16438 858 | end 859 | item 860 | Command = ecGotoMarker7 861 | ShortCut = 16439 862 | end 863 | item 864 | Command = ecGotoMarker8 865 | ShortCut = 16440 866 | end 867 | item 868 | Command = ecGotoMarker9 869 | ShortCut = 16441 870 | end 871 | item 872 | Command = ecSetMarker0 873 | ShortCut = 24624 874 | end 875 | item 876 | Command = ecSetMarker1 877 | ShortCut = 24625 878 | end 879 | item 880 | Command = ecSetMarker2 881 | ShortCut = 24626 882 | end 883 | item 884 | Command = ecSetMarker3 885 | ShortCut = 24627 886 | end 887 | item 888 | Command = ecSetMarker4 889 | ShortCut = 24628 890 | end 891 | item 892 | Command = ecSetMarker5 893 | ShortCut = 24629 894 | end 895 | item 896 | Command = ecSetMarker6 897 | ShortCut = 24630 898 | end 899 | item 900 | Command = ecSetMarker7 901 | ShortCut = 24631 902 | end 903 | item 904 | Command = ecSetMarker8 905 | ShortCut = 24632 906 | end 907 | item 908 | Command = ecSetMarker9 909 | ShortCut = 24633 910 | end 911 | item 912 | Command = EcFoldLevel1 913 | ShortCut = 41009 914 | end 915 | item 916 | Command = EcFoldLevel2 917 | ShortCut = 41010 918 | end 919 | item 920 | Command = EcFoldLevel1 921 | ShortCut = 41011 922 | end 923 | item 924 | Command = EcFoldLevel1 925 | ShortCut = 41012 926 | end 927 | item 928 | Command = EcFoldLevel1 929 | ShortCut = 41013 930 | end 931 | item 932 | Command = EcFoldLevel6 933 | ShortCut = 41014 934 | end 935 | item 936 | Command = EcFoldLevel7 937 | ShortCut = 41015 938 | end 939 | item 940 | Command = EcFoldLevel8 941 | ShortCut = 41016 942 | end 943 | item 944 | Command = EcFoldLevel9 945 | ShortCut = 41017 946 | end 947 | item 948 | Command = EcFoldLevel0 949 | ShortCut = 41008 950 | end 951 | item 952 | Command = EcFoldCurrent 953 | ShortCut = 41005 954 | end 955 | item 956 | Command = EcUnFoldCurrent 957 | ShortCut = 41003 958 | end 959 | item 960 | Command = EcToggleMarkupWord 961 | ShortCut = 32845 962 | end 963 | item 964 | Command = ecNormalSelect 965 | ShortCut = 24654 966 | end 967 | item 968 | Command = ecColumnSelect 969 | ShortCut = 24643 970 | end 971 | item 972 | Command = ecLineSelect 973 | ShortCut = 24652 974 | end 975 | item 976 | Command = ecTab 977 | ShortCut = 9 978 | end 979 | item 980 | Command = ecShiftTab 981 | ShortCut = 8201 982 | end 983 | item 984 | Command = ecMatchBracket 985 | ShortCut = 24642 986 | end 987 | item 988 | Command = ecColSelUp 989 | ShortCut = 40998 990 | end 991 | item 992 | Command = ecColSelDown 993 | ShortCut = 41000 994 | end 995 | item 996 | Command = ecColSelLeft 997 | ShortCut = 40997 998 | end 999 | item 1000 | Command = ecColSelRight 1001 | ShortCut = 40999 1002 | end 1003 | item 1004 | Command = ecColSelPageDown 1005 | ShortCut = 40994 1006 | end 1007 | item 1008 | Command = ecColSelPageBottom 1009 | ShortCut = 57378 1010 | end 1011 | item 1012 | Command = ecColSelPageUp 1013 | ShortCut = 40993 1014 | end 1015 | item 1016 | Command = ecColSelPageTop 1017 | ShortCut = 57377 1018 | end 1019 | item 1020 | Command = ecColSelLineStart 1021 | ShortCut = 40996 1022 | end 1023 | item 1024 | Command = ecColSelLineEnd 1025 | ShortCut = 40995 1026 | end 1027 | item 1028 | Command = ecColSelEditorTop 1029 | ShortCut = 57380 1030 | end 1031 | item 1032 | Command = ecColSelEditorBottom 1033 | ShortCut = 57379 1034 | end> 1035 | MouseActions = <> 1036 | MouseSelActions = <> 1037 | ScrollBars = ssVertical 1038 | SelectedColor.BackPriority = 50 1039 | SelectedColor.ForePriority = 50 1040 | SelectedColor.FramePriority = 50 1041 | SelectedColor.BoldPriority = 50 1042 | SelectedColor.ItalicPriority = 50 1043 | SelectedColor.UnderlinePriority = 50 1044 | inline SynLeftGutterPartList1: TSynGutterPartList 1045 | object SynGutterMarks1: TSynGutterMarks 1046 | Width = 24 1047 | MouseActions = <> 1048 | end 1049 | object SynGutterLineNumber1: TSynGutterLineNumber 1050 | Width = 17 1051 | MouseActions = <> 1052 | MarkupInfo.Background = clBtnFace 1053 | MarkupInfo.Foreground = clNone 1054 | DigitCount = 2 1055 | ShowOnlyLineNumbersMultiplesOf = 1 1056 | ZeroStart = False 1057 | LeadingZeros = False 1058 | end 1059 | object SynGutterChanges1: TSynGutterChanges 1060 | Width = 4 1061 | MouseActions = <> 1062 | ModifiedColor = 59900 1063 | SavedColor = clGreen 1064 | end 1065 | object SynGutterSeparator1: TSynGutterSeparator 1066 | Width = 2 1067 | MouseActions = <> 1068 | end 1069 | object SynGutterCodeFolding1: TSynGutterCodeFolding 1070 | MouseActions = <> 1071 | MarkupInfo.Background = clNone 1072 | MarkupInfo.Foreground = clGray 1073 | MouseActionsExpanded = <> 1074 | MouseActionsCollapsed = <> 1075 | end 1076 | end 1077 | end 1078 | end 1079 | object FormatCode: TTabSheet 1080 | Caption = 'Formatted script' 1081 | ClientHeight = 511 1082 | ClientWidth = 578 1083 | TabVisible = False 1084 | inline SynEdit1: TSynEdit 1085 | Left = 0 1086 | Height = 511 1087 | Top = 0 1088 | Width = 578 1089 | Align = alClient 1090 | Font.Height = -13 1091 | Font.Name = 'Courier New' 1092 | Font.Pitch = fpFixed 1093 | Font.Quality = fqNonAntialiased 1094 | ParentColor = False 1095 | ParentFont = False 1096 | TabOrder = 0 1097 | Gutter.Width = 57 1098 | Gutter.MouseActions = <> 1099 | RightGutter.Width = 0 1100 | RightGutter.MouseActions = <> 1101 | Keystrokes = < 1102 | item 1103 | Command = ecUp 1104 | ShortCut = 38 1105 | end 1106 | item 1107 | Command = ecSelUp 1108 | ShortCut = 8230 1109 | end 1110 | item 1111 | Command = ecScrollUp 1112 | ShortCut = 16422 1113 | end 1114 | item 1115 | Command = ecDown 1116 | ShortCut = 40 1117 | end 1118 | item 1119 | Command = ecSelDown 1120 | ShortCut = 8232 1121 | end 1122 | item 1123 | Command = ecScrollDown 1124 | ShortCut = 16424 1125 | end 1126 | item 1127 | Command = ecLeft 1128 | ShortCut = 37 1129 | end 1130 | item 1131 | Command = ecSelLeft 1132 | ShortCut = 8229 1133 | end 1134 | item 1135 | Command = ecWordLeft 1136 | ShortCut = 16421 1137 | end 1138 | item 1139 | Command = ecSelWordLeft 1140 | ShortCut = 24613 1141 | end 1142 | item 1143 | Command = ecRight 1144 | ShortCut = 39 1145 | end 1146 | item 1147 | Command = ecSelRight 1148 | ShortCut = 8231 1149 | end 1150 | item 1151 | Command = ecWordRight 1152 | ShortCut = 16423 1153 | end 1154 | item 1155 | Command = ecSelWordRight 1156 | ShortCut = 24615 1157 | end 1158 | item 1159 | Command = ecPageDown 1160 | ShortCut = 34 1161 | end 1162 | item 1163 | Command = ecSelPageDown 1164 | ShortCut = 8226 1165 | end 1166 | item 1167 | Command = ecPageBottom 1168 | ShortCut = 16418 1169 | end 1170 | item 1171 | Command = ecSelPageBottom 1172 | ShortCut = 24610 1173 | end 1174 | item 1175 | Command = ecPageUp 1176 | ShortCut = 33 1177 | end 1178 | item 1179 | Command = ecSelPageUp 1180 | ShortCut = 8225 1181 | end 1182 | item 1183 | Command = ecPageTop 1184 | ShortCut = 16417 1185 | end 1186 | item 1187 | Command = ecSelPageTop 1188 | ShortCut = 24609 1189 | end 1190 | item 1191 | Command = ecLineStart 1192 | ShortCut = 36 1193 | end 1194 | item 1195 | Command = ecSelLineStart 1196 | ShortCut = 8228 1197 | end 1198 | item 1199 | Command = ecEditorTop 1200 | ShortCut = 16420 1201 | end 1202 | item 1203 | Command = ecSelEditorTop 1204 | ShortCut = 24612 1205 | end 1206 | item 1207 | Command = ecLineEnd 1208 | ShortCut = 35 1209 | end 1210 | item 1211 | Command = ecSelLineEnd 1212 | ShortCut = 8227 1213 | end 1214 | item 1215 | Command = ecEditorBottom 1216 | ShortCut = 16419 1217 | end 1218 | item 1219 | Command = ecSelEditorBottom 1220 | ShortCut = 24611 1221 | end 1222 | item 1223 | Command = ecToggleMode 1224 | ShortCut = 45 1225 | end 1226 | item 1227 | Command = ecCopy 1228 | ShortCut = 16429 1229 | end 1230 | item 1231 | Command = ecPaste 1232 | ShortCut = 8237 1233 | end 1234 | item 1235 | Command = ecDeleteChar 1236 | ShortCut = 46 1237 | end 1238 | item 1239 | Command = ecCut 1240 | ShortCut = 8238 1241 | end 1242 | item 1243 | Command = ecDeleteLastChar 1244 | ShortCut = 8 1245 | end 1246 | item 1247 | Command = ecDeleteLastChar 1248 | ShortCut = 8200 1249 | end 1250 | item 1251 | Command = ecDeleteLastWord 1252 | ShortCut = 16392 1253 | end 1254 | item 1255 | Command = ecUndo 1256 | ShortCut = 32776 1257 | end 1258 | item 1259 | Command = ecRedo 1260 | ShortCut = 40968 1261 | end 1262 | item 1263 | Command = ecLineBreak 1264 | ShortCut = 13 1265 | end 1266 | item 1267 | Command = ecSelectAll 1268 | ShortCut = 16449 1269 | end 1270 | item 1271 | Command = ecCopy 1272 | ShortCut = 16451 1273 | end 1274 | item 1275 | Command = ecBlockIndent 1276 | ShortCut = 24649 1277 | end 1278 | item 1279 | Command = ecLineBreak 1280 | ShortCut = 16461 1281 | end 1282 | item 1283 | Command = ecInsertLine 1284 | ShortCut = 16462 1285 | end 1286 | item 1287 | Command = ecDeleteWord 1288 | ShortCut = 16468 1289 | end 1290 | item 1291 | Command = ecBlockUnindent 1292 | ShortCut = 24661 1293 | end 1294 | item 1295 | Command = ecPaste 1296 | ShortCut = 16470 1297 | end 1298 | item 1299 | Command = ecCut 1300 | ShortCut = 16472 1301 | end 1302 | item 1303 | Command = ecDeleteLine 1304 | ShortCut = 16473 1305 | end 1306 | item 1307 | Command = ecDeleteEOL 1308 | ShortCut = 24665 1309 | end 1310 | item 1311 | Command = ecUndo 1312 | ShortCut = 16474 1313 | end 1314 | item 1315 | Command = ecRedo 1316 | ShortCut = 24666 1317 | end 1318 | item 1319 | Command = ecGotoMarker0 1320 | ShortCut = 16432 1321 | end 1322 | item 1323 | Command = ecGotoMarker1 1324 | ShortCut = 16433 1325 | end 1326 | item 1327 | Command = ecGotoMarker2 1328 | ShortCut = 16434 1329 | end 1330 | item 1331 | Command = ecGotoMarker3 1332 | ShortCut = 16435 1333 | end 1334 | item 1335 | Command = ecGotoMarker4 1336 | ShortCut = 16436 1337 | end 1338 | item 1339 | Command = ecGotoMarker5 1340 | ShortCut = 16437 1341 | end 1342 | item 1343 | Command = ecGotoMarker6 1344 | ShortCut = 16438 1345 | end 1346 | item 1347 | Command = ecGotoMarker7 1348 | ShortCut = 16439 1349 | end 1350 | item 1351 | Command = ecGotoMarker8 1352 | ShortCut = 16440 1353 | end 1354 | item 1355 | Command = ecGotoMarker9 1356 | ShortCut = 16441 1357 | end 1358 | item 1359 | Command = ecSetMarker0 1360 | ShortCut = 24624 1361 | end 1362 | item 1363 | Command = ecSetMarker1 1364 | ShortCut = 24625 1365 | end 1366 | item 1367 | Command = ecSetMarker2 1368 | ShortCut = 24626 1369 | end 1370 | item 1371 | Command = ecSetMarker3 1372 | ShortCut = 24627 1373 | end 1374 | item 1375 | Command = ecSetMarker4 1376 | ShortCut = 24628 1377 | end 1378 | item 1379 | Command = ecSetMarker5 1380 | ShortCut = 24629 1381 | end 1382 | item 1383 | Command = ecSetMarker6 1384 | ShortCut = 24630 1385 | end 1386 | item 1387 | Command = ecSetMarker7 1388 | ShortCut = 24631 1389 | end 1390 | item 1391 | Command = ecSetMarker8 1392 | ShortCut = 24632 1393 | end 1394 | item 1395 | Command = ecSetMarker9 1396 | ShortCut = 24633 1397 | end 1398 | item 1399 | Command = EcFoldLevel1 1400 | ShortCut = 41009 1401 | end 1402 | item 1403 | Command = EcFoldLevel2 1404 | ShortCut = 41010 1405 | end 1406 | item 1407 | Command = EcFoldLevel1 1408 | ShortCut = 41011 1409 | end 1410 | item 1411 | Command = EcFoldLevel1 1412 | ShortCut = 41012 1413 | end 1414 | item 1415 | Command = EcFoldLevel1 1416 | ShortCut = 41013 1417 | end 1418 | item 1419 | Command = EcFoldLevel6 1420 | ShortCut = 41014 1421 | end 1422 | item 1423 | Command = EcFoldLevel7 1424 | ShortCut = 41015 1425 | end 1426 | item 1427 | Command = EcFoldLevel8 1428 | ShortCut = 41016 1429 | end 1430 | item 1431 | Command = EcFoldLevel9 1432 | ShortCut = 41017 1433 | end 1434 | item 1435 | Command = EcFoldLevel0 1436 | ShortCut = 41008 1437 | end 1438 | item 1439 | Command = EcFoldCurrent 1440 | ShortCut = 41005 1441 | end 1442 | item 1443 | Command = EcUnFoldCurrent 1444 | ShortCut = 41003 1445 | end 1446 | item 1447 | Command = EcToggleMarkupWord 1448 | ShortCut = 32845 1449 | end 1450 | item 1451 | Command = ecNormalSelect 1452 | ShortCut = 24654 1453 | end 1454 | item 1455 | Command = ecColumnSelect 1456 | ShortCut = 24643 1457 | end 1458 | item 1459 | Command = ecLineSelect 1460 | ShortCut = 24652 1461 | end 1462 | item 1463 | Command = ecTab 1464 | ShortCut = 9 1465 | end 1466 | item 1467 | Command = ecShiftTab 1468 | ShortCut = 8201 1469 | end 1470 | item 1471 | Command = ecMatchBracket 1472 | ShortCut = 24642 1473 | end 1474 | item 1475 | Command = ecColSelUp 1476 | ShortCut = 40998 1477 | end 1478 | item 1479 | Command = ecColSelDown 1480 | ShortCut = 41000 1481 | end 1482 | item 1483 | Command = ecColSelLeft 1484 | ShortCut = 40997 1485 | end 1486 | item 1487 | Command = ecColSelRight 1488 | ShortCut = 40999 1489 | end 1490 | item 1491 | Command = ecColSelPageDown 1492 | ShortCut = 40994 1493 | end 1494 | item 1495 | Command = ecColSelPageBottom 1496 | ShortCut = 57378 1497 | end 1498 | item 1499 | Command = ecColSelPageUp 1500 | ShortCut = 40993 1501 | end 1502 | item 1503 | Command = ecColSelPageTop 1504 | ShortCut = 57377 1505 | end 1506 | item 1507 | Command = ecColSelLineStart 1508 | ShortCut = 40996 1509 | end 1510 | item 1511 | Command = ecColSelLineEnd 1512 | ShortCut = 40995 1513 | end 1514 | item 1515 | Command = ecColSelEditorTop 1516 | ShortCut = 57380 1517 | end 1518 | item 1519 | Command = ecColSelEditorBottom 1520 | ShortCut = 57379 1521 | end> 1522 | MouseActions = <> 1523 | MouseSelActions = <> 1524 | Lines.Strings = ( 1525 | 'SynEdit1' 1526 | ) 1527 | VisibleSpecialChars = [vscSpace, vscTabAtLast] 1528 | SelectedColor.BackPriority = 50 1529 | SelectedColor.ForePriority = 50 1530 | SelectedColor.FramePriority = 50 1531 | SelectedColor.BoldPriority = 50 1532 | SelectedColor.ItalicPriority = 50 1533 | SelectedColor.UnderlinePriority = 50 1534 | BracketHighlightStyle = sbhsBoth 1535 | BracketMatchColor.Background = clNone 1536 | BracketMatchColor.Foreground = clNone 1537 | BracketMatchColor.Style = [fsBold] 1538 | FoldedCodeColor.Background = clNone 1539 | FoldedCodeColor.Foreground = clGray 1540 | FoldedCodeColor.FrameColor = clGray 1541 | MouseLinkColor.Background = clNone 1542 | MouseLinkColor.Foreground = clBlue 1543 | LineHighlightColor.Background = clNone 1544 | LineHighlightColor.Foreground = clNone 1545 | inline SynLeftGutterPartList1: TSynGutterPartList 1546 | object SynGutterMarks1: TSynGutterMarks 1547 | Width = 24 1548 | MouseActions = <> 1549 | end 1550 | object SynGutterLineNumber1: TSynGutterLineNumber 1551 | Width = 17 1552 | MouseActions = <> 1553 | MarkupInfo.Background = clBtnFace 1554 | MarkupInfo.Foreground = clNone 1555 | DigitCount = 2 1556 | ShowOnlyLineNumbersMultiplesOf = 1 1557 | ZeroStart = False 1558 | LeadingZeros = False 1559 | end 1560 | object SynGutterChanges1: TSynGutterChanges 1561 | Width = 4 1562 | MouseActions = <> 1563 | ModifiedColor = 59900 1564 | SavedColor = clGreen 1565 | end 1566 | object SynGutterSeparator1: TSynGutterSeparator 1567 | Width = 2 1568 | MouseActions = <> 1569 | end 1570 | object SynGutterCodeFolding1: TSynGutterCodeFolding 1571 | MouseActions = <> 1572 | MarkupInfo.Background = clNone 1573 | MarkupInfo.Foreground = clGray 1574 | MouseActionsExpanded = <> 1575 | MouseActionsCollapsed = <> 1576 | end 1577 | end 1578 | end 1579 | end 1580 | end 1581 | object StatusBar1: TStatusBar 1582 | Left = 0 1583 | Height = 23 1584 | Top = 565 1585 | Width = 586 1586 | Panels = <> 1587 | end 1588 | object OpenDialog1: TOpenDialog 1589 | Filter = 'Scripts|*.simba|*.scar' 1590 | left = 206 1591 | top = 140 1592 | end 1593 | object BtnList: TImageList 1594 | left = 434 1595 | top = 62 1596 | Bitmap = { 1597 | 4C69040000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1598 | FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1599 | FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF001C1C964C26268DB3323291C13232 1600 | 90C1333391C1333391C1343492C1353592C1353592C1353592C1363692C13737 1601 | 93C12D2D90B71919803FFFFFFF00FFFFFF00363697D9ACACDEFFAAAADBFFACAC 1602 | DEFFAFAFE1FFB3B3E5FFB0B0E4FFB3B3E7FFBDBDEDFFBFBFEEFFC3C3EFFFC5C5 1603 | F0FFD1D1F7FF8C8CB1CCFFFFFF00FFFFFF003737A5FF7878C3FF7676C4FF7676 1604 | C8FF7171C7FF7B7BCFFFF1F1FBFFF6F6FDFF8383D8FF8080D7FF8989E0FF8F8F 1605 | E1FF9696E5FF4444BAFFFFFFFF00FFFFFF002E2EA3FF6B6BC3FF6464C3FF7171 1606 | C6FFAFAFD7FF8585D4FFE7E7F8FFE9E9FAFFA5A5E1FFD0D0E8FF8787DEFF7B7B 1607 | E5FF8D8DEAFF3535BAFFFFFFFF00FFFFFF002828A2FF5959C1FF6161C2FFDDDD 1608 | EEFFFFFFFFFF9393E0FFE1E1F7FFE6E6F9FFA0A0EBFFFFFFFFFFE9E9F6FF8383 1609 | E6FF6363EDFF1717B9FFFFFFFF00FFFFFF002424A2FF4141BCFFAAAADEFFFFFF 1610 | FFFF9F9FE5FF4A4AD0FFEEEEFBFFF4F4FDFF5454E0FF9595EFFFFFFFFFFFC5C5 1611 | F4FF0E10E7FF1617BBFFFFFFFF00FFFFFF001F1FA3FF3A3ABCFFE3E3F5FFEFEF 1612 | FBFF4343CEFF3D3DD2FF9B9BEBFF9E9EEFFF4949E3FF4A4AE9FFDEDEFCFFEFF0 1613 | FDFF1E24EAFF1C1FBDFFFFFFFF00FFFFFF001B1BA4FF3333BEFFEFEFFAFFDCDC 1614 | F6FF2C2CCBFF3636D4FF3232D9FF3636DFFF3938E6FF1213E6FFB5B6F7FFFFFF 1615 | FFFF333CEEFF1E23BEFFFFFFFF00FFFFFF001717A6FF1717B9FFD3D3F2FFF6F6 1616 | FCFF3333CFFF1E1ED4FF1F1FDAFF1313DEFF0000E3FF070AE3FFE4E4FAFFEBEC 1617 | FEFF2935EEFF2228C0FFFFFFFF00FFFFFF001212A8FF0101B3FF6969D6FFFFFF 1618 | FFFFADADE9FF0A0ACEFF0000D5FF0000DDFF0202E0FF9597EEFFFFFFFFFF9399 1619 | F6FF1D2BEDFF252CC1FFFFFFFF00FFFFFF001010AAFF0000B5FF0101BBFF8E8E 1620 | E5FFFFFFFFFFDFDFF6FF9090E9FF8B8BEBFFD4D4F6FFFFFFFFFFADB1F8FF202C 1621 | EBFF2A39EFFF262DC3FFFFFFFF00FFFFFF001010ADFF0000B5FF0000BEFF0000 1622 | C3FF6C6CE1FFD8D8F9FFFFFFFFFFFFFFFFFFE3E3FDFF8588F3FF1822E9FF1F2B 1623 | EBFF2D3CEFFF272EC4FFFFFFFF00FFFFFF001C1CAEF90605C1FF0000C2FF0000 1624 | C9FF0000CEFF0000D9FF1818E4FF1A1AEAFF0C0FEBFF060CECFF1A24EFFF2430 1625 | F1FF3243FBFF2A2FBDFFFFFFFF00FFFFFF000C0C3A641F1FA3FF1F1FA3FF1F1F 1626 | A3FF1F1FA3FF1F1FA3FF1F1FA3FF1F1FA3FF1F1FA3FF1F1FA3FF1F1FA3FF1F1F 1627 | A3FF1F1FA3FF1010447A00000001FFFFFF00000000000000001E000005300000 1628 | 052F0000052F0000052F0000052F0000052F0000052F0000052F0000052F0000 1629 | 0530000000220000000000000000000000000000000000000000000000000000 1630 | 0000000000000000000000000000000000000000000000000000000000000000 1631 | 0000000000000000000000000000000000000000000000000000000000000000 1632 | 000000000000000000000000000000000000BC8C8468C69C96D15C413C180000 1633 | 0000000000000000000000000000000000000000000000000000000000000000 1634 | 00000000000000000000BB8D8524CDAAA3C0F0E0DEFFF7EDECFFAA7D75A00000 1635 | 0006000000000000000000000000CC6F2E70E3B48EE1E2B084E1E2AC7CE1DD99 1636 | 61E1B24D0E74C0969076E1CAC6F7FDF6F6FFFAEEEEFFF6EAEAFFE4CAC7FC8254 1637 | 4C4C000000020000000000000000D4804880FFFADEFFFFF2C9FFFFECC0FFF5D8 1638 | AFFFD7B1A0FFF7F0EFFFFFFAFAFFFCF4F4FFFAEEEEFFF6E9E9FFF7EDEDFFC28F 1639 | 82E8802C03360000000000000000D27E4680FFF9DCFFFFF0C8FFE4C7AEFFE8D7 1640 | D4FFFFFFFFFFFFFEFEFFFFFAFAFFFCF4F4FFFAEEEEFFF2E1DEFFE4BCABFFE0B6 1641 | A4FF9A4B2A9FA1340046A5330037D27A4280FFF8D8FFFEEEC6FFDFC8C0FFFFFF 1642 | FFFFFFFFFFFFFFFEFEFFFFFAFAFFFCF4F4FFF8ECEBFFCF7E50FFEAA878FFEEA6 1643 | 72FFEAA06DFFDF8B54E5A53904C3D0783D80FFF6D5FFFFEDC3FFD4854EFFE3AA 1644 | 84FFE4AA83FFE2A77EFFE0A278FFDF9D72FFDC9569FFF4BA8AFFFFA257FFFF9E 1645 | 50FFF7954CFFBE3A08F68326008DCE743980FFF4D2FFECBE8AFFEECDB1FFF5E6 1646 | DAFFFFFFE8FFFFF2CEFFFFD8ABFFFCBD87FFF8A466FFF48E4CFFEC7E3DFFD75E 1647 | 28FFB72A05F0AC2600ED4914004BCE713480FFF3CEFFDC9257FFFFFCEDFFFEF1 1648 | D0FFF8D9B1FFFEC897FFF8AB76FFF29056FFE67033FFD56D0FFFC2490AFFC147 1649 | 04FFB01D00E4A32700D900000024CC6E3080FEEAC1FFDE9E70FFFFF4D5FFFFE0 1650 | ACFFFAC38DFFFBB985FFF8A46CFFE77D42FFE28E05FFEBA805FFDB8411FFDD8B 1651 | 11FFC35905F8932B01B500000014CC6A2B80E7AF78FFF2D4BCFFFFF4E2FFFFEE 1652 | D9FFFCE0C9FFF4CEB6FFF0C3AAFFD48754FFF19B01FFDB8230FFCE8052FFD182 1653 | 39FFE89E2BFFAD4E05C76C1D0118CA682780DA8A50FFFFFFFFFFFFFFFFFFFFFF 1654 | FFFFFCF8F8FFF6F0F0FFF0E7E7FFDE8A44FFFEA000FFE5A258FFD6C4C4FFD0BB 1655 | B9FFE3B03FFDF9AC16FFA93B006BC0541280DFA681FFFFFFFFFFFFFFFFFFFFFF 1656 | FFFFFEFCFCFFF5F1F0FFEBE5E4FFD6B4A7FFDC751DFFFA9404FFDDA261FFC8AE 1657 | 9BFFD1862DE0F7960DFFB5430084AE400043A5542399A65F359CA55C349CA35B 1658 | 339CA158309C9D532C9C994E289C9548219ED97802F5F59300FFFE9400FFFD87 1659 | 07FEFE8804FFEF8500FFB84A008200000000000000080000000A0000000A0000 1660 | 000A0000000A0000000A0000000A0000000AA245035799380256E48F00E9EB7D 1661 | 00F5EDAF00F9C75300D58E1D0005BC6B3671BC6B3690BC6B36CCBC6B36EEBC6B 1662 | 36FABB6B36FEBB6B36FFBB6A36FFBB6A36FFBC6C39FFBD6E3BFFBB6D3AFFBB6B 1663 | 38EFBB703ECBB6693554FFFFFF00BC6B369BF6E0D1FFF7E0D1FFFEFBF8FFFEFB 1664 | F7FFFDF9F6FFFCF5F0FFFAF0EAFFFBF2EDFFFDF9F6FFFDFAF7FFFBF1EBFFF8E9 1665 | DFFEECD0BDFBC9895EECB5693563BC6B36D8F6DFD1FFE9AA80FFFEFAF6FFFDFA 1666 | F6FFC88C64FFFBF3EEFFFBF1EAFFFCF6F2FFFEFBF8FFFCF6F1FFF9ECE2FFF8E7 1667 | DBFFEED0BAFFECD0BDFFBB703EF8BC6B36F0F6DFD0FFE8A87EFFFCF6F1FFFCF6 1668 | F1FFC88C64FFFAF1E9FFFBF4EEFFFDFAF7FFFDF9F6FFFAF0E8FFF8E8DDFFF7E6 1669 | DBFFE1A37AFFEFD5C3FFB76935FEBC6B36FAF5DDCCFFE7A87EFFFAF0E8FFFAF0 1670 | E8FFC98D66FFFAF0E9FFFDF8F3FFFEFAF8FFFCF4EFFFF9E9DFFFF7E7DBFFF7E5 1671 | D9FFE0A278FFE7C2A9FFB66835FFBB6B36FEF4DCC9FFE7A77DFFF9ECE1FFF9EC 1672 | E1FFF9EDE3FFFCF4EEFFFDFAF7FFFDF7F3FFFAEDE5FFF7E7DBFFF7E5D9FFF6E5 1673 | D8FFDEA077FFE4BEA4FFB46734FFBB6B36FFF4D9C7FFE6A67DFFC88C64FFC98D 1674 | 65FFC98E67FFCB926CFFCB926DFFCA9069FFC88C65FFC88C64FFC88C64FFC88C 1675 | 64FFDA9C74FFE1BA9FFFB36634FFBB6A36FFF2D8C5FFE3A47BFFE3A37AFFE3A4 1676 | 7AFFE2A47BFFE2A37BFFE1A37BFFE1A279FFDFA077FFDE9F76FFDD9E74FFDB9C 1677 | 72FFDC9D74FFDDB59AFFB16534FFBB6A36FFF2D5C2FFE3A37AFFE3A37AFFE2A3 1678 | 7BFFE2A37BFFE2A47BFFE1A279FFE0A178FFDEA077FFDE9E75FFDC9D74FFDA9B 1679 | 73FFD99B73FFDAB095FFAF6433FFBB6A36FFF0D2BEFFE2A37AFFE2A37AFFE1A3 1680 | 7AFFE2A37BFFE1A37BFFE0A178FFDE9F77FFDD9F76FFDC9D74FFD99B72FFD899 1681 | 71FFD69970FFD5AB8EFFAD6333FFBA6A36FFEFD0BBFFE2A27AFFFEFBF8FFFEFB 1682 | F8FFFEFBF8FFFEFBF8FFFEFBF8FFFEFBF8FFFEFBF8FFFEFBF8FFFEFBF8FFFEFB 1683 | F8FFD3966DFFD2A78AFFAB6232FFBB6B38FFEFCEB8FFE1A279FFFEFAF7FF62C0 1684 | 88FF62C088FF62C088FF62C088FF62C088FF62C088FF62C088FF62C088FFFDF9 1685 | F6FFCF936AFFCEA384FFAA6132FFBB6C38FFEECCB6FFE1A27AFFFEFAF7FFBFDC 1686 | C2FFBFDCC2FFBFDCC2FFBFDCC2FFBFDCC2FFBFDCC2FFBFDCC2FFBFDCC2FFFDF9 1687 | F6FFCD9068FFCC9E81FFA86132FFBA6B37FEEDCAB3FFE0A27AFFFEFAF7FF62C0 1688 | 88FF62C088FF62C088FF62C088FF62C088FF62C088FF62C088FF62C088FFFDF9 1689 | F6FFCA8D65FFC99B7CFFA76031FEBA6A35DEEBC6ADFFEAC5ADFFFEFBF8FFFEFB 1690 | F8FFFEFBF8FFFEFBF8FFFEFBF8FFFEFBF8FFFEFBF8FFFEFBF8FFFEFBF8FFFEFB 1691 | F8FFC89A7CFFC79879FFA76031EDBA6A3600B96935B5B86935EEB76835FFB568 1692 | 35FFB46734FFB26634FFB06533FFAE6433FFAC6332FFAA6232FFA96132FFA860 1693 | 31FFA76031FEA66031F1A86131C40276B000037CB919037FBD64037FBD84037F 1694 | BD84037FBD64037CB9190101E5560101E556037CB919037FBD64037FBD84037F 1695 | BD84037FBD64037CB9190276B0000271A91C0E7BB19864BAE0D492D8F8F68AD1 1696 | F1F63886ADE8187FB2B60101E3A70101E3A7187FB2B63886ADE88AD1F1F692D8 1697 | F8F664BAE0D40E7BB1980271A91C01679B7B5DAFD3DD8BCFEFFF73B8DAFF3D81 1698 | A3FF8FAFB6FFCCDBDAFFF0F0E9FFF0F0E9FFCCDBDAFF8FAFB6FF3D81A3FF73B8 1699 | DAFF8BCFEFFF5DAFD3DD01679B7B016191AE5FB1D2F955A0C2FF35799BFFBBBB 1700 | AAFFE7E7DBFFF1F1EBFFC1C1BEFFF1F1EBFFF1F1EBFFE7E7DBFFBBBBAAFF3579 1701 | 9BFF55A0C2FF5FB1D2F9016191AE005B88B74DA9CFFA2D7193FFBBBBAAFFE0E0 1702 | D0FFF0F0E9FFF1F1EBFF8C8C8CFFF1F1EBFFF1F1EBFFF0F0E9FFE0E0D0FFBBBB 1703 | AAFF2D7193FF4DA9CFFA005B88B70056828D1F688DF383A1A8FFDDDDCCFFE6E6 1704 | DAFFF1F1EBFFF1F1EBFF848484FFF1F1EBFFF1F1EBFFF1F1EBFFE6E6DAFFDFDF 1705 | CEFF83A2A8FF1F688DF30056828D00558123005580CCBDCBC7FFDDDDCCFFDDDD 1706 | CCFFDDDDCCFFDDDDCCFF5C5C5CFFDDDDCCFFDDDDCCFFDDDDCCFFDDDDCCFFDDDD 1707 | CCFFC2D0CEFF005580CC00558123012BA6000101CCB6D7D7CFFCDDDDCCFFDDDD 1708 | CCFFF1F1EBFFF1F1EBFF4F4F4FFFF1F1EBFFF1F1EBFFF1F1EBFFEFEFE7FFDDDD 1709 | CCFFDEDED9FC0101CCB6012BA6000101C8000101C8B0D9D9D1FCDDDDCCFFF1F1 1710 | EBFFF1F1EBFF353535FF777777FF484848FF555555FF626262FF6E6E6EFFA9A9 1711 | A0FFE0E0DBFC0101C8B00101C8000101C3000101C397BCBCD3F1DDDDCCFFF1F1 1712 | EBFFF1F1EBFFDFDFDCFF383838FFDFDFDCFFDFDFDCFFDFDFDCFFDFDFDBFFDFB2 1713 | 77FFCCB0A3F40101C3970101C3000101BE000101BE636F6FCEDAE0E0D0FFEFEF 1714 | E7FFF1F1EBFFF1F1EBFFDFDFDCFFF1F1EBFFF1F1EBFFF1F1EBFFEFEFE7FFE0A4 1715 | 57FFCF9154F87A5174936A4477000101B8000101B6181212B8B4C4C4D8F3EDED 1716 | E4FFF1F1EBFFF1F1EBFFF1F1EBFFDEB179FFD89C54FFD89C54FFD79B53FFD194 1717 | 51FDFFE597FFCD8431D1D0852D5C00005900000086000000AC492121B3C6CCCC 1718 | E3F4F3F3EEFFF1F1EBFFF1F1EBFFCC914BFFFFE392FFFFD56AFFFFD15DFFFFD1 1719 | 5DFFFFD15DFFFFD873FFC37923CC0000000000000000151515420F0F50A91212 1720 | A7BB7676CAE0CCCCE7F4EFEFF2FDCEA171FEBA7D40FDAB6E39F99C5D2FF29D5D 1721 | 21EEFFC538FFB56A18CCB76C195C000000070000002909090976070707600000 1722 | 2B4300006F7F000094AA000099C3000099C3000094AA00006F7F00002B439A55 1723 | 0DDF97530DE4673A09750000000700000000000000150000001A0000001A0000 1724 | 001A0000001A0000001A0000001A0000001A0000001A0000001A0000001A974E 1725 | 069E834405680000001500000000 1726 | } 1727 | end 1728 | object SynPasSyn1: TSynPasSyn 1729 | Enabled = False 1730 | AsmAttri.FrameEdges = sfeAround 1731 | CommentAttri.FrameEdges = sfeAround 1732 | IDEDirectiveAttri.FrameEdges = sfeAround 1733 | IdentifierAttri.FrameEdges = sfeAround 1734 | KeyAttri.FrameEdges = sfeAround 1735 | NumberAttri.FrameEdges = sfeAround 1736 | SpaceAttri.FrameEdges = sfeAround 1737 | StringAttri.FrameEdges = sfeAround 1738 | SymbolAttri.FrameEdges = sfeAround 1739 | CaseLabelAttri.FrameEdges = sfeAround 1740 | DirectiveAttri.FrameEdges = sfeAround 1741 | CompilerMode = pcmDelphi 1742 | NestedComments = False 1743 | left = 294 1744 | top = 192 1745 | end 1746 | end 1747 | -------------------------------------------------------------------------------- /ob_main.pas: -------------------------------------------------------------------------------- 1 | unit ob_main; 2 | {** 3 | * This file is part of the Obfuscator for PascalScript. 4 | * Simba Obfuscator. is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Simba Obfuscator. is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Simba Obfuscator. If not, see <http://www.gnu.org/licenses/>. 16 | *} 17 | 18 | {$mode objfpc}{$H+} 19 | 20 | interface 21 | 22 | uses 23 | Classes, SysUtils, FileUtil, SynEdit, SynHighlighterPas, SynMemo, Forms, 24 | Controls, Graphics, Dialogs, ExtCtrls, ComCtrls; 25 | 26 | type 27 | 28 | { TForm1 } 29 | 30 | TForm1 = class(TForm) 31 | BtnList: TImageList; 32 | OpenDialog1: TOpenDialog; 33 | PageControl1: TPageControl; 34 | StatusBar1: TStatusBar; 35 | CodeMemo: TSynEdit; 36 | CodeTab: TTabSheet; 37 | ProcCode: TTabSheet; 38 | SynEdit1: TSynEdit; 39 | ObfCode: TSynMemo; 40 | SynPasSyn1: TSynPasSyn; 41 | FormatCode: TTabSheet; 42 | ToolBar1: TToolBar; 43 | ToolButton1: TToolButton; 44 | ToolButton2: TToolButton; 45 | ToolButton3: TToolButton; 46 | ToolButton4: TToolButton; 47 | ToolButton5: TToolButton; 48 | ToolButton6: TToolButton; 49 | ToolButton7: TToolButton; 50 | ToolButton8: TToolButton; 51 | procedure FormCreate(Sender: TObject); 52 | procedure ToolButton1Click(Sender: TObject); 53 | procedure ToolButton3Click(Sender: TObject); 54 | procedure ToolButton6Click(Sender: TObject); 55 | private 56 | { private declarations } 57 | public 58 | { public declarations } 59 | end; 60 | 61 | var 62 | Form1: TForm1; 63 | 64 | implementation 65 | uses ob_obfuscator; 66 | {$R *.lfm} 67 | 68 | { TForm1 } 69 | 70 | procedure TForm1.ToolButton1Click(Sender: TObject); 71 | begin 72 | Application.Terminate; 73 | end; 74 | 75 | procedure TForm1.FormCreate(Sender: TObject); 76 | begin 77 | Self.Caption:='Obfuscator for Simba\SCAR'+#32+ 'v 0.2.2 for' +#32+ {$IFDEF WINDOWS}'WIN'{$ELSE}'LIN'{$ENDIF}+#32+ 'by Cynic'; 78 | end; 79 | 80 | procedure TForm1.ToolButton3Click(Sender: TObject); 81 | begin 82 | if OpenDialog1.Execute then 83 | begin 84 | CodeMemo.Lines.LoadFromFile(OpenDialog1.FileName); 85 | end; 86 | end; 87 | 88 | procedure TForm1.ToolButton6Click(Sender: TObject); 89 | var 90 | obf: TObfuscator; 91 | begin 92 | (Sender as TToolButton).Enabled := false; 93 | if CodeMemo.Text = '' then 94 | Exit; 95 | obf := TObfuscator.Create; 96 | try 97 | try 98 | obf.InnerText := CodeMemo.Text; 99 | obf.Obfuscate; 100 | obfCode.Lines.Clear; 101 | obfCode.Text := obf.OutText; 102 | except 103 | on e: Exception do 104 | MessageDlg(e.ClassName + ': ' + e.Message, mtError, [mbOk], 0); 105 | end; 106 | finally 107 | obf.Destroy; 108 | end; 109 | (Sender as TToolButton).Enabled := true; 110 | end; 111 | 112 | end. 113 | 114 | -------------------------------------------------------------------------------- /ob_obfuscator.pas: -------------------------------------------------------------------------------- 1 | unit ob_obfuscator; 2 | {** 3 | * This file is part of the Obfuscator for PascalScript. 4 | * Simba Obfuscator. is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Simba Obfuscator. is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Simba Obfuscator. If not, see <http://www.gnu.org/licenses/>. 16 | *} 17 | {$mode objfpc}{$H+} 18 | 19 | interface 20 | 21 | uses 22 | ob_analyzer,Math, SysUtils; 23 | 24 | const 25 | {$WARNINGS OFF} 26 | Chars: set of Char = ['(', ')', '+', '-', '*', '/', ';', '=', '[', ']', 27 | ',', '@', ':', '.', '<', '>', '#', '$', '''', '"', '{']; 28 | {$WARNINGS ON} 29 | Reserved: array [0 .. 30] of string = ('program', 'var', 'const', 'begin', 30 | 'end', 'if', 'then', 'while', 'do', 'repeat', 'until', 'case', 'of', 'for', 31 | 'to', 'as', 'is', 'mod', 'div', 'or', 'and', 'xor', 'uses', 'type', 32 | 'function', 'procedure', 'string', 'nil','pointer','out','forward'); 33 | type 34 | ObfuscationOptions = 35 | ( 36 | ooUnreadable, 37 | // ooInvisible, // невидимые имена , будут, если будет юникод 38 | ooMuchBrackets 39 | ); 40 | 41 | const 42 | SetOptions: 43 | set of ObfuscationOptions = [ooUnreadable, ooMuchBrackets]; 44 | 45 | type 46 | 47 | TBeginEnd = record 48 | beginPos, endPos: Integer; 49 | end; 50 | 51 | TBEArray = array of TBeginEnd; 52 | TStrArray = array of String; 53 | TIdArray = record 54 | I: TStrArray; 55 | end; 56 | 57 | 58 | 59 | TMArray = record 60 | Names: TStrArray; 61 | Positions: TBEArray; 62 | end; 63 | 64 | TObfuscator = class(TObject) 65 | private 66 | FLexems: TLexems; 67 | FLC: Integer; 68 | FOutText: string; 69 | FInnerText: string; 70 | GlobalConsts: TIdArray; 71 | GlobalVars: TIdArray; 72 | Methods: TMArray; 73 | FAnalyzer: TLexicalAnalyzer; 74 | procedure FindConsts(var constsArray: TStrArray; const pos: Integer); 75 | 76 | procedure FindVars(var varsArray: TStrArray; const apos: Integer); 77 | 78 | procedure ObfuscateNumbers; // 79 | 80 | procedure ObfuscateMethods; 81 | 82 | procedure ObfuscateGlobals; 83 | 84 | procedure GetGlobal; // 85 | procedure GetMethods; // 86 | function GenerateUnRdblName: string; // 87 | { 88 | function GenerateInvslbName: string; // 89 | } 90 | function AddBrackets(const Src: string): string; // 91 | function FindLexem(const Name: string; const Offset: Cardinal = 0): Cardinal; // 92 | function IsReserved(const Name: string): boolean; 93 | function GenerateExpr(const num: string): string; 94 | procedure SetInText(txt: string); 95 | public 96 | procedure Obfuscate; 97 | constructor Create; 98 | destructor Destroy; override; 99 | property OutText: string read FOutText; 100 | property InnerText: string read FInnerText write FInnerText; 101 | end; 102 | 103 | function MArray(Name: string; Position: TBeginEnd): TMArray; 104 | 105 | Operator := (A : TStrArray) R : TIDArray; 106 | Operator + (left,right: TIdArray): TIdArray; 107 | Operator + (left,right: TMArray): TMArray; 108 | 109 | implementation 110 | 111 | function MArray(Name: string; Position: TBeginEnd): TMArray; 112 | var 113 | tmp: TMArray; 114 | begin 115 | SetLength(tmp.Names, 1); 116 | SetLength(tmp.Positions, 1); 117 | tmp.Names[0] := Name; 118 | tmp.Positions[0] := Position; 119 | Result := tmp; 120 | end; 121 | 122 | operator:=(A: TStrArray)R: TIDArray; 123 | var 124 | j: Integer; 125 | t: TIdArray; 126 | begin 127 | SetLength(t.I, Length(a)); 128 | for j := 0 to Length(a) - 1 do 129 | t.I[j] := a[j]; 130 | R := t; 131 | end; 132 | 133 | operator+(left, right: TIdArray): TIdArray; 134 | var 135 | j: Integer; 136 | t: TIdArray; 137 | begin 138 | SetLength(t.I, Length(left.I) + Length(right.I)); 139 | for j := 0 to Length(left.I) - 1 do 140 | t.I[j] := left.I[j]; 141 | for j := Length(left.I) to Length(t.I) - 1 do 142 | t.I[j] := right.I[j - Length(left.I)]; 143 | Result := t; 144 | end; 145 | 146 | operator+(left, right: TMArray): TMArray; 147 | var 148 | j: Integer; 149 | t: TMArray; 150 | begin 151 | SetLength(t.Names, Length(left.Names) + Length(right.Names)); 152 | SetLength(t.Positions, Length(left.Positions) + Length(right.Positions)); 153 | for j := 0 to Length(left.Names) - 1 do 154 | begin 155 | t.Names[j] := left.Names[j]; 156 | t.Positions[j] := left.Positions[j]; 157 | end; 158 | for j := Length(left.Names) to Length(t.Names) - 1 do 159 | begin 160 | t.Names[j] := right.Names[j - Length(left.Names)]; 161 | t.Positions[j] := right.Positions[j - Length(left.Positions)]; 162 | end; 163 | Result := t; 164 | end; 165 | 166 | function TObfuscator.AddBrackets(const Src: string): string; 167 | var 168 | brCount, I: Integer; 169 | tmpStr: string; 170 | begin 171 | tmpStr := Src; 172 | Randomize; 173 | brCount := Random(21) + Random(21); 174 | for I := 1 to brCount do 175 | tmpStr := '(' + tmpStr; 176 | for I := 1 to brCount do 177 | tmpStr := tmpStr + ')'; 178 | Result := tmpStr; 179 | end; 180 | 181 | constructor TObfuscator.Create; 182 | begin 183 | inherited; 184 | FAnalyzer := TLexicalAnalyzer.Create; 185 | FLexems := nil; 186 | FLC := 0; 187 | FOutText := ''; 188 | FInnerText := ''; 189 | end; 190 | 191 | destructor TObfuscator.Destroy; 192 | begin 193 | FAnalyzer.Destroy; 194 | FLexems := nil; 195 | FLC := 0; 196 | FOutText := ''; 197 | FInnerText := ''; 198 | inherited; 199 | end; 200 | 201 | procedure TObfuscator.FindConsts(var constsArray: TStrArray; 202 | const pos: Integer); 203 | var 204 | len, I: Integer; 205 | begin 206 | len := 0; 207 | constsArray := nil; 208 | I := pos + 1; 209 | while true do 210 | begin 211 | if (FLexems[I].LexType = 0) and (not IsReserved(FLexems[I].Lexem)) then 212 | begin 213 | Inc(len); 214 | SetLength(constsArray, len); 215 | constsArray[len - 1] := FLexems[I].Lexem; 216 | while FLexems[I].Lexem <> ';' do 217 | Inc(I); 218 | Inc(I); 219 | end 220 | else 221 | break; 222 | end; 223 | end; 224 | 225 | function TObfuscator.FindLexem(const Name: string; 226 | const Offset: Cardinal = 0): Cardinal; 227 | var 228 | I: Integer; 229 | begin 230 | Result := -1; 231 | for I := Offset to FLC - 1 do 232 | begin 233 | 234 | case StringQuote of 235 | sqSingle: 236 | begin 237 | if (I + 1) < FLC then 238 | if FLexems[I + 1].Lexem = '''' then 239 | Continue; 240 | end; 241 | sqDouble: 242 | begin 243 | if (I + 1) < FLC then 244 | if FLexems[I + 1].Lexem = '"' then 245 | Continue; 246 | end; 247 | sqSingleAndDouble: 248 | begin 249 | if (I + 1) < FLC then 250 | if (FLexems[I + 1].Lexem = '''') or (FLexems[I + 1].Lexem = '"') 251 | then 252 | Continue; 253 | end; 254 | end; 255 | 256 | if UpperCase(FLexems[I].Lexem) = UpperCase(Name) then 257 | begin 258 | Result := I; 259 | break; 260 | end; 261 | end; 262 | end; 263 | 264 | procedure TObfuscator.FindVars(var varsArray: TStrArray; 265 | const apos: Integer); 266 | var 267 | len, I: Integer; 268 | begin 269 | len := 0; 270 | varsArray := nil; 271 | I := apos + 1; 272 | while true do 273 | begin 274 | if (FLexems[I].LexType = 0) and (not IsReserved(FLexems[I].Lexem)) then 275 | begin 276 | Inc(len); 277 | SetLength(varsArray, len); 278 | varsArray[len - 1] := FLexems[I].Lexem; 279 | if FLexems[I + 1].Lexem = ',' then 280 | begin 281 | Inc(I, 2); 282 | while FLexems[I - 1].Lexem <> ':' do 283 | begin 284 | Inc(len); 285 | SetLength(varsArray, len); 286 | varsArray[len - 1] := FLexems[I].Lexem; 287 | Inc(I, 2) 288 | end; 289 | end; 290 | while FLexems[I].Lexem <> ';' do 291 | Inc(I); 292 | Inc(I); 293 | end 294 | else 295 | break; 296 | end; 297 | end; 298 | 299 | function TObfuscator.GenerateExpr(const num: string): string; 300 | var 301 | tmp, t1, t2, t3, m, rn: Integer; 302 | begin 303 | Result := ''; 304 | tmp := strtoint(num); 305 | Randomize; 306 | t1 := tmp - (Random(tmp) + 1); 307 | t2 := tmp - t1; 308 | Result := Result + inttostr(t1) + '+'; 309 | rn := Random(5) + 1; 310 | t3 := t2 div rn; 311 | m := t2 mod rn; 312 | Result := Result + '(' + inttostr(t3) + '*' + inttostr(rn) + '+' + 313 | inttostr(m) + ')'; 314 | end; 315 | 316 | {function TObfuscator.GenerateInvslbName: string; 317 | const 318 | InvslbSymbols: array [0 .. 6] of Char = (' ', '͖', 'ֹ', 'ٴ', '‎', '‏', ' '); 319 | var 320 | len, I: Integer; 321 | tmpName: string; 322 | begin 323 | tmpName := ''; 324 | Randomize; 325 | len := Random(50); 326 | for I := 0 to len - 1 do 327 | tmpName := tmpName + InvslbSymbols[Random(7)]; 328 | Result := tmpName; 329 | end; } 330 | 331 | function TObfuscator.GenerateUnRdblName: string; 332 | const 333 | UnrdlbSymbols = 'qwertyuiopasdfghjklzxcvbnm_QWERTYUIOPASDFGHJKLZXCVBNM'; 334 | var 335 | S: string; 336 | i, N,len: integer; 337 | begin 338 | len:= RandomRange(5,Length(UnrdlbSymbols)); 339 | for i := 1 to len-1 do begin 340 | N := Random(Length(UnrdlbSymbols)) + 1; 341 | S := S + UnrdlbSymbols[N]; 342 | end; 343 | Result:=S; 344 | end; 345 | 346 | procedure TObfuscator.GetGlobal; 347 | var 348 | cPos, vPos: Integer; 349 | tmp: TStrArray; 350 | begin 351 | cPos := 0; 352 | cPos := FindLexem('const', cPos + 1); 353 | while cPos > 0 do 354 | begin 355 | tmp := nil; 356 | FindConsts(tmp, cPos); 357 | GlobalConsts := GlobalConsts + TIdArray(tmp); 358 | cPos := FindLexem('const', cPos + 1); 359 | end; 360 | vPos := 0; 361 | vPos := FindLexem('var', vPos + 1); 362 | while vPos > 0 do 363 | begin 364 | tmp := nil; 365 | FindVars(tmp, vPos); 366 | GlobalVars := GlobalVars + TIdArray(tmp); 367 | vPos := FindLexem('var', vPos + 1); 368 | end; 369 | end; 370 | 371 | procedure TObfuscator.GetMethods; 372 | var 373 | mPos, br, id: Integer; 374 | tmpN: string; 375 | tmpP: TBeginEnd; 376 | begin 377 | mPos := 0; 378 | mPos := FindLexem('function', mPos + 1); 379 | while mPos > 0 do 380 | begin 381 | tmpN := FLexems[mPos + 1].Lexem; 382 | tmpP.beginPos := FindLexem('begin', mPos); 383 | br := 1; 384 | id := tmpP.beginPos + 1; 385 | while br > 0 do 386 | begin 387 | if UpperCase(FLexems[id].Lexem) = 'BEGIN' then 388 | Inc(br); 389 | if UpperCase(FLexems[id].Lexem) = 'END' then 390 | Dec(br); 391 | Inc(id); 392 | end; 393 | tmpP.endPos := id - 1; 394 | Methods := Methods + MArray(tmpN, tmpP); 395 | 396 | mPos := FindLexem('function', mPos + 1); 397 | end; 398 | 399 | 400 | mPos := FindLexem('procedure', mPos + 1); 401 | while mPos > 0 do 402 | begin 403 | tmpN := FLexems[mPos + 1].Lexem; 404 | tmpP.beginPos := FindLexem('begin', mPos); 405 | br := 1; 406 | id := tmpP.beginPos + 1; 407 | while br > 0 do 408 | begin 409 | if UpperCase(FLexems[id].Lexem) = 'BEGIN' then 410 | Inc(br); 411 | if UpperCase(FLexems[id].Lexem) = 'END' then 412 | Dec(br); 413 | Inc(id); 414 | end; 415 | tmpP.endPos := id - 1; 416 | Methods := Methods + MArray(tmpN, tmpP); 417 | 418 | mPos := FindLexem('procedure', mPos + 1); 419 | end; 420 | end; 421 | 422 | function TObfuscator.IsReserved(const Name: string): boolean; 423 | var 424 | I: Integer; 425 | begin 426 | Result := false; 427 | for I := 0 to 30 do 428 | begin 429 | if LowerCase(Name) = Reserved[I] then 430 | begin 431 | Result := true; 432 | Exit; 433 | end; 434 | end; 435 | end; 436 | 437 | procedure TObfuscator.Obfuscate; 438 | var 439 | I: integer; 440 | begin 441 | SetInText(FInnerText); 442 | GetGlobal; 443 | GetMethods; 444 | ObfuscateMethods; 445 | ObfuscateGlobals; 446 | if ooMuchBrackets in SetOptions then 447 | ObfuscateNumbers; 448 | 449 | FOutText := FLexems[0].Lexem; 450 | 451 | for I := 1 to FLC - 1 do 452 | begin 453 | if (FLexems[I - 1].LexType = 0) and ((FLexems[I].LexType = 0)) then 454 | FOutText := FOutText + ' ' + FLexems[I].Lexem 455 | else if (FLexems[I - 1].LexType = 0) and (FLexems[I].LexType = 1) then 456 | begin 457 | FOutText := FOutText + ' ' + FLexems[I].Lexem 458 | end 459 | else if (FLexems[I - 1].LexType = 1) and (FLexems[I].LexType = 0) then 460 | begin 461 | FOutText := FOutText + FLexems[I].Lexem 462 | end 463 | else 464 | FOutText := FOutText + FLexems[I].Lexem 465 | end; 466 | end; 467 | 468 | procedure TObfuscator.ObfuscateGlobals; 469 | var 470 | I, j: Integer; 471 | atmp: string; 472 | begin 473 | if Length(GlobalConsts.I) > 0 then 474 | for j := 0 to Length(GlobalConsts.I) - 1 do 475 | begin 476 | // if ooUnreadable in SetOptions then 477 | atmp := GenerateUnRdblName; 478 | for I := 2 to FLC - 1 do 479 | begin 480 | if UpperCase(FLexems[I].Lexem) = UpperCase(GlobalConsts.I[j]) then 481 | FLexems[I].Lexem := atmp; 482 | end; 483 | end; 484 | 485 | if Length(GlobalVars.I) > 0 then 486 | for j := 0 to Length(GlobalVars.I) - 1 do 487 | begin 488 | // if ooUnreadable in SetOptions then 489 | atmp := GenerateUnRdblName; 490 | for I := 2 to FLC - 1 do 491 | begin 492 | if (UpperCase(FLexems[I].Lexem) = UpperCase(GlobalVars.I[j])) and (FLexems[I-1].Lexem<>'.') then 493 | FLexems[I].Lexem := atmp; 494 | end; 495 | end; 496 | end; 497 | 498 | procedure TObfuscator.ObfuscateMethods; 499 | var 500 | I, j: Integer; 501 | atmp: string; 502 | begin 503 | if Length(Methods.Names) <= 0 then 504 | Exit; 505 | for j := 0 to Length(Methods.Names) - 1 do 506 | begin 507 | // if ooUnreadable in SetOptions then 508 | atmp := GenerateUnRdblName; 509 | for I := 2 to FLC - 1 do 510 | begin 511 | if UpperCase(FLexems[I].Lexem) = UpperCase(Methods.Names[j]) then 512 | FLexems[I].Lexem := atmp; 513 | end; 514 | end; 515 | end; 516 | 517 | procedure TObfuscator.ObfuscateNumbers; 518 | var 519 | I: Integer; 520 | begin 521 | for I := 0 to FLC - 1 do 522 | begin 523 | if FLexems[I].LexType = 1 then 524 | begin 525 | if pos('.', FLexems[I].Lexem) = 0 then 526 | FLexems[I].Lexem := GenerateExpr(FLexems[I].Lexem); 527 | FLexems[I].Lexem := AddBrackets(FLexems[I].Lexem); 528 | end; 529 | end; 530 | end; 531 | 532 | procedure TObfuscator.SetInText(txt: string); 533 | var 534 | I: Integer; 535 | begin 536 | FAnalyzer.Source := txt; 537 | FInnerText := FAnalyzer.Source; 538 | FAnalyzer.Analyze; 539 | SetLength(FLexems, FAnalyzer.LexemsCount); 540 | FLC := FAnalyzer.LexemsCount; 541 | for I := 0 to FAnalyzer.LexemsCount - 1 do 542 | FLexems[I] := FAnalyzer.Lexem[I] 543 | end; 544 | 545 | end. 546 | 547 | --------------------------------------------------------------------------------