This site uses cookies own and third. If you continue to browse consider to accept the use of cookies. OK More Info.

[Function] Adf.ly Decode by crack81[Delphi]

  • 0 Replies
  • 4468 Views

0 Members and 1 Guest are viewing this topic.

Offline BDWONG

  • *
  • Underc0der
  • Posts: 1
  • Actividad:
    0%
  • Reputación 0
    • View Profile
    • Email

[Function] Adf.ly Decode by crack81[Delphi]

  • on: September 16, 2015, 11:11:27 pm
Hola chicos viendo el post de fudmario You are not allowed to view links. Register or Login

decidi hacerle su traduccion en Delphi el codigo se puede mejorar un monton pero funciona bien

Code: (delphi) You are not allowed to view links. Register or Login
uses
  SysUtils,
  IdHTTP,
  IdCoderMIME;

function DecodeAdFly(const url:string):string;
var
http:TIdHTTP;
content,data,urlFinal,part1,part2:string;
pos1,pos2,i,npos:integer;
const
STRINGKEY='ysmm = ';
begin
  urlFinal:='';
  i:=1;
  http:=TIdHTTP.Create(nil);
  try
    content:=http.Get(url);//obtenemos el codigo html
    pos1:=pos(STRINGKEY,content);//encontramos el ysmm =
    pos2:=1;
    npos:=pos1;
    while(content[npos]<>';')do//recorremos el content hasta encontrar el ';'
    begin
      inc(npos);
      inc(pos2);//el pos2 nos dira cuantos caracteres tiene el ysmm
    end;
    //data alamcenrar la cadena de ysmm
    data:=copy(content,pos1+length(STRINGKEY)+1,pos2-length(STRINGKEY)-3);
    while(i<=length(data)) do //filtramos la cadena llamada data
    begin
      part1:=part1+data[i];
      part2:=data[i+1]+part2;
      i:=i+2;
    end;
    urlFinal:=TIdDecoderMIME.DecodeString(part1+part2);//los desencriptamos con base64
    Result:=copy(urlFinal,3,length(urlFinal)-2);//retornamos la url original
  finally
    http.Free; //liberamos el objeto creado arriba
  end;
end;

var
url:string;
begin
  url:=DecodeAdFly('http://adf.ly/dLgCS');
  writeln(url);
  readln;
end.
« Last Edit: October 11, 2015, 08:36:11 pm by Expermicid »