Category : debugging

gcc version 10.2.1 OS – Kali 2020.3 x86_64 The code (pointer.c): #include <stdio.h> #include <string.h> int main(){ char str_a[20]; char *pointer; char *pointer2; strcpy(str_a, "Hello, world!n"); pointer = str_a; printf(pointer); pointer2 = pointer + 2; printf(pointer2); strcpy(pointer2, "y you guys!n"); printf(pointer); } I compiled this code by (by default it should use -O0 flag): gcc ..

Read more

I was doing some debugging when I got an access violation caught. Visually nothing happens with an application, but I still would like to investigate whether it has something to do with a user application’s logic. The call stack does not add any clarity. comctl32.dll!00007ffaa46664e5() Unknown comctl32.dll!00007ffaa46665ad() Unknown comctl32.dll!00007ffaa46666ba() Unknown comctl32.dll!00007ffaa4668bf4() Unknown comctl32.dll!00007ffaa4668774() Unknown comctl32.dll!00007ffaa466b53e() ..

Read more

GDB’s call command normally works great for calling functions, as long as the symbols are present. But if the function is in a namespace or a class, suddenly it won’t work unless it was compiled with debugging information. For example, let’s say I have this program: #include <iostream> namespace ns { void test() { std::cout ..

Read more