» »

Brute forcing :) in VB problemi

Brute forcing :) in VB problemi

StratOS ::

Heh, pa sem spet tam, kjer je moj VB brutefoce prešvoh.
Namreč potrebujem brute force za string s, da bo sledeči pogoj rešen :

dolžina s naj bi bila enaka dolžini s2 konstante.


disasemblan Java applet loop:

{
String s = PasswordField.getText();
String s1 = getDocumentBase().toString();
String s2 = "AMYBPfPYZV";
s1 = s1.substring(0, s1.lastIndexOf('/') + 1);
StringBuffer stringbuffer = new StringBuffer(s1.length() + 20);
String s3 = "";
int j = -75;
for(int i = 0; i < s.length(); i++)
{
char c = (char)(s2.charAt(i) + s.charAt(i) + j);
s3 = s3 + c;
j -= 2;
}

stringbuffer.append(s1);
if(s3.equals("confirming"))
{
stringbuffer.append(s);
stringbuffer.append(".php");
} else
{
stringbuffer.append("wrong.php");
}
try
{
getAppletContext().showDocument(new URL(new String(stringbuffer)), "_self");
}
catch(Exception exception) { }


Naredil sem program za BF v VB-ju, vendar je zgleda majhen problem, ker VB in C pri tretiranju indexov nista ista, pa me zanima kakšne rešitve dobite vi glede tega.
VB C index i tretira kot i+1 ; x.charAt(i)=mid$(x,i+1,1)
Pa še problem pri Do/Until (i) zanki imam

Tudi VB je zelo počasen. Treba je namreč BF string dolžine 10, vsak karakter tega stringa ima 25(ali več ?) možnosti v medsebojni kombinaciji med sabo.

A ima kdo dobro idejo kako se tega rešiti kot BF ali pa preveriti, če mogoče obstaja inverzna eksplicitna funkcija ali postopek za pridobiter odgovorjev.

V glavnem, če dobite, da je s3="confirming" boste, seveda, če rutino pravilno postavite dobili rešitev.
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"The one who is digging the hole for the other to fall in is allready in it."

Thomas ::

A lahko prevedeš tole v domači jezik? Kakšen algoritem rabiš, za kaj delat?
Man muss immer generalisieren - Carl Jacobi

StratOS ::

Določi string s pri sledećih pogojih :

String s3 = "";
int j = -75;
s2 = "AMYBPfPYZV";

for(int i = 0; i < s.length(); i++)
{
char c = (char)(s2.charAt(i) + s.charAt(i) + j);
s3 = s3 + c;
j -= 2;
}

če je s3="confirming" mi povej koliko je torej string s

En dober quest :
Iščem nekaj, kaj bi najhitreje rešilo omenjeni problem, naj si bo to program za BF, kakšen ostali namig ali kaj, ker moj VB bruteforce za teh 10 karakterjev v s-u bi trajal DOLGO!

Evo, pa imate vsi programerji malce dela, vsaj tisti, ki problem vzamete resno :)
Pozdrav
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"The one who is digging the hole for the other to fall in is allready in it."

Zgodovina sprememb…

  • spremenila: StratOS ()

Thomas ::

Bum, zvečer. Ublubm.
Man muss immer generalisieren - Carl Jacobi

JerKoJ ::

hmm saj ce problem mal bolj pogledas ni treba BF uporabt
se da kr direkt doloct kva je resitev (tut na roke ce znas dobr ascii tabelo)

StratOS ::

jup, vendar "nonulation" ni rešitev :)
morda je kaj narobe z mojim pristopom k stvari ?
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"The one who is digging the hole for the other to fall in is allready in it."

JerKoJ ::

hmm

mal čudn vse skupi

men se zdi enačba čist preprost obrljiva

99('c')-65('A')+75($j)=109('m');
111('o')-77('M')+77($j)=111('o');
...

tko da ne vidm zakaj mo... ne bi bla rešitev

StratOS ::

jaz pa moje kalkulacije !
modulation je pravilno.


No, quest kateri BF program bo prej rešil stvar od začetka recimo z vsemi majhimi ASCII črkami (97-122) je še zmerom odprt !

Škoda da ste tako hitro spoznali trik :O

Na koncu sem moral še program za to naredit (poleg BF)

Sub Main()
Const Dano As String = "AMYBPfPYZV"
Dano1 = "confirming"

j = -75
For i = 1 To Len(Dano1)
For Char = 1 To 255
test = Asc(Mid(Dano, i, 1))
test = test + Char + j
If test = Asc(Mid(Dano1, i, 1)) Then GoTo JupiJa
Next Char
JupiJa:
j = j - 2
Rešitev = Rešitev + Chr(Char)
Next i

MsgBox Rešitev, vbInformation, "Rešitev"
End Sub
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"The one who is digging the hole for the other to fall in is allready in it."

Zgodovina sprememb…

  • spremenila: StratOS ()

Thomas ::

Potem se mi ni treba vmešavat. Good.
Man muss immer generalisieren - Carl Jacobi

darkolord ::

Če se ti mogoče zdi prepočasi, takole bi moralo bit hitrejše:

Sub Main()
Const Dano As String = "AMYBPfPYZV"
Dim j As Long, Char As Byte, i As Long, Rešitev As String, test As long, Dano1 As String
Dano1 = "confirming"

j = -75
For i = 1 To Len(Dano1)
   For Char = 1 To 255
      test = AscW(Mid$(Dano, i, 1))
      test = test + Char + j
      If test = AscW(Mid$(Dano1, i, 1)) Then Exit For
   Next Char
   
   j = j - 2
   Rešitev = Rešitev + Chr$(Char)
Next i

MsgBox Rešitev, vbInformation, "Rešitev"
End Sub

Zgodovina sprememb…

  • spremenilo: darkolord ()

StratOS ::

Ja, ni problema glede tega, poglej kak quest je.

Bruteforcing quest za tistih 10 karakterjev ASCII: 97-122

Ker ste sami odkrili, da se da rešiti "na roke" ni problem napisati proggy za to, gre se kako hitro bo tvoj BF program za zgoraj navedene karakterje rešil ta problem od začetka vsi karakterji ascii 97 naprej :)
aaaaaaaaaa
aaaaaaaaab
.
.
.
modulation : stop ---> time:\
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"The one who is digging the hole for the other to fall in is allready in it."


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

[JAVA] String problem!

Oddelek: Programiranje
151595 (1292) Sergio
»

[Java] Frekvenca besed

Oddelek: Programiranje
71249 (1103) zila90
»

Java-Izdelek-Nujno

Oddelek: Programiranje
71465 (1237) iggy
»

osnove v Javi - zvezdice

Oddelek: Programiranje
403422 (2644) Tutankhamun
»

[NALOGA][Java] Branje vsebine datoteke vzvratno

Oddelek: Programiranje
71555 (1497) SkIDiver

Več podobnih tem