intent
stringlengths
4
313
snippet
stringlengths
2
271
divide eax by ebx
div ebx
move address of request variable into ecx
mov ecx, request
decrement the eax register by one
dec eax
declare the exit_on_error label
exit_on_error:
push esi onto the stack
push esi
move the 4 bytes of data at address esi+4*ebx into edx
mov edx, [esi+4*ebx]
declare msg string containing 'hello world!'
msg db 'hello, world!', 0xa
push 0xa to the stack
push 0xa
restore eax from the value we pushed onto the stack at the start
pop eax
push the double word 0x313a303a onto the stack
push dword 0x313a303a
move the remainder into eax
mov eax, edx
create a new process
mov eax, 2
move readbuffer into ecx
mov ecx, readbuffer
syscall 63
mov al, 0x3f
move cl into the address [esp + 1]
mov [esp + 1], cl
push the dword 0x6b2f7379 onto the stack
push dword 0x6b2f7379
push the dword 0x7665642f onto the stack
push dword 0x7665642f
define shellcode label
shellcode:
decrement the ecx register and jump to the L1 label if the contents of the ecx register is not zero and the zero flag is zero else jump to the shellcode label
loopnz L1 \n jmp shellcode
define download function
download:
define the numeric label 2
2:
move exit_call into al
mov al, exit_call
declare a byte with no label containing the value 10
db 10
if zero jump to the child label
jz child
push the contents of the edx register onto the stack and point ebx to the stack register
push edx \n mov ebx, esp
set the contents of edx to zero
xor edx, edx
move decimal 43 into edx
mov edx, 43
push zero_reg onto the stack
push zero_reg
restore the original value of eax
pop eax
push byte 6 onto the stack
push byte 6
allocate memory for 30 bytes uninitialized name variable
name db 30 dup
define egg equal to 'egg '
egg equ 'egg '
decrement ebp
dec ebp
put the syscall 0x04 into the eax register
push byte 0x04 \n pop eax
declare the priv_setgid label
priv_setgid:
pop the value on the stack back into ecx
pop ecx
jump to the shell label
jmp shell
push the word 0x0a to the stack
push word 0x0a
declare the here label
here:
move 5 into eax
mov eax, 0x5
getppid
mov eax, 64
move decimal number 255 into edx
mov edx, 255
if the contents of the bl register is equal to the contents of the al register then jump to the loop_2 label else jump short to the not_found label
cmp bl, al \n je loop_2 \n jmp short not_found
call the two function
call two
move al into ebx+7
mov [ebx+7], al
zero out zero_reg
xor zero_reg, zero_reg
move 0x3f into al
mov al, 0x3f
define constant total_students equal to 50
total_students equ 50
move the contents of the esi register into the dword at the memory location [esp-4]
mov dword [esp-4], esi
clear ebx register
xor ebx, ebx
push double word 0x39396e2d onto the stack and point the edi register to the stack register
push dword 0x39396e2d \n mov edi, esp
declare code section .bss
section .bss
move 0x1e into cl
mov cl, 0x1e
add one to the doubleword integer stored at memory location value
inc dword [value]
push 0x0a206873 onto the stack
push 0x0a206873
push the value 0x69622f2f onto the stack and point the ecx register to the stack register
push 0x69622f2f \n mov ecx, esp
zero out ax register
xor ax, ax
push the byte 0xb onto the stack
push byte 0xb
push the byte 0x0 onto the stack
push byte 0x0
add 4 to the contents of the esi register
add esi, 4
move 0xf into al
mov al, 0xf
put the byte my_value into the eax register
push byte my_value \n pop eax
move value at top of the stack to ebx
mov ebx, [esp]
move bx to count
mov count, bx
declare the incaddr label
incaddr:
define the _exit label
_exit:
zero out the eax register and jump to the l3 label if the contents of the edx register is not equal to the contents of the eax register
xor eax, eax \n cmp edx, eax \n jne l3
push the esp onto the stack
push esp
push 0x16 onto the stack
push 0x16
move 0x21 into al
mov al, 0x21
push the 0x3170762d onto the stack
push 0x3170762d
call the sprint function
call sprint
push the value 0x2f2f2f2f onto the stack and point eax to the stack register
push 0x2f2f2f2f \n mov eax, esp
jump to the IncAddr label if the value in the eax register is not equal to the doubleword addressed by edi else jump to the edi register
scasd \n jnz IncAddr \n jmp edi
left shift eax by two bits
shl eax,2
compare the byte in esi with 0x7
cmp byte [esi], 0x7
move the byte at the address 3h into al
mov al, byte 3h
add 2 to the contents of the ebx register
add ebx, 2
push the contents of the esi register onto the stack.
push esi
move 0x06 into al
mov al, 0x06
define the _setsockopt label
_setsockopt:
move 0x30 into al
mov al, 0x30
make the socketcall
mov al, 0x66
push the 0x6e onto the stack
push 0x6e
push the word 0x02 onto the stack
push word 0x02
load the effective address of ebx+8 into ecx
lea ecx, [ebx+8]
jump to the wrap_around label if the byte starting at the address contained in the esi register is lower than the byte value 0xD else subtract the byte value 0xD from byte starting at the address contained in the esi register
cmp byte [esi], 0xD \n jl wrap_around \n sub byte [esi], 0xD
declare the done label
done:
push 0x5 onto the stack
push 0x5
declare retry label
retry:
declare buffersize to be a word containing 1024
buffersize: dw 1024
push the word 0x3930 onto the stack
push word 0x3930
push 0x682f2f2f onto the stack
push 0x682f2f2f
exchange ebx with ecx
xchg ebx, ecx
call the strlen function
call strlen
move the doubleword 0x65676760 into edx
mov edx, dword 0x65676760
clear ebx
xor ebx, ebx
section data
section .data
push the contents of the edi register onto the stack
push edi
put the syscall 0x66 into the eax register
push byte 0x66 \n pop eax