flat assembler
Message board for the users of flat assembler.

Index > Linux > Beep console for linux?

Author
Thread Post new topic Reply to topic
Gonzalo28



Joined: 03 Feb 2008
Posts: 9
Gonzalo28
Hi all! Very Happy

Beep console for linux?



Sorry for my english
Post 21 Jun 2008, 01:51
View user's profile Send private message Reply with quote
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak
No more giving back...


Last edited by kohlrak on 07 Aug 2008, 14:31; edited 1 time in total
Post 21 Jun 2008, 16:05
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
Gonzalo28



Joined: 03 Feb 2008
Posts: 9
Gonzalo28
Quote:

Same as in windows =p


mmm....kernel function Beep? with frequency and duration?

I search function equivalent for beep(Windows) in linux. In kernel linux i not found.
Post 21 Jun 2008, 17:51
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Code:
format ELF executable
entry start

segment readable executable
start:
  mov     eax, 4 ; SYS_WRITE
  mov     ebx, 1 ; STDOUT
  mov     ecx, beep
  mov     edx, 1
  int     $80

  mov     eax,1
  xor     ebx,ebx
  int     $80

beep db 0x7    


This does a beep on my Debian Etch at least but of course is very far from specifying duration and frequency...

Maybe the answer is writting to something from /dev/ but I can't investigate that right now.
Post 21 Jun 2008, 18:46
View user's profile Send private message Reply with quote
System86



Joined: 15 Aug 2007
Posts: 77
System86
Or you can use the KDMKTONE or KIOCSOUND IOCTL.
Post 21 Jun 2008, 21:01
View user's profile Send private message Reply with quote
gunslinger_



Joined: 06 Feb 2010
Posts: 2
Location: indonesia
gunslinger_
in c language:

Code:
#include <stdlib.h>
#include <fcntl.h>
#include <linux/kd.h>

int main(int argc, char *argv[]) {
    int fd = open("/dev/tty10", O_RDONLY);
    if (fd == -1 || argc != 3) return -1;
    return ioctl(fd, KDMKTONE, (atoi(argv[2])<<16)+(1193180/atoi(argv[1])));
}
    


and i use assembly

Code:
global        _start                  

        

_start:

     jmp short ender

 starter:
        xor eax, eax    
    mov al,5        
    pop ebx         
    mov ecx, edx
        int 80h
     
    mov ebx, eax
        push byte 54
        pop eax
     mov ecx, 4294948047
         not ecx
     mov edx, 61211100
           int 80h
     
    xor eax, eax
        inc al
      xor ebx, ebx
        int 80h
     
    ender:
        call starter      ;put the address of the string on the stack
        db '/dev/tty10'
    


and i use to make shellcode
http://inj3ct0r.com/exploits/12492 <-- high frequency system beep
http://inj3ct0r.com/exploits/12493 <-- low frequency system beep

gunslinger_ Very Happy [/code]
Post 06 Jun 2010, 14:11
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.