-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMNC
More file actions
1953 lines (1461 loc) · 74.5 KB
/
MNC
File metadata and controls
1953 lines (1461 loc) · 74.5 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
--[[
https://www.scribd.com/document/758096167/Synapse-v3-Docs
TODO
1. Add more functions
2. re-do all input checks
3. re-do all return type checks (use typeof() instead of type())
]]
local HttpService = game:GetService("HttpService");
local Players = game:GetService("Players");
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local RunService = game:GetService("RunService");
local StarterPlayer = game:GetService("StarterPlayer");
local UserInputService = game:GetService("UserInputService");
repeat task.wait() until Players.LocalPlayer.Character and Players.LocalPlayer.Character:FindFirstChild("Head")
local Pass, NA, Fail = 0, 0, 0
local function checkFunction(aliasTable, args, callback, na)
local mainAlias = aliasTable[1]
local otherAliases = {table.unpack(aliasTable, 2, #aliasTable)}
local splitFunc = mainAlias:split(".")
local mainFunc
if splitFunc[1] then
mainFunc = getfenv(0)
for i, v in pairs(splitFunc) do
mainFunc = mainFunc and mainFunc[v]
end
else
mainFunc = getfenv(0)[mainAlias]
end
if not mainFunc then
Fail = Fail + 1
warn((#otherAliases > 0 and "| 🟥 - ".. mainAlias .." | function not found | Missing aliases: ".. table.concat(otherAliases, ", ") .." |" or "| 🟥 - ".. mainAlias .." | function not found |"))
return
end
if na then
NA = NA + 1
print("| 🟦 - " .. mainAlias .. " |")
return;
end
local mainSuccess, mainResult = pcall(mainFunc, table.unpack(args))
if not mainSuccess then
Fail = Fail + 1
local errorMsg = string.gsub(mainResult, "%S+:%d+: ", "")
warn((#otherAliases > 0 and "| 🟥 - ".. mainAlias .." | ".. errorMsg .." | missing aliases: ".. table.concat(otherAliases, ", ") .." |") or ("| 🟥 - ".. mainAlias .." | ".. errorMsg .." |"))
return
end
local callbackSuccess, callbackResult = pcall(callback, mainFunc, mainResult)
if not callbackSuccess then
Fail = Fail + 1
local errorMsg = string.gsub(callbackResult, "%S+:%d+: ", "")
warn((#otherAliases > 0 and "| 🟥 - ".. mainAlias .." | ".. errorMsg .." | missing aliases: ".. table.concat(otherAliases, ", ") .." |") or ("| 🟥 - ".. mainAlias .." | ".. errorMsg .." |"))
return
end
if callbackResult == 0 then
Pass = Pass + 1
elseif callbackResult == 1 then
NA = NA + 1
else
Fail = Fail + 1
return
end
local missingAliases = {}
for _, v in pairs(otherAliases) do
local splitFunc = mainAlias:split(".")
local func
if splitFunc[1] then
func = getfenv(0)
for i, v in pairs(splitFunc) do
func = func and func[v]
end
else
func = getfenv(0)[mainAlias]
end
if not func then
table.insert(missingAliases, v)
else
local success = func == mainFunc
if not success then
table.insert(missingAliases, v)
end
end
end
local emoji = callbackResult == 0 and "🟩" or callbackResult == 1 and "🟦" or "🟥"
local message = "| " .. emoji .. " - " .. mainAlias .. " |"
if #missingAliases > 0 then
message = message .. " missing aliases: " .. table.concat(missingAliases, ", ") .. " |"
end
if callbackResult == 0 or callbackResult == 1 then
print(message)
else
warn(message)
end
end
print("|-- Scroll Down --|"..string.rep('\n', 100))
print("")
print("|-- Environment --|")
do
checkFunction({"getgenv"}, {0}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
test_varaible = "This is a Test!";
assert(returned["print"], "returned table without basic lua functions");
assert(returned["test_varaible"], "returned table without custom global variable");
test_varaible = nil;
return 0;
end)
checkFunction({"getrenv"}, {0}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
assert(returned["print"], "returned table without basic lua functions");
assert(returned["DockWidgetPluginGuiInfo"] and returned["CatalogSearchParams"], "returned table without default roblox global variables");
assert(_G ~= returned["_G"], "returned table matching global tables");
return 0;
end)
local thread;
checkFunction({"getreg", "debug.getregistry"}, {0}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
assert(#returned > 0, "returned blank table");
assert(returned["DateTime"], "returned table without basic lua functions");
assert(returned["DockWidgetPluginGuiInfo"] and returned["CatalogSearchParams"], "returned table without default roblox global variable");
for i,v in pairs(returned) do
if type(v) == "thread" then
thread = v
break
end
end
return 0;
end)
checkFunction({"gettenv"}, {thread}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
assert(thread, "failed due to not having getreg")
assert(returned["print"], "returned table without basic lua functions");
assert(returned["DockWidgetPluginGuiInfo"] and returned["CatalogSearchParams"], "returned table without default roblox global variables");
assert(_VERSION == returned["_VERSION"], "returned mismatch version");
return 0;
end)
local wt = setmetatable({}, { __mode = "v" })
local test = { MNC_TEST_TABLE = true }
wt[1] = test
test = nil
collectgarbage('count')
checkFunction({"getgc"}, {true}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
assert(#returned > 0, "returned blank table");
local found = false
for _, obj in ipairs(returned) do
if type(obj) == "table" and rawget(obj, "MNC_TEST_TABLE") then
found = true
break
end
end
assert(found, "returned table without test instance")
return 0;
end)
checkFunction({"getinstances"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
assert(#returned > 0, "returned blank table");
assert(typeof(returned[1]) == "Instance", "returned invalid instance");
return 0;
end)
checkFunction({"getnilinstances"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
assert(#returned > 0, "returned blank table");
assert(returned[1].parent == nil, "returned invalid instance");
return 0;
end)
checkFunction({"getscripts"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
assert(#returned > 0, "returned blank table");
assert(typeof(returned[1]) == "Instance", "returned invalid instance");
assert((returned[1].ClassName == "LocalScript") or (returned[1].ClassName == "ModuleScript"), "returned invalid instance");
return 0;
end)
checkFunction({"getloadedmodules"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
assert(#returned > 0, "returned blank table");
assert(typeof(returned[1]) == "Instance", "returned invalid instance");
assert(returned[1].ClassName == "ModuleScript", "returned invalid instance");
return 0;
end)
local fired = false;
local cd = Instance.new("ClickDetector");
cd.MaxActivationDistance = 9e9
cd.MouseClick:Connect(function()fired = true;end)
checkFunction({"fireclickdetector"}, {cd, 100, "MouseClick"}, function(self, returned)
local timeout = 0
repeat task.wait(0.016) timeout+=0.016 until fired or timeout > 1
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(fired, "clickdetector didn't get fired")
return 0;
end)
cd:Destroy();cd=nil;
fired=nil;
local fired = false;
local PP = Instance.new("ProximityPrompt");
PP.Parent = workspace
PP.MaxActivationDistance = 9e9
PP.Triggered:Connect(function()fired = true;end)
checkFunction({"fireproximityprompt"}, {PP}, function(self, returned)
local timeout = 0
repeat task.wait(0.016) timeout+=0.016 until fired or timeout > 1
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(fired, "proximityprompt didn't get fired")
return 0;
end)
PP:Destroy();PP=nil;
fired=nil;
local fired = false
local part = Instance.new("Part")
part.Parent = workspace
part.Touched:Connect(function()fired = true;end)
checkFunction({"firetouchinterest"}, {game.Players.LocalPlayer.Character:WaitForChild("Head"), part, 0}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
firetouchinterest(game.Players.LocalPlayer.Character:WaitForChild("Head"), part, 1)
task.wait(0.1)
assert(fired, ".touched wasn't fired")
return 0;
end)
part:Destroy();part=nil;
fired=nil;
end
print("")
print("|-- Filesystem --|")
do
local GUID = HttpService:GenerateGUID(false);
local data = "return '"..GUID.."'";
local hasfile = false;
checkFunction({"writefile"}, {"MNCTest.txt", data}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(isfile("MNCTest.txt"), "failed to create test file");
hasfile = true;
return 0;
end)
checkFunction({"loadfile"}, {"MNCTest.txt"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "function", "Expected 'function', got "..type(returned))
if not hasfile then
error("failed to test loadfile, test file was never created")
end
assert(returned() == loadstring(readfile("MNCTest.txt"))(), "not equivalent to loadstring(readfile(path))");
return 0;
end)
checkFunction({"isfile"}, {"MNCTest.txt"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
if not hasfile then
error("failed to test isfile, test file was never created")
end
assert(returned, "failed to validate test file");
return 0;
end)
checkFunction({"readfile"}, {"MNCTest.txt"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "string", "Expected 'string', got "..type(returned))
if not hasfile then
error("failed to test readfile, test file was never created")
end
assert(returned == data, "failed to get correct text from test file");
return 0;
end)
checkFunction({"appendfile"}, {"MNCTest.txt", "Test1"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
if not hasfile then
error("failed to test appendfile, test file was never created")
end
assert(readfile("MNCTest.txt") == data.."Test1", "failed to get correct text from appended test file");
return 0;
end)
checkFunction({"delfile"}, {"MNCTest.txt"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
if not hasfile then
error("failed to test delfile, test file was never created")
end
assert(not isfile("MNCTest.txt"), "failed to delete test file");
return 0;
end)
local hasfolder = false;
checkFunction({"makefolder"}, {"MNCTest"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(isfolder("MNCTest"), "failed to create test folder");
hasfolder = true;
return 0;
end)
checkFunction({"isfolder"}, {"MNCTest"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
if not hasfolder then
error("failed to test isfolder, test folder was never created")
end
assert(returned, "failed to validate test folder");
return 0;
end)
checkFunction({"delfolder"}, {"MNCTest"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
if not hasfolder then
error("failed to test delfolder, test folder was never created")
end
assert(not isfolder("MNCTest"), "failed to delete test folder");
return 0;
end)
checkFunction({"getcustomasset"}, {"test.png"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "string", "Expected 'string', got "..type(returned))
return 1;
end, true)
checkFunction({"saveinstance"}, {Instance.new("Part")}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
return 0;
end, true)
data = nil;
hasfile = nil;
hasfolder = nil;
end
print("")
print("|-- Hooking --|")
do
local function testfunction()
return "A"
end
local newcTest;
checkFunction({"newcclosure"}, {testfunction, "testcfunction"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "function", "Expected 'function', got "..type(returned))
local returnedType = debug.info(returned, "l") == -1 and "C" or "L";
assert(returnedType == "C", "function wasn't wrapped in a cclosure");
assert(returned ~= testfunction, "original and C wrapped function are the same");
assert(debug.info(returned, "n") == "testcfunction", "closures name is wrong");
newcTest = returned
return 0;
end)
checkFunction({"newlclosure"}, {newcTest or function() end, "testlfunction"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "function", "Expected 'function', got "..type(returned))
assert(newcTest, "failed due to not having newcclosure")
local returnedType = debug.info(returned, "l") == -1 and "C" or "L";
assert(returnedType == "L", "function wasn't wrapped in a lclosure");
assert(returned ~= newcTest, "original and l wrapped function are the same");
assert(debug.info(returned, "n") == "testlfunction", "closures name is wrong");
return 0;
end)
checkFunction({"iscclosure"}, {testfunction}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
assert(not returned, "returned true on a lclosure")
assert(iscclosure(print), "returned false on a cclosure")
return 0;
end)
checkFunction({"islclosure"}, {testfunction}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "boolean 'function', got "..type(returned))
assert(returned, "returned false on a lclosure")
assert(not islclosure(print), "returned true on a cclosure")
return 0;
end)
checkFunction({"clonefunction"}, {testfunction}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "function", "Expected 'function', got "..type(returned))
local returnedType = debug.info(returned, "l") == -1 and "C" or "L";
assert(returnedType == "L", "cloned function was wrapped in C");
assert(returned ~= testfunction, "original and cloned function are the same");
return 0;
end)
checkFunction({"hookfunction", "replaceclosure"}, {testfunction, function() return "B" end}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "function", "Expected 'function', got "..type(returned))
local output = returned();
assert(output == "A", "returned function outputs different retult than original");
local output = testfunction();
assert(output == "B", "functions output wasn't changed");
local returnedType = debug.info(returned, "l") == -1 and "C" or "L";
local oreturnedType = debug.info(testfunction, "s") == "[C]" and "C" or "L";
assert(returnedType == oreturnedType, "original and hooked functions closures are different");
local l = function() return "l" end
local c = clonefunction(string.upper)
local ncc = newcclosure(function() return "ncc" end)
do -- l -> ?
local ltol = hookfunction(l, function() return "l2" end)
assert(ltol() == "l", "hookfunction didn't return the original function | l -> l")
assert(l() == "l2", "l closure wasen't hooked | l -> l")
local ltoc = hookfunction(ltol, c)
assert(ltoc() == "l", "hookfunction didn't return the original function | l -> c")
assert(ltol("l") == "L", "l closure wasen't hooked | l -> c")
local ltoncc = hookfunction(ltoc, ncc)
assert(ltoncc() == "l", "hookfunction didn't return the original function | l -> ncc")
assert(ltoc() == "ncc", "l closure wasen't hooked | l -> ncc")
end
do -- c -> ?
local ctol = hookfunction(c, l)
assert(ctol("c") == "C", "hookfunction didn't return the original function | c -> l")
assert(c() == "l2", "c closure wasen't hooked | c -> l")
local ctoc = hookfunction(ctol, c)
assert(ctoc("l") == "L", "hookfunction didn't return the original function | c -> c")
assert(ctol() == "l2", "c closure wasen't hooked | c -> c")
local ctoncc = hookfunction(ctoc, ncc)
assert(ctoncc("l") == "L", "hookfunction didn't return the original function | c -> ncc")
assert(ctoc() == "ncc", "c closure wasen't hooked | c -> ncc")
end
do -- ncc -> ?
local ncctol = hookfunction(ncc, l)
assert(ncctol() == "ncc", "hookfunction didn't return the original function | ncc -> l")
assert(c() == "l2", "c closure wasen't hooked | ncc -> l")
local ncctoc = hookfunction(ncctol, c)
assert(ncctoc() == "ncc", "hookfunction didn't return the original function | ncc -> c")
assert(ncctol() == "l2", "c closure wasen't hooked | ncc -> c")
local ncctoncc = hookfunction(ncctoc, ncc)
assert(ncctoncc() == "ncc", "hookfunction didn't return the original function | ncc -> ncc")
assert(ncctoc() == "l2", "c closure wasen't hooked | ncc -> ncc")
end
l = nil
c = nil
ncc = nil
return 0;
end)
checkFunction({"restorefunction"}, {testfunction}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
local output = testfunction();
assert(output == "A", "functions output wasn't restored");
assert(debug.info(testfunction, "l") ~= -1, "restored function closure was elevated to c");
return 0;
end)
checkFunction({"isfunctionhooked"}, {testfunction}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
hookfunction(testfunction, function() return "B" end);
local ishooked = isfunctionhooked(testfunction);
assert(ishooked, "returned false when function was hooked");
restorefunction(testfunction);
local ishooked = isfunctionhooked(testfunction);
assert(not ishooked, "returned true when function was restored");
return 0;
end)
testfunction = nil;
end
print("")
print("|-- Input --|")
do
checkFunction({"iswindowactive", "isrbxactive"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
return 1;
end)
local state = false;
checkFunction({"lockwindow"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
if iswindowlocked() then
state = true;
end
assert(state, "window was not locked")
return 0;
end)
checkFunction({"iswindowlocked"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
if iswindowlocked() then
state = true;
end
assert(state, "window was not locked")
return 0;
end)
checkFunction({"unlockwindow"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(state, "window was still locked")
return 0;
end)
state = nil;
if iswindowactive then
repeat task.wait() until iswindowactive()
end
local state = false
checkFunction({"keypress"}, {0x41}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
task.wait()
assert(UserInputService:IsKeyDown(Enum.KeyCode.A), "key was not pressed down")
state = true
return 0;
end)
checkFunction({"keyrelease"}, {0x41}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
task.wait()
assert(state, "keypress did not press the key")
assert(not UserInputService:IsKeyDown(Enum.KeyCode.A), "key was not released")
return 0;
end)
state = nil
local clicked = nil;
local connection1 = UserInputService.InputBegan:Connect(function(something)
if something.KeyCode == 0x41 then
clicked = true;
end
end)
local connection2 = UserInputService.InputEnded:Connect(function(something)
if something.KeyCode == 0x41 then
clicked = false;
end
end)
checkFunction({"keyclick", "keytap"}, {0x41}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
local timeout = 0
repeat task.wait(0.016) timeout+=0.016 until clicked or timeout > 1
assert(clicked == nil, "keyclick was not fired on key")
assert(clicked, "key was pressed but not released")
return 0;
end)
connection1:Disconnect();connection1 = nil;
connection2:Disconnect();connection2 = nil;
checkFunction({"mouse1press"}, {0, 0}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"mouse1release"}, {0, 0}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"mouse1click"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"mouse2press"}, {0, 0}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"mouse2release"}, {0, 0}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"mouse2click"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"mousescroll"}, {0, 0}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"mousemoverel"}, {10, 10}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"mousemoveabs"}, {0, 0}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"iskeydown"}, {0x41}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"iskeytoggled"}, {0x41}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
return 1;
end, true)
checkFunction({"getmousestate"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
return 1;
end, true)
checkFunction({"setmousestate"}, {true}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
end
print("")
print("|-- Miscellaneous --|")
do
checkFunction({"setclipboard"}, {"Hey!"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end)
checkFunction({"setrbxclipboard"}, {"Hey!"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end)
checkFunction({"setfflag"}, {"UGCValidationValidateTransparencyEnhancedErrorMessage", false}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(returned, "returned false on a valid FFlag");
return 0;
end)
checkFunction({"getfflag"}, {"UGCValidationValidateTransparencyEnhancedErrorMessage"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(returned == "false", "returned true when FFlag was disabled");
setfflag("UGCValidationValidateTransparencyEnhancedErrorMessage", true)
assert(getfflag("UGCValidationValidateTransparencyEnhancedErrorMessage"), "returned false when FFlag was enabled");
return 0;
end)
checkFunction({"identifyexecutor"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "string", "Expected 'string', got "..type(returned))
return 0;
end)
checkFunction({"unlockmodulescript"}, {game:GetService("StarterPlayer").StarterPlayerScripts.PlayerModule}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 0;
end)
checkFunction({"require"}, {game:GetService("StarterPlayer").StarterPlayerScripts.PlayerModule}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
assert(returned["cameras"], "table returned without expected values")
assert(returned["controls"], "table returned without expected values")
return 0;
end)
checkFunction({"messagebox"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "number", "Expected 'number', got "..type(returned))
return 1;
end, true)
checkFunction({"setwindowtitle"}, {"MNC TEST"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(getwindowtitle()=="MNC TEST", "failed to set window title")
return 0;
end)
checkFunction({"getwindowtitle"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "string", "Expected 'string', got "..type(returned))
assert(returned=="MNC TEST", "failed to set window title")
setwindowtitle("Roblox")
assert(getwindowtitle()=="Roblox", "failed to set window title")
return 0;
end)
checkFunction({"setwindowicon"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"gethui"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "userdata", "Expected 'userdata', got "..type(returned))
assert(returned ~= game:GetService"CoreGui", "protected container is just CoreGui")
local a,b = pcall(function() return returned:IsDescendantOf(game:GetService"CoreGui") end)
assert(a and not b or not a, "protected container is a descendant of CoreGui")
return 0;
end)
local test = game.Workspace;
local test2 = nil;
checkFunction({"cloneref"}, {test}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "userdata", "Expected 'userdata', got "..type(returned))
assert(returned ~= game:GetService"Workspace", "cloned instance is equivalent to original")
assert(returned.CurrentCamera, "cloned workspace doesn't have CurrentCamera")
assert(returned:FindFirstChild("Camera"), "cloned workspace doesn't have Camera child")
test2 = returned
return 0;
end)
checkFunction({"compareinstances"}, {test, test2}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
assert(test ~= test2, "cloned instance is equivalent to original")
assert(returned, "cloned instance should've returned true")
test, test2 = nil, nil
return 0;
end)
checkFunction({"queue_on_teleport"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"clear_teleport_queue"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
return 1;
end, true)
checkFunction({"setthreadidentity", "set_thread_identity"}, {2}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(getthreadidentity, "test failed exploit doesn't support 'getthreadidentity'")
assert(getthreadidentity() == 2, "thread identity wasn't set to 2")
local a, b = pcall(function() return game.CoreGui end)
assert(a, "thread identity 2 shouldn't be able to access CoreGui")
setthreadidentity(7)
return 0;
end)
checkFunction({"getthreadidentity", "get_thread_identity"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "number", "Expected 'number', got "..type(returned))
assert(setthreadidentity, "test failed exploit doesn't support 'setthreadidentity'")
assert(returned == 7, "thread identity doesn't equal 7")
return 0;
end)
end
print("")
print("|-- Network --|")
do
checkFunction({"isnetworkowner"}, {game.Players.LocalPlayer.Character:FindFirstChild("Head")}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
assert(returned, "returned false on a part in your character");
return 0;
end)
end
print("")
print("|-- Reflection --|")
do
checkFunction({"setscriptable"}, {Players, 'BanningEnabled', true}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
assert(returned, "didn't return flags original state");
local oldbanning = Players.BanningEnabled
pcall(function() Players.BanningEnabled = not oldbanning end)
assert(Players.BanningEnabled == not oldbanning, "failed to set a read-only property after setting it to scriptable");
pcall(function() Players.BanningEnabled = oldbanning end)
oldbanning = nil
return 0;
end)
old = nil
checkFunction({"gethiddenproperty"}, {Players.LocalPlayer.Character:FindFirstChild"Humanoid", "Health_XML"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "number", "Expected 'number', got "..type(returned))
assert(returned == Players.LocalPlayer.Character:FindFirstChild"Humanoid".Health, "returns unexpected value");
return 0;
end)
checkFunction({"sethiddenproperty"}, {Players.LocalPlayer.Character:FindFirstChild"Humanoid", "Health_XML", 50}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "boolean", "Expected 'boolean', got "..type(returned))
return 0;
end)
checkFunction({"getproperties"}, {Players.LocalPlayer.Character:FindFirstChild"Humanoid"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
local len = 0
for i,v in pairs(returned) do
len += 1
end
assert(len > 0, "returned blank table");
assert(returned["Health"], "returned table without basic properties");
assert(returned["Health_XML"], "returned table without non-scriptable properties");
return 0;
end)
checkFunction({"gethiddenproperties"}, {Players.LocalPlayer.Character:FindFirstChild"Humanoid"}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")
assert(type(returned) == "table", "Expected 'table', got "..type(returned))
local len = 0
for i,v in pairs(returned) do
len += 1
end
assert(len > 0, "returned blank table");
assert(returned["Health_XML"], "returned table without non-scriptable properties");
return 0;
end)
local test = RunService:BindToRenderStep("MNCTEST", 1, function()
return;
end)
checkFunction({"getrendersteppedlist"}, {}, function(self, returned)
assert(debug.info(self, "s") == "[C]", "Function is not native C")