Repository navigation
Expand file tree
/
Copy pathprotected-operations.json
More file actions
1027 lines (1027 loc) · 38.4 KB
/
Copy pathprotected-operations.json
File metadata and controls
1027 lines (1027 loc) · 38.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"schemaVersion": 1,
"catalogId": "cheatengine-sdk-lua-protected-operations",
"host": {
"product": "Cheat Engine",
"version": "7.7.0.10621",
"architecture": "x64",
"lua": {
"majorMinor": "5.3",
"fixtureSha256": "C95DCDFA0F60F97B43D970D77FD1BB907AF4DE04B500A3C89A99600B20B35BD2"
},
"evidence": [
{
"component": "Lua fixture",
"symbol": "lua53-64.dll",
"status": "ExactInstalledFile",
"source": "https://www.lua.org/manual/5.3/manual.html",
"verifiedOn": "2026-09-20",
"verification": "The SDK fixture hash matches the CE 7.7 installed Lua DLL; its hash is recorded above.",
"note": "The fixture identity does not, by itself, prove every CE host behavior."
}
]
},
"bridgeContract": {
"abiMajor": 1,
"minimumAbiMinor": 1,
"operationBitmapWidth": 64,
"operationBitmap": "0x0000000000000FFF"
},
"classificationPreconditions": [
"The Lua state, stack indices, argument types, and target tables satisfy the documented Lua 5.3 C API preconditions.",
"The managed caller holds the SDK lifetime/serialization lease for the current attach epoch and Lua state generation.",
"A raw operation marked never is not permission to bypass stack admission, ownership, or the protected boundary of a surrounding operation."
],
"operations": [
{
"id": "PushBytes",
"nativeEnum": "OP_PUSH_BYTES",
"managed": {
"constant": "PushBytesOperation",
"wrapper": "PushBytes"
},
"opcode": 0,
"capability": "push-bytes",
"protected": true,
"requiresNativeProtection": true,
"raises": "memory",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 0,
"inputDescription": "The bytes are borrowed from the managed call for its duration.",
"success": {
"resultCount": 1,
"delta": "+1",
"note": "The copied Lua string is returned by the protected call."
},
"failure": {
"resultCount": 1,
"delta": "+1",
"note": "lua_pcallk leaves its error object."
}
},
"ownership": {
"input": "Managed bytes are borrowed only while the call is active.",
"result": "Lua owns the copied string and its garbage collector determines its lifetime."
},
"hostOperation": "lua_pushlstring",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_pushlstring",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_pushlstring",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+1,m]; m means a memory error may be raised."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK PushBytes protected failure recovered"
}
]
},
{
"id": "CreateTable",
"nativeEnum": "OP_CREATE_TABLE",
"managed": {
"constant": "CreateTableOperation",
"wrapper": "CreateTable"
},
"opcode": 1,
"capability": "create-table",
"protected": true,
"requiresNativeProtection": true,
"raises": "memory",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 0,
"inputDescription": "Array and record capacities travel as integer bridge parameters, not Lua stack values.",
"success": {
"resultCount": 1,
"delta": "+1"
},
"failure": {
"resultCount": 1,
"delta": "+1",
"note": "lua_pcallk leaves its error object."
}
},
"ownership": {
"input": "No managed or Lua input has ownership transferred.",
"result": "Lua owns the new table."
},
"hostOperation": "lua_createtable",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_createtable",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_createtable",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+1,m]."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK CreateTable protected failure recovered"
}
]
},
{
"id": "NewUserdata",
"nativeEnum": "OP_NEW_USERDATA",
"managed": {
"constant": "NewUserdataOperation",
"wrapper": "NewUserdata"
},
"opcode": 2,
"capability": "new-userdata",
"protected": true,
"requiresNativeProtection": true,
"raises": "memory",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 0,
"inputDescription": "The requested byte size travels as a bridge parameter.",
"success": {
"resultCount": 1,
"delta": "+1"
},
"failure": {
"resultCount": 1,
"delta": "+1",
"note": "lua_pcallk leaves its error object."
}
},
"ownership": {
"input": "No input ownership is transferred.",
"result": "Lua owns the full-userdata allocation; later metatable and __gc behavior is separate from this allocation."
},
"hostOperation": "lua_newuserdata",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_newuserdata",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_newuserdata",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+1,m]."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK NewUserdata protected failure recovered"
}
]
},
{
"id": "PushClosure",
"nativeEnum": "OP_PUSH_CLOSURE",
"managed": {
"constant": "PushClosureOperation",
"wrapper": "PushClosure"
},
"opcode": 3,
"capability": "push-closure",
"protected": true,
"requiresNativeProtection": true,
"raises": "memory",
"conditionalFastPath": "A separately designed direct fast path may call lua_pushcclosure only when upvalueCount == 0 and lua_checkstack(state, 1) succeeded immediately before on the same call path. The current generic operation accepts arbitrary upvalues and remains protected.",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": "upvalueCount",
"inputDescription": "The top upvalueCount values become closure upvalues; the C-function address is borrowed.",
"success": {
"resultCount": 1,
"delta": "1 - upvalueCount"
},
"failure": {
"resultCount": 1,
"delta": "1 - upvalueCount",
"note": "lua_pcallk leaves its error object."
}
},
"ownership": {
"input": "Lua consumes the upvalue stack values; the managed layer must root the native callback target for as long as Lua can invoke it.",
"result": "Lua owns the closure and its upvalue references."
},
"hostOperation": "lua_pushcclosure",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_pushcclosure",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_pushcclosure",
"verifiedOn": "2026-09-20",
"verification": "The general manual annotation is [-n,+1,m]; the Lua 5.3.6 source has a distinct n == 0 light-C-function fast path."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK TryPushGeneratedFunction PushClosure status, stack, and ownership recovered"
},
{
"kind": "FailureProbeMarker",
"marker": "MARK PushClosure protected failure recovered"
}
]
},
{
"id": "RawSet",
"nativeEnum": "OP_RAWSET",
"managed": {
"constant": "RawSetOperation",
"wrapper": "RawSet"
},
"opcode": 4,
"capability": "raw-set",
"protected": true,
"requiresNativeProtection": true,
"raises": "memory",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 3,
"inputDescription": "Argument one is a copied target table, followed by key and value.",
"success": {
"resultCount": 0,
"delta": "-3"
},
"failure": {
"resultCount": 1,
"delta": "-2",
"note": "lua_pcallk consumes the arguments and leaves its error object."
}
},
"ownership": {
"input": "The table receives a Lua reference to the key/value as specified by Lua.",
"result": "No result is returned."
},
"hostOperation": "lua_rawset",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_rawset",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_rawset",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-2,+0,m]; raw access disables metamethods but not allocation failure."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK RawSet protected failure recovered"
}
]
},
{
"id": "RawSetIndex",
"nativeEnum": "OP_RAWSETI",
"managed": {
"constant": "RawSetIndexOperation",
"wrapper": "RawSetI"
},
"opcode": 5,
"capability": "raw-set-index",
"protected": true,
"requiresNativeProtection": true,
"raises": "memory",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 2,
"inputDescription": "Argument one is a copied target table and argument two is the value; the integer key is a bridge parameter.",
"success": {
"resultCount": 0,
"delta": "-2"
},
"failure": {
"resultCount": 1,
"delta": "-1",
"note": "lua_pcallk consumes the arguments and leaves its error object."
}
},
"ownership": {
"input": "The table receives a Lua reference to the value.",
"result": "No result is returned."
},
"hostOperation": "lua_rawseti",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_rawseti",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_rawseti",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-1,+0,m]."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK RawSetIndex protected failure recovered"
}
]
},
{
"id": "RawSetPointer",
"nativeEnum": "OP_RAWSETP",
"managed": {
"constant": "RawSetPointerOperation",
"wrapper": "RawSetP"
},
"opcode": 6,
"capability": "raw-set-pointer",
"protected": true,
"requiresNativeProtection": true,
"raises": "memory",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 2,
"inputDescription": "Argument one is a copied target table and argument two is the value; the pointer key is borrowed as a bridge parameter.",
"success": {
"resultCount": 0,
"delta": "-2"
},
"failure": {
"resultCount": 1,
"delta": "-1",
"note": "lua_pcallk consumes the arguments and leaves its error object."
}
},
"ownership": {
"input": "The pointer key is borrowed and the table receives a Lua reference to the value.",
"result": "No result is returned."
},
"hostOperation": "lua_rawsetp",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_rawsetp",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_rawsetp",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-1,+0,m]."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK RawSetPointer protected failure recovered"
}
]
},
{
"id": "CreateReference",
"nativeEnum": "OP_REF",
"managed": {
"constant": "CreateReferenceOperation",
"wrapper": "TryCreatePrivateRef"
},
"opcode": 7,
"capability": "create-private-reference",
"protected": true,
"requiresNativeProtection": true,
"raises": "memory",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 1,
"inputDescription": "The value becomes a reference in the SDK-private registry table identified by a borrowed stable key.",
"success": {
"resultCount": 1,
"delta": "0",
"note": "The returned Lua integer is the reference slot."
},
"failure": {
"resultCount": 1,
"delta": "0",
"note": "lua_pcallk consumes the value and leaves its error object."
}
},
"ownership": {
"input": "The registry table acquires the Lua reference to the input value.",
"result": "The returned reference id is a value; the registry owns the strong Lua reference until Unref."
},
"hostOperation": "lua_rawgetp + lua_createtable + lua_rawset + luaL_ref",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "luaL_ref",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#luaL_ref",
"verifiedOn": "2026-09-20",
"verification": "luaL_ref is annotated [-1,+0,m]; the lazy private-table path also calls lua_createtable and lua_rawset, both m."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK CreateReference protected failure recovered"
}
]
},
{
"id": "PushReference",
"nativeEnum": "OP_PUSH_REF",
"managed": {
"constant": "PushReferenceOperation",
"wrapper": "PushPrivateRef"
},
"opcode": 8,
"capability": "push-private-reference",
"protected": true,
"requiresNativeProtection": true,
"raises": "any",
"successPathRaises": "never",
"availability": {
"state": "supported-unused",
"consumerCount": 0,
"candidateRetirement": true,
"note": "LuaReferences.Push already uses the proven direct rawgetp/rawgeti fast path and normalizes a missing table in managed code. Retire this ABI bit only in a deliberate contract-major/minor plan."
},
"conditionalFastPath": "A separately designed PushExistingPrivateRef fast path can be direct only after it proves the private table exists and reports a missing table in managed code. The current operation intentionally creates an error string and calls lua_error when the table is absent.",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 0,
"inputDescription": "Stable key and reference id are bridge parameters; neither transfers ownership.",
"success": {
"resultCount": 1,
"delta": "+1",
"note": "The referenced value is pushed; the intermediate table is not returned."
},
"failure": {
"resultCount": 1,
"delta": "+1",
"note": "The absent-table path calls lua_pushlstring and lua_error; lua_pcallk leaves its error object."
}
},
"ownership": {
"input": "Stable key and reference id are borrowed values.",
"result": "The pushed value is a borrowed stack reference; the registry retains ownership."
},
"hostOperation": "lua_rawgetp + lua_type + lua_rawgeti; absent table calls lua_pushlstring + lua_error",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_rawgetp, lua_rawgeti, lua_error",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_error",
"verifiedOn": "2026-09-20",
"verification": "The normal raw-get path has no error annotation; the current absent-table branch intentionally raises through lua_error after allocating its message."
}
],
"failureEvidence": [
{
"kind": "ManagedTest",
"project": "tests/CheatEngine.SDK.Lua.Interop.Tests/CheatEngine.SDK.Lua.Interop.Tests.csproj",
"file": "tests/CheatEngine.SDK.Lua.Interop.Tests/Protected/LuaProtectedApiTests.cs",
"test": "LuaProtectedApiTests.Push_private_reference_without_its_table_returns_an_error_and_preserves_the_caller_stack"
}
]
},
{
"id": "ReleaseReference",
"nativeEnum": "OP_UNREF",
"managed": {
"constant": "ReleaseReferenceOperation",
"wrapper": "UnrefPrivate"
},
"opcode": 9,
"capability": "release-private-reference",
"protected": true,
"requiresNativeProtection": true,
"raises": "any",
"successPathRaises": "memory",
"availability": {
"state": "active",
"consumerCount": 1,
"candidateRetirement": false,
"note": "LuaReferences.Release calls UnrefPrivate for current SDK-private registry slots."
},
"provenanceConflict": "The Lua manual annotates luaL_unref [-0,+0,-], while Lua 5.3.6 lauxlib.c calls lua_rawseti twice and the manual annotates lua_rawseti as m. The successful path is therefore conservatively classified memory until a pinned fixture proves allocator-failure behavior.",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 0,
"inputDescription": "Stable key and reference id are bridge parameters; neither transfers ownership.",
"success": {
"resultCount": 0,
"delta": "0"
},
"failure": {
"resultCount": 1,
"delta": "+1",
"note": "The absent-table path calls lua_pushlstring and lua_error; lua_pcallk leaves its error object."
}
},
"ownership": {
"input": "Stable key and reference id are borrowed values.",
"result": "The SDK-private registry releases its strong Lua reference; Lua may reuse the released slot."
},
"hostOperation": "lua_rawgetp + lua_type + luaL_unref; absent table calls lua_pushlstring + lua_error",
"provenance": [
{
"component": "Lua 5.3 auxiliary library",
"symbol": "luaL_unref",
"status": "PinnedUpstream",
"source": "https://www.lua.org/source/5.3/lauxlib.c.html",
"verifiedOn": "2026-09-20",
"verification": "Lua 5.3.6 source shows luaL_unref calling lua_rawseti twice; the current absent-table branch intentionally raises with lua_error."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK LuaRef.Release protected allocator boundary recovered"
}
]
},
{
"id": "PushHostObject",
"nativeEnum": "OP_PUSH_HOST_OBJECT",
"managed": {
"constant": "PushHostObjectOperation",
"wrapper": "PushHostObject"
},
"opcode": 10,
"capability": "push-host-object",
"protected": true,
"requiresNativeProtection": true,
"raises": "any",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 0,
"inputDescription": "The CE host pusher address and CE object pointer are borrowed bridge parameters.",
"success": {
"resultCount": 1,
"delta": "+1",
"note": "The host pusher contract is that it pushes one CE userdata."
},
"failure": {
"resultCount": 1,
"delta": "+1",
"note": "Any Lua/CE failure becomes the lua_pcallk error object."
}
},
"ownership": {
"input": "The CE object pointer remains borrowed; the managed layer must not infer destruction rights from this push.",
"result": "Lua owns the userdata container and its metatable; Cheat Engine retains ownership of the native object by default."
},
"hostOperation": "Cheat Engine LuaPushClassInstance / luaclass_pushClass",
"provenance": [
{
"component": "Cheat Engine Lua class projection",
"symbol": "luaclass_pushClass",
"status": "PinnedUpstream",
"source": "https://github.com/cheat-engine/cheat-engine/blob/ec45d5f47f92a239ba0bf51ec5d04a7509c3fd37/Cheat%20Engine/LuaClass.pas",
"verifiedOn": "2026-09-20",
"verification": "The pusher delegates to userdata and metatable creation; its exact CE 7.7 failure behavior is qualification scenario Q23, not yet executed on the host.",
"note": "Host behavior beyond the pinned implementation is Unknown until live verification."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK PushHostObject native pusher longjmp observed"
}
]
},
{
"id": "PushByteTable",
"nativeEnum": "OP_PUSH_BYTE_TABLE",
"managed": {
"constant": "PushByteTableOperation",
"wrapper": "PushByteTable"
},
"opcode": 11,
"capability": "push-byte-table",
"protected": true,
"requiresNativeProtection": true,
"raises": "memory",
"stack": {
"scope": "Relative to the stack before the bridge pushes its light C closure; inputs are lua_pcallk arguments.",
"inputCount": 0,
"inputDescription": "The managed byte span is borrowed for the protected call while the bridge builds its ordered Lua sequence table.",
"success": {
"resultCount": 1,
"delta": "+1",
"note": "The protected call returns one Lua table with one-based integer byte entries."
},
"failure": {
"resultCount": 1,
"delta": "+1",
"note": "lua_pcallk leaves its error object."
}
},
"ownership": {
"input": "Managed bytes are borrowed only while the call is active.",
"result": "Lua owns the new table and the integer values stored in it."
},
"hostOperation": "lua_checkstack + lua_createtable + lua_pushinteger + lua_rawseti",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_createtable, lua_pushinteger, lua_rawseti",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_createtable",
"verifiedOn": "2026-09-20",
"verification": "lua_createtable is annotated [-0,+1,m] and lua_rawseti is annotated [-1,+0,m], so the whole table construction remains under one native lua_pcallk boundary."
}
],
"failureEvidence": [
{
"kind": "FailureProbeMarker",
"marker": "MARK PushByteTable protected allocator boundary recovered"
}
]
}
],
"directApiPolicy": [
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_gettop",
"nativeSymbol": "lua_gettop",
"raises": "never",
"allowedDirectly": true,
"requiresBridge": false,
"reason": "Read-only stack-height query.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_gettop",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_gettop",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+0,-]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_settop",
"nativeSymbol": "lua_settop",
"raises": "never",
"allowedDirectly": true,
"requiresBridge": false,
"reason": "Stack restoration is non-allocating; the caller owns index validity and balance.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_settop",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_settop",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-?,+?,-]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_checkstack",
"nativeSymbol": "lua_checkstack",
"raises": "never",
"allowedDirectly": true,
"requiresBridge": false,
"reason": "It reports lack of stack capacity by returning zero; the caller must check that result before a conditional direct fast path.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_checkstack",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_checkstack",
"verifiedOn": "2026-09-20",
"verification": "The manual specifies a boolean capacity result, not a Lua error."
},
{
"component": "CE 7.7-identical Lua fixture",
"symbol": "lua_checkstack(4096)",
"status": "ExactInstalledFile",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_checkstack",
"verifiedOn": "2026-09-20",
"verification": "A rejecting-allocator fixture probe returned 0, preserved stack height 0, and left the state reusable. The fixture DLL hash is recorded by host.lua.fixtureSha256.",
"note": "This is an exact-installed-file fixture observation, not an ObservedLive Cheat Engine result."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_rotate",
"nativeSymbol": "lua_rotate",
"raises": "never",
"allowedDirectly": true,
"requiresBridge": false,
"reason": "Pure stack permutation.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_rotate",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_rotate",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-?,+?,-]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_pushinteger",
"nativeSymbol": "lua_pushinteger",
"raises": "never",
"allowedDirectly": true,
"requiresBridge": false,
"reason": "Scalar push without allocation, subject to the normal Lua API stack-capacity precondition.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_pushinteger",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_pushinteger",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+1,-]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_pushlightuserdata",
"nativeSymbol": "lua_pushlightuserdata",
"raises": "never",
"allowedDirectly": true,
"requiresBridge": false,
"reason": "Light userdata is a scalar pointer value; it does not create full userdata.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_pushlightuserdata",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_pushlightuserdata",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+1,-]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_rawgetp",
"nativeSymbol": "lua_rawgetp",
"raises": "never",
"allowedDirectly": true,
"requiresBridge": false,
"reason": "Raw get bypasses metamethods and the Lua 5.3 API annotation is non-raising.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_rawgetp",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_rawgetp",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+1,-]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_rawgeti",
"nativeSymbol": "lua_rawgeti",
"raises": "never",
"allowedDirectly": true,
"requiresBridge": false,
"reason": "Raw integer get bypasses metamethods and the Lua 5.3 API annotation is non-raising.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_rawgeti",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_rawgeti",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+1,-]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_type",
"nativeSymbol": "lua_type",
"raises": "never",
"allowedDirectly": true,
"requiresBridge": false,
"reason": "Type inspection is non-allocating and does not invoke metamethods.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_type",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_type",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+0,-]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_pcallk",
"nativeSymbol": "lua_pcallk",
"raises": "never",
"allowedDirectly": true,
"requiresBridge": false,
"reason": "lua_pcallk is the native protected-call boundary and returns a status. It does not authorize a managed reverse callback to run a raising Lua primitive directly.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_pcallk",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_pcallk",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation has no error marker and specifies status results from protected execution."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_pushlstring",
"nativeSymbol": "lua_pushlstring",
"raises": "memory",
"allowedDirectly": false,
"requiresBridge": true,
"bridgeOperation": "PushBytes",
"reason": "Copies/allocates a Lua string; route through PushBytes.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_pushlstring",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_pushlstring",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+1,m]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_createtable",
"nativeSymbol": "lua_createtable",
"raises": "memory",
"allowedDirectly": false,
"requiresBridge": true,
"bridgeOperation": "CreateTable",
"reason": "Allocates a Lua table; route through CreateTable.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_createtable",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_createtable",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+1,m]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_newuserdata",
"nativeSymbol": "lua_newuserdata",
"raises": "memory",
"allowedDirectly": false,
"requiresBridge": true,
"bridgeOperation": "NewUserdata",
"reason": "Allocates full userdata; route through NewUserdata.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_newuserdata",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_newuserdata",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-0,+1,m]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_pushcclosure",
"nativeSymbol": "lua_pushcclosure",
"raises": "memory",
"allowedDirectly": false,
"requiresBridge": true,
"bridgeOperation": "PushClosure",
"conditionalDirectUse": {
"allowed": true,
"when": "upvalueCount == 0 and lua_checkstack(state, 1) returned nonzero immediately before on the same call path",
"proof": "Lua 5.3.6 lapi.c has a light-C-function fast path for n == 0; no generic direct path is approved."
},
"reason": "The general operation owns arbitrary upvalues and can allocate; route through PushClosure unless the exact n == 0 fast-path proof holds.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_pushcclosure",
"status": "PinnedUpstream",
"source": "https://www.lua.org/source/5.3/lapi.c.html",
"verifiedOn": "2026-09-20",
"verification": "The general manual annotation is [-n,+1,m]; lapi.c has a separate n == 0 light-C-function branch."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_rawset",
"nativeSymbol": "lua_rawset",
"raises": "memory",
"allowedDirectly": false,
"requiresBridge": true,
"bridgeOperation": "RawSet",
"reason": "Raw access avoids metamethods but table mutation may allocate; route through RawSet.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_rawset",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_rawset",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-2,+0,m]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_rawseti",
"nativeSymbol": "lua_rawseti",
"raises": "memory",
"allowedDirectly": false,
"requiresBridge": true,
"bridgeOperation": "RawSetIndex",
"reason": "Raw access avoids metamethods but table mutation may allocate; route through RawSetI.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_rawseti",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_rawseti",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-1,+0,m]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_rawsetp",
"nativeSymbol": "lua_rawsetp",
"raises": "memory",
"allowedDirectly": false,
"requiresBridge": true,
"bridgeOperation": "RawSetPointer",
"reason": "Raw access avoids metamethods but table mutation may allocate; route through RawSetP.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_rawsetp",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_rawsetp",
"verifiedOn": "2026-09-20",
"verification": "The manual annotation is [-1,+0,m]."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.lua_error",
"nativeSymbol": "lua_error",
"raises": "any",
"allowedDirectly": false,
"requiresBridge": true,
"reason": "Intentionally throws a Lua error with longjmp behavior; it is valid only under a native lua_pcallk boundary.",
"provenance": [
{
"component": "Lua 5.3 C API",
"symbol": "lua_error",
"status": "PinnedUpstream",
"source": "https://www.lua.org/manual/5.3/manual.html#lua_error",
"verifiedOn": "2026-09-20",
"verification": "Lua 5.3 documents C error handling through longjmp; .NET does not support longjmp skipping managed frames."
}
]
},
{
"managedSymbol": "CheatEngine.SDK.Lua.Interop.Api.LuaApi.luaL_ref",
"nativeSymbol": "luaL_ref",
"raises": "memory",
"allowedDirectly": false,
"requiresBridge": true,
"bridgeOperation": "CreateReference",
"reason": "Creates a registry reference and may allocate; route through TryCreatePrivateRef.",
"provenance": [
{
"component": "Lua 5.3 auxiliary library",
"symbol": "luaL_ref",
"status": "PinnedUpstream",