Skip to main content

Questions tagged [nasm]

Nasm for *Netwide Assembler* is a very popular and free assembler and disassembler for the x86 architecture (16-bits, 32-bits, and 64-bits).

Filter by
Sorted by
Tagged with
1 vote
1 answer
56 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
1 vote
0 answers
110 views

How can I make IDA disassemble in NASM-like syntax instead of MASM-like syntax?

I'm new to reverse engineering, assembly and IDA and I'm learning NASM. Whenever I load an executable (a PE file or an ELF) IDA disassembles it using a MASM-like syntax (it looks to me that it does) ...
LyZeN77's user avatar
  • 11
2 votes
0 answers
69 views

​Why output is disabled in console when using int3?

​I am using NASM(2.15) assembler to generate code. But I am unable to figure out why it does not show output in the console(windows system) when using int3 - software breakpoint, it only shows output ...
Viktor's user avatar
  • 461
0 votes
0 answers
107 views

Starting out with reverse engineering. What assembly is disassembled code

I am new to reverse engineering and want to analyze my own exe/dll files. I took a look at nasm and masm and so far I have the feeling that this is unnecessary for me to learn in detail because it ...
Nur1's user avatar
  • 101
2 votes
1 answer
249 views

far jump do not point to instruction?

My title is kind of ambiguous and not sure if it is true, Hence the question mark at the end. Basically, I was trying to trace windows printf in NASM to identify "what is the last call/function ...
neehack's user avatar
  • 21
0 votes
1 answer
69 views

NULL character (same code) different locations

I'd like to know why NASM generates different opcodes for the same code, when it's in the begin or end of the program? This question is important because I found NULL characters when I compile the ...
bugsam's user avatar
  • 3
9 votes
4 answers
10k views

What is the difference between MOV and LEA in example?

Looking at an assembly code snippet I see: lea rax, [rbp-0x50] Which tells me that the rax register now points to whatever value is in rbp-hex(50). Question. Would I achieve the same result doing ...
user3732445's user avatar
0 votes
1 answer
1k views

Reassembling reversed ASM

I am trying to reassemble code reversed from an executable using radare2. I have managed to extract the asm and am using nasm for reassembling. The question is, the code also contains commands like ...
Flipsyde's user avatar
  • 103
0 votes
1 answer
284 views

Is it possible to add a label to an ELF executable and then call that label? If so, how?

Let's say we have this simple "hello world" nasm code that will be compiled to an ELF executable: global main section .data message db "Hello World!", 0x00 section .text main: call ...
Arne's user avatar
  • 103
2 votes
1 answer
242 views

Inversion of input parameters in ASM

the code is: .global asm0 asm0: push ebp mov ebp,esp mov eax,DWORD PTR [ebp+0x8] mov ebx,DWORD PTR [ebp+0xc] mov eax,ebx mov esp,ebp pop ebp The entry is: asm0(0x2a,...
Ricardo Prieto's user avatar
5 votes
1 answer
2k views

What's the meaning of dword_XXXX and offset dword_XXXX in IDA?

Consider the following code: In C++: SomeClass* globalPointer; // we don't know what it points to, but it's not null a pointer, it's initialized void someFunction() { globalPointer->...
anx199's user avatar
  • 175
2 votes
1 answer
3k views

NASM, MASM, Intel, AT&T' syntax?

I see word NASM, MASM, Intel, AT&T. I am confused between them. Is it different types of assembly?
QChí Nguyễn's user avatar
2 votes
1 answer
720 views

Objective-C disassembling - I dont understand this code

I assembled a simple objective-c file that prints hello to the screen. this is the code: #import <Foundation/Foundation.h> int main() { NSString* a = [NSString stringWithUTF8String: "hi"]; ...
Camden's user avatar
  • 123
6 votes
1 answer
1k views

How to Make .text Section in Assembly Writeable for Win7-64 EXE

I have a basic XOR decoder that functions perfectly in Linux, but when I try to move it over to an exe in windows, it fails. I am leaving this question open for historical reference since the issue ...
hexhatchet's user avatar
0 votes
2 answers
1k views

Working Linux assembly XOR Encoder/Decoder Failing on Windows

Should I be able to extract shellcode from a basic (tested and working) Win7-64 message box app and place the extracted shellcode into a tested and working assembly language encoder/decoder and expect ...
hexhatchet's user avatar
2 votes
1 answer
1k views

Debugging EXE File in Windbg and How to set Breakpoints in Assembly

I am trying to set a breakpoint (created in assembly) and step into an EXE file line by line to watch registers and memory behavior. I have done this easily with gdb under Linux like this. gdb -q ./...
hexhatchet's user avatar
5 votes
3 answers
9k views

Segmentation fault while pushing onto the stack

So I have been following some tutorials on assembly and the instructor compiles the following code: ;hello3.asm attempts to make the code position independent section .text global _start _start: ;...
Dhayalan Pro's user avatar
1 vote
1 answer
2k views

Is there a way to 'mov eax, ax'? [closed]

I would like to move my return from htons call 00005c11 and have have moved to the top if eax and have the result of 5c110000. Nasm won't let me mov eax, ax due to size constraints. Is there a ...
LUser's user avatar
  • 793
4 votes
1 answer
3k views

Injecting shellcode in ELF binary

I am trying to inject a piece of shellcode inside a 32-bit ELF executable. I am running Ubuntu 14.04 64-bit. Hence, all the commands I have run require explicit switches to produce 32-bit code. I am ...
sherlock's user avatar
  • 1,381
6 votes
2 answers
4k views

How to directly re-use the dumped content of `.rodata`, `.data` and `.bss` section?

OK, so basically I want to re-use the content from dumped .rodata data and bss section from ELF on Linux 32bit. The dump command: objdump -s -j .text elf_binary objdump -s -j .rodata elf_binary ...
lllllllllllll's user avatar
2 votes
2 answers
451 views

Why cl.exe change the extern function name used in my code?

So basically I my nasm syntax asm code, I use some extern functions like this: extern _printf extern __imp__Sleep@4 .... call _printf call [__imp__Sleep@4] Then I use nasm to assemble it into obj:...
lllllllllllll's user avatar
3 votes
3 answers
934 views

Why IDA Pro generate define-lack code like this?

Basically I us IDA Pro 6.1 on Windows 32 bit, dealing with binaries from SPEC 2006. I use IDA Pro to generate asm code from the binaries, and in the .data section, I see data define like this: ...
lllllllllllll's user avatar
3 votes
1 answer
2k views

What is the meaning of this code generated by IDA Pro?

Test platform is Linux 32 bit. I use IDA Pro to disassembly the basename from coreutils 8.5 compiled by gcc 4.6.3 Here is a code snippet generated by IDA Pro call ...
lllllllllllll's user avatar
2 votes
1 answer
1k views

Why IDA Pro will generate this kind of code(mess up macro name and variable name)?

I use IDA Pro 6.1 to disassembly ELF file, which is compiled on 32 bit Linux, gcc 4.6.3 I modified the code and try to make it reassemble, and I find a problem here(this is directly created by IDA ...
lllllllllllll's user avatar
5 votes
1 answer
5k views

Is there an online service which provides the same functionalities as the Metasploit NASM shell?

Does anyone know if there exists an online service which provides the same functionalities as the Metasploit NASM shell ? Probably the above script can be ported to a standalone tool but I'm not very ...
lc4nt's user avatar
  • 71