This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <openssl/evp.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def vxworks_sum_to_pw(int) | |
out = "%u" % ((int * 31695317) & 0xffffffff) | |
out.bytes.each_with_index do |b, i| | |
out[i] += '!'[0] if out[i] < '3'[0] | |
out[i] += '/'[0] if out[i] < '7'[0] | |
out[i] += 'B'[0] if out[i] < '9'[0] | |
end | |
out | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sum_to_pw(int) | |
out = "%u" % ((int * 31695317) & 0xffffffff) | |
out.bytes.each_with_index do |b, i| | |
out[i] += '!'[0] if out[i] < '3'[0] | |
out[i] += '/'[0] if out[i] < '7'[0] | |
out[i] += 'B'[0] if out[i] < '9'[0] | |
end | |
out | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def vxworks_sum(plaintext) | |
int = 0 | |
0.upto(plaintext.length - 1) do |i| | |
int += plaintext[i] * (i + 1) ^ (i + 1) | |
end | |
int | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# can be called like this: | |
# | |
# spec_run.rb foo.rb | |
# spec_run.rb foo_spec.rb | |
# spec_run.rb foo.rb -e "some test case" | |
ruby_file = "" + ARGV.shift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loaded 71 hackers | |
testing: s.matches_are_sane? = true | |
getting new hackers | |
hacker1 will probably defeat hacker2 | |
picking hacker1 | |
@sequence = "L" (1) | |
i know about 1412 hacker matches | |
guessing accuracy == 0.00% | |
checking on last guess and getting new hackers | |
last guess was good |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first, run protocol.rb for a little while to get some match data into gamelog | |
$ ruby protocol.rb | |
...later... | |
# then, run smart.rb (reads gamelog and plays games with the server until it wins) | |
$ ruby smart.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.FlowLayout; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.io.DataInputStream; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.io.PrintStream; | |
import java.net.InetAddress; | |
import java.net.Socket; | |
import javax.swing.ImageIcon; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main(int argc, char **argv) { | |
char buf[14]; | |
char *pass, *salt; | |
if(argc < 3) { | |
printf("usage: %s password salt\n", argv[0]); | |
return 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
PASS_BIN = 'pass' | |
SHADOW_FILE = ARGV[0] | |
lines = File.read(SHADOW_FILE).split("\n") | |
def generate_password(user) | |
'houdini!@#' + user | |
end |