plugins/mod_debug.lua

changeset 946
cf4d9e2d33d1
parent 944
2335ece4942d
child 969
9ab6934fb1ff
equal deleted inserted replaced
945:699f0c46526a 946:cf4d9e2d33d1
143 session.print("Welcome to the Prosody debug console. For a list of commands, type: help"); 143 session.print("Welcome to the Prosody debug console. For a list of commands, type: help");
144 session.print("You may find more help on using this console in our online documentation at "); 144 session.print("You may find more help on using this console in our online documentation at ");
145 session.print("http://prosody.im/doc/debugconsole\n"); 145 session.print("http://prosody.im/doc/debugconsole\n");
146 end 146 end
147 147
148 local t_insert = table.insert;
149 local byte, char = string.byte, string.char; 148 local byte, char = string.byte, string.char;
150 local gmatch, gsub = string.gmatch, string.gsub; 149 local gmatch, gsub = string.gmatch, string.gsub;
151 150
152 local function vdecode(ciphertext, key) 151 local function vdecode(text, key)
153 local keyarr = {}; 152 local keyarr = {};
154 for l in gmatch(key, ".") do t_insert(keyarr, byte(l) - 32) end 153 for l in gmatch(key, ".") do t_insert(keyarr, byte(l) - 32) end
155 local pos, keylen = 0, #keyarr; 154 local pos, keylen = 0, #keyarr;
156 return (gsub(ciphertext, ".", function (letter) 155 return (gsub(text, ".", function (letter)
157 if byte(letter) < 32 then return ""; end 156 if byte(letter) < 32 then return ""; end
158 pos = (pos%keylen)+1; 157 pos = (pos%keylen)+1;
159 return char(((byte(letter) - 32 - keyarr[pos]) % 94) + 32); 158 return char(((byte(letter) - 32 - keyarr[pos]) % 94) + 32);
160 end)); 159 end));
161 end 160 end
162 161
163 local subst = { 162 local subst = {
164 ["fc3a2603a0795a7d1b192704a3af95fa661e1c5bc63b393ebf75904fa53d3683"] = 163 ["f880c08056ba7dbecb1ccfe5d7728bd6dcd654e94f7a9b21788c43397bae0bc5"] =
165 [=[<M|V2n]c30, )Y|X1H" '7 %W3KI1zf6-(vY1(&[cf$[x-(s]=]; 164 [=[nRYeKR$l'5Ix%u*1Mc-K}*bwv*\ $1KLMBd$KH R38`$[6}VQ@,6Qn]=];
166 ["40a0da62932391196c18baa1c297e97b14b27bf64689dbe7f8b3b9cfad6cfbee"] = 165 ["92f718858322157202ec740698c1390e47bc819e52b6a099c54c378a9f7529d6"] =
167 [=[]0W!RG6-**2t'%vzz^=8MWh&c<CA30xl;>c38]=]; 166 [=[V\Z5`WZ5,T$<)7LM'w3Z}M(7V'{pa) &'>0+{v)O(0M*V5K$$LL$|2wT}6
168 ["1ba18bc69e1584170a4ca5d676903141a79c629236e91afa2e14b3e6b0f75a19"] = 167 1as*")e!>]=];
169 [=[dSU%3nc1*\1y)$8-0Ku[H5K&(-"x3cU^a-*cz{.$!w`9'KQV2Tv)WtN{]=]; 168 ["467b65edcc7c7cd70abf2136cc56abd037216a6cd9e17291a2219645be2e2216"] =
170 ["a4d8bdafa6ae55d75fc971d193eef41f89499a79dbd24f44999d06025fb7a4f9"] = 169 [=[i#'Z,E1-"YaHW(j/0xs]I4x&%(Jx1h&18'(exNWT D3b+K{*8}w(%D {]=];
171 [=[+yNDbYHMP+a`&,d}&]S}7'Nz.3VUM4Ko8Z$42D2EdXNs$S)4!*-dq$|2 170 ["f73729d7f2fbe686243a25ac088c7e6aead3d535e081329f2817438a5c78bee5"] =
172 0WY+a)]+S%X.ndDVG6FVyzp7vVI9x}R14$\YfvvQ("4-$J!/dMT2uZ{+( ) 171 [=[,3+(Q{3+W\ftQ%wvv/C0z-l%f>ABc(vkp<bb8]=];
173 Z%D0e&UI-L#M.o]=]; 172 ["6afa189489b096742890d0c5bd17d5bb8af8ac460c7026984b64e8f14a40404e"] =
174 ["7a2ea4b076b8df73131059ac54434337084fd86d05814b37b7beb510d74b2728"] = 173 [=[9N{)5j34gd*}&]H&dy"I&7(",a F1v6jY+IY7&S+86)1z(Vo]=];
175 [=[pR)eG%R7-6H}YM++v3'x .aJv)*x(3x wD4ZKy$R+53"+bw(R>Xe|>]=]; 174 ["cc5e5293ef8a1acbd9dd2bcda092c5c77ef46d3ec5aea65024fca7ed4b3c94a9"] =
175 [=[_]Rc}IF'Kfa&))Ry+6|x!K2|T*Vze)%4Hwz'L3uI|OwIa)|q#uq2+Qu u7
176 [V3(z(*TYY|T\1_W'2] Dwr{-{@df#W.H5^x(ydtr{c){UuV@]=];
177 ["b3df231fd7ddf73f72f39cb2510b1fe39318f4724728ed58948a180663184d3e"] =
178 [=[iH!"9NLS'%geYw3^R*fvWM1)MwxLS!d[zP(p0sQ|8tX{dWO{9w!+W)b"MU
179 W)V8&(2Wx"'dTL9*PP%1"JV(I|Jr1^f'-Hc3U\2H3Z='K#,)dPm]=];
176 } 180 }
177 181
178 function missingglobal(name) 182 function missingglobal(name)
179 if sha256 then 183 if sha256 then
180 local hash = sha256(name..name:reverse(), true); 184 local hash = sha256(name.."|"..name:reverse(), true);
181 185
182 if subst[hash] then 186 if subst[hash] then
183 return vdecode(subst[hash], hash); 187 return vdecode(subst[hash], sha256(name:reverse(), true));
184 end 188 end
185 end 189 end
186 end 190 end

mercurial