2

I finally successfuly installed a cross toolchain from this site in order to run and debug a mips elf on my x86-64 . I only have the elf file. I can disassemble it but when i try to run it with :

mipsel-none-elf-run myelf

i get the following error :

mips-core: 4 byte read to unmapped address 0x400670 at 0x400670
program stopped with signal 10 (User defined signal 1).

(the adresse 0x400670 points the first instructions of the main function.

Specifying the endianess to the tool gives me the same error.

I tried to run it with

mipsel-none-elf-gdb myelf

GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=mipsel-none-elf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...

warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
of GDB.  Attempting to continue with the default mips:3000 settings.

Reading symbols from /home/ashkan/Crack/crackme200...(no debugging symbols found)...done.
(gdb) target sim
Connected to the simulator.
(gdb) load
Loading section .interp, size 0xd vma 0x400154
Loading section .note.ABI-tag, size 0x20 vma 0x400164
Loading section .reginfo, size 0x18 vma 0x400184
Loading section .note.gnu.build-id, size 0x24 vma 0x40019c
Loading section .dynamic, size 0xd8 vma 0x4001c0
Loading section .hash, size 0xa4 vma 0x400298
Loading section .dynsym, size 0x160 vma 0x40033c
Loading section .dynstr, size 0xdf vma 0x40049c
Loading section .gnu.version, size 0x2c vma 0x40057c
Loading section .gnu.version_r, size 0x30 vma 0x4005a8
Loading section .init, size 0x90 vma 0x4005d8
Loading section .text, size 0x490 vma 0x400670
Loading section .MIPS.stubs, size 0xa0 vma 0x400b00
Loading section .fini, size 0x4c vma 0x400ba0
Loading section .rodata, size 0x40 vma 0x400bec
Loading section .eh_frame, size 0x4 vma 0x400c2c
Loading section .ctors, size 0xc vma 0x410c30
Loading section .dtors, size 0x8 vma 0x410c3c
Loading section .jcr, size 0x4 vma 0x410c44
Loading section .data, size 0x1b0 vma 0x410c50
Loading section .rld_map, size 0x4 vma 0x410e00
Loading section .got, size 0x5c vma 0x410e10
Loading section .sdata, size 0x4 vma 0x410e6c
---Type <return> to continue, or q <return> to quit---
Start address 0x400670
Transfer rate: 26592 bits in <1 sec.

I used target sim and load to configure gdb. But when i want to run the program. I get :

(gdb) r Starting program: /home/ashkan/Crack/crackme200 mips-core: 4 byte read to unmapped address 0x400670 at 0x400670

Program received signal SIGBUS, Bus error. 0x00400670 in ?? () (gdb)

So i've read that the error comes from unaligned adresses. Is there a way to fix it ? Here is the link to the elf file: link If anybody has an idea.. Thanks have a good day.

  • Which toolchain are you using ? How exactly do you run the executable ?By the way it is not because of unaligned address, this address is aligned to 0x10. The problem looks like in loading the executable. – w s Apr 16 '15 at 12:44
  • Hey, thanks. I use the toolchain provided by this tuto [hs-augsburg.de/~beckmanf/dokuwiki/…. I use the command : mipsel-none-elf-gdb myelf . Plus gdb if configured as : This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=mipsel-none-elf". I'm sorry i have only a few knowledge about cross toolchain, embeded systems .. hope it will help you to understand the problem – creuchmeuch Apr 16 '15 at 13:40
  • Would you please update the question with full sequence of running the executable and links? I don't see how are you running the emulator. – w s Apr 16 '15 at 14:02
  • I reedit the question i hope you have more information. Sorry, i 'm a begginer – creuchmeuch Apr 16 '15 at 15:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.