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).

0
votes
1answer
138 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
1answer
86 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 ...
1
vote
1answer
102 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
1answer
222 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->...
1
vote
1answer
503 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?
1
vote
1answer
252 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"]; ...
5
votes
1answer
509 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
2answers
679 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 ...
1
vote
1answer
366 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 ./...
4
votes
3answers
4k 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: ;...
1
vote
1answer
832 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 ...
4
votes
1answer
2k 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 ...
5
votes
2answers
3k 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 ...
2
votes
2answers
331 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:...
2
votes
3answers
717 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: ...
2
votes
1answer
1k 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 ...
1
vote
1answer
983 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 ...
3
votes
1answer
4k 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 ...