My application builds on environments that are older, and do not support newer (specific) system calls. I can’t go upgrading them for reasons I can’t disclose, but instead of making it compile time (which would lose out on any ‘benefits’) I was wondering if there’s a way to do in inline assembly. For example: Is there a way to check
Tag: assembly
How can I make Linux system calls from a C/C++ application, without using assembly, and in a cpu-independent manner? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 4 years ago. Improve this question I am looking to write a program that will need to
Why doesn’t this attempt at using sys_write do anything?
Here it is: Not only does this code not segfault, it also outputs nothing. According to what I’ve read, a program should call sys_exit, or it would segfault, but this does not happen. Answer This instruction will interpret the data at “msg” as 64-bit value and load that value into the register rsi. The instruction does NOT load the address
Pass values from C program to Assembly language
I would like to pass values from C program to Assembly using the linked assembly method instead of inline assembly method in C. Below is the Assembly program(GCD) which is am working on. And this is the C program from with I am trying to pass the values to assembly program When I compile using the below method and run
Is it possible to use both 64 bit and 32 bit instructions in the same executable in 64 bit Linux?
A 64 bit CPU (amd64) supports 32 bit Intel instructions in the compatibility mode. Also, a 64 bit Linux installation allows running ELFs containing 32 bit instructions if the ELF header says it is a 32 bit executable. I was wondering if it is possible to put some assembly instructions inside the ELF which switches the CPU to 32 bit
Why does my shellcode segfault when executed from C, but not as a stand-alone executable?
I’m trying to execute a shell with shellcode. I’ve made this code in a 64-bits machine: After using nasm and linking with ld if i execute the file this works fine. The problem is if i get the shellcode from this and tried to execute it with this program: It gives me a segmentation fault error. I can’t see what’s
NASM division using variables instead of actual values
I’m learning some basic arithmetic using NASM on Linux. I need to divide two numbers using variables NUMBER1 and NUMBER2. My code works if I type in actual value instead of variables. For example if I type in ‘6’ instead of NUMBER2 and ‘2’ instead of NUMBER1, the program does division and gives me answer of 3. Running code with
Segmentation fault in my Assembly implementation
I am new to assembly language programing, and here I am trying to call C standard library function puts from my assembly code, but I am continuously getting segmentaion fault. Please help; Operating system : LINUX 16.04 Assembler : nasm Machine : intel x86 – 64bit Answer to explain Comments More, start with x86 calling convention and your code. x86
Why can’t I mmap(MAP_FIXED) the highest virtual page in a 32-bit Linux process on a 64-bit kernel?
While attempting to test Is it allowed to access memory that spans the zero boundary in x86? in user-space on Linux, I wrote a 32-bit test program that tries to map the low and high pages of 32-bit virtual address space. After echo 0 | sudo tee /proc/sys/vm/mmap_min_addr, I can map the zero page, but I don’t know why I
Linux page table of the process
I’m reading about the memory paging here and now trying to experiment with it. I wrote a simple assembly program for getting Segmentation Fault and ran in gdb. Here it is: I assemble and link this into a 64-bit ELF static executable. As far as I read each process has its own Page Table which cr3 register points to. Now