All Questions
7 questions
1
vote
1
answer
349
views
Why this x64 shellcode doesn't work?(segmentation fault)
I found a simple shellcode on the internet.
Then, to test this shellcode, I make the simple ret overwrite code.
test.c
#include <stdio.h>
#include <string.h>
char buf[100];
int main(void)...
2
votes
2
answers
551
views
Changing value of parameter with gdb
I have a file named exploit.c inside which:
#include <stdbool.h>
#include <stdio.h>
const char y1 = 'a';
const char y2 = 'b';
const char y3 = 'x';
const char y4 = 'y';
const char y5 = 'i';...
2
votes
1
answer
357
views
Arrangement of variables on the stack - out of order?
I was practicing some reverse engineering crack-mes as part of our university curriculum, and I have a question around the arrangement of variables on the stack.
I have a very basic C++ code, like ...
1
vote
3
answers
16k
views
Use GCC and objdump to disassemble any hex to assembly code
What would be the best way (also fewer steps) to generate assembly code for a given hex code ? For e.g., if we know the architecture is x86, and given hex value 0x55, what is the best way to generate ...
2
votes
2
answers
5k
views
Changing Entrypoint in ELF executable
I wrote some code that does the following:
Searches for and finds an offset in a binary file to add code (looks for a sequence of 00s I can overwrite).
Then, I change the entrypoint of the ELF to the ...
3
votes
1
answer
3k
views
GCC change the order of variable declaration
I have this very simple piece of code:
// test.c
int main(){
int a = 0;
char b[10];
int c = 0;
return 0;
}
Compiled with gcc (6.2.1):
$ gcc -g -o test test.c
And analysed with gdb:
$ gdb -...
1
vote
1
answer
6k
views
Passing argument through registers instead of the stack
I'm learning (and re-learning) C and assembly, and I came across a difference between what I've been taught and the actual result I have.
Some code:
int test(int a, int b){
return a + b;
}
int ...