flat assembler
Message board for the users of flat assembler.

Index > Non-x86 architectures > [linux] how to arrange for the arguments ioctl?

Author
Thread Post new topic Reply to topic
sergo_mat



Joined: 12 Nov 2015
Posts: 7
sergo_mat 12 Nov 2015, 11:00
Please help me figure out how to make a call ioctl EVIOCGKEY
Code:
start_key:
     stmfd   sp!, {r1-r2, r7, lr}

    mov     r7, toch_desc
    ldr     r0, [r7]
    imm32 r1,  EVIOCGKEY
    imm32 r2,  newt
    mov r7,  sys_ioctl
    swi     0
    ldmfd   sp!, {r1-r2, r7, pc}    ; return 

 EVIOCGKEY =  0x4518


 newt:
      dw 256 dup(?)    
edit by revolution: Added code tags
Post 12 Nov 2015, 11:00
View user's profile Send private message AIM Address Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20421
Location: In your JS exploiting you and your system
revolution 12 Nov 2015, 11:41
sergo_mat: To load arbitrary constants you need to do it in more than one instruction, or use a LDR instruction and load from memory. To access memory pointers close to the code you can use ADR.
Code:
EVIOCGKEY       = 0x4518
toch_desc       = 0x12345678
sys_ioctl       = 0x87654321

start_key:
        stmfd   sp!,{r1-r2,r7,lr}
        ldr     r7,[constant_toch_desc]
        ldr     r0,[r7]
        ldr     r1,[constant_EVIOCGKEY]
        adr     r2,newt
        ldr     r7,[constant_sys_ioctl]
        swi     0
        ldmfd   sp!,{r1-r2,r7,pc}       ;return

constant_EVIOCGKEY:     dw      EVIOCGKEY
constant_toch_desc:     dw      toch_desc
constant_sys_ioctl:     dw      sys_ioctl

newt:           dw      256 dup(?)    
Post 12 Nov 2015, 11:41
View user's profile Send private message Visit poster's website Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 7
sergo_mat 12 Nov 2015, 11:56
Thank you but the question is that how to arrange for the arguments ioctl
to get data from the touchscreen
/dev/input/event0
Post 12 Nov 2015, 11:56
View user's profile Send private message AIM Address Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20421
Location: In your JS exploiting you and your system
revolution 12 Nov 2015, 12:09
sergo_mat: Your question appears to be related to your OS. Which OS are you using?
Post 12 Nov 2015, 12:09
View user's profile Send private message Visit poster's website Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 7
sergo_mat 12 Nov 2015, 12:12
Linux
Post 12 Nov 2015, 12:12
View user's profile Send private message AIM Address Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 7
sergo_mat 12 Nov 2015, 12:14
I have successfully open /dev/input/event0 and get fd
Post 12 Nov 2015, 12:14
View user's profile Send private message AIM Address Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 7
sergo_mat 12 Nov 2015, 12:18
Next, we need to use the argument ioctl EVIOCGKEY and then there is a problem ioctl returns an error FFFFFFEA
Post 12 Nov 2015, 12:18
View user's profile Send private message AIM Address Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1398
Location: Piraeus, Greece
Picnic 23 Feb 2016, 09:16
sergo_mat are you trying to get the coordinates of touchscreen?
If you did, can you provide an arm code sample (or give a few more information on how).
Post 23 Feb 2016, 09:16
View user's profile Send private message Visit poster's website Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 7
sergo_mat 20 Jun 2016, 13:34
You can obtain the coordinates tochskreen well as keystrokes but you need to read the size of the virtual file to find out whether or not it was touch
Post 20 Jun 2016, 13:34
View user's profile Send private message AIM Address Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 7
sergo_mat 07 Feb 2021, 09:05
Help, can anyone come across trying to output sound through db "/ dev / snd / pcmC0D0p", 0 when opening decryptor = 3 but I can not write the structure using SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR ('A', 0x11, struct sndrv_pcm4_hw_params

SNDRV_PCM_IOCTL_HW_PARAMS =0xc25c4111

FFFFFFE7-ANSWER
Post 07 Feb 2021, 09:05
View user's profile Send private message AIM Address Reply with quote
Melissa



Joined: 12 Apr 2012
Posts: 125
Melissa 27 Sep 2021, 13:56
take a look at source code of driver, and modify as needed
Post 27 Sep 2021, 13:56
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.