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).
25 questions
1 vote
1 answer
300 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, ...
1 vote
0 answers
158 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) ...
2 votes
0 answers
88 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 ...
0 votes
0 answers
123 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 ...
2 votes
1 answer
293 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 ...
0 votes
1 answer
89 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 ...
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 ...
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 ...
0 votes
1 answer
311 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 ...
2 votes
1 answer
271 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,...
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->...
3 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?
2 votes
1 answer
753 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"]; ...
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 ...
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 ...