I have a simple code that suppose to read length sized and fetch data from character device in Linux C. This is my code and errno is set to 9. I made sure the file exists and it does. And able to read it with cat /dev/mychardev-0 but why bad file descriptor error at time of read. I am getting
Tag: c++
Removing null bytes for shellcode results in missing char and continuous loop
Update: I have fixed the argv array pointers not being valid causing the continuous loop and have updated the assembly code. Now the only issue is the disappearing space char on compilation. I’ve been experimenting with executing shellcode after exploiting a buffer overflow on a 32-bit Linux VM. My assembly program simply uses execve to start a shell via python
An Error has occured during the migrations System.ArgumentNullException: Value cannot be null. (Parameter ‘connectionString’)
I have the following piece of code In my Program.cs, I have the following I did a publish on a CentOs7. When I am running my application using the command: I have the following error: I do not understand why is the value of my connection string null when I hardcoded directly it in the application. What could be the
Can we update some object without stopping the program?
There is a program written in C++ and running in linux box. It has a configuration file given to it at starting point. I came to know that it can sometime support updating the configuration file without the need to stop the program. As the configuration update means eventually updating some of the objects(member variables) inside the running program. I
Error while linking static library to test script
I’m building a static library for a small project, and when I compile it with ar, it correctly links. When I go to include the relevant header file and link the test script to the archive; I get linker errors; Running ar t libuttu.a returns My test script includes the main header file, uttu.hpp, which itself refers to the np
Add OpenGL to Linux Vscode
I followed this tutorial successfully. But it doesn’t explain how to configure on vscode. Glad is in this folder /usr/include and I did use sudo in the terminal to compile and generate a.out. How do I do that in vscode? I have this error output when I try to build task: terminal My tasks is configured like that: tasks.json How
How to parse values from a C string into a struct timespec
My program will be receiving C string input in the format of Wed, 21 Oct 2015 07:28:00 GMT, e.g. How to convert this into a struct timespec so I can compare with the st_atim, st_mtim, and st_ctim struct timespec’s returned from the stat() function? This post talks about strptime and sscanf, and I also found strftime, but all these convert
How to correctly time speed of writing to a disk (i.e. file) in C
I have a Zynq SoC which runs a Linux system and would like to time the speed at which I can write to its SD card in C. I have tried out clock() and clock_gettime() where for the latter, I have done the following: The times that I’m getting are around 0.019 seconds for 2097152 bytes which I believe is
Can I use ioread32_rep(addr, buf, 2) to replace ioread64()?
I am currently going through Linux Device Drivers book and found the functions for reading from I/O memory: To read from I/O memory, use one of the following: unsigned int ioread8(void *addr); unsigned int ioread16(void *addr); unsigned int ioread32(void *addr); If you must read or write a series of values to a given I/O memory address, you can use the
Is there a command execution vulnerability in this C program?
So I am working on a challenge problem to find a vulnerability in a C program binary that allows a command to be executed by the program (using the effective UID in Linux). I am really struggling to find how to do this with this particular program. The disassembly of the function in question (main function): According to Ghidra, this