anonymous hacks and reverse engineering voodoo


July 2015

Ex-Machine: the code

There’s a point in the film where Caleb is entering code on Nathan’s workstation. And unlike code you’d find in other films, this one actually serves a useful purpose as mentioned in my earlier post.

If you’d like to play with the code in Google’s own Code Playground, you can copy & paste this snippet adapted to work with google’s webapp API:

import webapp2

def sieve(n):
    x = [1] * n
    x[1] = 0
    for i in range(2,n/2):
            j = 2 * i
            while j < n:
                    j = j+i
    return x
def prime(n,x):
    i = 1
    j = 1
    while j <= n:
            if x[i] == 1:
                    j = j + 1
            i = i + 1
    return i - 1

def DeusEx():
  code = [1206,301,384,5]
  key =[1,1,2,2,]
  out = "".join(chr(i) for i in [73,83,66,78,32,61,32])
  for i in range (0,4):
      out += str(prime(code[i],x)-key[i])
  return out

# WebApp 
class MainHandler(webapp2.RequestHandler):

  def get(self):  # pylint:disable-msg=invalid-name
    """Handle GET requests."""

APP = webapp2.WSGIApplication([
    ('/.*', MainHandler),
], debug=True)

In case you were wondering, the ISBN number is generated by concatenating the 1206th, 301th, 384th, and 5th prime number, where each pair is subtracted by an N starting with 1, 2, and so on:

The 1,206th prime is 9,781. -1
The 301st prime is 1,993. -1
The 384th prime is 2,657. -2
The 5th prime is 11. -2
= 9780 1992 2655 9

73,83,66,78,32,61,32 are the ascii characters for “ISBN = ”

Of course, the name of the function “sieve” is a reference to a method of reducing number of prime candidates as described on this wiki


Deus Ex-Machina

Following up on my previous post where I had talked about the latest AI movie Ex-Machina, I thought you’d be interested in examining some of the BlueBook’s source code. (WARNING: SPOILER)

Continue reading “Deus Ex-Machina”

Sentient Machines

Have you seen the latest flick Ex-Machina? If you haven’t, you must. Having re-watched it a few times by now, I find myself enthralled by it’s message and apprehensive of the implication of that message. Are we, humans, capable of building truly sentient machines? And if it were possible, could we ensure these machines we build would be benign or the beginning of the end of our entire kind?

As a software programmer, a hacker, I’m particularly interested in the field of artificial intelligence. What does it really mean to be intelligent? Obviously being able to sum up a pair of digits (such as a 2) doesn’t make one smart; capable of pulling of simple arithmetic operations, but definitely not smart. But what about a machine capable of making many mathematical computations in a very short span of time, over and over again, in perpetuity and without a pause; does that make for an intelligent machine? Hardly. Just like we cannot in full conscience define computers as intelligent. They are very capable machines, perfectly fit to solve specific problems. But do they posses true intelligence? I think not.

The Mariam-Webster Dictionary defines the word “intelligence” as

the ability to learn or understand things or to deal with new or difficult situations

Thus, the mark of true intelligence is the ability to learn new things. Therefore the key to building a truly intelligent system is to program it to be able to learn: process new input, acquire and catalogue information in a meaningful way so as to be able to reference these vast stores of data to make sense of reality (through external stimuli) and chart future course of action.

And just how do we go about building such a machine? That I will touch on in my future musings.. stay tuned.


… I have nothing to say… yet.

Stay tuned …

Blog at

Up ↑