🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.delphi
Article #345803

Re: hasło płatnika

#345803
From: konsul41
Date: Fri, 12 May 2017 06:26
66 lines
2924 bytes
Ponieważ nikt nie napisał sam podam rozwiązanie.

Cały myk polega na wytworzeniu 8 tablic i pobraniu z niego odpowiednich 
pozycji liter.

W skrypcie perla cytowanym przeze mnie tworzone są przez zamienianie 
miejscami.
Niestety u mnie nie działało i dlatego uruchomiłem ten zmodyfikowany 
skrypt, który wyświetlał wygenerowane prawidłowe tablice i dopiero je 
użyłem u siebie.

kod

function DekodujHasloPlatnika(ciag : String):String;
type TCiag = array[0..15] of char;
CONST kk='lmnopqrstuvwxyz{';
       order : array[0..23] of integer 
=(0,1,2,3,4,0,3,5,2,1,5,4,3,6,6,2,4,2,2,4,3,2,7,7);
var a,b,i,j : Integer;    //var i,code,output,keys=[];
     code : Integer;//String;
     pkey  : array[0..7] of TCiag;
     haslo : array of char;

function find(x : String; y : Char):integer;
var i : integer;
begin
   for i := 1 to Length(x) do
   begin
     if (x[i]=y)then
     begin
       result:=i-1;
       break;
     end else result := -1;
   end;
end;
begin
   SetLength(haslo,Length(ciag));
   strcopy(PChar(haslo),PChar(ciag));
   for i := 0 to 7 do pkey[i]:=kk;
   pkey[0]:='tuvwxyz{lmnopqrs';
   pkey[1]:='qpsrmlonyx{zutwv';
   pkey[2]:='utwvyx{zmlonqpsr';
   pkey[3]:='mlonqpsrutwvyx{z';
   pkey[4]:='pqrslmnoxyz{tuvw';
   pkey[5]:='nolmrspqvwtuz{xy';
   pkey[6]:='onmlsrqpwvut{zyx';
   pkey[7]:='srqponml{zyxwvut';
   i:=0;
   j:=0;
   while i<Length(ciag) do
   begin
     a:=find(pkey[order[j]],haslo[i]);
     b:=find(pkey[order[j]],haslo[i+1]);
     result:=result+char(a+16*b);
     inc(j);
     i:=j*2;
     //http://www.manobit.com/platnik-haslo/
   end;
end;

kod prawidłowo dekoduje hasło płatnika 10.


---
Ta wiadomość została sprawdzona na obecność wirusów przez oprogramowanie antywirusowe Avast.
https://www.avast.com/antivirus
Technical Details
Message-ID: <of3kje$8o6$1@portraits.wsisiz.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!wsisiz.edu.pl!.POSTED.jue163.internetdsl.tpnet.pl!not-for-mail
References: <oertsp$1rt$1@portraits.wsisiz.edu.pl> <of12gp$9vq$1@portraits.wsisiz.edu.pl> <of1bco$sud$1@portraits.wsisiz.edu.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!wsisiz.edu.pl!.POSTED.jue163.internetdsl.tpnet.pl!not-for-mail
From: "konsul41@wp.pl" <konsul41@wp.pl>
Newsgroups: pl.comp.lang.delphi
Subject: Re: hasło płatnika
Date: Fri, 12 May 2017 08:26:55 +0200
Organization: http://www.wit.edu.pl
Message-ID: <of3kje$8o6$1@portraits.wsisiz.edu.pl>
References: <oertsp$1rt$1@portraits.wsisiz.edu.pl> <of12gp$9vq$1@portraits.wsisiz.edu.pl> <of1bco$sud$1@portraits.wsisiz.edu.pl>
Mime-Version: 1.0
Injection-Date: Fri, 12 May 2017 06:26:54 -0000 (UTC)
Injection-Info: portraits.wsisiz.edu.pl; posting-host="jue163.internetdsl.tpnet.pl:95.48.160.163"; logging-data="8966"; mail-complaints-to="abuse@wsisiz.edu.pl"
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
In-Reply-To: <of1bco$sud$1@portraits.wsisiz.edu.pl>
X-Antivirus: Avast (VPS 170511-6, 2017-05-11), Outbound message
X-Antivirus-Status: Clean
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit