system-calls

Reading input from keyboard with x64 linux syscalls (assembly)

旧时模样 提交于 2020-01-30 11:51:33
问题 I'm trying to learn how to use linux 64bits syscall in assembly. I was writing some code for reading keyboard and simply print it on screen the pressed keys: i'm using sys_read. The code: section .text global _start _start: ;write startmsg mov rax, 1 mov rdi, 1 mov rsi, startmsg mov rdx, sizestart syscall ;using sys_read mov ax, 0 mov rdi, 0 mov rsi, key mov rdx, 2 syscall ;trying to see if esc is pressed then exit mov rbx, 0x1b cmp rbx, key je _exit _exit: mov rax, 60 mov rdi, 0 syscall

Reading input from keyboard with x64 linux syscalls (assembly)

断了今生、忘了曾经 提交于 2020-01-30 11:50:05
问题 I'm trying to learn how to use linux 64bits syscall in assembly. I was writing some code for reading keyboard and simply print it on screen the pressed keys: i'm using sys_read. The code: section .text global _start _start: ;write startmsg mov rax, 1 mov rdi, 1 mov rsi, startmsg mov rdx, sizestart syscall ;using sys_read mov ax, 0 mov rdi, 0 mov rsi, key mov rdx, 2 syscall ;trying to see if esc is pressed then exit mov rbx, 0x1b cmp rbx, key je _exit _exit: mov rax, 60 mov rdi, 0 syscall

Arguments in syscall intercept using loadable kernel module seem to be broken

淺唱寂寞╮ 提交于 2020-01-29 13:25:23
问题 First post so I apologize for the possibly low quality explanation. I was trying to write a loadable kernel module that does nothing but intercept syscalls to SYS_open, print the arguments to KERN_INFO and then forward the arguments to the real syscall. The forwarding part seems to be working just fine, but I'm having issues with the printing, arguments seem to be broken, from the syscall interceptor function's perspective. Following are the pointer to the real open syscall as well as the

Arguments in syscall intercept using loadable kernel module seem to be broken

人走茶凉 提交于 2020-01-29 13:25:06
问题 First post so I apologize for the possibly low quality explanation. I was trying to write a loadable kernel module that does nothing but intercept syscalls to SYS_open, print the arguments to KERN_INFO and then forward the arguments to the real syscall. The forwarding part seems to be working just fine, but I'm having issues with the printing, arguments seem to be broken, from the syscall interceptor function's perspective. Following are the pointer to the real open syscall as well as the

Arguments in syscall intercept using loadable kernel module seem to be broken

梦想的初衷 提交于 2020-01-29 13:23:21
问题 First post so I apologize for the possibly low quality explanation. I was trying to write a loadable kernel module that does nothing but intercept syscalls to SYS_open, print the arguments to KERN_INFO and then forward the arguments to the real syscall. The forwarding part seems to be working just fine, but I'm having issues with the printing, arguments seem to be broken, from the syscall interceptor function's perspective. Following are the pointer to the real open syscall as well as the

syscall from within GCC inline assembly [duplicate]

ⅰ亾dé卋堺 提交于 2020-01-28 01:24:12
问题 This question already has answers here : How to invoke a system call via sysenter in inline assembly? (2 answers) Closed 11 months ago . is it possible to write a single character using a syscall from within an inline assembly block? if so, how? it should look "something" like this: __asm__ __volatile__ ( " movl $1, %%edx \n\t" " movl $80, %%ecx \n\t" " movl $0, %%ebx \n\t" " movl $4, %%eax \n\t" " int $0x80 \n\t" ::: "%eax", "%ebx", "%ecx", "%edx" ); $80 is 'P' in ascii, but that returns

How to pass parameters to Linux system call?

社会主义新天地 提交于 2020-01-22 13:13:05
问题 I'm a college student studying OS. I'm trying to add my own system call in Linux kernel, and something is going wrong. My environment is stated below: Linux Kernel v.4.19.1 64-bit Ubuntu LTS 18.04.1 with Intel Core i5-4210M CPU on Oracle VirtualBox 5.2.18 64-bit Windows 10 Home 1803 as a host machine Since I'm working on x86_64 machine, I started with arch/x86/entry/syscalls/syscall_64.tbl . In Linux kernel v.4.19.1, the last entry is 334 common rseq __x64_sys_rseq so I added those three

Make a program using only system-calls not windows dll's [duplicate]

醉酒当歌 提交于 2020-01-21 20:09:33
问题 This question already has an answer here : Windows system calls [duplicate] (1 answer) Closed 2 years ago . I am trying to make a program work with system-calls not dll's ( kernel32.dll , ntdll.dll ). I know for example that the 0x2C (44) system call in windows 10 64-bit is the NtTerminateProcess buy that web page. Also when I disassemble the ntdll.dll i found that code: NtTerminateProcess: mov r10, rcx mov eax, 44 test byte [abs 7FFE0308h], 01h ;also what is in that memory address? jnz label

Missing syscalls in gem5 ARM

一笑奈何 提交于 2020-01-21 18:52:09
问题 I am having the following error in gem5. This happens in ARM only. With X86 I see some syscalls being ignored but none causing a fatal error. tomas@ubuntu:~/gem5$ ./build/ARM/gem5.opt configs/example/arm/starter_se.py ../tests_gem5/hello gem5 Simulator System. http://gem5.org gem5 is copyrighted software; use the --copyright option for details. gem5 compiled Jul 9 2018 17:09:01 gem5 started Jul 9 2018 18:07:37 gem5 executing on ubuntu, pid 5064 command line: ./build/ARM/gem5.opt configs

How to search the Local file system of Windows using Javascript?

孤人 提交于 2020-01-17 18:01:32
问题 Operating system : Windows 8. Input-from : A text field from a html page . Input-type: text. Output : the file that was searched. What I want : I want the user to enter some keywords and have JavaScript search the user's local files... Is there any way? or A javascript Library?.... And how I can query the file system about the files using Javascript..in Windows.. EDIT:: Thanks everyone for the reply... The way I get it is ,either I have to develop my own browser based in Java that has