SHARE
TWEET

Untitled

finalshare Jul 29th, 2015 225 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uses crt,sysutils,strutils;
  2. var
  3. fi,fo:text;
  4. fin,fout:string;
  5. luachon:byte;
  6. Sin,Sout:ansistring;
  7.  
  8. function CONVERTHEX(a,b:char):byte;
  9. var
  10. ar:array [1..2] of byte;
  11. begin
  12. case a of
  13. '0':ar[1]:=0;
  14. '1':ar[1]:=1;
  15. '2':ar[1]:=2;
  16. '3':ar[1]:=3;
  17. '4':ar[1]:=4;
  18. '5':ar[1]:=5;
  19. '6':ar[1]:=6;
  20. '7':ar[1]:=7;
  21. '8':ar[1]:=8;
  22. '9':ar[1]:=9;
  23. 'A':ar[1]:=10;
  24. 'B':ar[1]:=11;
  25. 'C':ar[1]:=12;
  26. 'D':ar[1]:=13;
  27. 'E':ar[1]:=14;
  28. 'F':ar[1]:=15;
  29. end;
  30. case b of
  31. '0':ar[2]:=0;
  32. '1':ar[2]:=1;
  33. '2':ar[2]:=2;
  34. '3':ar[2]:=3;
  35. '4':ar[2]:=4;
  36. '5':ar[2]:=5;
  37. '6':ar[2]:=6;
  38. '7':ar[2]:=7;
  39. '8':ar[2]:=8;
  40. '9':ar[2]:=9;
  41. 'A':ar[2]:=10;
  42. 'B':ar[2]:=11;
  43. 'C':ar[2]:=12;
  44. 'D':ar[2]:=13;
  45. 'E':ar[2]:=14;
  46. 'F':ar[2]:=15;
  47. end;
  48. converthex:=ar[1]*16 + ar[2];
  49. end;
  50.  
  51. procedure HEXDECODER;
  52. var
  53. t1,t2,t3,t4:char;
  54. begin
  55. while not eof(fi) do
  56. begin
  57. while not eoln(fi) do
  58. begin
  59. read(fi,t1);
  60. if t1 ='\' then
  61. begin
  62. read(fi,t2);
  63. if t2 <> 'x' then write(fo,t1,t2) else
  64. begin
  65. read(fi,t3,t4);
  66. t3:=upcase(t3);
  67. t4:=upcase(t4);
  68. write(fo,chr(converthex(t3,t4)));
  69. end;
  70. end
  71. else write(fo,t1);
  72.  
  73. end;
  74. writeln(fo);
  75. readln(fi);
  76. end;
  77. end;
  78.  
  79. procedure RANDOMVAR;
  80. var
  81. S:Ansistring;
  82. ft:text;
  83. Sinp:Ansistring;
  84. Sout:ansistring;
  85. St:ansistring;
  86. l:qword;
  87. max:qword;
  88. count:qword;
  89. begin
  90. assign(ft,'temp');
  91. rewrite(ft);
  92. max:=0;
  93. while not eof(fi) do
  94. begin
  95. readln(fi,S);l:=length(S);
  96. if (S[1] ='$') and (S[l] =';') and (S[l-1] ='"') and (pos('{',S)=0) and (pos('}',S)=0) then
  97. begin
  98. Sin:=copy(S,1,pos('=',S)-1);
  99. Sout:=copy(s,pos('=',S)+1,length(S)-pos('=',S)-1);
  100. max:=max+2;
  101. end;
  102.  
  103. end;
  104. count:=0;
  105. reset(fi);
  106. while count <max-2 do
  107. begin
  108. readln(fi,S);l:=length(S);
  109. if (S[1] ='$') and (S[l] =';') and (S[l-1] ='"') and (pos('{',S)=0) and (pos('}',S)=0) then
  110. begin
  111. Sin:=copy(S,1,pos('=',S)-1);
  112. Sout:=copy(s,pos('=',S)+1,length(S)-pos('=',S)-1);
  113. writeln(ft,sin);
  114. writeln(ft,sout);
  115. count:=count+2;
  116. end;
  117.  
  118. end;
  119. readln(fi,S);
  120. l:=length(S);
  121. if (S[1] ='$') and (S[l] =';') and (S[l-1] ='"') and (pos('{',S)=0) and (pos('}',S)=0) then
  122. begin
  123. Sin:=copy(S,1,pos('=',S)-1);
  124. Sout:=copy(s,pos('=',S)+1,length(S)-pos('=',S)-1);
  125. writeln(ft,sin);
  126. write(ft,sout);
  127. end;
  128. reset(fi);
  129. reset(ft);
  130. rewrite(fo);
  131. while not eof(fi) do
  132. begin
  133. reset(ft);
  134. readln(fi,S);
  135. while not eof(ft) do
  136. begin
  137. readln(ft,sin);
  138. readln(ft,sout);
  139. S:=AnsiReplaceStr(S,sin,sout);
  140. writeln(fo,S);
  141. end;
  142. end;
  143. count:=0;
  144. rewrite(ft);
  145. reset(fo);
  146. l:=0;
  147. while not eof(fo) do
  148. begin
  149. count:=count+1;
  150. l:=max div 2;
  151. readln(fo,s);
  152. if (count =l) then
  153. begin
  154. count:=0;
  155. writeln(ft,S);
  156. end;
  157. end;
  158. reset(ft);
  159. rewrite(fo);
  160. while not eof(ft) do
  161. begin
  162. readln(ft,S);
  163. St:=S;
  164. if S[length(S)]=';' then delete(St,length(St),1);
  165. l:=length(St);
  166. Sin:=Copy(St,1,l div 2);
  167. sout:=copy(st,(l div 2) +2,l div 2);
  168. if not ((odd(l)) and (sin=sout) and (St[(l div 2) +1] = '=')) then writeln(fo,S);
  169. end;
  170. close(ft);
  171. erase(ft);
  172. end;
  173.  
  174. procedure ENDLINE;
  175. var
  176. ch,ch1:char;
  177. check:boolean;
  178. begin
  179. while not eof(fi) do
  180. begin
  181. while not eoln(fi) do
  182. begin
  183. read(fi,Ch);write(fo,Ch);
  184. if Ch=';' then
  185. begin
  186. writeln(fo);
  187. read(Fi,ch1);
  188. if ch1 <> ' ' then write(fo,ch1)
  189. else while ch1 <> ' ' do read(fi,ch1);
  190. end;
  191. end;
  192. readln(fi);
  193. end;
  194. end;
  195. begin
  196. clrscr;
  197. clrscr;
  198. writeln('********************************************************************************');
  199. writeln('************************** PHP DECODER by SK THELIGHT **************************');
  200. writeln('********************************************************************************');
  201. Writeln('1.)Hex \x decoder.');
  202. Writeln('2.)Random Variable decoder.');
  203. Writeln('3.)Endline after ; .');
  204. write('Nhap Lua Chon Cua Ban: ');readln(luachon);
  205. write('Nhap Ten File INPUT: ');readln(fin);
  206. write('Nhap Ten File OUTPUT: ');readln(fout);
  207. assign(fi,fin);
  208. assign(fo,fout);
  209. reset(fi);
  210. rewrite(fo);
  211. case luachon of
  212. 1:HEXDECODER;
  213. 2:RANDOMVAR;
  214. 3:ENDLINE;
  215. end;
  216. close(fi);
  217. close(fo);
  218. clrscr;
  219. writeln('********************************************************************************');
  220. writeln('************************** PHP DECODER by SK THELIGHT **************************');
  221. writeln('********************************************************************************');
  222. writeln('Qua trinh DECODE da hoan tat, ban vui long kiem tra file: ',fout,'.');
  223. readln;
  224. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top