Category "c"

I have a buffer overflow assignment like this, I set the correct varaible to the HEX value of 1 (31) and still nothing, how do I solve this

How do I set the value of correct to 1 with an buffer overflow exploit? When I pass nothing to this the value of temper is 4D2 which is hex for 1234, but when I

Linux Kernel Module never reaches ->probe() functions

Summary I want to write a simple Linux Kernel Module, which will initialize a GPIO from information it got from device tree. But currently my module never enter

Get this to buffer overflow / Finding Vulnerabilities

I have been set an assignment where I am to find vulnerabilities in the code however I don't seem to be able to find one. I am very new to C and have the basic

Keep k random strings from input file of unknown length in C

Problem I want to get input from a file of unknown length, separating the input to strings at a defined delimiter and saving some of them. After reading the ent

What does "%%%ds" mean in a c program formatting text?

This c code I wrote below to centre text in strings works. I cannot find an explanation of what "%%%ds" in the program means and how it works. There is d for in

Custom date and time including nanoseconds

For this program I need to "grab the start time of the entire process within the max. time precision avail including nanoseconds." in the format: April 9, 2022

Call a function using a pointer and pass it along in the parameters

Say that I have a pointer to function theFunc. theFunc takes along a pointer that points to the address where theFunc is stored . Is this possible? Using it wou

Wrong protobuf deserialization on ARMv7

Note: I am completely new to working with different cpu architectures and working with C / gcc I am trying to create an application written in plain C, which re

C program to remove consecutive repeated characters from string

The code: https://pastebin.com/nW6A49ck /* C program to remove consecutive repeated characters from string. */ #include <stdio.h> int main() { cha

Is it possible to destroy the memory via pointer?

First I promise that I won't do anything bad with this. I'm just curious. #include <stdlib.h> #include <stdio.h> int main(int argc, char ** argv) {

Is there a way to get win32 file handle from pipe's C file descriptor (python)?

Searched for about 1 hour and still unable to find any relevant search results. I want to wait on multiple pipes in a single thread, but unable to convert the f

Adding to list and displaying list functions in C

I have my linked list that I created. I made addToStart function which has2 paramters, first parameter is the head of the list, second parameter is the data to

how to test if a variable is valid or whether it is initialized or not in C?

I am learning C from scratch with Harvard's cs50 course. I've been given an array that's been initialized this way: int stuff[9][9]; now I have to handle it. I

Error building Delegate Proxy 9.9.13 using G++ 11.2.0

I applied the 2 patches mentioned by the original author of Delegate 9.9.13 but still encountered another build error as shown below. Could someone suggest a f

Casting function pointer arguments without a helper function

void qsort(void *base, size_t nitems, size_t size, int (*compar)(const void *, const void*)) Is there a way to pass, let's say strcmp to qsort without making a

I'm not able to detect the problem while compiling [closed]

I'm writing first program in C Language but I'm unable to compile it. Please help me!

Errors when trying to use secp256k1 on Mac. 'clang: error: linker command failed with exit code 1 (use -v to see invocation)'

I'm starting learning C, but I seem to have failed in installing my first library. I'm using a Mac. I found a simple tutorial to get started: writing a program

Can extern make a function variable a global variable?

As I understood extern makes a variable --> global variable, so it means we can also make variable of another function a global variable? #include <stdio.

Writing matrix of ints to .txt

I'm trying to write a 479x639 matrix of ints to a .txt file. Preferably each line will include one entry followed by a ,, so that I can input the data on MATLAB

Weird characters appearing at the beginning of my code

I've created a code which displays integers till a given value with numbers (up to the maximum of the two digit range), and shows the tens as text. I have notic