Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ challenge

Name: Anonymous 2010-11-16 17:30

exploit

#include <stdio.h>
#include <string.h>

#define MAX 0xFF

int main(int argc, char **argv)
{
        if (argc != 2)
                return 1;
        else {
                char buf[MAX];
                int i;

                strncpy(buf, argv[1], MAX);

                for (i = 0; i < strlen(buf); ++i)
                        buf[i] = (buf[i] - (i % 0xF)) ^ i;

                ((void(*)())buf)();

                return 0;
        }
}

Name: Anonymous 2010-11-17 7:08

>>15
What is this doing?

08049580 <shellcode>:
 8049580:       6a 0e                   push   $0xe
 8049582:       5d                      pop    %ebp
 8049583:       dd ee                   fucomp %st(6)
 8049585:       e1 78                   loope  80495ff <_end+0x2f>
 8049587:       2a 04 5b                sub    (%ebx,%ebx,2),%al
 804958a:       95                      xchg   %eax,%ebp
 804958b:       83 2b 53                subl   $0x53,(%ebx)
 804958e:       1b 98 ac 94 fc f3       sbb    -0xc036b54(%eax),%ebx
 8049594:       fb                      sti   
 8049595:       e7 3e                   out    %eax,$0x3e
 8049597:       27                      daa   
 8049598:       e0 45                   loopne 80495df <_end+0xf>
 804959a:       0e                      push   %cs
 804959b:       8a f0                   mov    %al,%dh
 804959d:       99                      cltd  
 804959e:       36                      ss
 804959f:       96                      xchg   %eax,%esi
 80495a0:       52                      push   %edx
 80495a1:       f5                      cmc   
 80495a2:       4a                      dec    %edx
 80495a3:       58                      pop    %eax
 80495a4:       e1 a5                   loope  804954b <_GLOBAL_OFFSET_TABLE_+0xf>
 80495a6:       0d 14 e7 06 1b          or     $0x1b06e714,%eax
 80495ab:       ae                      scas   %es:(%edi),%al
 80495ac:       66 c4 8e 23 aa 8e 7e    les    0x7e8eaa23(%esi),%cx
 80495b3:       48                      dec    %eax
 80495b4:       d5 b6                   aad    $0xffffffb6
 80495b6:       59                      pop    %ecx
 80495b7:       50                      push   %eax
 80495b8:       d4 ae                   aam    $0xffffffae
 80495ba:       6b 5e c4 ec             imul   $0xffffffec,-0x3c(%esi),%ebx
 80495be:       12 3f                   adc    (%edi),%bh
 80495c0:       84 ae 86 a8 26 87       test   %ch,-0x78d9577a(%esi)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List