Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decompiling 16-bit x86 with non-standard CS #2948

Closed
samrussell opened this issue Apr 18, 2021 · 5 comments
Closed

decompiling 16-bit x86 with non-standard CS #2948

samrussell opened this issue Apr 18, 2021 · 5 comments
Milestone

Comments

@samrussell
Copy link

I'm decompiling an unpacked version of commander keen #1 and I get this error in the decompiler:

Offset must be between 0x0 and 0x10ffef, got 0x23055660 instead!

The app has CS = 0x2305 and I think something is broken with the memory mapping

@Malvineous
Copy link

I got the same issue. Sometimes it works and sometimes not. Looking more closely, it seems that if the function has a reference to the data segment that hasn't been mapped properly then this error will happen, and you can fix it by mapping it properly.

In my case there was a word ptr[SI + 0x1234] that hadn't been mapped anywhere so I got an error the same as yours. I had to map this pointer to the data segment and set the data type to be an array of words and then the decompiler worked.

So I would suggest finding the addresses in the data segment it's complaining about and setting them to a data type instead of the default 'undefined'. If that isn't enough then also add some mappings (right-click, References, Add/Edit) and make it a memory reference to the right offset in the data segment.

@samrussell
Copy link
Author

samrussell commented May 2, 2021 via email

@Malvineous
Copy link

I'm looking at Dangerous Dave myself and very impressed at how well Ghidra works. By far the best disassembler I've ever used.

I'm very familiar with Commander Keen (I run the Commander Keen Wiki) and the community has pretty much fully reverse engineered the game (look at all the patches they have) so unless you're doing it for the exercise that particular game series is pretty well reverse engineered.

@samrussell
Copy link
Author

samrussell commented May 2, 2021 via email

@ryanmkurtz ryanmkurtz added this to the 10.0.2 milestone Aug 4, 2021
@ryanmkurtz
Copy link
Collaborator

Fixed by 0e81327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants