koffi 2.3.7 → 2.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE.txt +22 -165
  3. package/README.md +2 -2
  4. package/doc/index.rst +2 -2
  5. package/doc/static/custom.css +18 -10
  6. package/package.json +3 -3
  7. package/src/cnoke/LICENSE.txt +22 -165
  8. package/src/cnoke/assets/FindCNoke.cmake +18 -10
  9. package/src/cnoke/assets/win_delay_hook.c +18 -10
  10. package/src/cnoke/cnoke.js +18 -10
  11. package/src/cnoke/package.json +1 -1
  12. package/src/cnoke/src/builder.js +18 -10
  13. package/src/cnoke/src/index.js +18 -10
  14. package/src/cnoke/src/tools.js +18 -10
  15. package/src/core/libcc/libcc.cc +20 -12
  16. package/src/core/libcc/libcc.hh +20 -12
  17. package/src/koffi/CMakeLists.txt +27 -19
  18. package/src/koffi/build/2.3.9/koffi_darwin_arm64/koffi.node +0 -0
  19. package/src/koffi/build/2.3.9/koffi_darwin_x64/koffi.node +0 -0
  20. package/src/koffi/build/2.3.9/koffi_freebsd_arm64/koffi.node +0 -0
  21. package/src/koffi/build/2.3.9/koffi_freebsd_ia32/koffi.node +0 -0
  22. package/src/koffi/build/2.3.9/koffi_freebsd_x64/koffi.node +0 -0
  23. package/src/koffi/build/2.3.9/koffi_linux_arm32hf/koffi.node +0 -0
  24. package/src/koffi/build/2.3.9/koffi_linux_arm64/koffi.node +0 -0
  25. package/src/koffi/build/2.3.9/koffi_linux_ia32/koffi.node +0 -0
  26. package/src/koffi/build/2.3.9/koffi_linux_riscv64hf64/koffi.node +0 -0
  27. package/src/koffi/build/2.3.9/koffi_linux_x64/koffi.node +0 -0
  28. package/src/koffi/build/2.3.9/koffi_openbsd_ia32/koffi.node +0 -0
  29. package/src/koffi/build/2.3.9/koffi_openbsd_x64/koffi.node +0 -0
  30. package/src/koffi/build/2.3.9/koffi_win32_arm64/koffi.node +0 -0
  31. package/src/koffi/build/2.3.9/koffi_win32_ia32/koffi.node +0 -0
  32. package/src/koffi/build/2.3.9/koffi_win32_x64/koffi.node +0 -0
  33. package/src/koffi/src/abi_arm32.cc +19 -11
  34. package/src/koffi/src/abi_arm32_asm.S +211 -0
  35. package/src/koffi/src/abi_arm64.cc +27 -13
  36. package/src/koffi/src/abi_arm64_asm.S +238 -0
  37. package/src/koffi/src/abi_arm64_asm.asm +207 -0
  38. package/src/koffi/src/abi_riscv64.cc +19 -11
  39. package/src/koffi/src/abi_riscv64_asm.S +239 -0
  40. package/src/koffi/src/abi_x64_sysv.cc +19 -11
  41. package/src/koffi/src/abi_x64_sysv_asm.S +272 -0
  42. package/src/koffi/src/abi_x64_win.cc +27 -13
  43. package/src/koffi/src/abi_x64_win_asm.asm +203 -0
  44. package/src/koffi/src/abi_x86.cc +27 -13
  45. package/src/koffi/src/abi_x86_asm.S +213 -0
  46. package/src/koffi/src/abi_x86_asm.asm +191 -0
  47. package/src/koffi/src/call.cc +18 -10
  48. package/src/koffi/src/call.hh +18 -10
  49. package/src/koffi/src/ffi.cc +23 -34
  50. package/src/koffi/src/ffi.hh +18 -10
  51. package/src/koffi/src/index.d.ts +25 -17
  52. package/src/koffi/src/index.js +18 -10
  53. package/src/koffi/src/parser.cc +18 -10
  54. package/src/koffi/src/parser.hh +18 -10
  55. package/src/koffi/src/{abi_arm64_fwd.asm → trampolines/armasm.inc} +18 -193
  56. package/src/koffi/src/{abi_arm64_fwd.S → trampolines/gnu.inc} +18 -226
  57. package/src/koffi/src/{abi_x86_fwd.asm → trampolines/masm32.inc} +1042 -1203
  58. package/src/koffi/src/{abi_x64_win_fwd.asm → trampolines/masm64.inc} +1042 -1215
  59. package/src/koffi/src/{abi_trampolines.inc → trampolines/prototypes.inc} +18 -10
  60. package/src/koffi/src/util.cc +18 -10
  61. package/src/koffi/src/util.hh +18 -10
  62. package/src/koffi/src/win32.hh +28 -14
  63. package/src/koffi/build/2.3.7/koffi_darwin_arm64/koffi.node +0 -0
  64. package/src/koffi/build/2.3.7/koffi_darwin_x64/koffi.node +0 -0
  65. package/src/koffi/build/2.3.7/koffi_freebsd_arm64/koffi.node +0 -0
  66. package/src/koffi/build/2.3.7/koffi_freebsd_ia32/koffi.node +0 -0
  67. package/src/koffi/build/2.3.7/koffi_freebsd_x64/koffi.node +0 -0
  68. package/src/koffi/build/2.3.7/koffi_linux_arm32hf/koffi.node +0 -0
  69. package/src/koffi/build/2.3.7/koffi_linux_arm64/koffi.node +0 -0
  70. package/src/koffi/build/2.3.7/koffi_linux_ia32/koffi.node +0 -0
  71. package/src/koffi/build/2.3.7/koffi_linux_riscv64hf64/koffi.node +0 -0
  72. package/src/koffi/build/2.3.7/koffi_linux_x64/koffi.node +0 -0
  73. package/src/koffi/build/2.3.7/koffi_openbsd_ia32/koffi.node +0 -0
  74. package/src/koffi/build/2.3.7/koffi_openbsd_x64/koffi.node +0 -0
  75. package/src/koffi/build/2.3.7/koffi_win32_arm64/koffi.node +0 -0
  76. package/src/koffi/build/2.3.7/koffi_win32_ia32/koffi.node +0 -0
  77. package/src/koffi/build/2.3.7/koffi_win32_x64/koffi.node +0 -0
  78. package/src/koffi/src/abi_arm32_fwd.S +0 -6344
  79. package/src/koffi/src/abi_riscv64_fwd.S +0 -6375
  80. package/src/koffi/src/abi_x64_sysv_fwd.S +0 -6410
  81. package/src/koffi/src/abi_x86_fwd.S +0 -6346
  82. /package/src/koffi/build/{2.3.7 → 2.3.9}/koffi_win32_arm64/koffi.exp +0 -0
  83. /package/src/koffi/build/{2.3.7 → 2.3.9}/koffi_win32_arm64/koffi.lib +0 -0
  84. /package/src/koffi/build/{2.3.7 → 2.3.9}/koffi_win32_ia32/koffi.exp +0 -0
  85. /package/src/koffi/build/{2.3.7 → 2.3.9}/koffi_win32_ia32/koffi.lib +0 -0
  86. /package/src/koffi/build/{2.3.7 → 2.3.9}/koffi_win32_x64/koffi.exp +0 -0
  87. /package/src/koffi/build/{2.3.7 → 2.3.9}/koffi_win32_x64/koffi.lib +0 -0
@@ -1,15 +1,23 @@
1
- // This program is free software: you can redistribute it and/or modify
2
- // it under the terms of the GNU Lesser General Public License as published by
3
- // the Free Software Foundation, either version 3 of the License, or
4
- // (at your option) any later version.
1
+ // Copyright 2023 Niels Martignène <niels.martignene@protonmail.com>
5
2
  //
6
- // This program is distributed in the hope that it will be useful,
7
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
8
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
- // GNU Lesser General Public License for more details.
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ // this software and associated documentation files (the “Software”), to deal in
5
+ // the Software without restriction, including without limitation the rights to use,
6
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ // Software, and to permit persons to whom the Software is furnished to do so,
8
+ // subject to the following conditions:
10
9
  //
11
- // You should have received a copy of the GNU Lesser General Public License
12
- // along with this program. If not, see https://www.gnu.org/licenses/.
10
+ // The above copyright notice and this permission notice shall be included in all
11
+ // copies or substantial portions of the Software.
12
+ //
13
+ // THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
14
+ // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ // OTHER DEALINGS IN THE SOFTWARE.
13
21
 
14
22
  extern "C" int Trampoline0; extern "C" int TrampolineX0;
15
23
  extern "C" int Trampoline1; extern "C" int TrampolineX1;
@@ -1,15 +1,23 @@
1
- // This program is free software: you can redistribute it and/or modify
2
- // it under the terms of the GNU Lesser General Public License as published by
3
- // the Free Software Foundation, either version 3 of the License, or
4
- // (at your option) any later version.
1
+ // Copyright 2023 Niels Martignène <niels.martignene@protonmail.com>
5
2
  //
6
- // This program is distributed in the hope that it will be useful,
7
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
8
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
- // GNU Lesser General Public License for more details.
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ // this software and associated documentation files (the “Software”), to deal in
5
+ // the Software without restriction, including without limitation the rights to use,
6
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ // Software, and to permit persons to whom the Software is furnished to do so,
8
+ // subject to the following conditions:
10
9
  //
11
- // You should have received a copy of the GNU Lesser General Public License
12
- // along with this program. If not, see https://www.gnu.org/licenses/.
10
+ // The above copyright notice and this permission notice shall be included in all
11
+ // copies or substantial portions of the Software.
12
+ //
13
+ // THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
14
+ // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ // OTHER DEALINGS IN THE SOFTWARE.
13
21
 
14
22
  #include "src/core/libcc/libcc.hh"
15
23
  #include "call.hh"
@@ -1,15 +1,23 @@
1
- // This program is free software: you can redistribute it and/or modify
2
- // it under the terms of the GNU Lesser General Public License as published by
3
- // the Free Software Foundation, either version 3 of the License, or
4
- // (at your option) any later version.
1
+ // Copyright 2023 Niels Martignène <niels.martignene@protonmail.com>
5
2
  //
6
- // This program is distributed in the hope that it will be useful,
7
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
8
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
- // GNU Lesser General Public License for more details.
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ // this software and associated documentation files (the “Software”), to deal in
5
+ // the Software without restriction, including without limitation the rights to use,
6
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ // Software, and to permit persons to whom the Software is furnished to do so,
8
+ // subject to the following conditions:
10
9
  //
11
- // You should have received a copy of the GNU Lesser General Public License
12
- // along with this program. If not, see https://www.gnu.org/licenses/.
10
+ // The above copyright notice and this permission notice shall be included in all
11
+ // copies or substantial portions of the Software.
12
+ //
13
+ // THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
14
+ // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ // OTHER DEALINGS IN THE SOFTWARE.
13
21
 
14
22
  #pragma once
15
23
 
@@ -1,15 +1,23 @@
1
- // This program is free software: you can redistribute it and/or modify
2
- // it under the terms of the GNU Lesser General Public License as published by
3
- // the Free Software Foundation, either version 3 of the License, or
4
- // (at your option) any later version.
1
+ // Copyright 2023 Niels Martignène <niels.martignene@protonmail.com>
5
2
  //
6
- // This program is distributed in the hope that it will be useful,
7
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
8
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
- // GNU Lesser General Public License for more details.
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ // this software and associated documentation files (the “Software”), to deal in
5
+ // the Software without restriction, including without limitation the rights to use,
6
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ // Software, and to permit persons to whom the Software is furnished to do so,
8
+ // subject to the following conditions:
10
9
  //
11
- // You should have received a copy of the GNU Lesser General Public License
12
- // along with this program. If not, see https://www.gnu.org/licenses/.
10
+ // The above copyright notice and this permission notice shall be included in all
11
+ // copies or substantial portions of the Software.
12
+ //
13
+ // THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
14
+ // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ // OTHER DEALINGS IN THE SOFTWARE.
13
21
 
14
22
  #pragma once
15
23
 
@@ -22,24 +30,30 @@ namespace RG {
22
30
  #if _WIN64
23
31
 
24
32
  struct TEB {
25
- char _pad1[8];
33
+ void *ExceptionList;
26
34
  void *StackBase;
27
35
  void *StackLimit;
28
- char _pad2[5216];
36
+ char _pad1[5216];
29
37
  void *DeallocationStack;
38
+ char _pad2[712];
39
+ uint32_t GuaranteedStackBytes;
30
40
  };
31
41
  RG_STATIC_ASSERT(RG_OFFSET_OF(TEB, DeallocationStack) == 0x1478);
42
+ RG_STATIC_ASSERT(RG_OFFSET_OF(TEB, GuaranteedStackBytes) == 0x1748);
32
43
 
33
44
  #else
34
45
 
35
46
  struct TEB {
36
- char _pad1[4];
47
+ void *ExceptionList;
37
48
  void *StackBase;
38
49
  void *StackLimit;
39
- char _pad2[3584];
50
+ char _pad1[3584];
40
51
  void *DeallocationStack;
52
+ char _pad2[360];
53
+ uint32_t GuaranteedStackBytes;
41
54
  };
42
55
  RG_STATIC_ASSERT(RG_OFFSET_OF(TEB, DeallocationStack) == 0xE0C);
56
+ RG_STATIC_ASSERT(RG_OFFSET_OF(TEB, GuaranteedStackBytes) == 0x0F78);
43
57
 
44
58
  #endif
45
59