Comments (2)
Additional information.
AbstractMixedCodeDataModel.SpanGenerator.cs
Lines 254 - 260
public override (ModelPosition, LineSpan)? GenerateSpan()
{
Debug.Assert(line.Count == 0);
var addr = this.position.Address;
if (program.TryCreateImageReader(program.Architecture, addr, item.Size, out var rdr))
{
mem.Formatter.RenderLine(rdr, program.TextEncoding, this);
Prior to IMemory Interface
When creating the the Image reader for the item it used the end address, item.EndAddress
var rdr = program.CreateImageReader(program.Architecture, addr, item.EndAddress);
With new IMemory Interface when creating a reader for the current line of hex data, it uses the current address for the hex data to be displayed from and the Item.size to set the reader data size.
If less than one line this works. If more than one line needs to be displayed it will attempt to display the first line correctly, but when it creates a reader for the second line of hex data for an item, it will use the address for the start of hex data to be displayed and use the Item.size to calculate the end of the reader data which is fine for a full line of hex data. But if the last line is a partial line
eg. for an Item starting at 0x00100F58 and Item.size of 18 (decimal)
x00100F58 01 02 03 04 05 06 07 08
x00100F60 09 0a 0b 0c 0d 0e 0f 10 11 12
Line 1 generation with addr passed as x00100F58, Item.size is 18, calculated end address for reader rdr is x00100F6A
Line 2 generation with addr passed as x00100F60, Item.size is 18, calculated end address for reader rdr is 0x00100F72, which is outside of the original Item range.
When generating the hex representation for the current line, it checks to see if it's less than the end address and reads the data, if it is at the end address it should flag it and return invalid data, so it can pad the remainder of the line before adding the ASCII data view at the end of the line.
What is happening during line 2 generation is a full line of hex data is generated as the end address address is now outside of the range of the item and more than a full line. When the next item to show is being processed the current addr is at 0x00100F70, so the data from 00100F6A - 0x001006F was displayed as hex data and not disassembled code as expected.
from reko.
Fixed in 74817ce. Thanks for all the hard work digging up the cause of this regression.
from reko.
Related Issues (20)
- Multidimensional array can not be reconstructed if memory accesses are done at another statements
- cannot build solution HOT 8
- RISC-V: Missing instructions from H and Q extensions HOT 1
- RISC-V: missing c.slli64, c.srai64, c.srli64 hint instructions HOT 1
- Unable to cast object of type 'Reko.ImageLoaders.Omf.OmfLoader' to type 'Reko.Core.Loading.ImageLoader' HOT 3
- no binary output after building on Ubuntu HOT 2
- Crash at 'reconstruct data types' HOT 2
- can not open csky elf HOT 2
- Several bugs found: incorrect function argument order, double type value, and strings HOT 2
- Unexpected argument order when decompiling program
- Reko fails to recover floating-point code
- Reko doesn't generate any decompiled code
- Problems with type inference around `printf`
- No string literals are generated
- incomplete control flow recovery
- reko crash during "Finish Decompilation" step with Alone in the Dark HOT 3
- MASTER - WINDOWS Decompiler - popup of target call is empty
- MASTER - M68K switch statement fail
- To run this application, you must install .NET Core. HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reko.