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);
}