really ugly... but its a start

This commit is contained in:
Reece Wilson 2018-08-17 04:11:20 +01:00
commit 7459d15b9a
113 changed files with 9480 additions and 0 deletions

332
.gitignore vendored Normal file
View File

@ -0,0 +1,332 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/

6
App.config Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>

192
HavokHelper.csproj Normal file
View File

@ -0,0 +1,192 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{145567FE-0B23-4858-AD58-420DC21718D6}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>HavokHelper</RootNamespace>
<AssemblyName>HavokHelper</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="src\Form\Form1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Form.resx</DependentUpon>
</Compile>
<Compile Include="src\Lua\Constants.cs" />
<Compile Include="src\Form\Form.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="src\Form\Form.Designer.cs">
<DependentUpon>Form.cs</DependentUpon>
</Compile>
<Compile Include="src\Lua\Header.cs" />
<Compile Include="src\Lua\Instructions\AddBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\AddInstruction.cs" />
<Compile Include="src\Lua\Instructions\BaseInstruction.cs" />
<Compile Include="src\Lua\Instructions\CallCInstruction.cs" />
<Compile Include="src\Lua\Instructions\CallIInstruction.cs" />
<Compile Include="src\Lua\Instructions\CallInstruction.cs" />
<Compile Include="src\Lua\Instructions\CallIR1Instruction.cs" />
<Compile Include="src\Lua\Instructions\CallMInstruction.cs" />
<Compile Include="src\Lua\Instructions\ChecktypeDInstruction.cs" />
<Compile Include="src\Lua\Instructions\ChecktypeInstruction.cs" />
<Compile Include="src\Lua\Instructions\ChecktypesInstruction.cs" />
<Compile Include="src\Lua\Instructions\CloseInstruction.cs" />
<Compile Include="src\Lua\Instructions\ClosureInstruction.cs" />
<Compile Include="src\Lua\Instructions\ConcatInstruction.cs" />
<Compile Include="src\Lua\Instructions\DataInstruction.cs" />
<Compile Include="src\Lua\Instructions\DivBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\DivInstruction.cs" />
<Compile Include="src\Lua\Instructions\EqBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\EqInstruction.cs" />
<Compile Include="src\Lua\Instructions\ForloopInstruction.cs" />
<Compile Include="src\Lua\Instructions\ForprepInstruction.cs" />
<Compile Include="src\Lua\Instructions\GetfieldInstruction.cs" />
<Compile Include="src\Lua\Instructions\GetfieldMmInstruction.cs" />
<Compile Include="src\Lua\Instructions\GetfieldR1Instruction.cs" />
<Compile Include="src\Lua\Instructions\GetglobalInstruction.cs" />
<Compile Include="src\Lua\Instructions\GetglobalMemInstruction.cs" />
<Compile Include="src\Lua\Instructions\GetslotDInstruction.cs" />
<Compile Include="src\Lua\Instructions\GetslotInstruction.cs" />
<Compile Include="src\Lua\Instructions\GetslotmtInstruction.cs" />
<Compile Include="src\Lua\Instructions\GettableInstruction.cs" />
<Compile Include="src\Lua\Instructions\GettableNInstruction.cs" />
<Compile Include="src\Lua\Instructions\GettableSInstruction.cs" />
<Compile Include="src\Lua\Instructions\GetupvalInstruction.cs" />
<Compile Include="src\Lua\Instructions\Helpers\CallHelper.cs" />
<Compile Include="src\Lua\Instructions\Helpers\IfExpHelper.cs" />
<Compile Include="src\Lua\Instructions\Helpers\TestHelper.cs" />
<Compile Include="src\Lua\Instructions\IntrinsicIndexInstruction.cs" />
<Compile Include="src\Lua\Instructions\IntrinsicIndexLiteralInstruction.cs" />
<Compile Include="src\Lua\Instructions\IntrinsicNewindexInstruction.cs" />
<Compile Include="src\Lua\Instructions\IntrinsicNewindexLiteralInstruction.cs" />
<Compile Include="src\Lua\Instructions\IntrinsicSelfInstruction.cs" />
<Compile Include="src\Lua\Instructions\IntrinsicSelfLiteralInstruction.cs" />
<Compile Include="src\Lua\Instructions\JmpInstruction.cs" />
<Compile Include="src\Lua\Instructions\LeBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\LeInstruction.cs" />
<Compile Include="src\Lua\Instructions\LoadboolInstruction.cs" />
<Compile Include="src\Lua\Instructions\LoadkInstruction.cs" />
<Compile Include="src\Lua\Instructions\LoadnilInstruction.cs" />
<Compile Include="src\Lua\Instructions\LtBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\LtInstruction.cs" />
<Compile Include="src\Lua\Instructions\ModBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\ModInstruction.cs" />
<Compile Include="src\Lua\Instructions\MoveInstruction.cs" />
<Compile Include="src\Lua\Instructions\MulBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\MulInstruction.cs" />
<Compile Include="src\Lua\Instructions\NewstructInstruction.cs" />
<Compile Include="src\Lua\Instructions\NewtableInstruction.cs" />
<Compile Include="src\Lua\Instructions\NotInstruction.cs" />
<Compile Include="src\Lua\Instructions\NotR1Instruction.cs" />
<Compile Include="src\Lua\Instructions\PowBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\PowInstruction.cs" />
<Compile Include="src\Lua\Instructions\ReturnInstruction.cs" />
<Compile Include="src\Lua\Instructions\SelfInstruction.cs" />
<Compile Include="src\Lua\Instructions\SelfslotInstruction.cs" />
<Compile Include="src\Lua\Instructions\SelfslotmtInstruction.cs" />
<Compile Include="src\Lua\Instructions\SetfieldInstruction.cs" />
<Compile Include="src\Lua\Instructions\SetfieldR1Instruction.cs" />
<Compile Include="src\Lua\Instructions\SetglobalInstruction.cs" />
<Compile Include="src\Lua\Instructions\SetlistInstruction.cs" />
<Compile Include="src\Lua\Instructions\SetslotiInstruction.cs" />
<Compile Include="src\Lua\Instructions\SetslotInstruction.cs" />
<Compile Include="src\Lua\Instructions\SetslotmtInstruction.cs" />
<Compile Include="src\Lua\Instructions\SetslotnInstruction.cs" />
<Compile Include="src\Lua\Instructions\SetslotsInstruction.cs" />
<Compile Include="src\Lua\Instructions\SettableBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\SettableInstruction.cs" />
<Compile Include="src\Lua\Instructions\SettableNBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\SettableNInstruction.cs" />
<Compile Include="src\Lua\Instructions\SettableSBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\SettableSInstruction.cs" />
<Compile Include="src\Lua\Instructions\SetupvalInstruction.cs" />
<Compile Include="src\Lua\Instructions\SetupvalR1Instruction.cs" />
<Compile Include="src\Lua\Instructions\SubBkInstruction.cs" />
<Compile Include="src\Lua\Instructions\SubInstruction.cs" />
<Compile Include="src\Lua\Instructions\TailcallCInstruction.cs" />
<Compile Include="src\Lua\Instructions\TailcallIInstruction.cs" />
<Compile Include="src\Lua\Instructions\TailcallInstruction.cs" />
<Compile Include="src\Lua\Instructions\TailcallIR1Instruction.cs" />
<Compile Include="src\Lua\Instructions\TailcallMInstruction.cs" />
<Compile Include="src\Lua\Instructions\TestInstruction.cs" />
<Compile Include="src\Lua\Instructions\TestR1Instruction.cs" />
<Compile Include="src\Lua\Instructions\TestsetInstruction.cs" />
<Compile Include="src\Lua\Instructions\TforloopInstruction.cs" />
<Compile Include="src\Lua\Instructions\UnmInstruction.cs" />
<Compile Include="src\Lua\Instructions\VarargInstruction.cs" />
<Compile Include="src\Lua\Script.cs" />
<Compile Include="src\Lua\Stub.cs" />
<Compile Include="src\Parser\JSParserPort.cs" />
<Compile Include="src\Program.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="src\Form\Form.resx">
<DependentUpon>Form.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="src\Form\Form.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Form1.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HavokHelper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HavokHelper")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("145567fe-0b23-4858-ad58-420dc21718d6")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

71
Properties/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace HavokHelper.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HavokHelper.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

117
Properties/Resources.resx Normal file
View File

@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

30
Properties/Settings.Designer.cs generated Normal file
View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace HavokHelper.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

718
src/Form/Form.Designer.cs generated Normal file
View File

@ -0,0 +1,718 @@
namespace HavokHelper
{
partial class Main
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SupportedOpsList = new System.Windows.Forms.CheckedListBox();
this.MethodsView = new System.Windows.Forms.ListView();
this.ClosureColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ParameterColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.RegColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.UpValColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.FlagsColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.SizeLbl = new System.Windows.Forms.Label();
this.InstructionLbl = new System.Windows.Forms.Label();
this.IntLbl = new System.Windows.Forms.Label();
this.NumLbl = new System.Windows.Forms.Label();
this.ShareLbl = new System.Windows.Forms.Label();
this.TypesLbl = new System.Windows.Forms.Label();
this.FlagsLbl = new System.Windows.Forms.Label();
this.EndianLbl = new System.Windows.Forms.Label();
this.VersionLbl = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.CurOpPseudo = new System.Windows.Forms.RichTextBox();
this.label1 = new System.Windows.Forms.Label();
this.AbsAVal = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.AbsBVal = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.AbsCVal = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.PseudocodeBox = new System.Windows.Forms.RichTextBox();
this.InstructionView = new System.Windows.Forms.ListView();
this.InstIndexColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.InstructionColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.AColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.BColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.CColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.ConstantsView = new System.Windows.Forms.ListView();
this.IndexColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.TypeColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ValueColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ImplementOpsGroup = new System.Windows.Forms.GroupBox();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripSplitButton();
this.FromFileItem = new System.Windows.Forms.ToolStripMenuItem();
this.fromSourceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.FromClipboardItem = new System.Windows.Forms.ToolStripMenuItem();
this.FromRichTxtItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripButton2 = new System.Windows.Forms.ToolStripSplitButton();
this.SavePseudocodeItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox4.SuspendLayout();
this.ImplementOpsGroup.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// SupportedOpsList
//
this.SupportedOpsList.FormattingEnabled = true;
this.SupportedOpsList.Location = new System.Drawing.Point(0, 14);
this.SupportedOpsList.Name = "SupportedOpsList";
this.SupportedOpsList.Size = new System.Drawing.Size(259, 559);
this.SupportedOpsList.TabIndex = 0;
this.SupportedOpsList.SelectedIndexChanged += new System.EventHandler(this.SupportedOpsList_SelectedIndexChanged);
//
// MethodsView
//
this.MethodsView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.ClosureColumn,
this.ParameterColumn,
this.RegColumn,
this.UpValColumn,
this.FlagsColumn});
this.MethodsView.Dock = System.Windows.Forms.DockStyle.Fill;
this.MethodsView.GridLines = true;
this.MethodsView.Location = new System.Drawing.Point(3, 16);
this.MethodsView.Name = "MethodsView";
this.MethodsView.Size = new System.Drawing.Size(289, 410);
this.MethodsView.TabIndex = 5;
this.MethodsView.UseCompatibleStateImageBehavior = false;
this.MethodsView.View = System.Windows.Forms.View.Details;
this.MethodsView.SelectedIndexChanged += new System.EventHandler(this.MethodsView_SelectedIndexChanged);
//
// ClosureColumn
//
this.ClosureColumn.Text = "Closure";
this.ClosureColumn.Width = 86;
//
// ParameterColumn
//
this.ParameterColumn.Text = "Parameters";
this.ParameterColumn.Width = 66;
//
// RegColumn
//
this.RegColumn.Text = "Regs";
this.RegColumn.Width = 43;
//
// UpValColumn
//
this.UpValColumn.Text = "UpVals";
this.UpValColumn.Width = 49;
//
// FlagsColumn
//
this.FlagsColumn.Text = "Flags";
this.FlagsColumn.Width = 37;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.SizeLbl);
this.groupBox1.Controls.Add(this.InstructionLbl);
this.groupBox1.Controls.Add(this.IntLbl);
this.groupBox1.Controls.Add(this.NumLbl);
this.groupBox1.Controls.Add(this.ShareLbl);
this.groupBox1.Controls.Add(this.TypesLbl);
this.groupBox1.Controls.Add(this.FlagsLbl);
this.groupBox1.Controls.Add(this.EndianLbl);
this.groupBox1.Controls.Add(this.VersionLbl);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.label9);
this.groupBox1.Controls.Add(this.label10);
this.groupBox1.Controls.Add(this.label11);
this.groupBox1.Controls.Add(this.label13);
this.groupBox1.Controls.Add(this.label14);
this.groupBox1.Controls.Add(this.label15);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Location = new System.Drawing.Point(3, 28);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(292, 143);
this.groupBox1.TabIndex = 6;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Header";
//
// SizeLbl
//
this.SizeLbl.AutoSize = true;
this.SizeLbl.Location = new System.Drawing.Point(221, 97);
this.SizeLbl.Name = "SizeLbl";
this.SizeLbl.Size = new System.Drawing.Size(10, 13);
this.SizeLbl.TabIndex = 22;
this.SizeLbl.Text = " ";
//
// InstructionLbl
//
this.InstructionLbl.AutoSize = true;
this.InstructionLbl.Location = new System.Drawing.Point(221, 71);
this.InstructionLbl.Name = "InstructionLbl";
this.InstructionLbl.Size = new System.Drawing.Size(10, 13);
this.InstructionLbl.TabIndex = 21;
this.InstructionLbl.Text = " ";
//
// IntLbl
//
this.IntLbl.AutoSize = true;
this.IntLbl.Location = new System.Drawing.Point(221, 45);
this.IntLbl.Name = "IntLbl";
this.IntLbl.Size = new System.Drawing.Size(10, 13);
this.IntLbl.TabIndex = 20;
this.IntLbl.Text = " ";
//
// NumLbl
//
this.NumLbl.AutoSize = true;
this.NumLbl.Location = new System.Drawing.Point(221, 19);
this.NumLbl.Name = "NumLbl";
this.NumLbl.Size = new System.Drawing.Size(10, 13);
this.NumLbl.TabIndex = 19;
this.NumLbl.Text = " ";
//
// ShareLbl
//
this.ShareLbl.AutoSize = true;
this.ShareLbl.Location = new System.Drawing.Point(57, 123);
this.ShareLbl.Name = "ShareLbl";
this.ShareLbl.Size = new System.Drawing.Size(10, 13);
this.ShareLbl.TabIndex = 18;
this.ShareLbl.Text = " ";
//
// TypesLbl
//
this.TypesLbl.AutoSize = true;
this.TypesLbl.Location = new System.Drawing.Point(57, 97);
this.TypesLbl.Name = "TypesLbl";
this.TypesLbl.Size = new System.Drawing.Size(10, 13);
this.TypesLbl.TabIndex = 17;
this.TypesLbl.Text = " ";
//
// FlagsLbl
//
this.FlagsLbl.AutoSize = true;
this.FlagsLbl.Location = new System.Drawing.Point(57, 71);
this.FlagsLbl.Name = "FlagsLbl";
this.FlagsLbl.Size = new System.Drawing.Size(10, 13);
this.FlagsLbl.TabIndex = 16;
this.FlagsLbl.Text = " ";
//
// EndianLbl
//
this.EndianLbl.AutoSize = true;
this.EndianLbl.Location = new System.Drawing.Point(57, 45);
this.EndianLbl.Name = "EndianLbl";
this.EndianLbl.Size = new System.Drawing.Size(10, 13);
this.EndianLbl.TabIndex = 15;
this.EndianLbl.Text = " ";
//
// VersionLbl
//
this.VersionLbl.AutoSize = true;
this.VersionLbl.Location = new System.Drawing.Point(57, 19);
this.VersionLbl.Name = "VersionLbl";
this.VersionLbl.Size = new System.Drawing.Size(10, 13);
this.VersionLbl.TabIndex = 14;
this.VersionLbl.Text = " ";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(178, 97);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(37, 13);
this.label8.TabIndex = 13;
this.label8.Text = "SizeT:";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(156, 71);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(59, 13);
this.label9.TabIndex = 12;
this.label9.Text = "Instruction:";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(172, 45);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(43, 13);
this.label10.TabIndex = 11;
this.label10.Text = "Integer:";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(168, 19);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(47, 13);
this.label11.TabIndex = 10;
this.label11.Text = "Number:";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(13, 123);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(38, 13);
this.label13.TabIndex = 9;
this.label13.Text = "Share:";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(12, 97);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(39, 13);
this.label14.TabIndex = 8;
this.label14.Text = "Types:";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(16, 71);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(35, 13);
this.label15.TabIndex = 7;
this.label15.Text = "Flags:";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(8, 45);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(43, 13);
this.label7.TabIndex = 1;
this.label7.Text = "Endian:";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 19);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(45, 13);
this.label6.TabIndex = 0;
this.label6.Text = "Version:";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.MethodsView);
this.groupBox2.Location = new System.Drawing.Point(0, 177);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(295, 429);
this.groupBox2.TabIndex = 7;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Code";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.CurOpPseudo);
this.groupBox3.Controls.Add(this.label1);
this.groupBox3.Controls.Add(this.AbsAVal);
this.groupBox3.Controls.Add(this.label3);
this.groupBox3.Controls.Add(this.AbsBVal);
this.groupBox3.Controls.Add(this.label2);
this.groupBox3.Controls.Add(this.AbsCVal);
this.groupBox3.Controls.Add(this.label4);
this.groupBox3.Location = new System.Drawing.Point(445, 19);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(305, 202);
this.groupBox3.TabIndex = 7;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Instruction Help";
//
// CurOpPseudo
//
this.CurOpPseudo.Location = new System.Drawing.Point(85, 112);
this.CurOpPseudo.Name = "CurOpPseudo";
this.CurOpPseudo.ReadOnly = true;
this.CurOpPseudo.Size = new System.Drawing.Size(215, 84);
this.CurOpPseudo.TabIndex = 12;
this.CurOpPseudo.Text = "";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 112);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(73, 26);
this.label1.TabIndex = 26;
this.label1.Text = " Instruction\r\n Pseudocode:";
//
// AbsAVal
//
this.AbsAVal.Location = new System.Drawing.Point(33, 33);
this.AbsAVal.Name = "AbsAVal";
this.AbsAVal.ReadOnly = true;
this.AbsAVal.Size = new System.Drawing.Size(267, 20);
this.AbsAVal.TabIndex = 22;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(9, 36);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(17, 13);
this.label3.TabIndex = 21;
this.label3.Text = "A:";
//
// AbsBVal
//
this.AbsBVal.Location = new System.Drawing.Point(33, 59);
this.AbsBVal.Name = "AbsBVal";
this.AbsBVal.ReadOnly = true;
this.AbsBVal.Size = new System.Drawing.Size(267, 20);
this.AbsBVal.TabIndex = 20;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 62);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(17, 13);
this.label2.TabIndex = 19;
this.label2.Text = "B:";
//
// AbsCVal
//
this.AbsCVal.Location = new System.Drawing.Point(33, 85);
this.AbsCVal.Name = "AbsCVal";
this.AbsCVal.ReadOnly = true;
this.AbsCVal.Size = new System.Drawing.Size(267, 20);
this.AbsCVal.TabIndex = 18;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(9, 88);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(17, 13);
this.label4.TabIndex = 17;
this.label4.Text = "C:";
//
// PseudocodeBox
//
this.PseudocodeBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.PseudocodeBox.Location = new System.Drawing.Point(3, 16);
this.PseudocodeBox.Name = "PseudocodeBox";
this.PseudocodeBox.ReadOnly = true;
this.PseudocodeBox.Size = new System.Drawing.Size(299, 327);
this.PseudocodeBox.TabIndex = 11;
this.PseudocodeBox.Text = "";
//
// InstructionView
//
this.InstructionView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.InstIndexColumn,
this.InstructionColumn,
this.AColumn,
this.BColumn,
this.CColumn});
this.InstructionView.GridLines = true;
this.InstructionView.Location = new System.Drawing.Point(0, 19);
this.InstructionView.Name = "InstructionView";
this.InstructionView.Size = new System.Drawing.Size(439, 423);
this.InstructionView.TabIndex = 8;
this.InstructionView.UseCompatibleStateImageBehavior = false;
this.InstructionView.View = System.Windows.Forms.View.Details;
this.InstructionView.SelectedIndexChanged += new System.EventHandler(this.InstructionView_SelectedIndexChanged);
//
// InstIndexColumn
//
this.InstIndexColumn.Text = "Index";
this.InstIndexColumn.Width = 48;
//
// InstructionColumn
//
this.InstructionColumn.Text = "Instruction";
this.InstructionColumn.Width = 257;
//
// AColumn
//
this.AColumn.Text = "A";
this.AColumn.Width = 42;
//
// BColumn
//
this.BColumn.Text = "B";
this.BColumn.Width = 42;
//
// CColumn
//
this.CColumn.Text = "C";
this.CColumn.Width = 42;
//
// groupBox5
//
this.groupBox5.Controls.Add(this.groupBox4);
this.groupBox5.Controls.Add(this.ConstantsView);
this.groupBox5.Controls.Add(this.InstructionView);
this.groupBox5.Controls.Add(this.groupBox3);
this.groupBox5.Location = new System.Drawing.Point(301, 28);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(755, 575);
this.groupBox5.TabIndex = 9;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Current Stub";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.PseudocodeBox);
this.groupBox4.Location = new System.Drawing.Point(445, 228);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(305, 346);
this.groupBox4.TabIndex = 12;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Stub Pseudocode";
//
// ConstantsView
//
this.ConstantsView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.IndexColumn,
this.TypeColumn,
this.ValueColumn});
this.ConstantsView.Location = new System.Drawing.Point(0, 444);
this.ConstantsView.Name = "ConstantsView";
this.ConstantsView.Size = new System.Drawing.Size(439, 130);
this.ConstantsView.TabIndex = 9;
this.ConstantsView.UseCompatibleStateImageBehavior = false;
this.ConstantsView.View = System.Windows.Forms.View.Details;
//
// IndexColumn
//
this.IndexColumn.Text = "Index";
this.IndexColumn.Width = 45;
//
// TypeColumn
//
this.TypeColumn.Text = "Type";
this.TypeColumn.Width = 113;
//
// ValueColumn
//
this.ValueColumn.Text = "Value";
this.ValueColumn.Width = 237;
//
// ImplementOpsGroup
//
this.ImplementOpsGroup.Controls.Add(this.SupportedOpsList);
this.ImplementOpsGroup.Location = new System.Drawing.Point(1060, 28);
this.ImplementOpsGroup.Name = "ImplementOpsGroup";
this.ImplementOpsGroup.Size = new System.Drawing.Size(260, 575);
this.ImplementOpsGroup.TabIndex = 10;
this.ImplementOpsGroup.TabStop = false;
this.ImplementOpsGroup.Text = "Implemented Operations";
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1,
this.toolStripButton2});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1318, 25);
this.toolStrip1.TabIndex = 11;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripButton1
//
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.FromFileItem,
this.fromSourceToolStripMenuItem});
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(88, 22);
this.toolStripButton1.Text = "Load Source";
//
// FromFileItem
//
this.FromFileItem.Name = "FromFileItem";
this.FromFileItem.Size = new System.Drawing.Size(141, 22);
this.FromFileItem.Text = "From File";
this.FromFileItem.Click += new System.EventHandler(this.FromFileItem_Click);
//
// fromSourceToolStripMenuItem
//
this.fromSourceToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.FromClipboardItem,
this.FromRichTxtItem});
this.fromSourceToolStripMenuItem.Name = "fromSourceToolStripMenuItem";
this.fromSourceToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
this.fromSourceToolStripMenuItem.Text = "From Source";
//
// FromClipboardItem
//
this.FromClipboardItem.Name = "FromClipboardItem";
this.FromClipboardItem.Size = new System.Drawing.Size(135, 22);
this.FromClipboardItem.Text = "Clipboard";
this.FromClipboardItem.Click += new System.EventHandler(this.FromClipboardItem_Click);
//
// FromRichTxtItem
//
this.FromRichTxtItem.Name = "FromRichTxtItem";
this.FromRichTxtItem.Size = new System.Drawing.Size(135, 22);
this.FromRichTxtItem.Text = "Richtextbox";
this.FromRichTxtItem.Click += new System.EventHandler(this.FromRichTxtItem_Click);
//
// toolStripButton2
//
this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.SavePseudocodeItem});
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(86, 22);
this.toolStripButton2.Text = "Save Source";
//
// SavePseudocodeItem
//
this.SavePseudocodeItem.Name = "SavePseudocodeItem";
this.SavePseudocodeItem.Size = new System.Drawing.Size(169, 22);
this.SavePseudocodeItem.Text = "Save pseudocode ";
this.SavePseudocodeItem.Click += new System.EventHandler(this.SavePseudocodeItem_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk);
//
// Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1318, 604);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.ImplementOpsGroup);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Main";
this.Text = "Havok Kore Script Helper";
this.Load += new System.EventHandler(this.Main_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.ImplementOpsGroup.ResumeLayout(false);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckedListBox SupportedOpsList;
private System.Windows.Forms.ListView MethodsView;
private System.Windows.Forms.ColumnHeader ClosureColumn;
private System.Windows.Forms.ColumnHeader ParameterColumn;
private System.Windows.Forms.ColumnHeader UpValColumn;
private System.Windows.Forms.ColumnHeader FlagsColumn;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.RichTextBox PseudocodeBox;
private System.Windows.Forms.ListView InstructionView;
private System.Windows.Forms.ColumnHeader InstructionColumn;
private System.Windows.Forms.ColumnHeader AColumn;
private System.Windows.Forms.ColumnHeader BColumn;
private System.Windows.Forms.ColumnHeader CColumn;
private System.Windows.Forms.TextBox AbsAVal;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox AbsBVal;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox AbsCVal;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.ListView ConstantsView;
private System.Windows.Forms.ColumnHeader IndexColumn;
private System.Windows.Forms.ColumnHeader TypeColumn;
private System.Windows.Forms.ColumnHeader ValueColumn;
private System.Windows.Forms.GroupBox ImplementOpsGroup;
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ToolStripSplitButton toolStripButton1;
private System.Windows.Forms.ToolStripSplitButton toolStripButton2;
private System.Windows.Forms.ToolStripMenuItem FromFileItem;
private System.Windows.Forms.ToolStripMenuItem fromSourceToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem FromClipboardItem;
private System.Windows.Forms.ToolStripMenuItem FromRichTxtItem;
private System.Windows.Forms.ToolStripMenuItem SavePseudocodeItem;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.RichTextBox CurOpPseudo;
private System.Windows.Forms.Label SizeLbl;
private System.Windows.Forms.Label InstructionLbl;
private System.Windows.Forms.Label IntLbl;
private System.Windows.Forms.Label NumLbl;
private System.Windows.Forms.Label ShareLbl;
private System.Windows.Forms.Label TypesLbl;
private System.Windows.Forms.Label FlagsLbl;
private System.Windows.Forms.Label EndianLbl;
private System.Windows.Forms.Label VersionLbl;
private System.Windows.Forms.ColumnHeader RegColumn;
private System.Windows.Forms.ColumnHeader InstIndexColumn;
private System.Windows.Forms.GroupBox groupBox4;
}
}

169
src/Form/Form.cs Normal file
View File

@ -0,0 +1,169 @@
using HavokHelper.Lua;
using HavokHelper.Lua.Instructions;
using HavokHelper.src.Parser;
using System;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HavokHelper
{
public partial class Main : Form
{
private Stub SelectedStub;
public Main()
{
InitializeComponent();
}
private void Main_Load(object sender, EventArgs e)
{
int ImplCount = 0;
BaseInstruction.All.ToList().ForEach((ahh) =>
{
if (ahh.Implemented()) ImplCount++;
SupportedOpsList.Items.Add(ahh.GetFullName(), ahh.Implemented());
});
ImplementOpsGroup.Text += " " + ImplCount + "/" + BaseInstruction.All.Length;
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
JSParserPort.ParseStatic(File.ReadAllText(openFileDialog1.FileName));
RefreshUI();
}
private void FromFileItem_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
}
private void SupportedOpsList_SelectedValueChanged(object sender, EventArgs e)
{
if (SupportedOpsList.SelectedItem != null)
SupportedOpsList.SelectedItem = null;
}
private void SupportedOpsList_SelectedIndexChanged(object sender, EventArgs e)
{
if (SupportedOpsList.SelectedItem != null)
SupportedOpsList.SelectedItem = null;
}
private void AddMethodToView(Stub Stub)
{
MethodsView.Items.Add(new ListViewItem(new String[] { Stub.AsString(), Stub.Parameters.ToString(), Stub.Registers.ToString(), Stub.UpVals.ToString(), "0x" + Stub.Flags.ToString("X") }));
Stub.Closures.ForEach(AddMethodToView);
}
private void RefreshUI()
{
VersionLbl.Text = HavokScript.Header.Version.ToString();
TypesLbl.Text = HavokScript.Header.Types.ToString();
ShareLbl.Text = HavokScript.Header.Share.ToString();
EndianLbl.Text = HavokScript.Header.Endianness + "-endian";
FlagsLbl.Text = "0x" + HavokScript.Header.Flags.ToString("X");
NumLbl.Text = HavokScript.Header.NumSize.ToString();
IntLbl.Text = HavokScript.Header.IntSize.ToString();
SizeLbl.Text = HavokScript.Header.SizeSize.ToString();
InstructionLbl.Text = HavokScript.Header.AltSize.ToString();
MethodsView.Items.Clear();
AddMethodToView(HavokScript.MainMethod);
MethodsView.Columns[0].Width = MethodsView.Width - (MethodsView.Columns[1].Width + MethodsView.Columns[2].Width + MethodsView.Columns[3].Width + MethodsView.Columns[4].Width + SystemInformation.VerticalScrollBarWidth + 4);
}
private void RenderMethod()
{
ConstantsView.Items.Clear();
SelectedStub.Constants.Constants.ToList().ForEach((ah) =>
{
ConstantsView.Items.Add(new ListViewItem(new String[] { ah.Key.ToString(), ah.Value.Type.ToString(), ah.Value.GetString()}));
});
StringBuilder PCode = new StringBuilder();
SelectedStub.Print(PCode);
PseudocodeBox.Text = PCode.ToString();
InstructionView.Items.Clear();
int Idx = 0;
SelectedStub.Instructions.ForEach((Instruction) =>
{
InstructionView.Items.Add(new ListViewItem(new String[] { (Idx++).ToString(), Instruction.GetFullName(), Instruction.A.ToString(), Instruction.B.ToString(), Instruction.C.ToString() }));
});
InstructionView.Columns[1].Width = InstructionView.Width - (InstructionView.Columns[0].Width + InstructionView.Columns[4].Width + InstructionView.Columns[2].Width + InstructionView.Columns[3].Width + SystemInformation.VerticalScrollBarWidth + 4);
}
private void RenderMethodSearch(Stub Stub)
{
if (!Stub.AsString().Equals(MethodsView.SelectedItems[0].SubItems[0].Text))
{
Stub.Closures.ForEach(RenderMethodSearch);
return;
}
SelectedStub = Stub;
RenderMethod();
}
private void MethodsView_SelectedIndexChanged(object sender, EventArgs e)
{
if (MethodsView.SelectedIndices.Count <= 0)
return;
RenderMethodSearch(HavokScript.MainMethod);
}
private void InstructionView_SelectedIndexChanged(object sender, EventArgs e)
{
if (InstructionView.SelectedIndices.Count <= 0)
return;
if (InstructionView.SelectedIndices.Count <= 0)
return;
int idx = InstructionView.SelectedIndices[0];
BaseInstruction Instruction = SelectedStub.Instructions[idx];
if (!Instruction.Implemented())
{
AbsAVal.Text = "Not Impl";
AbsBVal.Text = "Not Impl";
AbsCVal.Text = "Not Impl";
CurOpPseudo.Text = "Not Yet Implemented";
return;
}
StringBuilder PCode = new StringBuilder();
Instruction.AttainPseudoCode(PCode);
CurOpPseudo.Text = PCode.ToString();
SetABCField(Instruction.GetAUsage(), AbsAVal, Instruction.AStringify, Instruction.A);
SetABCField(Instruction.GetBUsage(), AbsBVal, Instruction.BStringify, Instruction.B);
if (Instruction.HasC())
SetABCField(Instruction.GetCUsage(), AbsCVal, Instruction.CStringify, Instruction.C);
else
AbsCVal.Text = "";
}
private void SetABCField(RegisterUsage Usage, TextBox Box, Stub.Stringify AsString, int Val)
{
Box.Text = "No Impl";
String Str = SelectedStub.StringifyInstruction(Usage, AsString, Val);
if (Str != null)
Box.Text = " = " + Str;
}
private void FromClipboardItem_Click(object sender, EventArgs e)
{
}
private void FromRichTxtItem_Click(object sender, EventArgs e)
{
}
private void SavePseudocodeItem_Click(object sender, EventArgs e)
{
}
}
}

129
src/Form/Form.resx Normal file
View File

@ -0,0 +1,129 @@
<?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>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>293, 17</value>
</metadata>
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>153, 17</value>
</metadata>
</root>

93
src/Form/Form1.Designer.cs generated Normal file
View File

@ -0,0 +1,93 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace HavokHelper.src.Form {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Form {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Form() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HavokHelper.src.Form.Form", typeof(Form).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Point similar to {X=153,Y=17}.
/// </summary>
public static System.Drawing.Point openFileDialog1_TrayLocation {
get {
object obj = ResourceManager.GetObject("openFileDialog1.TrayLocation", resourceCulture);
return ((System.Drawing.Point)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Point similar to {X=17,Y=17}.
/// </summary>
public static System.Drawing.Point saveFileDialog1_TrayLocation {
get {
object obj = ResourceManager.GetObject("saveFileDialog1.TrayLocation", resourceCulture);
return ((System.Drawing.Point)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Point similar to {X=293,Y=17}.
/// </summary>
public static System.Drawing.Point toolStrip1_TrayLocation {
get {
object obj = ResourceManager.GetObject("toolStrip1.TrayLocation", resourceCulture);
return ((System.Drawing.Point)(obj));
}
}
}
}

81
src/Lua/Constants.cs Normal file
View File

@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HavokHelper.Lua
{
public class Constant
{
private float I = 420;
private bool Bool;
private String Str;
public ConstantType Type { get; protected set; }
public Constant(float I)
{
this.Type = ConstantType.NUMBER;
this.I = I;
}
public Constant(String Str)
{
this.Type = ConstantType.STRING;
this.Str = Str;
}
public Constant(bool Val)
{
this.Type = ConstantType.BOOL;
this.Bool = Val;
}
public Constant()
{
this.Type = ConstantType.NIL;
}
public float FloatVal()
{
return this.I;
}
public int IntVal()
{
return (int)this.I;
}
public String GetString()
{
switch (this.Type)
{
case ConstantType.NUMBER:
return I.ToString();
case ConstantType.NIL:
return "NIL";
case ConstantType.STRING:
return Str; // "\"" + Str + "\"";
case ConstantType.BOOL:
return Bool.ToString();
default:
return "ERROR";
}
}
}
public class ConstantList
{
public Dictionary<int, Constant> Constants { get; protected set; } = new Dictionary<int, Constant>();
public Constant ByIdx(int index)
{
return Constants[index];
}
}
public enum ConstantType
{
NUMBER, NIL, STRING, BOOL
}
}

23
src/Lua/Header.cs Normal file
View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HavokHelper.Lua
{
public class Header
{
public int Flags { get; set; }
public int Version { get; set; }
public int Types { get; set; }
public bool Share { get; set; }
public bool IsLE { get; set; }
public String Endianness { get { return IsLE ? "little" : "big"; } set { } }
public int NumSize;
public int IntSize;
public int AltSize;
public int SizeSize;
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class AddBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_ADD_BK";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} + {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class AddInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.ConstantRegister;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_ADD";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} + {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,142 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public enum RegisterUsage
{
Stringify,
Register,
Constant,
ConstantRegister,
Numeric,
NotImplemented
}
public abstract class BaseInstruction
{
public int A { get; set; }
public int B { get; set; }
public int C { get; set; }
public abstract bool HasC();
public abstract String GetFullName();
public abstract bool Implemented();
public abstract RegisterUsage GetAUsage();
public abstract RegisterUsage GetBUsage();
public abstract RegisterUsage GetCUsage();
public abstract String AStringify(Stub Stub);
public abstract String BStringify(Stub Stub);
public abstract String CStringify(Stub Stub);
public abstract void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index);
public abstract void AttainPseudoCode(StringBuilder Buf);
public static BaseInstruction FromName(string name)
{
return All.ToList().Where((a) => { return a.GetFullName().Equals(name); }).ElementAtOrDefault(0);
}
public static BaseInstruction[] All = {
new TestInstruction(),
new TestR1Instruction(),
new EqInstruction(),
new EqBkInstruction(),
new MoveInstruction(),
new SelfInstruction(),
new ReturnInstruction(),
new GettableInstruction(),
new GettableSInstruction(),
new GettableNInstruction(),
new TforloopInstruction(),
new ForloopInstruction(),
new ForprepInstruction(),
new SettableSInstruction(),
new SettableSBkInstruction(),
new SettableNInstruction(),
new SettableNBkInstruction(),
new SettableInstruction(),
new SettableBkInstruction(),
new TailcallIR1Instruction(),
new TailcallIInstruction(),
new TailcallCInstruction(),
new TailcallMInstruction(),
new TailcallInstruction(),
new LoadkInstruction(),
new LoadnilInstruction(),
new LoadboolInstruction(),
new JmpInstruction(),
new CallInstruction(),
new CallMInstruction(),
new CallCInstruction(),
new CallIR1Instruction(),
new CallIInstruction(),
new IntrinsicIndexInstruction(),
new IntrinsicNewindexInstruction(),
new IntrinsicSelfInstruction(),
new IntrinsicIndexLiteralInstruction(),
new IntrinsicNewindexLiteralInstruction(),
new IntrinsicSelfLiteralInstruction(),
new GetupvalInstruction(),
new SetupvalInstruction(),
new SetupvalR1Instruction(),
new AddInstruction(),
new AddBkInstruction(),
new SubInstruction(),
new SubBkInstruction(),
new MulInstruction(),
new MulBkInstruction(),
new DivInstruction(),
new DivBkInstruction(),
new ModInstruction(),
new ModBkInstruction(),
new PowInstruction(),
new PowBkInstruction(),
new NewtableInstruction(),
new UnmInstruction(),
new NotInstruction(),
new NotR1Instruction(),
new LeInstruction(),
new LtInstruction(),
new LtBkInstruction(),
new LeInstruction(),
new LeBkInstruction(),
new ConcatInstruction(),
new TestsetInstruction(),
new SetlistInstruction(),
new CloseInstruction(),
new ClosureInstruction(),
new VarargInstruction(),
new NewstructInstruction(),
new DataInstruction(),
new SetslotnInstruction(),
new SetslotiInstruction(),
new SetslotInstruction(),
new SetslotmtInstruction(),
new SetslotsInstruction(),
new ChecktypeInstruction(),
new ChecktypeDInstruction(),
new ChecktypesInstruction(),
new GetslotInstruction(),
new GetslotDInstruction(),
new GetslotmtInstruction(),
new SelfslotInstruction(),
new SelfslotmtInstruction(),
new SetfieldInstruction(),
new SetfieldR1Instruction(),
new GetfieldInstruction(),
new GetfieldR1Instruction(),
new GetfieldMmInstruction(),
new SetglobalInstruction(),
new GetglobalInstruction(),
new GetglobalMemInstruction()
};
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class CallCInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_CALL_C";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,71 @@
using HavokHelper.Lua.Instructions.Helpers;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class CallIInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Numeric;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.Numeric;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_CALL_I";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
CallHelper.DecompileCall(false, this, Buf, OwnerStub, Index);
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append("TODO:");
}
}
}

View File

@ -0,0 +1,71 @@
using HavokHelper.Lua.Instructions.Helpers;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class CallIR1Instruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Numeric;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.Numeric;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_CALL_I_R1";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
CallHelper.DecompileCall(true, this, Buf, OwnerStub, Index);
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append("TODO:");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class CallInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_CALL";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class CallMInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_CALL_M";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class ChecktypeDInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_CHECKTYPE_D";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class ChecktypeInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_CHECKTYPE";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class ChecktypesInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_CHECKTYPES";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class CloseInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_CLOSE";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class ClosureInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Numeric;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_CLOSURE";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("var_{0}\t= {1}", A, OwnerStub.Closures[B].AsFnString()));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
String ahh = @"
a = R[a] = dest
b = PROTO(R[b]) = closure
dest = closure
if (closure->m_method->num_upvals == 0)
return
for (i = 0; i < closure ->m_method->num_upvals; i ++)
a->m_method->m_upvals[i] = 0
for (var i = 0; i < closure ->m_method->num_upvals; i ++) {
target = null
if (nextInstruction a == 1) {
target = luaState->pending;
if (!target) goto notFound;
while (luaPending->loc != &R[nextInstruction b])
{
luaPending = luaPending->m_next;
if (!luaPending) goto notFound;
}
} else {
notFound:
target = new UpVal()
target.loc.type = 0;
target.loc.value = 0;
target.loc = &R[nextInstruction b];
target.m_next = luaState->pending;
luaState->pending = target;
}
a->m_method->m_upvals[i] = target; // R[nextInstruction b] I think
ip ++;
}
";
Buf.Append(ahh);
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class ConcatInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_CONCAT";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class DataInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_DATA";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class DivBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_DIV_BK";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} / {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append("TODO:");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class DivInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.ConstantRegister;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_DIV";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} / {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append("TODO:");
}
}
}

View File

@ -0,0 +1,71 @@
using HavokHelper.Lua.Instructions.Helpers;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class EqBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_EQ_BK";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Index = IfExpHelper.DecompileExpressionStatement("==", this, Buf, OwnerStub, Index);
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,71 @@
using HavokHelper.Lua.Instructions.Helpers;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class EqInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Numeric;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.ConstantRegister;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_EQ";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Index = IfExpHelper.DecompileExpressionStatement("==", this, Buf, OwnerStub, Index);
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append("TODO");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class ForloopInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_FORLOOP";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class ForprepInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_FORPREP";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GetfieldInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.Constant;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETFIELD";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(
String.Format("var_{0}\t= var_{1}[{2}]\n", A, B, OwnerStub.DecompileInstruction_C(this)) +
String.Format("R1\t\t= var_{0}", A)
);
if (OwnerStub.Instructions[Index + 1].GetFullName().Contains("_DATA"))
Index += 2;
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append(
"A\t= R[A]\t\t= dest \n" +
"B\t= Table(B)\t\t= source \n" +
"C\t= int(C)\t\t= key \n" +
"\n" +
"dest\t= source[key]\n" +
"R1\t= dest");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GetfieldMmInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETFIELD_MM";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GetfieldR1Instruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.Constant;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETFIELD_R1";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(
String.Format("var_{0}\t= R1[{1}]\n", A, OwnerStub.DecompileInstruction_C(this)) +
String.Format("R1\t\t= var_{0}", A)
);
Index += 2;
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append(
"A\t= R[A]\t\t= dest \n" +
"C\t= int(C)\t\t= key \n" +
"\n" +
"dest\t= R1[key]\n" +
"R1\t= dest");
}
}
}

View File

@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GetglobalInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETGLOBAL";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("var_{0}\t= _G[{1}]\n", A, OwnerStub.DecompileInstruction_B(this)));
Buf.Append(String.Format("R1\t\t= var_{0}", A));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append(
"A\t= R[A]\t\t= object \n" +
"Bx\t= constant(Bx)\t= constant \n" +
" \n" +
"R1 = object = Global[constant]");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GetglobalMemInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETGLOBAL_MEM";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GetslotDInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETSLOT_D";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GetslotInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETSLOT";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GetslotmtInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETSLOTMT";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GettableInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETTABLE";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GettableNInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETTABLE_N";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GettableSInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETTABLE_S";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class GetupvalInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_GETUPVAL";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,47 @@
using HavokHelper.Lua;
using HavokHelper.Lua.Instructions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HavokHelper.Lua.Instructions.Helpers
{
class CallHelper
{
public static void DecompileCall(bool R1, BaseInstruction Cur, StringBuilder Buf, Stub OwnerStub, int Index)
{
String FuncName;
StringBuilder ReturnVals = new StringBuilder();
StringBuilder Parameters = new StringBuilder();
FuncName = R1 ? "R1" : String.Format("var_{0}", Cur.A);
if (Cur.C > 1)
{
int ReturnParameters;
ReturnParameters = Cur.C - 1;
if (ReturnParameters != 0)
{
for (int I = 0; I < ReturnParameters; I++)
ReturnVals.Append("val_" + I + ", ");
ReturnVals.Remove(ReturnVals.Length - 2, 2);
ReturnVals.Append("\t= ");
}
}
else if (Cur.C == 0)
{
ReturnVals.Append("--[[top = last_result+1]]");
}
for (int Reg = Cur.A + 1; Reg < Cur.A + Cur.B; Reg++)
Parameters.Append(String.Format("val_{0}, ", Reg));
if (Parameters.Length != 0)
Parameters.Remove(Parameters.Length - 2, 2);
Buf.Append(String.Format("{0}{1}({2})", ReturnVals.ToString(), FuncName, Parameters.ToString()));
}
}
}

View File

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HavokHelper.Lua.Instructions.Helpers
{
class IfExpHelper
{
public static int DecompileExpressionStatement(String ExprLogic, BaseInstruction Cur, StringBuilder Buf, Stub OwnerStub, int Index)
{
bool AVal = Cur.A != 0;
String IfStatement = "";
BaseInstruction BI = OwnerStub.Instructions[Index + 1];
if (BI.GetFullName().Contains("_JMP"))
{
if (AVal)
IfStatement = String.Format("if ({0} {2} {1})", OwnerStub.DecompileInstruction_B(Cur), OwnerStub.DecompileInstruction_C(Cur), ExprLogic);
else
IfStatement = String.Format("if (not({0} {2} {1}))", OwnerStub.DecompileInstruction_B(Cur), OwnerStub.DecompileInstruction_C(Cur), ExprLogic);
IfStatement += String.Format(" goto {0}", Index + BI.B + 1 + 1);
Index++;
}
else
{
if (AVal)
IfStatement = String.Format("if (not({0} {2} {1}))", OwnerStub.DecompileInstruction_B(Cur), OwnerStub.DecompileInstruction_C(Cur), ExprLogic);
else
IfStatement = String.Format("if ({0} {2} {1})", OwnerStub.DecompileInstruction_B(Cur), OwnerStub.DecompileInstruction_C(Cur), ExprLogic);
IfStatement += String.Format(" goto {0}", Index + 2);
}
Buf.Append(IfStatement);
return Index;
}
}
}

View File

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HavokHelper.Lua.Instructions.Helpers
{
class TestHelper
{
public static int DecompileTest(bool R1, BaseInstruction Cur, StringBuilder Buf, Stub OwnerStub, int Index)
{
String CmpTarget = R1 ? "R1" : OwnerStub.DecompileInstruction_A(Cur);
bool TestVal = Cur.C != 0;
BaseInstruction BI = OwnerStub.Instructions[Index + 1];
Buf.Append(String.Format("R1\t\t= {0}\n", CmpTarget));
if (BI.GetFullName().Contains("_JMP"))
{
if (TestVal)
Buf.Append(String.Format("if ({0}) goto {1}", CmpTarget, Index + BI.B + 1 + 1));
else
Buf.Append(String.Format("if (not ({0})) goto {1}", CmpTarget, Index + BI.B + 1 + 1));
Index++;
return Index;
}
if (TestVal)
Buf.Append(String.Format("if (not({0})) goto {1}", CmpTarget, Index + 2));
else
Buf.Append(String.Format("if ({0}) goto {1}", CmpTarget, Index + 2));
return Index;
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class IntrinsicIndexInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_INTRINSIC_INDEX";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class IntrinsicIndexLiteralInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_INTRINSIC_INDEX_LITERAL";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class IntrinsicNewindexInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_INTRINSIC_NEWINDEX";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class IntrinsicNewindexLiteralInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_INTRINSIC_NEWINDEX_LITERAL";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class IntrinsicSelfInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_INTRINSIC_SELF";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class IntrinsicSelfLiteralInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_INTRINSIC_SELF_LITERAL";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class JmpInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Numeric;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_JMP";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("goto {0}", Index + B + 1));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append( "B\t= signed int(B)\t= offset\n" +
"\n" +
"IP += offset");
}
}
}

View File

@ -0,0 +1,71 @@
using HavokHelper.Lua.Instructions.Helpers;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class LeBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_LE_BK";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Index = IfExpHelper.DecompileExpressionStatement("<=", this, Buf, OwnerStub, Index);
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,71 @@
using HavokHelper.Lua.Instructions.Helpers;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class LeInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.ConstantRegister;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_LE";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Index = IfExpHelper.DecompileExpressionStatement("<=", this, Buf, OwnerStub, Index);
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class LoadboolInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Numeric;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.Numeric;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_LOADBOOL";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1}", OwnerStub.DecompileInstruction_A(this), B == 0 ? "False" : "True"));
if (this.C != 0)
Buf.Append(String.Format("\ngoto {0}", Index + 2));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append("A\t= R[A]\t\t= dest\n" +
"B\t= bool(int(R[B]))\t= src\n" +
"C\t= int(C)\t\t= skip\n" +
"\n" +
"dest\t= src\n" +
"ip\t+= skip");
}
}
}

View File

@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class LoadkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_LOADK";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append("A\t= R[A]\t= dest\n" +
"B\t= K(B)\t= constant\n" +
"\n" +
"dest = constant");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class LoadnilInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_LOADNIL";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,71 @@
using HavokHelper.Lua.Instructions.Helpers;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class LtBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_LT_BK";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Index = IfExpHelper.DecompileExpressionStatement("<", this, Buf, OwnerStub, Index);
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,71 @@
using HavokHelper.Lua.Instructions.Helpers;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class LtInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.ConstantRegister;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_LT";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Index = IfExpHelper.DecompileExpressionStatement("<", this, Buf, OwnerStub, Index);
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class ModBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_MOD_BK";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} % {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class ModInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.ConstantRegister;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_MOD";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} % {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class MoveInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_MOVE";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append("" +
"R1\t\t= dest_r1\n" +
"A\t= R[A]\t= dest_a\n" +
"B\t= R[B]\t= src\n" +
"\n" +
"dest_r1\t= src\n" +
"dest_a\t= src");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class MulBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.Register;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_MUL_BK";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} * {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class MulInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.ConstantRegister;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_MUL";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} * {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class NewstructInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_NEWSTRUCT";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class NewtableInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Numeric;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.Numeric;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_NEWTABLE";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("var_{0} \t= {{}}\n", A));
Buf.Append(String.Format("R1 \t\t= var_{0}", A));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append(
"A\t= R[A]\t\t= object \n" +
"B\t= int(B)\t\t= SizeB \n" +
"C\t= int(C)\t\t= SizeC \n" +
" \n" +
"object\t= {} \n" +
"R1\t= {}");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class NotInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_NOT";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class NotR1Instruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_NOT_R1";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class PowBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_POW_BK";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} ^ {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class PowInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.ConstantRegister;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_POW";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} ^ {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class ReturnInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_RETURN";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SelfInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SELF";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append( String.Format("var_{0}\t= {1}\n", A + 1, OwnerStub.DecompileInstruction_B(this)) +
String.Format("{0}\t= {1}[{2}]\n", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)) +
String.Format("R1\t\t= {0}", OwnerStub.DecompileInstruction_A(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append(
"R1\t\t= dest_r1 \n" +
"A\t= R[A]\t= dest_a \n" +
"A_one\t= R[A + 1]= dest_a_one \n" +
"B\t= R[b]\t= table \n" +
"C\t= RK[c]\t= key \n" +
" \n" +
"dest_a_one\t= table \n" +
"dest_a\t\t= table[key] \n" +
"dest_r1\t\t= dest_a");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SelfslotInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SELFSLOT";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SelfslotmtInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SELFSLOTMT";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetfieldInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETFIELD";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
bool NoAppend = false;
if (Index > 0)
{
BaseInstruction BI = OwnerStub.Instructions[Index - 1];
if (BI.GetFullName().Equals(GetFullName()))
if (BI.A == this.A)
NoAppend = true;
}
if (!NoAppend)
Buf.Append(String.Format("R1\t\t= var_{0}\n", A));
Buf.Append(String.Format("var_{0}[{1}]\t= {2}", A, OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append(
"R1\t= R[A]\n" +
"R1[K[B]]\t= RK[C]");
}
}
}

View File

@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetfieldR1Instruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETFIELD_R1";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("R1[{0}]\t= {1}", OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append(
"R1[K[B]]\t= RK[C]");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetglobalInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return false;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETGLOBAL";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetlistInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETLIST";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetslotInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETSLOT";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetslotiInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETSLOTI";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetslotmtInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETSLOTMT";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetslotnInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETSLOTN";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetslotsInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETSLOTS";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SettableBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETTABLE_BK";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SettableInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETTABLE";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SettableNBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETTABLE_N_BK";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SettableNInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETTABLE_N";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SettableSBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETTABLE_S_BK";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SettableSInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETTABLE_S";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetupvalInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETUPVAL";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SetupvalR1Instruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SETUPVAL_R1";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SubBkInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.Constant;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SUB_BK";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} - {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append("TODO:");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class SubInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.Register;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.ConstantRegister;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.ConstantRegister;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_SUB";
}
public override bool Implemented()
{
return true;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
Buf.Append(String.Format("{0}\t= {1} - {2}", OwnerStub.DecompileInstruction_A(this), OwnerStub.DecompileInstruction_B(this), OwnerStub.DecompileInstruction_C(this)));
}
public override void AttainPseudoCode(StringBuilder Buf)
{
Buf.Append("TODO:");
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class TailcallCInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_TAILCALL_C";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HavokHelper.Lua.Instructions
{
public class TailcallIInstruction : BaseInstruction
{
public override RegisterUsage GetAUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetBUsage()
{
return RegisterUsage.NotImplemented;
}
public override RegisterUsage GetCUsage()
{
return RegisterUsage.NotImplemented;
}
public override String AStringify(Stub Stub)
{
return null;
}
public override String BStringify(Stub Stub)
{
return null;
}
public override String CStringify(Stub Stub)
{
return null;
}
public override bool HasC()
{
return true;
}
public override String GetFullName()
{
return "HKS_OPCODE_TAILCALL_I";
}
public override bool Implemented()
{
return false;
}
public override void Decompile(StringBuilder Buf, Stub OwnerStub, ref int Index)
{
}
public override void AttainPseudoCode(StringBuilder Buf)
{
}
}
}

Some files were not shown because too many files have changed in this diff Show More