Lynux-Penguin + and others, _asm_?

This is a discussion on Lynux-Penguin + and others, _asm_? within the C Programming forums, part of the General Programming Boards category; hey, you told me to do this to kill a program: _asm_(" mem.addrss. here ") and i did it, and ...

  1. #1
    Unregistered
    Guest

    Angry Lynux-Penguin + and others, _asm_?

    hey, you told me to do this to kill a program:
    _asm_(" mem.addrss. here ") and i did it, and it worked! BUT that was the only time it worked, i didn't save the prog. caue i was testing it. but when i rewrote it, it didn't work, i tried thosands of times and then all of a sudden it worked 1 time again. but again it's not working agian. please help

  2. #2
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    Posts
    533
    it is two _'s
    example:
    Code:
    void main() {
    __asm__("
            jmp    0x1f                     # 2 bytes
            popl   %esi                     # 1 byte
            movl   %esi,0x8(%esi)           # 3 bytes
            xorl   %eax,%eax                # 2 bytes
    	movb   %eax,0x7(%esi)		# 3 bytes
            movl   %eax,0xc(%esi)           # 3 bytes
            movb   $0xb,%al                 # 2 bytes
            movl   %esi,%ebx                # 2 bytes
            leal   0x8(%esi),%ecx           # 3 bytes
            leal   0xc(%esi),%edx           # 3 bytes
            int    $0x80                    # 2 bytes
            xorl   %ebx,%ebx                # 2 bytes
            movl   %ebx,%eax                # 2 bytes
            inc    %eax                     # 1 bytes
            int    $0x80                    # 2 bytes
            call   -0x24                    # 5 bytes
            .string \"/bin/sh\"             # 8 bytes
    					# 46 bytes total
    ");
    }
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21