• Stars
    star
    186
  • Rank 206,127 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tool for predicting the output of random number generators

Foresight

foresight is a python library for predicting the output of random number generators across a variety of platforms and languages including:

  • glibc
  • MSVC
  • PHP
  • Java
  • MySQL

This repository also contains a simple wrapper (called foresee) around this library that provides a CLI.

Installation

To install foresight, clone this repository and run python setup.py install.

Library Usage

The library is divided into subpackages for each supported platform. These subpackages then provide submodules for each supported function. For example,the following sample will predict the output of the glibc rand_r from some prior outputs:

from foresight.glibc import rand_r

prior_outputs = [int(i) for i in input().split()]
future_outputs = rand_r.from_outputs(prior_outputs)

for output in future_outputs:
    print(output)

Generally, each module provides the following functions:

  • from_seed(seed): get a generator to the future values returned by the RNG when seeded with the given value.

  • from_outputs(prev_values): attempt to predict the internal state of the RNG from the given prior outputs. If successful, returns a generator to the future values returned by the RNG.

CLI Usage

Command line usage of the library has the following general form:

foresee <platform> <function> [<options>]

For example, the above script is equivalent to the following foresee command:

foresee glibc rand_r -o <the prior outputs>

By default, an infinite stream is generated. The output may be limited to the next N outputs with -c N.

Tests

Tests can be run with nose by first installing the package with pip install nose, and then running nosetest in the project root.

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details

Contributing

Keeping in mind that this project is still fairly unstable, contributions are welcome.

More Repositories

1

dwarfexport

Export dwarf debug information from IDA Pro
C++
204
star
2

pISO

Hardware and software source for the pISO
Rust
138
star
3

transient

A wrapper for QEMU allowing the creation of virtual machines with shared folder, ssh, and disk creation support.
Python
99
star
4

janet-mode

A major mode for the janet programming language: https://janet-lang.org/
Emacs Lisp
44
star
5

PuppyJusticeAutomated

A utility for generating PuppyJustice videos with Oyez.org transcripts and audio
Python
27
star
6

devirtualize

Python
17
star
7

lfpAlloc

A lock-free pool-based allocator using C++11 facilities
C++
15
star
8

elvish-mode

A major mode for the Elvish programming language
Emacs Lisp
14
star
9

freud

A C++ library for structure-based memory analysis
C++
7
star
10

flycheck-nim

A flycheck syntax checker for nim
Emacs Lisp
6
star
11

Quad

A simple puzzle game using Phaser js
JavaScript
6
star
12

power-mode.el

Like "activate-power-mode" for atom
Emacs Lisp
5
star
13

entrospy

A command line tool for entropy analysis
C++
5
star
14

SyntaxAwareSearch

A syntax aware search tool
C++
4
star
15

transient-baseimages

A collection of base Imagefiles for transient https://transient.readthedocs.io/en/latest/
Shell
3
star
16

rapport

A ROP utility
C++
2
star
17

cppEvolve

A C++ library for developing genetic programs
C++
2
star
18

keyview

A python utility for viewing information about cryptographic keys and certificates
Python
2
star
19

devolve

A genetic programming library in D
D
2
star
20

nonogram

A nonogram implementation for emacs
Emacs Lisp
2
star
21

parsecpponline

A website backed by clang that shows an interactive AST representation of source.
JavaScript
1
star
22

spread

A flood-it style puzzle game for emacs
Emacs Lisp
1
star
23

cpputils

A collection of dependency-free implementations of useful C++ utilities
C++
1
star
24

flycheck-janet

A flycheck synatx checker for Janet: https://janet-lang.org/
Emacs Lisp
1
star
25

binutils

C
1
star
26

deinopis

A text similarity engine for reddit
JavaScript
1
star
27

scapy-pgp

A scapy layer for OpenPGP
Python
1
star
28

tftprs

A TFTP implementation in Rust
Rust
1
star
29

selfpass-chrome-extension

JavaScript
1
star
30

selfpass

Python
1
star
31

PlanetsWeb

Web based real-time strategy game
JavaScript
1
star
32

buildroot

Buildroot fork for the pISO project
Makefile
1
star
33

uefi-example

Minimal example to reproduce compiler-builtins issue on uefi
Rust
1
star
34

PolygonPanic

JavaScript
1
star
35

flycheck-elvish

Adds flycheck support for the Elvish programming language: https://elvish.io/
Emacs Lisp
1
star
36

gather-keepass-http-creds

A demo tool that gathers credentials from keepass through keepass-http
Python
1
star
37

mlnx_release_mirror

Mirror of the Mellanox OFED releases
1
star
38

pthy

A hy language REPL
Python
1
star
39

cec

A library providing extended C++ containers
C++
1
star
40

dotfiles

A collection of various configuration files
Emacs Lisp
1
star
41

channel9.bundle

A Channel 9 plugin for plex media server
Python
1
star