Skip to content

Commit

Permalink
Zoomable graph control for code view
Browse files Browse the repository at this point in the history
  • Loading branch information
uxmal committed Mar 9, 2016
2 parents 95f78f1 + f92f9da commit 052ffae
Show file tree
Hide file tree
Showing 591 changed files with 174,216 additions and 151,595 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ install:

script:
- xbuild /p:Configuration=TravisRelease src/Reko-decompiler.sln


- cp ./src/Environments/Msdos/realmodeintservices.xml ./src/UnitTests/bin/TravisRelease/realmodeintservices.xml
# Still not ready for unit tests
# - mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe ./src/UnitTests/bin/TravisRelease/Reko.UnitTests.dll -exclude=UserInterface,Capstone
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Contributing
==
Glad to see you're interested in contributing to Reko. Being a small team, all help is appreciated.

What can you do?
--
* If you have an exciting idea for a feature, a question about how Reko works, or have found a bug in Reko,
please open an [issue](http://github.com/uxmal/reko/issues) so we know about it.
* If you feel an urge to code, submit a pull request. Please make an effort to provide one or more unit tests
along with your code.
1 change: 0 additions & 1 deletion NEWS

This file was deleted.

91 changes: 91 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
## Recent versions of Reko

### Version 0.5.5.0
* Shingled disassembler implementation, in preparation for heuristic discovery of code.
* Support for WinCE / MIPS
* Improved data type inference
* New project file format supports saving of more user options.
* Better support for MonoDevelop
* Many many small bugfixes

### Version 0.5.4.0
* Support for renaming decompiled procedures and changing their signatures.
Changing signatures will affect following decompilation stages, as
expected.
* Support for the Windows - OS/2 New Executable format (NE EXE)
* Implemented continuous integration using Travis CI

### Version 0.5.3.0
* Support for the MIPS architecture, and MIPS support in the
PE and ELF image format
* TextViewer now supports free selection of text.

### Version 0.5.2.0
* New structural analysis inspired by "Native x86 Decompilation Using
Semantics-Preserving Structural Analysis and Iterative Control-Flow
Structuring" (Schwartz, Lee, Woo, Brumley) yields much improved
structured C-like code; the implementation itself is much simpler
than the previous one.
* C2Xml tool understands C++11 attributes, in particular the new
[[reko::reg(<regname>)]] which permits specifying the register in
which an argument is passed to or returned from a procedure.
* Implemented navigation history for CodeView window.
* Added support for ELF x86-64 and PE Thumb binaries.
* Many bugs fixed and code refactored.

### Version 0.5.1.0
* Integrated the Capstone.NET disassembler, now used for the ARM and
ARM Thumb architectures.
* Support for Arm Thumb PE executables.
* Bug fixes for #14 and #17.

### Version 0.5.0.0
* Moved project from SourceForge
* Renamed project to 'Reko'
* Started implementation of heuristic static analysis.

### Version 0.4.5.0
* Command line interpreter supports --default-to option
* More ARM instructions implemented
* CP/M environment added
* 64-bit Windows enviroment added

### Version 0.4.4.0
* Mostly bugfixes

### Version 0.4.3.0
* Beginnings of new tabbed GUI
* Command line interpreter now understands a few switches; try typing
decompile --help
* More x86 and m68k instructions supported

### Version 0.4.2.0
* Added support for PS3 and System V ELF files.
* For fun: a C64 BASIC "decompiler"!
* Fixed the following submitted bugs
#8: Can not load ELF or Amiga Hunk binaries
#9: Can not run the decompiler from the command line
* Implemented more x86 and PowerPC instructions
* Improvements in SSA transformation code in preparation for
move to new decompilation model
* ImageSegmentRenders allow viewing of the structured data
in image segments.

### Version 0.4.1.0
* (Crude) support for loading 32- and 64-bit PowerPC ELF binaries
* Many PowerPC opcodes supported.
* User interface bugfixes (broken keyboard accelerators etc)
* The Copy command (Ctrl+C) is supported in windows where it
makes sense.

### Version 0.4.0.0
* Support added for loading packed binaries using unpacker scripts
written in OdbgScript.
* Modest beginning of an X86 emulator added to the solution
* New memory navigation bar assists in overview of binary image
* More x86 opcodes supported.
* Many bugs fixed.

Special thanks to halsten, who assisted in the implementation and
testing of the OdbgScript loader.

94 changes: 3 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# reko - a general purpose decompiler.

[![Build Status](https://travis-ci.org/uxmal/reko.svg?branch=master)](https://travis-ci.org/uxmal/reko)
[![Build Status](https://travis-ci.org/uxmal/reko.svg?branch=master)](https://travis-ci.org/uxmal/reko) [![Join the chat at https://gitter.im/uxmal/reko](https://badges.gitter.im/uxmal/reko.svg)](https://gitter.im/uxmal/reko?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

**Reko** (Swedish: "decent, obliging") is a C# project containing
a decompiler for machine code binaries. This project is freely
available under the GNU General Public License.
Expand Down Expand Up @@ -35,92 +35,4 @@ about the Reko project's internal workings.

## Recent versions

### Version 0.5.5.0
* Shingled disassembler implementation, in preparation for heuristic discovery of code.
* Support for WinCE / MIPS
* Improved data type inference
* New project file format supports saving of more user options.
* Better support for MonoDevelop
* Many many small bugfixes

### Version 0.5.4.0
* Support for renaming decompiled procedures and changing their signatures.
Changing signatures will affect following decompilation stages, as
expected.
* Support for the Windows - OS/2 New Executable format (NE EXE)
* Implemented continuous integration using Travis CI

### Version 0.5.3.0
* Support for the MIPS architecture, and MIPS support in the
PE and ELF image format
* TextViewer now supports free selection of text.

### Version 0.5.2.0
* New structural analysis inspired by "Native x86 Decompilation Using
Semantics-Preserving Structural Analysis and Iterative Control-Flow
Structuring" (Schwartz, Lee, Woo, Brumley) yields much improved
structured C-like code; the implementation itself is much simpler
than the previous one.
* C2Xml tool understands C++11 attributes, in particular the new
[[reko::reg(<regname>)]] which permits specifying the register in
which an argument is passed to or returned from a procedure.
* Implemented navigation history for CodeView window.
* Added support for ELF x86-64 and PE Thumb binaries.
* Many bugs fixed and code refactored.

### Version 0.5.1.0
* Integrated the Capstone.NET disassembler, now used for the ARM and
ARM Thumb architectures.
* Support for Arm Thumb PE executables.
* Bug fixes for #14 and #17.

### Version 0.5.0.0
* Moved project from SourceForge
* Renamed project to 'Reko'
* Started implementation of heuristic static analysis.

### Version 0.4.5.0
* Command line interpreter supports --default-to option
* More ARM instructions implemented
* CP/M environment added
* 64-bit Windows enviroment added

### Version 0.4.4.0
* Mostly bugfixes

### Version 0.4.3.0
* Beginnings of new tabbed GUI
* Command line interpreter now understands a few switches; try typing
decompile --help
* More x86 and m68k instructions supported

### Version 0.4.2.0
* Added support for PS3 and System V ELF files.
* For fun: a C64 BASIC "decompiler"!
* Fixed the following submitted bugs
#8: Can not load ELF or Amiga Hunk binaries
#9: Can not run the decompiler from the command line
* Implemented more x86 and PowerPC instructions
* Improvements in SSA transformation code in preparation for
move to new decompilation model
* ImageSegmentRenders allow viewing of the structured data
in image segments.

### Version 0.4.1.0
* (Crude) support for loading 32- and 64-bit PowerPC ELF binaries
* Many PowerPC opcodes supported.
* User interface bugfixes (broken keyboard accelerators etc)
* The Copy command (Ctrl+C) is supported in windows where it
makes sense.

### Version 0.4.0.0
* Support added for loading packed binaries using unpacker scripts
written in OdbgScript.
* Modest beginning of an X86 emulator added to the solution
* New memory navigation bar assists in overview of binary image
* More x86 opcodes supported.
* Many bugs fixed.

Special thanks to halsten, who assisted in the implementation and
testing of the OdbgScript loader.

See NEWS.md for the change log.
Binary file added external/docopt.net-0.6.1.4/DocoptNet.dll
Binary file not shown.
9 changes: 7 additions & 2 deletions src/Arch/Arm/AArch64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,17 @@ public override IEnumerable<Address> CreatePointerScanner(ImageMap map, ImageRea
throw new NotImplementedException();
}

public override ImageReader CreateImageReader(LoadedImage image, Address addr)
public override ImageReader CreateImageReader(MemoryArea image, Address addr)
{
return new LeImageReader(image, addr);
}

public override ImageReader CreateImageReader(LoadedImage image, ulong offset)
public override ImageReader CreateImageReader(MemoryArea image, Address addrBegin, Address addrEnd)
{
return new LeImageReader(image, addrBegin, addrEnd);
}

public override ImageReader CreateImageReader(MemoryArea image, ulong offset)
{
return new LeImageReader(image, offset);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Arch/Arm/AArch64Disassembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public AArch64Disassembler(ImageReader rdr)
this.stream = dasm.DisassembleStream(
rdr.Bytes,
(int)rdr.Offset,
(long)(rdr.Address.ToLinear() - rdr.Offset))
(long)rdr.Address.ToLinear() - rdr.Offset)
.GetEnumerator();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Arch/Arm/Arm32Disassembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Arm32Disassembler(Arm32ProcessorArchitecture arch, ImageReader rdr) {
this.stream = dasm.DisassembleStream(
rdr.Bytes,
(int)rdr.Offset,
(long)(rdr.Address.ToLinear() - rdr.Offset))
(long)rdr.Address.ToLinear() - rdr.Offset)
.GetEnumerator();
}

Expand Down
9 changes: 7 additions & 2 deletions src/Arch/Arm/Arm32ProcessorArchitecture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,17 @@ public override IEnumerable<MachineInstruction> CreateDisassembler(ImageReader i
return new Arm32Disassembler(this, imageReader);
}

public override ImageReader CreateImageReader(LoadedImage image, Address addr)
public override ImageReader CreateImageReader(MemoryArea image, Address addr)
{
return new LeImageReader(image, addr);
}

public override ImageReader CreateImageReader(LoadedImage image, ulong offset)
public override ImageReader CreateImageReader(MemoryArea image, Address addrBegin, Address addrEnd)
{
return new LeImageReader(image, addrBegin, addrEnd);
}

public override ImageReader CreateImageReader(MemoryArea image, ulong offset)
{
return new LeImageReader(image, offset);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Arch/Arm/ArmProcedureSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace Reko.Arch.Arm
{
class ArmProcedureSerializer : ProcedureSerializer
public class ArmProcedureSerializer : ProcedureSerializer
{
private int gr;

Expand All @@ -38,11 +38,11 @@ public ArmProcedureSerializer(Arm32ProcessorArchitecture arch, ISerializedTypeVi
{
}

public override ProcedureSignature Deserialize(SerializedSignature ss, Core.Frame frame)
public override ProcedureSignature Deserialize(SerializedSignature ss, Frame frame)
{
if (ss == null)
return null;
var argser = new ArgumentSerializer(this, Architecture, frame, ss.Convention);
var argser = new ArgumentDeserializer(this, Architecture, frame, 0);
Identifier ret = null;

if (ss.ReturnValue != null)
Expand Down Expand Up @@ -71,11 +71,11 @@ public override Storage GetReturnRegister(Argument_v1 sArg, int bitSize)
return A32Registers.r0;
}

private Identifier DeserializeArgument(ArgumentSerializer argser, Argument_v1 sArg)
private Identifier DeserializeArgument(ArgumentDeserializer argser, Argument_v1 sArg)
{
Identifier arg;
if (sArg.Kind != null)
return sArg.Kind.Accept(argser);
return sArg.Kind.Deserialize(argser);

var dtArg = sArg.Type.Accept(TypeLoader);
var prim = dtArg as PrimitiveType;
Expand Down
4 changes: 2 additions & 2 deletions src/Arch/Arm/ThumbDisassembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public override Arm32Instruction DisassembleInstruction()
{
// Capstone doesn't actually use the imageReader, but apparently
// reko components peek at the reader, so we have to simulate motion.
rdr.Offset += (ulong)stream.Current.Bytes.Length;
rdr.Offset += stream.Current.Bytes.Length;
return new Arm32Instruction(stream.Current);
}
else
Expand All @@ -77,7 +77,7 @@ public override Arm32Instruction DisassembleInstruction()
this.stream = dasm.DisassembleStream(
rdr.Bytes,
(int)rdr.Offset,
(long)(rdr.Address.ToLinear() - rdr.Offset))
(long)rdr.Address.ToLinear() - rdr.Offset)
.GetEnumerator();
return instr;
}
Expand Down
9 changes: 7 additions & 2 deletions src/Arch/Arm/ThumbProcessorArchitecture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@ public override IEnumerable<MachineInstruction> CreateDisassembler(ImageReader i
return new ThumbDisassembler(imageReader);
}

public override ImageReader CreateImageReader(LoadedImage img, Address addr)
public override ImageReader CreateImageReader(MemoryArea img, Address addr)
{
return new LeImageReader(img, addr);
}

public override ImageReader CreateImageReader(LoadedImage img, ulong off)
public override ImageReader CreateImageReader(MemoryArea image, Address addrBegin, Address addrEnd)
{
return new LeImageReader(image, addrBegin, addrEnd);
}

public override ImageReader CreateImageReader(MemoryArea img, ulong off)
{
throw new NotImplementedException();
}
Expand Down
11 changes: 8 additions & 3 deletions src/Arch/M68k/M68kArchitecture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,17 @@ public override IEnumerable<Address> CreatePointerScanner(ImageMap map, ImageRea
return new M68kPointerScanner(rdr, knownLinAddresses, flags).Select(li => Address.Ptr32(li));
}

public override ImageReader CreateImageReader(LoadedImage image, Address addr)
public override ImageReader CreateImageReader(MemoryArea image, Address addr)
{
return new BeImageReader(image, addr);
}

public override ImageReader CreateImageReader(LoadedImage image, ulong offset)
public override ImageReader CreateImageReader(MemoryArea image, Address addrBegin, Address addrEnd)
{
return new BeImageReader(image, addrBegin, addrEnd);
}

public override ImageReader CreateImageReader(MemoryArea image, ulong offset)
{
return new BeImageReader(image, offset);
}
Expand Down Expand Up @@ -136,7 +141,7 @@ public override Address MakeAddressFromConstant(Constant c)

public override Address ReadCodeAddress(int size, ImageReader rdr, ProcessorState state)
{
throw new NotImplementedException();
return Address.Ptr32(rdr.ReadBeUInt32());
}

//$REVIEW: shouldn't this be flaggroup?
Expand Down
Loading

0 comments on commit 052ffae

Please sign in to comment.