EvilZone

Programming and Scripting => Assembly - Embedded => : xor December 11, 2010, 05:20:48 PM

: [Linux x86] - copy a file to another directory
: xor December 11, 2010, 05:20:48 PM
: (asm)
.section .data
        .globl _start

_start:
        nop
        jmp  loadstring

main:
        xor  %eax, %eax
       
        pop  %ebx          # load our string
        movb %al, 7(%ebx)  # terminate string
        movb %al, 15(%ebx)
        movb %al, 23(%ebx)
        mov  %ebx, 24(%ebx)

loadstring:
        call main
        .ascii "/bin/cpS/bin/shS/tmp/shN"

First part and second part of the .ascii string are which file to be copied, and last part is where to copy it to. The S and N are just for padding and string termination.
: Re: [Linux x86] - copy a file to another directory
: xor January 15, 2011, 08:30:44 AM
Obviously no one noticed, but this ASM is incomplete. It prepares the command line arguments for moving a file, but doesn't actually execute the syscall to start the move. Lets see if any of you can complete it. :)
: Re: [Linux x86] - copy a file to another directory
: ande January 15, 2011, 04:39:38 PM
: (asm)
int 0x80