2

I made a new segment in the ELF (ARM) game library I am working on (Page Aligned, .text segment (Pure Code)). The entirety of the segment includes only NOPs (0000A0E1). However, IDA recognizes the NOPs as:

DCD 0xE1A00000

If I press C to make it into code, it shows one NOP per line I press it on. When I try to create a function, it tells me that the function has undefined instruction/data at the specified address, and won't let me do it. In addition, each line of the DCD 0xE1A00000s is referenced in the .plt segment because they're referencing an offset out of the segment. This happens even after I turn it into code.

Is there a way to declare the entire segment as code, and/or put a segment property that does this, possibly fixing the function problem?

Aspire
  • 21
  • 1
  • 5
  • Try selecting the entire region and then press `c` to make the entire selection code. You might need to press `u` first to make the selection undefined first. – Ross Ridge Feb 06 '16 at 17:25
  • Thank you. This makes it work in IDA, however, is there some segment setting that I am missing, so that both the game and IDA can read it as code natively? – Aspire Feb 06 '16 at 18:34
  • 2
    You haven't shown output from objdump or readelf, so we can't really tell how your segment is marked and what it is missing. – Jester Feb 06 '16 at 20:58
  • `DCD 0xE1A00000` can be data; if you are using DCD your tools are probably marking it as data and not code. Any ARM instruction can co-incidentally be data. The tool (IDA) can/should use ELF sections as hints. – artless noise Feb 06 '16 at 22:02

0 Answers0