Browse Source

Initial commit.

pull/1/head
Andrei Vlad LUTAS 2 years ago
parent
commit
698ba367a1
  1. 65
      .gitignore
  2. 21
      .vsconfig
  3. 22
      Makefile
  4. 50
      README.md
  5. 87
      bddisasm.sln
  6. 123
      bddisasm/Makefile
  7. 5050
      bddisasm/bddisasm.c
  8. 474
      bddisasm/bddisasm.vcproj
  9. 458
      bddisasm/bddisasm.vcxproj
  10. 81
      bddisasm/bddisasm.vcxproj.filters
  11. 44
      bddisasm/crt.c
  12. 35360
      bddisasm/include/instructions.h
  13. 282
      bddisasm/include/mnemonics.h
  14. 90
      bddisasm/include/nd_crt.h
  15. 34
      bddisasm/include/prefixes.h
  16. 12254
      bddisasm/include/table_evex.h
  17. 15555
      bddisasm/include/table_root.h
  18. 11644
      bddisasm/include/table_vex.h
  19. 1541
      bddisasm/include/table_xop.h
  20. 480
      bddisasm/include/tabledefs.h
  21. 12
      bddisasm_test/README.md
  22. BIN
      bddisasm_test/amx/amx1_64
  23. 23
      bddisasm_test/amx/amx1_64.asm
  24. 263
      bddisasm_test/amx/amx1_64.result
  25. BIN
      bddisasm_test/avx/avx2_64
  26. 302
      bddisasm_test/avx/avx2_64.asm
  27. 5540
      bddisasm_test/avx/avx2_64.result
  28. BIN
      bddisasm_test/avx/avx2gather_64
  29. 12
      bddisasm_test/avx/avx2gather_64.asm
  30. 180
      bddisasm_test/avx/avx2gather_64.result
  31. BIN
      bddisasm_test/avx/avx_64
  32. 2200
      bddisasm_test/avx/avx_64.asm
  33. 40788
      bddisasm_test/avx/avx_64.result
  34. 4
      bddisasm_test/avx/f16c_64
  35. 11
      bddisasm_test/avx/f16c_64.asm
  36. 136
      bddisasm_test/avx/f16c_64.result
  37. 1
      bddisasm_test/avx/fma4_64
  38. 133
      bddisasm_test/avx/fma4_64.asm
  39. 2240
      bddisasm_test/avx/fma4_64.result
  40. 1
      bddisasm_test/avx/fma_64
  41. 198
      bddisasm_test/avx/fma_64.asm
  42. 3360
      bddisasm_test/avx/fma_64.result
  43. 1
      bddisasm_test/avx512/avx512bitalg_64
  44. 122
      bddisasm_test/avx512/avx512bitalg_64.asm
  45. 2358
      bddisasm_test/avx512/avx512bitalg_64.result
  46. BIN
      bddisasm_test/avx512/avx512bw_64
  47. 3492
      bddisasm_test/avx512/avx512bw_64.asm
  48. 71037
      bddisasm_test/avx512/avx512bw_64.result
  49. 1
      bddisasm_test/avx512/avx512cd_64
  50. 248
      bddisasm_test/avx512/avx512cd_64.asm
  51. 4902
      bddisasm_test/avx512/avx512cd_64.result
  52. BIN
      bddisasm_test/avx512/avx512dq_64
  53. 1926
      bddisasm_test/avx512/avx512dq_64.asm
  54. 39404
      bddisasm_test/avx512/avx512dq_64.result
  55. 1
      bddisasm_test/avx512/avx512er_64
  56. 226
      bddisasm_test/avx512/avx512er_64.asm
  57. 4504
      bddisasm_test/avx512/avx512er_64.result
  58. BIN
      bddisasm_test/avx512/avx512f_64
  59. 13534
      bddisasm_test/avx512/avx512f_64.asm
  60. 277669
      bddisasm_test/avx512/avx512f_64.result
  61. 1
      bddisasm_test/avx512/avx512fma_64
  62. 122
      bddisasm_test/avx512/avx512fma_64.asm
  63. 2520
      bddisasm_test/avx512/avx512fma_64.result
  64. BIN
      bddisasm_test/avx512/avx512pf_64
  65. 18
      bddisasm_test/avx512/avx512pf_64.asm
  66. 320
      bddisasm_test/avx512/avx512pf_64.result
  67. 1
      bddisasm_test/avx512/avx512vbmi_64
  68. 926
      bddisasm_test/avx512/avx512vbmi_64.asm
  69. 23586
      bddisasm_test/avx512/avx512vbmi_64.result
  70. 1
      bddisasm_test/avx512/avx512vnni_64
  71. 242
      bddisasm_test/avx512/avx512vnni_64.asm
  72. 5040
      bddisasm_test/avx512/avx512vnni_64.result
  73. BIN
      bddisasm_test/basic/address_16
  74. 31
      bddisasm_test/basic/address_16.asm
  75. 255
      bddisasm_test/basic/address_16.result
  76. BIN
      bddisasm_test/basic/address_32
  77. 32
      bddisasm_test/basic/address_32.asm
  78. 255
      bddisasm_test/basic/address_32.result
  79. BIN
      bddisasm_test/basic/address_64
  80. 81
      bddisasm_test/basic/address_64.asm
  81. 525
      bddisasm_test/basic/address_64.result
  82. 5
      bddisasm_test/basic/aes_64
  83. 57
      bddisasm_test/basic/aes_64.asm
  84. 696
      bddisasm_test/basic/aes_64.result
  85. BIN
      bddisasm_test/basic/basic1_64
  86. 562
      bddisasm_test/basic/basic1_64.asm
  87. 9088
      bddisasm_test/basic/basic1_64.result
  88. 7
      bddisasm_test/basic/basic2_64
  89. 171
      bddisasm_test/basic/basic2_64.asm
  90. 2604
      bddisasm_test/basic/basic2_64.result
  91. 4
      bddisasm_test/basic/bmi_64
  92. 57
      bddisasm_test/basic/bmi_64.asm
  93. 974
      bddisasm_test/basic/bmi_64.result
  94. BIN
      bddisasm_test/basic/branch_16
  95. 51
      bddisasm_test/basic/branch_16.asm
  96. 744
      bddisasm_test/basic/branch_16.result
  97. BIN
      bddisasm_test/basic/branch_32
  98. 54
      bddisasm_test/basic/branch_32.asm
  99. 784
      bddisasm_test/basic/branch_32.result
  100. BIN
      bddisasm_test/basic/branch_64
  101. Some files were not shown because too many files have changed in this diff Show More

65
.gitignore vendored

@ -0,0 +1,65 @@
syntax: glob
# Object files
*.o
*.obj
# Libraries
*.lib
*.a
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.sys
#VS/WDK project files
*.ilk
*.pdb
*.user
*.mac
*.res
*.log
build*_*_*.xml
*.suo
*.sdf
*.opensdf
*.tlog
*.ipch
vc*.idb
/bin/
/_intdir/
*.aps
*.vcxprojResolveAssemblyReference.cache
*.manifest
*.unsuccessfulbuild
UpgradeLog*.XML
_UpgradeReport_Files/*
*.sbr
#other files
*.pyc
.*.swp
*.pyd
pydis/pydis.egg-info/
pydis/build/
pydis/dist/
.vs/
disasmtool_lix/build
.dir-locals.el
.ccls-cache/
compile_commands.json
.gdb_history
pydis/.eggs
bdshemu_fuzz/out
bdshemu_fuzz/shfuzz
bdshemu_fuzz/out-32
bdshemu_fuzz/out-64
docs/build

21
.vsconfig

@ -0,0 +1,21 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.Component.MSBuild",
"Microsoft.VisualStudio.Component.TextTemplating",
"Microsoft.VisualStudio.Component.IntelliCode",
"Microsoft.VisualStudio.Component.VC.CoreIde",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
"Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.CMake",
"Microsoft.VisualStudio.Component.VC.CMake.Project",
"Microsoft.VisualStudio.Component.VC.ATL",
"Microsoft.VisualStudio.Workload.NativeDesktop",
"Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre"
]
}

22
Makefile

@ -0,0 +1,22 @@
.PHONY: all bddisasm bdshemu
all: bddisasm bdshemu
bddisasm:
@$(MAKE) --no-print-directory -C bddisasm
@$(MAKE) --no-print-directory RELEASE=y -C bddisasm
bdshemu:
@$(MAKE) --no-print-directory -C bdshemu
@$(MAKE) --no-print-directory RELEASE=y -C bdshemu
clean:
@$(MAKE) --no-print-directory -C bddisasm clean
@$(MAKE) --no-print-directory RELEASE=y -C bddisasm clean
@$(MAKE) --no-print-directory -C bdshemu clean
@$(MAKE) --no-print-directory RELEASE=y -C bdshemu clean
install:
@$(MAKE) --no-print-directory RELEASE=y -C bddisasm install
@$(MAKE) --no-print-directory RELEASE=y -C bdshemu install

50
README.md

@ -1,30 +1,30 @@
# The Bitdefender disassembler
The Bitdefender disassembler is a lightweight, x86/x64 only instruction decoder. It is easy to integrate, easy to work with, it has no external dependencies, it is thread-safe, it allocates no memory at all, it works in virtually any environment (we use it inside user, kernel, hypervisor, on both Windows and Linux environments), and it provides lots of info regarding the decoded instructions, such as: operands (both explicit and implicit), access mode for each operand, CPUID feature flag, flags access, etc.
The Bitdefender disassembler (bddisasm) is a lightweight, x86/x64 only instruction decoder. It is easy to integrate, easy to work with, it has no external dependencies, it is thread-safe, it allocates no memory at all, it works in virtually any environment (we use it inside user, kernel, hypervisor, on both Windows and Linux environments), and it provides lots of info regarding the decoded instructions, such as: operands (both explicit and implicit), access mode for each operand, CPUID feature flag, flags access, etc. More examples and info about the project can be found on the official documentation: [Bitdefender disassembler](http://bddisasm.readthedocs.io)
## Projects
1. disasm - this is the main disassembler project. In order to use the Bitdefender disassembler, all you have to do is build this project, and link with the output library. The only headers you need are located inside the inc folder.
1. bddisasm - this is the main disassembler project. In order to use the Bitdefender disassembler, all you have to do is build this project, and link with the output library. The only headers you need are located inside the `inc` folder.
2. shemu - this project makes use of the main disasm lib in order to build a simple, lightweight, fast, instructions emulator, designated to target shellcodes. This project is also integrated inside the disasmtool, so you can
emulate raw binary files, and see their output. Note that this simple emulator supports basic x86/x64 instructions, and does not support emulating any kind of API call.
2. bdshemu - this project makes use of the main bddisasm lib in order to build a simple, lightweight, fast, instructions emulator, designated to target shellcodes. This project is also integrated inside the disasmtool, so you can
emulate raw binary files, and see their output. Note that this simple emulator supports basic x86/x64 instructions, and does not support emulating any kind of API call. In addition, the only supported memory accesses are inside the shellcode itself, and on the emulated stack.
3. isagenerator - this project contains the instruction definitions and the scripts required to generate the disassembly tables. If you wish to add support for a new instruction, this is the place. This project will automatically generate several header files (instructions.h, mnemonics.h, constants.h, table_\*.h), so please make sure you don't manually edit any of these files.
3. isagenerator - this project contains the instruction definitions and the scripts required to generate the disassembly tables. If you wish to add support for a new instruction, this is the place. This project will automatically generate several header files (instructions.h, mnemonics.h, constants.h, table_\*.h), so please make sure you don't manually edit any of these files. You will need Python 3 to run the generation scripts.
4. disasmtool - this project is a command line disassembler tool, used mainly as an example of how to integrate the disasm lib.
4. disasmtool - this project is a command line disassembler tool, used mainly as an example of how to integrate the bddisasm and bdshemu libraries.
5. disasmtool_lix - like disasmtool, but for Linux.
6. pydis - this is the Python binding for the disasm project.
6. pydis - this is the Python binding for the bddisasm project. You will need Python 3 for this.
## Objectives
The main objectives of this disassembler are:
1. Lighetweight - it's written in C, with no external dependencies, no memory allocated, and thread safe by design.
2. Fast - less than 300 CPU clocks on a Intel Core i7-8650U per decoded instruction.
3. Resilient - tested against internal fuzzers and the famous [mishegos](https://github.com/trailofbits/mishegos) tool
4. Easy to work with - just include the main header file, disasm.h, link with the disasmlib library, and call the NdDecode API!
2. Fast - less than 300 CPU clocks on an Intel Core i7-8650U per decoded instruction (more than 7M instructions per second).
3. Resilient - tested against internal fuzzers and the famous [mishegos](https://github.com/trailofbits/mishegos) tool.
4. Easy to work with - just include the main header file, bddisasm.h, link with the bddisasm library, and call the NdDecode API!
5. Complete - support every x86 instruction to date, and provide as much information as possible.
## Build
@ -35,13 +35,14 @@ In order to build the projects on Windows you need:
* [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) with the Desktop development with C++ workload.
* [Windows SDK 10.0.18362.0](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/).
* [Python 3.7 or newer](https://www.python.org/downloads/release/python-373/)
When you first open the solution Visual Studio should prompt you to install any missing components.
This should be enough to build disasm, disasmtool and shemu for the Debug and Release configurations.
This should be enough to build bddisasm, disasmtool and bdshemu for the Debug and Release configurations.
For the DebugKernel and ReleaseKernel configurations, [WDK 1903](https://go.microsoft.com/fwlink/?linkid=2085767) is needed, alongside the Windows Driver Kit Visual Studio extension (the WDK installer should take care of this).
For isagenerator, python is needed.
For isagenerator, Python 3 is needed.
Building any of the projects is done directly from Visual Studio.
@ -60,16 +61,35 @@ For disasmtool_lix you also need:
* cmake 3.12 or newer
* [RapidJSON](https://github.com/Tencent/rapidjson/)
In order to build disasm and shemu run `make` in the root of the repository. The results will be placed in the bin directory.
In order to build bddisasm and bdshemu run `make` in the root of the repository. The results will be placed in the bin directory.
In order to build disasmtool_lix go to the disasmtool_lix directory and run `make`. The results will be in the bin directory in the disasmtool_lix/build directory.
## Example
Working with disasm is very easy. Decoding and printing the disassembly of an instruction is quick & simple:
Working with bddisasm is very easy. Decoding and printing the disassembly of an instruction is quick & simple:
```c
#include "disasm.h"
#include <stdio.h>
#include "bddisasm/disasmtypes.h"
#include "bddisasm/bddisasm.h"
int nd_vsnprintf_s(
char *buffer,
size_t sizeOfBuffer,
size_t count,
const char *format,
va_list argptr
)
{
return vsnprintf(buffer, sizeOfBuffer, format, argptr);
}
void* nd_memset(void *s, int c, size_t n)
{
return memset(s, c, n);
}
int main()
{

87
bddisasm.sln

@ -0,0 +1,87 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29519.87
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "disasmtool", "disasmtool\disasmtool.vcxproj", "{94F1B65D-3305-4CCB-9DF1-50B56900D867}"
ProjectSection(ProjectDependencies) = postProject
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA} = {3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bddisasm", "bddisasm\bddisasm.vcxproj", "{3653AA19-048B-410E-B5C4-FF78E1D84C12}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdshemu", "bdshemu\bdshemu.vcxproj", "{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}"
ProjectSection(ProjectDependencies) = postProject
{3653AA19-048B-410E-B5C4-FF78E1D84C12} = {3653AA19-048B-410E-B5C4-FF78E1D84C12}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isagenerator", "isagenerator\isagenerator.vcxproj", "{0E9D2957-34FA-40EE-B4B2-0D008D2FE317}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
DebugKernel|Win32 = DebugKernel|Win32
DebugKernel|x64 = DebugKernel|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
ReleaseKernel|Win32 = ReleaseKernel|Win32
ReleaseKernel|x64 = ReleaseKernel|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{94F1B65D-3305-4CCB-9DF1-50B56900D867}.Debug|Win32.ActiveCfg = Debug|Win32
{94F1B65D-3305-4CCB-9DF1-50B56900D867}.Debug|x64.ActiveCfg = Debug|x64
{94F1B65D-3305-4CCB-9DF1-50B56900D867}.DebugKernel|Win32.ActiveCfg = Debug|Win32
{94F1B65D-3305-4CCB-9DF1-50B56900D867}.DebugKernel|x64.ActiveCfg = Debug|x64
{94F1B65D-3305-4CCB-9DF1-50B56900D867}.Release|Win32.ActiveCfg = Release|Win32
{94F1B65D-3305-4CCB-9DF1-50B56900D867}.Release|x64.ActiveCfg = Release|x64
{94F1B65D-3305-4CCB-9DF1-50B56900D867}.ReleaseKernel|Win32.ActiveCfg = Release|Win32
{94F1B65D-3305-4CCB-9DF1-50B56900D867}.ReleaseKernel|x64.ActiveCfg = Release|x64
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.Debug|Win32.ActiveCfg = Debug|Win32
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.Debug|Win32.Build.0 = Debug|Win32
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.Debug|x64.ActiveCfg = Debug|x64
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.Debug|x64.Build.0 = Debug|x64
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.DebugKernel|Win32.ActiveCfg = DebugKernel|Win32
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.DebugKernel|Win32.Build.0 = DebugKernel|Win32
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.DebugKernel|x64.ActiveCfg = DebugKernel|x64
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.DebugKernel|x64.Build.0 = DebugKernel|x64
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.Release|Win32.ActiveCfg = Release|Win32
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.Release|Win32.Build.0 = Release|Win32
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.Release|x64.ActiveCfg = Release|x64
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.Release|x64.Build.0 = Release|x64
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.ReleaseKernel|Win32.ActiveCfg = ReleaseKernel|Win32
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.ReleaseKernel|Win32.Build.0 = ReleaseKernel|Win32
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.ReleaseKernel|x64.ActiveCfg = ReleaseKernel|x64
{3653AA19-048B-410E-B5C4-FF78E1D84C12}.ReleaseKernel|x64.Build.0 = ReleaseKernel|x64
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.Debug|Win32.ActiveCfg = Debug|Win32
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.Debug|Win32.Build.0 = Debug|Win32
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.Debug|x64.ActiveCfg = Debug|x64
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.Debug|x64.Build.0 = Debug|x64
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.DebugKernel|Win32.ActiveCfg = DebugKernel|Win32
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.DebugKernel|Win32.Build.0 = DebugKernel|Win32
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.DebugKernel|x64.ActiveCfg = DebugKernel|x64
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.DebugKernel|x64.Build.0 = DebugKernel|x64
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.Release|Win32.ActiveCfg = Release|Win32
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.Release|Win32.Build.0 = Release|Win32
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.Release|x64.ActiveCfg = Release|x64
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.Release|x64.Build.0 = Release|x64
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.ReleaseKernel|Win32.ActiveCfg = ReleaseKernel|Win32
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.ReleaseKernel|Win32.Build.0 = ReleaseKernel|Win32
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.ReleaseKernel|x64.ActiveCfg = ReleaseKernel|x64
{3C9B2CA7-CF4F-471B-BB72-6490C476CDCA}.ReleaseKernel|x64.Build.0 = ReleaseKernel|x64
{0E9D2957-34FA-40EE-B4B2-0D008D2FE317}.Debug|Win32.ActiveCfg = Debug|Win32
{0E9D2957-34FA-40EE-B4B2-0D008D2FE317}.Debug|x64.ActiveCfg = Debug|x64
{0E9D2957-34FA-40EE-B4B2-0D008D2FE317}.DebugKernel|Win32.ActiveCfg = Debug|Win32
{0E9D2957-34FA-40EE-B4B2-0D008D2FE317}.DebugKernel|x64.ActiveCfg = Debug|x64
{0E9D2957-34FA-40EE-B4B2-0D008D2FE317}.Release|Win32.ActiveCfg = Release|Win32
{0E9D2957-34FA-40EE-B4B2-0D008D2FE317}.Release|x64.ActiveCfg = Release|x64
{0E9D2957-34FA-40EE-B4B2-0D008D2FE317}.ReleaseKernel|Win32.ActiveCfg = Release|Win32
{0E9D2957-34FA-40EE-B4B2-0D008D2FE317}.ReleaseKernel|x64.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E950FA16-07C1-4613-8328-906BC10C7C02}
EndGlobalSection
EndGlobal

123
bddisasm/Makefile

@ -0,0 +1,123 @@
.PHONY: clean
SRC_FILES := crt.c bddisasm.c
OBJECTS := $(SRC_FILES:.c=.o)
INCLUDES := -Iinclude -I../inc
ifeq ($(PLATFORM),)
PLATFORM := x64
endif
ifeq ($(RELEASE),y)
CONFIGURATION := Release
else
CONFIGURATION := Debug
endif
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
DEFINES := -D_LIB -DAMD64
INT_DIR := ../_intdir/bddisasm/$(PLATFORM)/$(CONFIGURATION)
DEP_DIR := $(INT_DIR)/.d
OUT_DIR := ../bin/$(PLATFORM)/$(CONFIGURATION)
OBJECTS_PATH := $(addprefix $(INT_DIR)/, $(OBJECTS))
LIB_NAME := libbddisasm.a
WARNINGS_ENABLE := -Wall -Wextra -Wshadow -Wstrict-overflow \
-Wframe-larger-than=3072 -Wstack-usage=3072
WARNINGS_DISABLE := -Wno-missing-field-initializers \
-Wno-missing-braces \
-Wno-unused-function \
-Wno-unused-variable \
-Wno-unknown-pragmas \
-Wno-format \
-Wno-multichar
# Some warnings are compiler-specific, some version-specific
ifeq (,$(findstring clang,$(CC)))
CC_VERSION_MAJOR = $(shell $(CC) -dumpversion | cut -d '.' -f1)
CC_VERSION_GT_4 = $(shell [ $(CC_VERSION_MAJOR) -gt 4 ] && echo true)
CC_VERSION_GT_5 = $(shell [ $(CC_VERSION_MAJOR) -gt 5 ] && echo true)
ifeq (true,$(CC_VERSION_GT_4))
WARNINGS_DISABLE += -Wno-incompatible-pointer-types
endif
ifeq (true,$(CC_VERSION_GT_5))
WARNINGS_ENABLE += -Wshift-overflow=2 \
-Wnull-dereference \
-Wduplicated-cond
endif
else
WARNINGS_DISABLE += -Wno-typedef-redefinition \
-Wno-missing-braces \
-Wno-incompatible-pointer-types \
-Wno-missing-field-initializers
endif
DEPFLAGS = -MT $@ -MMD -MP -MF $(DEP_DIR)/$*.Td
CFLAGS = -pipe -c -std=c11 -fpic -fno-strict-aliasing \
-D_REENTRANT -fstack-protector -ffunction-sections -fdata-sections \
$(WARNINGS_ENABLE) $(WARNINGS_DISABLE) $(DEFINES) $(INCLUDES)
ifeq ($(RELEASE),y)
CFLAGS += -Ofast -g3 -DNDEBUG -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
else
CFLAGS += -O0 -g3 -D_DEBUG -DDEBUG
endif
all: $(LIB_NAME)
# Here it will link the objects created below in the final .a
$(LIB_NAME): $(OBJECTS_PATH)
@mkdir -p $(OUT_DIR)
@ar rcs $(OUT_DIR)/$(LIB_NAME) $(OBJECTS_PATH)
@echo Disasm library in $(OUT_DIR)/$(LIB_NAME)
# We need to mkdir inside the rule, so each subfolder gets created,
# and avoiding conflicts:
# ./linux/example.c => $(INT_DIR)/linux/example.o
# ./example.c => $(INT_DIR)/example.o
$(INT_DIR)/%.o: %.c $(DEP_DIR)/%.d
@mkdir -p $(dir $@)
@mkdir -p $(dir $(DEP_DIR)/$<) >/dev/null
@echo $<
@$(CC) $(DEPFLAGS) $(CFLAGS) -c $< -o $@
@mv -f $(DEP_DIR)/$*.Td $(DEP_DIR)/$*.d
# So 'make' won't fail if the dependecy file doesn't exist
$(DEP_DIR)/%.d: ;
# Don't delete the dependecy files
.PRECIOUS: $(DEP_DIR)/%.d
# Include all the dependecy files (this will trigger a rebuild if a header is changed)
-include $(patsubst %,$(DEP_DIR)/%.d,$(basename $(SRC_FILES)))
clean_lib_file:
@rm $(OUT_DIR)/$(LIB_NAME) 2>/dev/null ||:
clean_int_dir:
@rm -r $(INT_DIR) 2>/dev/null ||:
clean_dep_dir:
@rm -r $(DEP_DIR) 2>/dev/null ||:
clean: clean_lib_file clean_int_dir clean_dep_dir
install: all
install -d $(DESTDIR)$(PREFIX)/lib/
install -m 644 $(OUT_DIR)/$(LIB_NAME) $(DESTDIR)$(PREFIX)/lib/
install -d $(DESTDIR)$(PREFIX)/include/bddisasm
cp -r ../inc/* $(DESTDIR)$(PREFIX)/include/bddisasm/

5050
bddisasm/bddisasm.c

File diff suppressed because it is too large Load Diff

474
bddisasm/bddisasm.vcproj

@ -0,0 +1,474 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="bddisasm"
ProjectGUID="{3653AA19-048B-410E-B5C4-FF78E1D84C12}"
RootNamespace="bddisasmlib"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)_intdir\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="generate_tables.py instructions"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="include;..\inc"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;DEBUG;"
IgnoreStandardIncludePath="true"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)_intdir\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="generate_tables.py instructions"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D &quot;AMD64&quot;"
Optimization="0"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="include;..\inc"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;DEBUG;"
IgnoreStandardIncludePath="true"
StringPooling="true"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
AdditionalLibraryDirectories="&quot;x:\Projects-devel\dacia-hg\bin\$(PlatformName)\$(ConfigurationName)&quot;"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)_intdir\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="generate_tables.py instructions"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="include;..\inc"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
IgnoreStandardIncludePath="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)bin\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)_intdir\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="generate_tables.py instructions"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D &quot;AMD64&quot;"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="include;..\inc"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
IgnoreStandardIncludePath="true"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="false"
AdditionalLibraryDirectories=""
IgnoreAllDefaultLibraries="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\crt.c"
>
</File>
<File
RelativePath=".\bddisasm.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\include\crt.h"
>
</File>
<File
RelativePath=".\include\instructions.h"
>
</File>
<File
RelativePath=".\include\mnemonics.h"
>
</File>
<File
RelativePath=".\include\prefixes.h"
>
</File>
<File
RelativePath=".\include\sal.h"
>
</File>
<File
RelativePath=".\include\table_evex.h"
>
</File>
<File
RelativePath=".\include\table_root.h"
>
</File>
<File
RelativePath=".\include\table_vex.h"
>
</File>
<File
RelativePath=".\include\table_xop.h"
>
</File>
<File
RelativePath=".\include\tabledefs.h"
>
</File>
<Filter
Name="public"
>
<File
RelativePath="..\inc\constants.h"
>
</File>
<File
RelativePath="..\inc\bddisasm.h"
>
</File>
<File
RelativePath="..\inc\disasmstatus.h"
>
</File>
<File
RelativePath="..\inc\disasmtypes.h"
>
</File>
<File
RelativePath="..\inc\registers.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<Filter
Name="Instructions"
>
<File
RelativePath=".\instructions\table_0F.dat"
>
</File>
<File
RelativePath=".\instructions\table_0F_38.dat"
>
</File>
<File
RelativePath=".\instructions\table_0F_3A.dat"
>
</File>
<File
RelativePath=".\instructions\table_3dnow.dat"
>
</File>
<File
RelativePath=".\instructions\table_base.dat"
>
</File>
<File
RelativePath=".\instructions\table_evex1.dat"
>
</File>
<File
RelativePath=".\instructions\table_evex2.dat"
>
</File>
<File
RelativePath=".\instructions\table_evex3.dat"
>
</File>
<File
RelativePath=".\instructions\table_fpu.dat"
>
</File>
<File
RelativePath=".\instructions\table_vex1.dat"
>
</File>
<File
RelativePath=".\instructions\table_vex2.dat"
>
</File>
<File
RelativePath=".\instructions\table_vex3.dat"
>
</File>
<File
RelativePath=".\instructions\table_xop.dat"
>
</File>
</Filter>
<Filter
Name="Scripts"
>
<File
RelativePath=".\generate_tables.py"
>
</File>
</Filter>
<Filter
Name="Other"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

458
bddisasm/bddisasm.vcxproj

@ -0,0 +1,458 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugKernel|Win32">
<Configuration>DebugKernel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugKernel|x64">
<Configuration>DebugKernel</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseKernel|Win32">
<Configuration>ReleaseKernel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseKernel|x64">
<Configuration>ReleaseKernel</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{3653AA19-048B-410E-B5C4-FF78E1D84C12}</ProjectGuid>
<RootNamespace>bddisasm</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
<ProjectName>bddisasm</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<TargetVersion>Windows7</TargetVersion>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<SupportsPackaging>false</SupportsPackaging>
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<TargetVersion>Windows7</TargetVersion>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<SupportsPackaging>false</SupportsPackaging>
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<TargetVersion>Windows7</TargetVersion>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<SupportsPackaging>false</SupportsPackaging>
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<TargetVersion>Windows7</TargetVersion>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<SupportsPackaging>false</SupportsPackaging>
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>14.0.23107.0</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|Win32'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|Win32'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_intdir\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<ClCompile>
<Optimization>Disabled</Optimization>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Lib>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|Win32'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<ClCompile>
<Optimization>Disabled</Optimization>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles />
<AdditionalOptions>/kernel /D %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalOptions>/D "AMD64" %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<AdditionalLibraryDirectories>x:\Projects-devel\dacia-hg\bin\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalOptions>/kernel /D "AMD64" %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles />
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<AdditionalLibraryDirectories>x:\Projects-devel\dacia-hg\bin\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Native</SubSystem>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
<Lib>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|Win32'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles />
<AdditionalOptions>/kernel /D %(AdditionalOptions)</AdditionalOptions>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
<Lib>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalOptions>/D "AMD64" %(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalOptions>/kernel /D "AMD64" %(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>include;..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ProgramDataBaseFileName>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles />
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<SubSystem>Native</SubSystem>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="crt.c" />
<ClCompile Include="bddisasm.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='DebugKernel|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='DebugKernel|x64'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='ReleaseKernel|x64'">
</ForcedIncludeFiles>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\inc\constants.h" />
<ClInclude Include="..\inc\cpuidflags.h" />
<ClInclude Include="..\inc\bddisasm.h" />
<ClInclude Include="..\inc\disasmstatus.h" />
<ClInclude Include="..\inc\disasmtypes.h" />
<ClInclude Include="..\inc\registers.h" />
<ClInclude Include="..\inc\version.h" />
<ClInclude Include="include\instructions.h" />
<ClInclude Include="include\mnemonics.h" />
<ClInclude Include="include\nd_crt.h" />
<ClInclude Include="include\prefixes.h" />
<ClInclude Include="include\tabledefs.h" />
<ClInclude Include="include\table_evex.h" />
<ClInclude Include="include\table_root.h" />
<ClInclude Include="include\table_vex.h" />
<ClInclude Include="include\table_xop.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

81
bddisasm/bddisasm.vcxproj.filters

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Header Files\public">
<UniqueIdentifier>{8f31fedd-353c-4b9c-9e2d-bdb129e1e02b}</UniqueIdentifier>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
<Filter Include="Other">
<UniqueIdentifier>{5e26c505-e8f5-4e6c-9d54-f20e36b637b8}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="crt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bddisasm.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\instructions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\mnemonics.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\prefixes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\table_evex.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\table_root.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\table_vex.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\table_xop.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\tabledefs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\constants.h">
<Filter>Header Files\public</Filter>
</ClInclude>
<ClInclude Include="..\inc\bddisasm.h">
<Filter>Header Files\public</Filter>
</ClInclude>
<ClInclude Include="..\inc\disasmstatus.h">
<Filter>Header Files\public</Filter>
</ClInclude>
<ClInclude Include="..\inc\disasmtypes.h">
<Filter>Header Files\public</Filter>
</ClInclude>
<ClInclude Include="..\inc\registers.h">
<Filter>Header Files\public</Filter>
</ClInclude>
<ClInclude Include="..\inc\version.h">
<Filter>Header Files\public</Filter>
</ClInclude>
<ClInclude Include="..\inc\cpuidflags.h">
<Filter>Header Files\public</Filter>
</ClInclude>
<ClInclude Include="include\nd_crt.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

44
bddisasm/crt.c

@ -0,0 +1,44 @@
/*
* Copyright (c) 2020 Bitdefender
* SPDX-License-Identifier: Apache-2.0
*/
#include "include/nd_crt.h"
//
// nd_strcat_s
//
char *
nd_strcat_s(
char *dst,
size_t dst_size,
const char *src
)
{
char *p;
size_t available;
p = dst;
available = dst_size;
while (available > 0 && *p != 0)
{
p++;
available--;
}
if (available == 0)
{
nd_memzero(dst, dst_size);
return NULL;
}
while ((*p++ = *src++) != 0 && --available > 0);
if (available == 0)
{
nd_memzero(dst, dst_size);
return NULL;
}
return dst;
}

35360
bddisasm/include/instructions.h

File diff suppressed because it is too large Load Diff

282
bddisasm/include/mnemonics.h

@ -0,0 +1,282 @@
#ifndef _MNEMONICS_H_
#define _MNEMONICS_H_
const char *gMnemonics[1561] =
{
"AAA", "AAD", "AAM", "AAS", "ADC", "ADCX", "ADD", "ADDPD", "ADDPS",
"ADDSD", "ADDSS", "ADDSUBPD", "ADDSUBPS", "ADOX", "AESDEC", "AESDECLAST",
"AESENC", "AESENCLAST", "AESIMC", "AESKEYGENASSIST", "ALTINST",
"AND", "ANDN", "ANDNPD", "ANDNPS", "ANDPD", "ANDPS", "ARPL",
"BEXTR", "BLCFILL",