currect = 0xeaaeb43e477b8487 # = 16910651830403040391, -1536092243306511225
mul = 26729
guess = ''
1.upto(16) do |pos|
0.upto(15) do |hex|
if ((sprintf("%x", hex) << guess).to_i(16) * mul) & ((16**pos)-1) == (currect & (16**pos)-1)
guess = sprintf("%x", hex) << guess
break
end
end
end
answer = guess.to_i(16)
puts sprintf("%x", answer)
puts sprintf("%d", answer)
puts sprintf("%d", answer -1 - (16**16-1))
# answer = 0x83676f67696c676f, 9468659231510783855, -8978084842198767761
# java class source
__END__
// Decompiled by DJ v3.6.6.79 Copyright 2004 Atanas Neshkov Date: 2013-05-06 오후 7:17:08
// Home Page : http://m...content-available-to-author-only...y.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: JavaCrackMe.java
import java.io.PrintStream;
public class JavaCrackMe
{
public JavaCrackMe()
{
}
public static final synchronized volatile transient void main(String args[])
{
try
{
System.out.println("Reversing.Kr CrackMe!!");
System.out.println("-----------------------------");
System.out.println("The idea came out of the warsaw's crackme");
System.out.println("-----------------------------\n");
long l = Long.decode(args[0]).longValue();
l *= 26729L;
if(l == 0xeaaeb43e477b8487L)
System.out.println("Correct!");
else
System.out.println("Wrong");
}
catch(Exception exception)
{
System.out.println("Please enter a 64bit signed int");
}
}
}