Skip to content

elf disasm fails at ELF entry address #4

Closed
@muff1n1634

Description

@muff1n1634

When running elf disasm on an (unstripped) ELF file (from a Wii game), it fails with the message:

Failed: Range 0x00000000-{e_entry} outside of section .init: {.init->sh_addr}-{.init->sh_addr + .init->sh_size}

It may not happen on every ELF file, but I tried it on at least 10 and they all had the same result, so I think it probably does.

An actual example, from an actual game:
Failed: Range 0x00000000-0x80004134 outside of section .init: 0x80004000-0x800064C4

Seems to be emitted from obj/sections.rs:152:

ensure!(
	self.contains_range(start..end),
	"Range {:#010X}-{:#010X} outside of section {}: {:#010X}-{:#010X}",
	start,
	end,
	self.name,
	self.address,
	self.address + self.size
);

I guess the problem is that it thinks the entry point is a range? No idea where that's determined, though.

i also don't know any rust i just grepped for the string


reproduction

  1. get an applicable ELF file
  2. dtk elf disasm <path/to/file.elf> .
  3. message, maybe

environment

OS: Windows 10 22H2
dtk -V: dtk 0.5.5 36bb5ddcc67dabaf5d00d7335a9e764c4c668ee7

also tried on macOS Catalina with 0.5.4
same stuff but im not on that computer rn so no specs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions