Generated constants file via python script

This commit is contained in:
Antonio Parata 2015-10-14 16:34:10 +02:00
parent a45bc0c8cd
commit 59c3f1b315
9 changed files with 2387 additions and 2504 deletions

View file

@ -1,23 +1,4 @@
(*
.NET bindings for the UnicornEngine Emulator Engine
Copyright(c) 2015 Antonio Parata
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*)
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
namespace UnicornEngine.Const
@ -27,6 +8,7 @@ open System
module Arm =
// ARM registers
let UC_ARM_REG_INVALID = 0
let UC_ARM_REG_APSR = 1
let UC_ARM_REG_APSR_NZCV = 2
@ -148,3 +130,4 @@ module Arm =
let UC_ARM_REG_SL = 76
let UC_ARM_REG_FP = 77
let UC_ARM_REG_IP = 78

View file

@ -1,23 +1,4 @@
(*
.NET bindings for the UnicornEngine Emulator Engine
Copyright(c) 2015 Antonio Parata
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*)
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
namespace UnicornEngine.Const
@ -26,6 +7,8 @@ open System
[<AutoOpen>]
module Arm64 =
// ARM64 registers
let UC_ARM64_REG_INVALID = 0
let UC_ARM64_REG_X29 = 1
let UC_ARM64_REG_X30 = 2
@ -296,3 +279,4 @@ module Arm64 =
let UC_ARM64_REG_IP0 = 216
let UC_ARM64_REG_FP = 1
let UC_ARM64_REG_LR = 2

View file

@ -1,23 +1,4 @@
(*
.NET bindings for the UnicornEngine Emulator Engine
Copyright(c) 2015 Antonio Parata
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*)
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
namespace UnicornEngine.Const
@ -25,6 +6,7 @@ open System
[<AutoOpen>]
module Common =
let UC_API_MAJOR = 0
let UC_API_MINOR = 9
let UC_SECOND_SCALE = 1000000
@ -110,3 +92,4 @@ module Common =
let UC_PROT_WRITE = 2
let UC_PROT_EXEC = 4
let UC_PROT_ALL = 7

View file

@ -1,23 +1,4 @@
(*
.NET bindings for the UnicornEngine Emulator Engine
Copyright(c) 2015 Antonio Parata
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*)
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
namespace UnicornEngine.Const
@ -27,6 +8,7 @@ open System
module M68k =
// M68K registers
let UC_M68K_REG_INVALID = 0
let UC_M68K_REG_A0 = 1
let UC_M68K_REG_A1 = 2
@ -47,3 +29,4 @@ module M68k =
let UC_M68K_REG_SR = 17
let UC_M68K_REG_PC = 18
let UC_M68K_REG_ENDING = 19

View file

@ -1,23 +1,4 @@
(*
.NET bindings for the UnicornEngine Emulator Engine
Copyright(c) 2015 Antonio Parata
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*)
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
namespace UnicornEngine.Const
@ -27,6 +8,7 @@ open System
module Mips =
// MIPS registers
let UC_MIPS_REG_INVALID = 0
// General purpose registers
@ -218,3 +200,4 @@ module Mips =
let UC_MIPS_REG_LO1 = 46
let UC_MIPS_REG_LO2 = 47
let UC_MIPS_REG_LO3 = 48

View file

@ -1,23 +1,4 @@
(*
.NET bindings for the UnicornEngine Emulator Engine
Copyright(c) 2015 Antonio Parata
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*)
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
namespace UnicornEngine.Const
@ -27,6 +8,7 @@ open System
module Sparc =
// SPARC registers
let UC_SPARC_REG_INVALID = 0
let UC_SPARC_REG_F0 = 1
let UC_SPARC_REG_F1 = 2
@ -119,3 +101,4 @@ module Sparc =
let UC_SPARC_REG_ENDING = 89
let UC_SPARC_REG_O6 = 84
let UC_SPARC_REG_I6 = 67

View file

@ -1,23 +1,4 @@
(*
.NET bindings for the UnicornEngine Emulator Engine
Copyright(c) 2015 Antonio Parata
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*)
// For Unicorn Engine. AUTO-GENERATED FILE, DO NOT EDIT
namespace UnicornEngine.Const
@ -27,6 +8,7 @@ open System
module X86 =
// X86 registers
let UC_X86_REG_INVALID = 0
let UC_X86_REG_AH = 1
let UC_X86_REG_AL = 2
@ -272,6 +254,7 @@ module X86 =
let UC_X86_REG_ENDING = 242
// X86 instructions
let UC_X86_INS_INVALID = 0
let UC_X86_INS_AAA = 1
let UC_X86_INS_AAD = 2
@ -1611,3 +1594,4 @@ module X86 =
let UC_X86_INS_FDISI8087_NOP = 1336
let UC_X86_INS_FENI8087_NOP = 1337
let UC_X86_INS_ENDING = 1338

View file

@ -39,7 +39,7 @@ and OutHook = delegate of Unicorn * Int32 * Int32 * Int32 * Object -> unit
and SyscallHook = delegate of Unicorn * Object -> unit
// the managed unicorn engine
and Unicorn(arch: UInt32, mode: UInt32) =
and Unicorn(arch: Int32, mode: Int32) =
// hook callback list
let _codeHooks = new Dictionary<IntPtr, (CodeHook * Object)>()
@ -70,7 +70,7 @@ and Unicorn(arch: UInt32, mode: UInt32) =
do
let mem = Marshal.AllocHGlobal(IntPtr.Size)
_eng <- [|new UIntPtr(mem.ToPointer())|]
let err = NativeUnicornEngine.uc_open(arch, mode, _eng)
let err = NativeUnicornEngine.uc_open(uint32 arch, uint32 mode, _eng)
checkResult(err, "Unable to open the Unicorn Engine")
member this.MemMap(address: UInt64, size: UIntPtr, perm: Int32) =

View file

@ -29,7 +29,7 @@ namespace UnicornTests
{
class Program
{
private const Int64 ADDRESS = 0x1000000;
private const UInt64 ADDRESS = 0x1000000;
private static Byte[] X86_CODE32_SELF =
{
@ -57,13 +57,13 @@ namespace UnicornTests
}
}
private static Byte[] Int64ToBytes(Int64 intVal)
private static Byte[] Int64ToBytes(UInt64 intVal)
{
var res = new Byte[8];
for (var i = 0; i < res.Length; i++)
{
res[i] = (Byte)(intVal & 0xff);
intVal = (Int64)((UInt64)intVal >> 8);
intVal = intVal >> 8;
}
return res;
}
@ -146,7 +146,7 @@ namespace UnicornTests
static void Main(String[] args)
{
var u = new Unicorn((UInt32)Common.UC_ARCH_X86, (UInt32)Common.UC_MODE_32);
var u = new Unicorn(Common.UC_ARCH_X86, Common.UC_MODE_32);
Console.WriteLine("Unicorn version: {0}", u.Version());
// map 2MB of memory for this emulation
@ -168,7 +168,7 @@ namespace UnicornTests
Console.WriteLine(">>> Start tracing linux code");
// emulate machine code in infinite time
u.EmuStart(ADDRESS, (UInt64)(ADDRESS + X86_CODE32_SELF.Length), 0u, new UIntPtr(0));
u.EmuStart(ADDRESS, ADDRESS + (UInt64)X86_CODE32_SELF.Length, 0u, new UIntPtr(0));
Console.WriteLine();
Console.WriteLine(">>> Emulation Done!");