-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnokey.lua
More file actions
287 lines (273 loc) · 10.7 KB
/
nokey.lua
File metadata and controls
287 lines (273 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
--[[
This file is created for AutoPlay Media Studio 8.x and will not work in native Lua unless you convert the AMS native functions
to lua, most functions should be in Lua so should be able to be converted.
Created By Rexzooly Kai Black, Idea from 2006 created on 9th Jan 2017
]]--
NoKey = {
MinVersion = "",
Version = "",
-- part of the mix up and ecoding, add more, the demo I how off has over 20
-- www.youtube.com/watch?v=xK1E3NxiNlQ
Mix = {
{"WordBefore", "WordAfter"},
},
-- More Mixing up and encoding
Replace = {
{"A", "{01000001}"},{"a", "[01100001]"},
{"B", "{01000010}"},{"b", "[01100010]"},
{"C", "{01000011}"},{"c", "[01100011]"},
{"D", "{01000100}"},{"d", "[01000100]"},
{"E", "{01000101}"},{"e", "[01100101]"},
{"F", "{01000110}"},{"f", "[01100110]"},
{"G", "{01000111}"},{"g", "[01100111]"},
{"H", "{01001000}"},{"h", "[01101000]"},
{"I", "{01001001}"},{"i", "[01101001]"},
{"J", "{01001010}"},{"j", "[01101010]"},
--{"K", "{01001011}"},{"k", "[01101011]"},
--{"L", "{01001100}"},{"l", "[01101100]"},
--{"M", "{01001101}"},{"m", "[01101101]"},
--{"N", "{01001110}"},{"n", "[01101110]"},
{"O", "{01001111}"},{"o", "[01101111]"},
--{"P", "{01010000}"},{"p", "[01110000]"},
--{"Q", "{01010001}"},{"q", "[01110001]"},
--{"R", "{01010010}"},{"r", "[01110010]"},
{"S", "{01010011}"},{"s", "[01110011]"},
--{"T", "{01010100}"},{"t", "[01110100]"},
--{"U", "{01010101}"},{"u", "[01110101]"},
--{"V", "{01010110}"},{"v", "[01110110]"},
--{"W", "{01010111}"},{"w", "[01110111]"},
--{"X", "{01011000}"},{"x", "[01011000]"},
--{"Y", "{01011001}"},{"y", "[01111001]"},
--{"Z", "{01011010}"},{"z", "[01111010]"},
{" ", "{00100000}"},{".", "{00101110}"},
{",", "{00101100}"},{"'", "{00100111}"},
{"\\", "{00000}"},{"/", "{00101111}"},
{"#", "{00100011}"}, {"@", "{01000000}"},
{"-", "{00101101}"},{"=", "{00111101}"},
{"!", "{00100001}"},{"?", "{00111111}"},
{"\"", "{00100010}"},{"£", "{11000010 10100011}"},
{"$", "{00100100}"},{"%", "{00100101}"},
{"*", "{00101010}"}
}
}
-- hide a word in the app becore packing
function NoKey.Bow(_strString, _bBlock)
if type(_strString) == nil then
return false, 'Nothing given'
end
if _bBlock then
bowthis = string.gsub(_strString, "enc::(.-)::", function(a) return "<span class=\"block\" style=\"display:none;\">"..Crypto.Rot13(enc(a)).."</span>" end);
else
bowthis = string.gsub(_strString, "enc::(.-)::", function(a) return "dec::"..Crypto.Rot13(enc(a)).."::" end);
end
NewString = bowthis;
return NewString;
end
-- unhide a word
function NoKey.DeBow(_strString, _bBlock)
if type(_strString) == nil then
return false, 'Nothing given'
end
if _bBlock then
bowthis = string.gsub(_strString, "<span class=\"block\" style=\"display:none;\">(.-)</span>", function(a) return "enc::"..dec(Crypto.Rot13(a)).."::" end);
else
bowthis = string.gsub(_strString, "dec::(.-)::", function(a) return "enc::"..dec(Crypto.Rot13(a)).."::" end);
end
NewString = bowthis;
return NewString;
end
--First part of the encoding
function NoKey.AlphaChannel(_strString)
if type(_strString) == nil then
return false, 'Nothing given'
end
if type(NoKey.Mix) == nil then
return false, 'No replacements found'
end
for x = 1, Table.Count(NoKey.Mix) do
_strString = String.Replace(_strString, NoKey.Mix[x][1], enc(NoKey.Mix[x][2]), true);
end
for x = 1, Table.Count(NoKey.Replace) do
_strString = String.Replace(_strString, NoKey.Replace[x][1], NoKey.Replace[x][2], true);
end
for x = 1, Table.Count(NoKey.Replace) do
_strString = String.Replace(_strString, NoKey.Replace[x][2], enc(NoKey.Replace[x][2]), true);
end
return string.reverse(enc(string.reverse(_strString)))
end
--Last part of the decoding
function NoKey.BetaChannel(_strString)
_strString = string.reverse(dec(string.reverse(_strString)))
if type(_strString) == nil then
return false, 'Nothing given'
end
if type(NoKey.Mix) == nil then
return false, 'No replacements found'
end
for x = 1, Table.Count(NoKey.Replace) do
_strString = String.Replace(_strString, enc(NoKey.Replace[x][2]), NoKey.Replace[x][2], true);
end
for x = 1, Table.Count(NoKey.Replace) do
_strString = String.Replace(_strString, NoKey.Replace[x][2], NoKey.Replace[x][1], true);
end
for x = 1, Table.Count(NoKey.Mix) do
_strString = String.Replace(_strString, enc(NoKey.Mix[x][2]), NoKey.Mix[x][1], true);
end
return _strString
end
function NoKey.Lock(Dep, strKey)
if strKey == "" then
strKey = nil;
end
if Dep ~= "" and Dep ~= nil then
The_Next = Dep;
if strKey == nil then
The_Auth = enc("01001110011011110100110101101111011100100110010101001011011001010111100101100010011011110110000101110010011001000101000001100101011011110111000001101100011001010011001000110000001100010011011101000101011100000110100101100011010100000110100101100101");
SkyLandOverRide = 'SNBLOCK';
else
The_Auth = strKey;
SkyLandOverRide = 'PNBLOCK';
end
TextFile.WriteFromString(_TempFolder.."\\open.blob", The_Next, false);
-- Start CHANGE THIS TO YOUR AESCRYPT EXE ("Tools\\handle.exe" to PATH-TO-YOUR-AESCrypt-EXE)
Running = File.Run("Tools\\handle.exe", "-e -p "..The_Auth.." open.blob", _TempFolder.."\\", SW_HIDE, true);
-- End CHANGE
File.Delete(_TempFolder.."\\open.blob", true, true, true);
The_Start = Crypto.Base64EncodeToString(_TempFolder.."\\open.blob.aes", 70);
Save_Me = SkyLandOverRide..The_Start;
File.Delete(_TempFolder.."\\open.blob.aes", true, true, true);
return enc(Save_Me);
else
return 'error';
end
end
function NoKey.UnLock(Dep, strKey)
if strKey == nil then
-- NoMoreKeyboardPeople2017EpicPie
The_Auth = enc("01001110011011110100110101101111011100100110010101001011011001010111100101100010011011110110000101110010011001000101000001100101011011110111000001101100011001010011001000110000001100010011011101000101011100000110100101100011010100000110100101100101");
SkyLandOverRide = 'SNBLOCK';
else
The_Auth = enc(Crypto.Rot13(strKey));
SkyLandOverRide = 'PNBLOCK';
end
if Dep ~= "" and Dep ~= nil then
Dep = dec(Dep);
else
return 'error';
end
Dep = String.Replace(Dep, SkyLandOverRide, "", true);
Crypto.Base64DecodeFromString(Dep, _TempFolder.."\\open.blade.aes");
if not File.DoesExist(_TempFolder.."\\open.blade.aes") then
--
end
-- Start CHANGE THIS TO YOUR AESCRYPT EXE ("Tools\\handle.exe" to PATH-TO-YOUR-AESCrypt-EXE)
Running = File.Run("Tools\\handle.exe", "-d -p "..The_Auth.." open.blade.aes", _TempFolder.."\\", SW_HIDE, true);
-- End CHANGE
Application.Sleep(600); -- Not really needed, I used it to help UI and AMS to stay inline with each other two fast makes you think its broken
if not File.DoesExist(_TempFolder.."\\open.blade") then
--
end
The_Again = TextFile.ReadToString(_TempFolder.."\\open.blade");
File.Delete(_TempFolder.."\\open.blade", true, true, true);
File.Delete(_TempFolder.."\\open.blade.aes", true, true, true);
return The_Again;
end
function NoKey.Pack(m_key, __SaveText, SaveMe, __Format)
if m_key == "" then
IDPASS = Dialog.Message("No key provided", "You have not set the key/password, do you want to use the software key?\r\n\r\nYes - Use Software Key (Not Recommended).\r\nNo - Set own key.\r\nCancel - Stop action.", MB_YESNOCANCEL, MB_ICONNONE, MB_DEFBUTTON1);
if IDPASS == IDYES then
__SaveText = NoKey.Lock(NoKey.AlphaChannel(NoKey.Bow(__SaveText)));
end
if IDPASS == IDNO then
UserKey = Dialog.PasswordInput("Key Input", "Enter your key below", MB_ICONNONE);
if UserKey ~= "CANCEL" then
if UserKey ~= "" then
__SaveText = NoKey.Lock(NoKey.AlphaChannel(NoKey.Bow(__SaveText)), UserKey);
return true
else
return false, "We was unable to tape up your package, reason below:\r\n\r\nThe user(you) has canceled the action";
end
end
end
if IDPASS == IDCANCEL then
return false, "We was unable to tape up your package, reason below:\r\n\r\nThe user(you) has canceled the action";
end
else
__SaveText = NoKey.Lock(NoKey.AlphaChannel(NoKey.Bow(__SaveText)), m_key);
end
Application.Sleep(300);
if __SaveText ~= "" then
enksave = {
"ENK "..NoKey.Version,
enc(System.GetDate(DATE_FMT_EUROPE).."-"..System.GetTime(TIME_FMT_MIL)),
__SaveText
}
Math.RandomSeed(Math.Random(1, 4000));
RanNox = Math.Random(482, 882);
TextFile.WriteFromTable(SaveMe, enksave, false);
error = Application.GetLastError();
if (error ~= 0) then
return false, _tblErrorMessages[error];
end
return true, "";
else
return false, "We lost the curtains for packing";
end
end
function NoKey.Unpack(m_key, __SaveText)
if m_key == "" then
IDPASS = Dialog.Message("No key provided", "You have not set the key/password, do you want to try the software key?\r\n\r\nYes - Use Software Key.\r\nNo - Use your own key.\r\nCancel - Stop action.", MB_YESNOCANCEL, MB_ICONNONE, MB_DEFBUTTON1);
if IDPASS == IDYES then
__SaveText = NoKey.DeBow(NoKey.BetaChannel(NoKey.UnLock(__SaveText)));
__DoAction = true;
return true, __SaveText;
end
if IDPASS == IDNO then
UserKey = Dialog.PasswordInput("Key Input", "Enter your key below", MB_ICONNONE);
if UserKey ~= "CANCEL" then
if UserKey ~= "" then
__SaveText = NoKey.DeBow(NoKey.BetaChannel(NoKey.UnLock(__SaveText, UserKey)));
__DoAction = true;
return true, "";
else
return false, "We was unable to tape up your package, reason below:\r\n\r\nThe user(you) has canceled the action";
end
end
end
if IDPASS == IDCANCEL then
return false, "We was unable to tape up your package, reason below:\r\n\r\nThe user(you) has canceled the action";
end
end
__SaveText = NoKey.DeBow(NoKey.BetaChannel(NoKey.UnLock(__SaveText, m_key)));
__DoAction = true;
return true, "";
end
-- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <alexthkloss@web.de>
-- licensed under the terms of the LGPL2
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
function enc(data)
return ((data:gsub('.', function(x)
local r,b='',x:byte()
for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
return r;
end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
if (#x < 6) then return '' end
local c=0
for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
return b:sub(c+1,c+1)
end)..({ '', '==', '=' })[#data%3+1])
end
function dec(data)
data = string.gsub(data, '[^'..b..'=]', '')
return (data:gsub('.', function(x)
if (x == '=') then return '' end
local r,f='',(b:find(x)-1)
for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
return r;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if (#x ~= 8) then return '' end
local c=0
for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
return string.char(c)
end))
end