Thursday, 13 December 2012

Cheating with ZSNES

I had some fun time playing with the cheat feature in ZSNES emulator. What you are basically doing with this feature is to find values in memory and fix them to whatever value you decide. You can do more than just changing numerical values on screen, take a look at what I do with Super Ghouls and Ghosts here for example (Look at 22:26).


In some games you have a state where your character is blinking, usually right after you have been hit by an enemy. It is possible to lock your character in this state and become immortal (almost).

The state is controlled by the value of a variable. It's completly different in every game. But it is possible to find it.

In Super Mario World for example, when you pick up a star there is a counter that counts up or down until it reaches a certain value. And then when the counter has reached this final value your star power is gone. You can find this value with the compare method and fix it to any number, and you will have infinite star.

I also found a way to change my character into flower mode, or other strange unknown modes. But eventually the game crashed.

Saturday, 20 October 2012

Generic Assembler

This is an assembler I made for developing my own CPU, I can use this program to define what I want my opcodes to look like and make simple test programs with it. It is not really complete, I cannot use #define for example, but it is supposed to support #define, to use macros like you can in C.

And for some reason opcodes looks like they are shifted one bit to the left. I noticed this when I was recording this video, it was over a month ago I worked on this project so I really don't know why right now. Even though the assembler has this bug the .set file I wrote for DCPU-16 seems to assemble the correct opcodes so I really don't know what happened.

Also opcodes are limited and locked to 16 bits, but that should be configurable in the future, but still the maximum size of an opcode is 64 bits.

Be sure to look at this video in 720p

http://youtu.be/ejKyaFMzhNM?hd=1

You can check out the source code here:
https://github.com/Spekkio/spekkio_asm

Wednesday, 3 October 2012

Hide email addresses from email scanners

I have always wondered how spammers can find my email adress. Do they just send mail to random adresses and hope it will arrive. My idea was that there were scanners that search the web and find e-mail adresses on random web sites.

So I wanted to hide the e-mail adress in the HTML code somehow, but still keep the original function of a mailto: link.

Take this simple Javascript.

function mejl(adress) {
window.location = "mailto" + unescape("%3A") + decode(adress);
}

It can be used on a normal link like this:

<a href="javascript:mejl('znkv.sbb@ubzr.fr')">mail me</a>

As you can see there is my e-mail adress encoded using ROT-13, znkv.sbb@ubzr.fr. It also looks like a working e-mail adress. So an e-mail scanner might pick it up and think it is a real adress. The decode() function can be replaced with any de-randomizing function you can come up with yourself. But here's the ROT-13 decoder.

var rot13map;

function rot13init()
{
  var map = new Array();
  var s   = "abcdefghijklmnopqrstuvwxyz";
 
  for (i=0; i<s.length; i++)
    map[s.charAt(i)]            = s.charAt((i+13)%26);
  for (i=0; i<s.length; i++)
    map[s.charAt(i).toUpperCase()]    = s.charAt((i+13)%26).toUpperCase();
  return map;
}

function decode(a)
{
  if (!rot13map)
    rot13map=rot13init();
  s = "";
  for (i=0; i<a.length; i++)
    {
      var b = a.charAt(i);

      s    += (b>='A' && b<='Z' || b>='a' && b<='z' ? rot13map[b] : b);
    }
  return s;
}

function mejl(adress) {
    window.location = "mailto" + unescape("%3A") + decode(adress);
}

Thursday, 7 June 2012

FFT Animation

I played a little with the FFT I wrote in C which I showed in my previous post. My program transforms chunks of data from a soundfile, prints it in text files. Then plots are plotted with gnuplot and assembled into a video with mencoder. Source code of the program used can be found here

https://github.com/Spekkio/dig_filter/tree/master/fft/complex_builtin

Thursday, 31 May 2012

FFT

I have wasted to much time trying to write a DFT algoritm in C, source code can be found here. It's not very good, but it computes correctly. Here is an example, where I put in a noisy signal, it contains three sine signals, with frequencies 2Hz, 17Hz and 401Hz with different amplitudes and some noise. It looks like this

And after the Fourier Transform i get this data
In the code I simply checked which frequencies was larger than 0.35 in amplitude, and saved them. The other ones was zeroed. After and inverse fourier transform with the ifft() function. The output was this.
Pretty :)

Tuesday, 8 May 2012

Discrete low-pass filter in C

I was interested in trying to make a discrete low-pass filter in C, also make it so that it can take data from from the pipe maybe. Anyway, the filter_rc() function can take data by keep pushing in new values and it takes care of everything.

One problem that my program has is that it cannot run forever, it can only take a limited amount of samples till the buffer is full. I think it is possible to check the value with the first index in the buffer (the last_value[] buffer), and if it is zero the buffer can shift down, I think this will work. Since the zero values in the sum isn't necessary anymore.

Here is a plot of the output, the input is a Sine Wave with 1 Amplitude, and 42Hz. It's plotted over 0.1s. And the filter is C=4.7uF, R=5k. The program can take any input, it doesn't have to be a sine wave. The red curve has 20 samples over 0.1s, and the green has 100 samples over 0.1s.
The Program can be found here https://github.com/Spekkio/dig_filter/blob/master/main.c