diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f39b5f5520..e47ac36c3d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,7 +23,7 @@ endif() # The path to the Reko's "src" directory, used for relative path set(REKO_SRC ${CMAKE_CURRENT_LIST_DIR}) -set(REKO_VERSION "0.11.4") +set(REKO_VERSION "0.11.5") set(artifacts_dir ${REKO_SRC}/../bin) file(MAKE_DIRECTORY ${artifacts_dir}) diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 7b16dc8d54..9c4a98b5e6 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -1,7 +1,7 @@ - + {5C315C78-1F97-4B16-81AA-917284969DFE} Reko.Core diff --git a/src/Core/Output/GlobalDataWriter.cs b/src/Core/Output/GlobalDataWriter.cs index c2e27631fb..963029830b 100644 --- a/src/Core/Output/GlobalDataWriter.cs +++ b/src/Core/Output/GlobalDataWriter.cs @@ -321,7 +321,10 @@ private void FormatRawBytes(byte[] bytes) public CodeFormatter VisitMemberPointer(MemberPointer memptr) { - throw new NotImplementedException(); + if (!rdr.TryRead(PrimitiveType.Create(Domain.Offset, memptr.BitSize), out var c)) + return codeFormatter; + c.Accept(codeFormatter); + return codeFormatter; } public CodeFormatter VisitPointer(Pointer ptr) diff --git a/src/Core/Output/GlobalObjectTracer.cs b/src/Core/Output/GlobalObjectTracer.cs index 1511bfc96f..4e13138ad7 100644 --- a/src/Core/Output/GlobalObjectTracer.cs +++ b/src/Core/Output/GlobalObjectTracer.cs @@ -124,7 +124,7 @@ public int VisitFunctionType(FunctionType ft) public int VisitMemberPointer(MemberPointer memptr) { - throw new NotImplementedException(); + return 0; } public int VisitPointer(Pointer ptr) diff --git a/src/Core/PublicAPI.Unshipped.txt b/src/Core/PublicAPI.Unshipped.txt index b4aedb883d..fb4da3a9f9 100644 --- a/src/Core/PublicAPI.Unshipped.txt +++ b/src/Core/PublicAPI.Unshipped.txt @@ -1130,6 +1130,7 @@ Reko.Core.SegmentMap.CreateImageReader(Reko.Core.Address! address, Reko.Core.IPr Reko.Core.SegmentMap.SegmentMap(params Reko.Core.Loading.ImageSegment![]! segments) -> void Reko.Core.SegmentMap.SegmentMap(Reko.Core.Address! addrBase, params Reko.Core.Loading.ImageSegment![]! segments) -> void Reko.Core.SegmentMap.Segments.get -> System.Collections.Generic.SortedList! +Reko.Core.SegmentMap.TryCreateImageReader(Reko.Core.Address! address, Reko.Core.IProcessorArchitecture! arch, out Reko.Core.Memory.EndianImageReader! rdr) -> bool Reko.Core.SegmentMap.TryFindSegment(Reko.Core.Address! addr, out Reko.Core.Loading.ImageSegment! segment) -> bool Reko.Core.SegmentMap.TryFindSegment(string! segmentName, out Reko.Core.Loading.ImageSegment! segment) -> bool Reko.Core.SegmentMap.TryFindSegment(ulong linAddress, out Reko.Core.Loading.ImageSegment! segment) -> bool diff --git a/src/Core/SegmentMap.cs b/src/Core/SegmentMap.cs index cdfbbd199c..a8b706eaf9 100644 --- a/src/Core/SegmentMap.cs +++ b/src/Core/SegmentMap.cs @@ -227,6 +227,31 @@ public Address MapLinearAddressToAddress(ulong linearAddress) linearAddress)); } + /// + /// Creates an that starts reading at the + /// . The endianness of the image reader is controlled by the + /// . + /// + /// Address at which to start reading. + /// that determines the + /// endianness, byte granularity and other processor-specific details. + /// + /// The resulting instance. + public bool TryCreateImageReader( + Address address, + IProcessorArchitecture arch, + [MaybeNullWhen(false)] out EndianImageReader rdr) + { + if (!TryFindSegment(address, out var segment)) + { + rdr = null; + return false; + } + rdr = segment.CreateImageReader(arch); + rdr.Seek(address - segment.Address); + return true; + } + /// /// Returns the segment that contains the specified address. /// diff --git a/src/Drivers/WebSite/reko.config b/src/Drivers/WebSite/reko.config index 650e1624fd..f52815d962 100644 --- a/src/Drivers/WebSite/reko.config +++ b/src/Drivers/WebSite/reko.config @@ -1,120 +1,260 @@  - - - + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + Label="ModuleDefinitionFile" Description="Win32 module definition file" /> + + + + + + + + + + + + + + + + + + + + " /> + " /> + " /> + + + - - + + + + + + + + - - + + + - - + + + + + + + + + - + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - + - + + + + + + + eax,ecx,edx + + + 55 8B EC + FF FF FF + + + + + rax,rcx,rdx,rsi,rdi,r8,r9,r10,r11 + + + g1,o1,o2,o3,o4,o5,sp,o7 + + + r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r24,r25 + + + r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r24,r25 + + + r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r24,r25 + + + r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r24,r25 + + + + r0,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12 + + + r0,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12 + + + r0,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12 + + - - + - - - + + + + + + + + @@ -126,8 +266,8 @@ - 55 8B EC - FF FF FF + 55 8B EC + FF FF FF @@ -146,26 +286,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -180,22 +380,88 @@ + + + - + + + + + + + + + + + + + + + + + a5 + + + + + - + + + + + + + + + + + + + + + + + + - + + + + eax,ecx,edx + + - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + E9 2D 00 00 E2 4D D0 00 + FF FF A0 00 FF FF F0 00 + + + E9 2D 00 00 + FF FF A0 00 + + + ED 2D 0A 00 + FF BF 0E 00 + + + E5 2D E0 04 + FF FF FF FF + + + + + + + + F8 4D ED 04 + FF FF FF FF + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -231,6 +835,13 @@ + + + + + + + @@ -240,14 +851,17 @@