Skip to content
Advertisement

Tag: assembly

What is %gs in Assembly

void return_input (void) { char array[30]; gets (array); printf(“%sn”, array); } After compiling it in gcc, this function is converted to the following Assembly code: push %ebp mov %esp,%ebp sub $0x28,%esp mov %gs:0x14,%eax mov %eax,-0x4(%ebp) xor %eax,%eax lea -0x22(%ebp),%eax mov %eax,(%esp) call 0x8048374 lea -0x22(%ebp),%eax mov %eax,(%esp) call 0x80483a4 mov -0x4(%ebp),%eax xor %gs:0x14,%eax je 0x80484ac call 0x8048394 leave ret I

Permanently Change Disassembly Flavor in GDB

How can I permanently change the disassembly flavor in GDB. I tried:set disassembly-flavor intel in GDB, but when I fire up GDB later it still has the att flavor. Answer gdb executes a ~/.gdbinit file when it starts, if present; you should be able to add the line to it.

Why data and stack segments are executable?

I have just noticed that my simple program has its data and stack segments executable. I saw it in /proc/[pid]/maps, and simple code confirmed it. For example: then causes prog to execute int3 instruction. Programs written in C and built with gcc have their data, stack and heap non-executable, so why those written in assembly behave in a different manner?

C++/Assembly IDE on Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 4 years ago. Improve this question What I’m looking for is an IDE that will run on

Simple polymorphic engine

I have to program a simple polymorphic engine. I use linux (32-bit) and i can code in assembly and c. I don’t know how to start. Can you give me a schema for constructing such an engine? My idea is to make a program that: read the code section of a file encrypts it in a buffer, make space at

Advertisement