0

$file as1 as1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped

$file /bin/ls /bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

how do i run the binary?

Code:

  SECTION .data
msg1 db "HELLO WORLD !!!",0ah   ;msg to be print
msg1len equ $-msg1
SECTION .bss

SECTION .text
GLOBAL _start
_start:
mov rax,1                       ;system read call
mov rdi,1
mov rsi,msg1
mov rdx,msg1len
syscall

mov eax,60          ;system end call
mov edi,0
syscall

1 Answer 1

0

I assume as1 is your compiled assembley file. You seem to be running a 32-bit system according to the result of file /bin/ls. You can confirm you have an 32 bit kernel using uname -m. In that case it's impossible to run your program since you seem to be using the 64 bit registers rax ...

you can either setup a 64-bit system or rewrite your program to use only 32-stuff.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.