Skip to main content

Questions tagged [gcc]

GNU Compiler Collection, it includes front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these languages (libstdc++, libgcj,...).

1 vote
1 answer
78 views

Inject ELF with an entierly self-contained code section that can statically call standard library functions

What I want to do What I want to do is inject an existing ELF binary with additional code that runs before the original .text section and then transfers control back to it. What I can already do Now, ...
PaperTsar's user avatar
  • 111
0 votes
0 answers
47 views

How to traverse the GCC AST nodes?

I have looked into AST representations here http://icps.u-strasbg.fr/~pop/gcc-ast.html and I would like to know how I can programmatically access this tree/traverse the nodes of my source.c file? ...
killertoge's user avatar
0 votes
0 answers
134 views

Prevent GCC compiler from constant folding

I have simple C Code: int main() { int b = 3-1; return 0; } And when I objdump it after compiling with no optimization: 000000000000113d <main>: 113d: f3 0f 1e fa ...
killertoge's user avatar
1 vote
1 answer
323 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)...
doldom's user avatar
  • 55
5 votes
1 answer
166 views

Zlib structure inside a GCC static library

I'm trying to analyze a GCC static library which is a part of a commercial software. First, I used IDA Pro to analyze entire Lib file, but it could find only object files and was unable to disassemble ...
HamidReza's user avatar
  • 151
0 votes
1 answer
545 views

Output from gcc containing all included source code?

Right now, I'm using a combination of gcc -g and the objdump -S modes to generate assembly code with debug source code interleaved. However, I'm having trouble correlating some of the functions that ...
dingo_kinznerhook's user avatar
1 vote
0 answers
103 views

What change to the source code would produce an LT compare rather than an OLT compare in MIPS assembly?

I need some help reverse engineering a function in MIPS assembly. It was compiled for the PlayStation 2's EmotionEngine CPU. My goal is to produce a matching decomp of the function; it is the proof-of-...
Zac's user avatar
  • 11
2 votes
0 answers
185 views

What hints can x86 disassembly give as to GCC/G++ compiler version and options?

I've taken an interest to disassembling binaries and attempting to recreate 1:1 source code (logic) in C and C++ compiled with GCC. I say "logic" because this question does not pertain to ...
Matthew Tingum's user avatar
1 vote
1 answer
451 views

How to locate memory address in register $esp

000011d9 <main>: 11d9: 8d 4c 24 04 lea 0x4(%esp),%ecx 11dd: 83 e4 f0 and $0xfffffff0,%esp 11e0: ff 71 fc push -0x4(%ecx) 11e3: ...
user40564's user avatar
1 vote
0 answers
71 views

Is disassembly of standard gcc programs trivial, or just as difficult as video game ROMs?

I am attempting to do some reverse-engineering of ARM binaries, with the ultimate goal of reverse-engineering GBA ROMs. Of course, GBA ROMs contain a mixture of code and data, so a standard ...
JBraha's user avatar
  • 133
1 vote
0 answers
180 views

silvio packer for shared libray leads to error: "ELF load command address/offset not properly aligned"

I'm trying to implement a packer based on silvio infection. The packer works fine for ET_EXEC. However, it failed with "ELF load command address/offset not properly aligned" error for the ...
prgbenz's user avatar
  • 81
1 vote
0 answers
72 views

failed to trigger packer's loader by overwritting the entry of rela.dyn on aarch64

I have implemented packer of x86_64 shared library. Briefly, a loader is injected to a shared library, and the rela.dyn entry is modified such that it points to the address of the loader. Once the ...
prgbenz's user avatar
  • 81
3 votes
0 answers
391 views

How can I tell ld to link to a local symbol in a shared object?

Symbols in shared objects can be either local or global. This is controlled by a flag in the symbol table. If the symbol is local, ld won't resolve to it. Reverse engineering can often be aided by ...
SRobertJames's user avatar
2 votes
1 answer
4k views

How to disable relro while compilation?

My doubt is how to compile the binary without RELRO? and why it is enabling FULL-RELRO when we are not providing any flags? This is the code. #include <stdio.h> #include <stdlib.h> int ...
neeraj's user avatar
  • 33
2 votes
1 answer
417 views

Comparing the static address of the vtable of a class, to the pointer to it held by the object

I know this is compiler/ABI dependent, not necessarily standardized, etc. I've always assumed, from what I've read in several places (e.g. an answer here or the example in wikipedia), that a typical ...
Alejandro Exojo's user avatar

15 30 50 per page