Skip to content

Commit

Permalink
Development branch for #213
Browse files Browse the repository at this point in the history
  • Loading branch information
uxmal committed May 29, 2016
1 parent e0978e3 commit 49456ac
Show file tree
Hide file tree
Showing 15 changed files with 31,350 additions and 62,279 deletions.
22 changes: 21 additions & 1 deletion src/Decompiler/Scanning/VectorWorkItem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
using Reko.Core;
#region License
/*
* Copyright (C) 1999-2016 John Källén.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#endregion

using Reko.Core;
using Reko.Core.Expressions;
using Reko.Core.Lib;
using Reko.Core.Types;
Expand Down
33 changes: 33 additions & 0 deletions src/Gui/Forms/IJumpTableDialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#region License
/*
* Copyright (C) 1999-2016 John Källén.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#endregion

using Reko.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Reko.Gui.Forms
{
public interface IJumpTableDialog : IDialog
{
Address[] GetJumpTableAddresses();
}
}
11 changes: 11 additions & 0 deletions src/Gui/Gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
<Compile Include="Forms\CallSiteInteractor.cs" />
<Compile Include="Forms\IAssumedRegisterValuesDialog.cs" />
<Compile Include="Forms\IDeclarationForm.cs" />
<Compile Include="Forms\IJumpTableDialog.cs" />
<Compile Include="Forms\IResourceEditor.cs" />
<Compile Include="Forms\ResourceEditorInteractor.cs" />
<Compile Include="ICallGraphViewService.cs" />
Expand Down Expand Up @@ -289,6 +290,13 @@
<Compile Include="Windows\Forms\DeclarationForm.Designer.cs">
<DependentUpon>DeclarationForm.cs</DependentUpon>
</Compile>
<Compile Include="Windows\Forms\JumpTableDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Windows\Forms\JumpTableDialog.Designer.cs">
<DependentUpon>JumpTableDialog.cs</DependentUpon>
</Compile>
<Compile Include="Windows\Forms\JumpTableInteractor.cs" />
<Compile Include="Windows\Forms\TextEncodingDialog.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -594,6 +602,9 @@
<EmbeddedResource Include="Windows\Forms\FindStringsDialog.resx">
<DependentUpon>FindStringsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Windows\Forms\JumpTableDialog.resx">
<DependentUpon>JumpTableDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Windows\Forms\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
Expand Down
1 change: 1 addition & 0 deletions src/Gui/IDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ namespace Reko.Gui
/// </summary>
public interface IDialog : IDisposable
{
string Text { get; set; }
}
}
1 change: 1 addition & 0 deletions src/Gui/IDialogFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ public interface IDialogFactory
IWorkerDialog CreateWorkerDialog();
ITextEncodingDialog CreateTextEncodingDialog();
IDeclarationForm CreateDeclarationForm();
IJumpTableDialog CreateJumpTableDialog(Address addrIndirectJump);
}
}
51 changes: 51 additions & 0 deletions src/Gui/Windows/Forms/JumpTableDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions src/Gui/Windows/Forms/JumpTableDialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#region License
/*
* Copyright (C) 1999-2016 John Källén.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#endregion

using Reko.Gui.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Reko.Core;

namespace Reko.Gui.Windows.Forms
{
public partial class JumpTableDialog : Form, IJumpTableDialog
{
public JumpTableDialog()
{
new JumpTableInteractor().Attach(this);
InitializeComponent();
}

public Address IndirectJumpAddress { get; internal set; }

public Address[] GetJumpTableAddresses()
{
throw new NotImplementedException();
}
}
}
120 changes: 120 additions & 0 deletions src/Gui/Windows/Forms/JumpTableDialog.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
37 changes: 37 additions & 0 deletions src/Gui/Windows/Forms/JumpTableInteractor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#region License
/*
* Copyright (C) 1999-2016 John Källén.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Reko.Gui.Windows.Forms
{
public class JumpTableInteractor
{
private JumpTableDialog dlg;

public void Attach(JumpTableDialog dlg)
{
this.dlg = dlg;
}
}
}
8 changes: 8 additions & 0 deletions src/Gui/Windows/WindowsFormsDialogFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ public IDeclarationForm CreateDeclarationForm()
{
return new DeclarationForm();
}

public IJumpTableDialog CreateJumpTableDialog(Address addrIndirectJump)
{
return new JumpTableDialog()
{
IndirectJumpAddress = addrIndirectJump,
};
}
}
}

1 change: 0 additions & 1 deletion src/UnitTests/Analysis/ConditionCodeEliminatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
using Reko.Core.Types;
using Reko.UnitTests.Mocks;
using Rhino.Mocks;
using Rhino.Mocks;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
Loading

0 comments on commit 49456ac

Please sign in to comment.