forked from LorekeeperZinnia/DexSerializer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserializer.lua
More file actions
2465 lines (2179 loc) · 79.1 KB
/
Copy pathserializer.lua
File metadata and controls
2465 lines (2179 loc) · 79.1 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
--[[
____ _____ _ ___
/ __ \___ _ __ / ___/___ _____(_)___ _/ (_)___ ___ _____
/ / / / _ \| |/_/ \__ \/ _ \/ ___/ / __ `/ / /_ / / _ \/ ___/
/ /_/ / __/> < ___/ / __/ / / / /_/ / / / / /_/ __/ /
/_____/\___/_/|_| /____/\___/_/ /_/\__,_/_/_/ /___/\___/_/
The most accurate and top lua roblox binary format serializer since late 2020
Made in preparation for The Augur's reign that started in July 2021
Many ServerScriptService and ServerStorage models of top games were saved with top accuracy
This is old and discontinued, but the agency released it to show people the grand serializer that
powered the saveinstance function in the top executors at the time before they were discontinued:
- ScriptWare
- Synapse X
Activly working on supporting the following:
- Use ReflectionService
]]
-- Made by Moon
local Main,Serializer,API,Settings,DefaultSettings,env
local service = setmetatable({},{__index = function(self,name)
local serv = game:GetService(name)
self[name] = serv
return serv
end})
-- Helper functions for new features
local function activateSafeMode()
if pcall(function() game:GetService"Players".LocalPlayer:Kick("SaveInstance SafeMode: Saving initiated. Goodbye!") end) then
wait(1)
end
end
local function boostFPS()
local success = false
if pcall(function()
local gameSettings = UserSettings():FindFirstChild("GameSettings")
if gameSettings then
gameSettings.FPSUnlocked = false
gameSettings.MasterVolume = 0
success = true
end
end) then
-- Try disabling rendering via camera if available
if workspace.CurrentCamera then
workspace.CurrentCamera.MaxAxisOfRotation = 0
end
end
return success
end
local function startAntiIdle()
local antiIdleConn
antiIdleConn = service.RunService.Heartbeat:Connect(function()
-- Send periodic inputs to prevent idle timeout
pcall(function()
if game:FindFirstChild("__AntiIdleMouse") then return end
local mouse = game:FindFirstChild("__AntiIdleMouse") or game.Players.LocalPlayer:GetMouse()
if mouse then
local pos = mouse.Hit.Position
mouse.move(pos)
end
end)
end)
return antiIdleConn
end
local function cleanAnonymousData(root, options)
if not options.Anonymous then return end
-- Placeholder: would scrub player name and userid from instances
-- This is a simplified version; full implementation would recursively check properties
end
DefaultSettings = {
Serializer = {
_Recurse = true,
-- Decompilation
Decompile = false,
DecompileTimeout = 10,
MaxThreads = 3,
DecompileIgnore = {"Chat","CoreGui","CorePackages"},
SaveScriptCache = false,
SaveBytecode = false,
-- Instance Selection
NilInstances = false,
RemovePlayerCharacters = true,
SavePlayers = false,
IsolateStarterPlayer = true,
IsolateLocalPlayer = false,
SavePlayerCharacters = false,
-- Property Filtering
IgnoreDefaultProps = true,
IgnoreNotArchivable = true,
-- Output & Formatting
Binary = true,
ShowStatus = true,
ReadMe = true,
Mode = "full",
FilePath = false,
Callback = false,
Clipboard = false,
AvoidFileOverwrite = true,
-- Safety Features
SafeMode = false,
BoostFPS = false,
KillAllScripts = false,
AntiIdle = false,
-- Data Cleanup
Anonymous = false
}
}
-- Compatibility shims for environments missing newer Lua helpers
do
if not table.clear then
table.clear = function(t)
for k in pairs(t) do t[k] = nil end
end
end
if not string.split then
string.split = function(s, sep)
sep = sep or "%s"
local res = {}
if sep == "%s" then
for token in s:gmatch("%S+") do res[#res+1] = token end
else
local pattern = "(.-)" .. sep
local last_end = 1
local s_len = #s
local init = 1
while true do
local st, en, cap = s:find(pattern, init)
if not st then break end
res[#res+1] = cap
init = en + 1
end
if init <= s_len then
res[#res+1] = s:sub(init)
end
end
return res
end
end
if not table.move then
table.move = function(a, f, e, t, dest)
dest = dest or 1
for i = f, e do a[dest + (i - f)] = a[i] end
return a
end
end
end
Serializer = (function()
local Serializer = {}
local oldIndex,getnspval,getbspval,gethiddenprop,getnilinstances,getpcd,encodeBase64,lz4compress,hashmd5
local classes,saveProps,testInsts = {},{},{}
local tostring = tostring
local format = string.format
local gsub = string.gsub
local sub = string.sub
local getChildren = game.GetChildren
local isa = game.IsA
local components = CFrame.new(0,0,0).GetComponents
local httpService = service.HttpService
local urlEncode = httpService.UrlEncode
local concat = table.concat
local lrotate = bit32.lrotate
local tableCreate = table.create
local select = select
local unpack = unpack
local split = string.split
local s_rep = string.rep
local nilSafe = {}
local gameId
local s_pack, s_unpack
if rawget(_G, "buffer") then
function s_pack(fmt, ...)
local args = { ... }
local buf = buffer.create(256)
local offset, fmt_pos, arg_idx = 0, 1, 1
while fmt_pos <= #fmt do
local char = fmt:sub(fmt_pos, fmt_pos)
if char == '<' or char == '>' or char == '=' then
fmt_pos = fmt_pos + 1
elseif char == 'I' then
fmt_pos = fmt_pos + 1
if fmt:sub(fmt_pos, fmt_pos) == '4' then
buffer.writeu32(buf, offset, args[arg_idx])
offset = offset + 4; arg_idx = arg_idx + 1; fmt_pos = fmt_pos + 1
end
elseif char == 'i' then
fmt_pos = fmt_pos + 1
if fmt:sub(fmt_pos, fmt_pos) == '4' then
buffer.writei32(buf, offset, args[arg_idx])
offset = offset + 4; arg_idx = arg_idx + 1; fmt_pos = fmt_pos + 1
end
elseif char == 'f' then
buffer.writef32(buf, offset, args[arg_idx]); offset = offset + 4; arg_idx = arg_idx + 1; fmt_pos = fmt_pos + 1
elseif char == 'd' then
buffer.writef64(buf, offset, args[arg_idx]); offset = offset + 8; arg_idx = arg_idx + 1; fmt_pos = fmt_pos + 1
elseif char == 'b' then
buffer.writei8(buf, offset, args[arg_idx] or 0); offset = offset + 1; arg_idx = arg_idx + 1; fmt_pos = fmt_pos + 1
elseif char == 'B' then
buffer.writeu8(buf, offset, args[arg_idx] or 0); offset = offset + 1; arg_idx = arg_idx + 1; fmt_pos = fmt_pos + 1
else
fmt_pos = fmt_pos + 1
end
end
return buffer.readstring(buf, 0, offset)
end
function s_unpack(fmt, data, offset)
offset = offset or 1
local buf_offset = offset - 1
local buf = buffer.fromstring(data)
local results, fmt_pos = {}, 1
while fmt_pos <= #fmt do
local char = fmt:sub(fmt_pos, fmt_pos)
if char == '<' or char == '>' or char == '=' then
fmt_pos = fmt_pos + 1
elseif char == 'I' then
fmt_pos = fmt_pos + 1
if fmt:sub(fmt_pos, fmt_pos) == '4' then
results[#results+1] = buffer.readu32(buf, buf_offset); buf_offset = buf_offset + 4; fmt_pos = fmt_pos + 1
end
elseif char == 'i' then
fmt_pos = fmt_pos + 1
if fmt:sub(fmt_pos, fmt_pos) == '4' then
results[#results+1] = buffer.readi32(buf, buf_offset); buf_offset = buf_offset + 4; fmt_pos = fmt_pos + 1
end
elseif char == 'f' then
results[#results+1] = buffer.readf32(buf, buf_offset); buf_offset = buf_offset + 4; fmt_pos = fmt_pos + 1
elseif char == 'd' then
results[#results+1] = buffer.readf64(buf, buf_offset); buf_offset = buf_offset + 8; fmt_pos = fmt_pos + 1
elseif char == 'b' then
results[#results+1] = buffer.readi8(buf, buf_offset); buf_offset = buf_offset + 1; fmt_pos = fmt_pos + 1
elseif char == 'B' then
results[#results+1] = buffer.readu8(buf, buf_offset); buf_offset = buf_offset + 1; fmt_pos = fmt_pos + 1
else
fmt_pos = fmt_pos + 1
end
end
return unpack(results)
end
else
s_pack = string.pack; s_unpack = string.unpack
end
if not s_pack or not s_unpack then
local _msg = "string.pack/string.unpack not available; serialization requires Lua 5.3+ or a buffer implementation"
s_pack = function() error(_msg) end
s_unpack = function() error(_msg) end
end
--[[
local propBypass = {
["BasePart"] = {
["Size"] = true,
["Color"] = true,
},
["Part"] = {
["Shape"] = true
},
["Fire"] = {
["Heat"] = true,
["Size"] = true,
},
["Smoke"] = {
["Opacity"] = true,
["RiseVelocity"] = true,
["Size"] = true,
},
["DoubleConstrainedValue"] = {
["Value"] = true
},
["IntConstrainedValue"] = {
["Value"] = true
},
["TrussPart"] = {
["Style"] = true
}
}
]]
local propBypass = {
["BasePart"] = {
["Color"] = true, -- No Coloruint8
},
}
local propFilter = {
["BasePart"] = {
["Color3uint8"] = true
},
["BaseScript"] = {
["LinkedSource"] = true
},
["Script"] = {
["Source"] = true
},
["ModuleScript"] = {
["LinkedSource"] = true,
["Source"] = true
},
["Players"] = {
["CharacterAutoLoads"] = true
},
["BillboardGui"] = {
["PlayerToHideFrom"] = true
},
["Instance"] = {
["SourceAssetId"] = true,
["PropertyStatusStudio"] = true
},
["Model"] = {
["WorldPivotData"] = true -- No OptionalCoordinateFrame
},
["TerrainRegion"] = { -- No Vector3int16
["ExtentsMax"] = true,
["ExtentsMin"] = true
}
}
local xmlReplacePattern = "['\"<>&\0]"
local xmlReplace = {
["'"] = "'",
["\""] = """,
["<"] = "<",
[">"] = ">",
["&"] = "&",
["\0"] = ""
}
local serviceBlacklist = {
["CoreGui"] = true,
["CorePackages"] = true,
}
local nilClassParents = {
["Attachment"] = "Part",
["Bone"] = "Part",
["Animator"] = "Humanoid",
["SurfaceAppearance"] = "MeshPart"
}
local valueConverters = {
["bool"] = function(name,val)
return '\n<bool name="'..name..'">'..(val and "true" or "false")..'</bool>'
end,
["int"] = function(name,val)
return format('\n<int name="%s">%d</int>',name,val)
end,
["int64"] = function(name,val)
return format('\n<int64 name="%s">%d</int64>',name,val)
end,
["float"] = function(name,val)
return format('\n<float name="%s">%.12f</float>',name,val)
end,
["double"] = function(name,val)
return format('\n<double name="%s">%.12f</double>',name,val)
end,
["string"] = function(name,val)
return '\n<string name="'..name..'">'..gsub(val,xmlReplacePattern,xmlReplace)..'</string>'
end,
["BrickColor"] = function(name,val)
return format('\n<int name="%s">%d</int>',name,val.Number)
end,
["Vector2"] = function(name,val)
return format('\n<Vector2 name="%s">\n<X>%.12f</X>\n<Y>%.12f</Y>\n</Vector2>',name,val.X,val.Y)
end,
["Vector3"] = function(name,val)
return format('\n<Vector3 name="%s">\n<X>%.12f</X>\n<Y>%.12f</Y>\n<Z>%.12f</Z>\n</Vector3>',name,val.X,val.Y,val.Z)
end,
["Vector3int16"] = function(name,val)
return format('\n<Vector3int16 name="%s">\n<X>%d</X>\n<Y>%d</Y>\n<Z>%d</Z>\n</Vector3int16>',name,val.X,val.Y,val.Z)
end,
["CFrame"] = function(name,val)
return format('\n<CoordinateFrame name="%s">\n<X>%.12f</X>\n<Y>%.12f</Y>\n<Z>%.12f</Z>\n<R00>%.12f</R00>\n<R01>%.12f</R01>\n<R02>%.12f</R02>\n<R10>%.12f</R10>\n<R11>%.12f</R11>\n<R12>%.12f</R12>\n<R20>%.12f</R20>\n<R21>%.12f</R21>\n<R22>%.12f</R22>\n</CoordinateFrame>',name,components(val))
end,
["Content"] = function(name,val)
if sub(val,1,15) == "rbxgameasset://" then
val = format("https://assetdelivery.roblox.com/v1/asset?universeId=%d&assetName=%s&skipSigningScripts=1",gameId,urlEncode(httpService,sub(val,16)))
end
return '\n<Content name="'..name..'"><url>'..gsub(val,xmlReplacePattern,xmlReplace)..'</url></Content>'
end,
["UDim"] = function(name,val)
return format('\n<UDim name="%s">\n<S>%.12f</S>\n<O>%d</O>\n</UDim>',name,val.Scale,val.Offset)
end,
["UDim2"] = function(name,val)
local x = val.X
local y = val.Y
return format('\n<UDim2 name="%s">\n<XS>%.12f</XS>\n<XO>%d</XO>\n<YS>%.12f</YS>\n<YO>%d</YO>\n</UDim2>',name,x.Scale,x.Offset,y.Scale,y.Offset)
end,
["Color3"] = function(name,val)
return format('\n<Color3 name="%s">\n<R>%.12f</R>\n<G>%.12f</G>\n<B>%.12f</B>\n</Color3>',name,val.R,val.G,val.B)
end,
["NumberRange"] = function(name,val)
return '\n<NumberRange name="'..name..'">'..tostring(val)..'</NumberRange>'
end,
["NumberSequence"] = function(name,val)
return '\n<NumberSequence name="'..name..'">'..tostring(val)..'</NumberSequence>'
end,
["ColorSequence"] = function(name,val)
return '\n<ColorSequence name="'..name..'">'..tostring(val)..'</ColorSequence>'
end,
["Rect"] = function(name,val)
local min,max = val.Min,val.Max
return format('\n<Rect2D name="%s">\n<min>\n<X>%.12f</X>\n<Y>%.12f</Y>\n</min>\n<max>\n<X>%.12f</X>\n<Y>%.12f</Y>\n</max>\n</Rect2D>',name,min.X,min.Y,max.X,max.Y)
end,
["PhysicalProperties"] = function(name,val)
if val then
return format('\n<PhysicalProperties name="%s">\n<CustomPhysics>true</CustomPhysics>\n<Density>%.12f</Density>\n<Friction>%.12f</Friction>\n<Elasticity>%.12f</Elasticity>\n<FrictionWeight>%.12f</FrictionWeight>\n<ElasticityWeight>%.12f</ElasticityWeight>\n</PhysicalProperties>',name,val.Density,val.Friction,val.Elasticity,val.FrictionWeight,val.ElasticityWeight)
else
return '\n<PhysicalProperties name="'..name..'">\n<CustomPhysics>false</CustomPhysics>\n</PhysicalProperties>'
end
end,
["Faces"] = function(name,val)
local faceInt = (val.Front and 32 or 0) + (val.Bottom and 16 or 0) + (val.Left and 8 or 0) + (val.Back and 4 or 0) + (val.Top and 2 or 0) + (val.Right and 1 or 0)
return format('\n<Faces name="%s">\n<faces>%d</faces>\n</Faces>',name,faceInt)
end,
["Axes"] = function(name,val)
local axisInt = (val.Z and 4 or 0) + (val.Y and 2 or 0) + (val.X and 1 or 0)
return format('\n<Axes name="%s">\n<axes>%d</axes>\n</Axes>',name,axisInt)
end,
["Ray"] = function(name,val)
local origin = val.Origin
local direction = val.Direction
return format('\n<Ray name="%s">\n<origin>\n<X>%.12f</X>\n<Y>%.12f</Y>\n<Z>%.12f</Z>\n</origin>\n<direction>\n<X>%.12f</X>\n<Y>%.12f</Y>\n<Z>%.12f</Z>\n</direction>\n</Ray>',name,origin.X,origin.Y,origin.Z,direction.X,direction.Y,direction.Z)
end,
["BinaryString"] = function(name,val)
if val then
return '\n<BinaryString name="'..name..'"><![CDATA['..val..']]></BinaryString>'
else
return ""
end
end,
["ProtectedString"] = function(name,val)
return '\n<ProtectedString name="'..name..'">'..gsub(val,xmlReplacePattern,xmlReplace)..'</ProtectedString>'
end,
["SharedString"] = function(name,val)
return '\n<SharedString name="'..name..'">'..val..'</SharedString>'
end,
["SecurityCapabilities"] = function(name,val)
return format('\n<SecurityCapabilities name="%s">%d</SecurityCapabilities>',name,val or 0)
end,
}
local binaryDataTypes = {
["string"] = "\1",
["ContentId"] = "\1",
["BinaryString"] = "\1",
["bool"] = "\2",
["int"] = "\3",
["float"] = "\4",
["double"] = "\5",
["UDim"] = "\6",
["UDim2"] = "\7",
["Ray"] = "\8",
["Faces"] = "\9",
["Axes"] = "\10",
["BrickColor"] = "\11",
["Color3"] = "\12",
["Vector2"] = "\13",
["Vector3"] = "\14",
["CFrame"] = "\16",
["Enum"] = "\18",
["Referent"] = "\19",
["Vector3int16"] = "\20",
["NumberSequence"] = "\21",
["ColorSequence"] = "\22",
["NumberRange"] = "\23",
["Rect"] = "\24",
["PhysicalProperties"] = "\25",
["Color3uint8"] = "\26",
["int64"] = "\27",
["SharedString"] = "\28",
["OptionalCoordinateFrame"] = "\30",
["Font"] = "\32"
}
local binaryCFrameMap = {
["\0\0\128\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\63"] = "\2",
["\0\0\128\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\191\0\0\0\0\0\0\128\63\0\0\0\0"] = "\3",
["\0\0\128\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\191\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\191"] = "\5",
["\0\0\128\63\0\0\0\0\0\0\0\128\0\0\0\0\0\0\0\0\0\0\128\63\0\0\0\0\0\0\128\191\0\0\0\0"] = "\6",
["\0\0\0\0\0\0\128\63\0\0\0\0\0\0\128\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\191"] = "\7",
["\0\0\0\0\0\0\0\0\0\0\128\63\0\0\128\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\63\0\0\0\0"] = "\9",
["\0\0\0\0\0\0\128\191\0\0\0\0\0\0\128\63\0\0\0\0\0\0\0\128\0\0\0\0\0\0\0\0\0\0\128\63"] = "\10",
["\0\0\0\0\0\0\0\0\0\0\128\191\0\0\128\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\191\0\0\0\0"] = "\12",
["\0\0\0\0\0\0\128\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\63\0\0\128\63\0\0\0\0\0\0\0\0"] = "\13",
["\0\0\0\0\0\0\0\0\0\0\128\191\0\0\0\0\0\0\128\63\0\0\0\0\0\0\128\63\0\0\0\0\0\0\0\0"] = "\14",
["\0\0\0\0\0\0\128\191\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\191\0\0\128\63\0\0\0\0\0\0\0\0"] = "\16",
["\0\0\0\0\0\0\0\0\0\0\128\63\0\0\0\0\0\0\128\191\0\0\0\0\0\0\128\63\0\0\0\0\0\0\0\128"] = "\17",
["\0\0\128\191\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\191"] = "\20",
["\0\0\128\191\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\63\0\0\0\0\0\0\128\63\0\0\0\128"] = "\21",
["\0\0\128\191\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\191\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\63"] = "\23",
["\0\0\128\191\0\0\0\0\0\0\0\128\0\0\0\0\0\0\0\0\0\0\128\191\0\0\0\0\0\0\128\191\0\0\0\128"] = "\24",
["\0\0\0\0\0\0\128\63\0\0\0\128\0\0\128\191\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\63"] = "\25",
["\0\0\0\0\0\0\0\0\0\0\128\191\0\0\128\191\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\63\0\0\0\0"] = "\27",
["\0\0\0\0\0\0\128\191\0\0\0\128\0\0\128\191\0\0\0\0\0\0\0\128\0\0\0\0\0\0\0\0\0\0\128\191"] = "\28",
["\0\0\0\0\0\0\0\0\0\0\128\63\0\0\128\191\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\191\0\0\0\0"] = "\30",
["\0\0\0\0\0\0\128\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\191\0\0\128\191\0\0\0\0\0\0\0\0"] = "\31",
["\0\0\0\0\0\0\0\0\0\0\128\63\0\0\0\0\0\0\128\63\0\0\0\128\0\0\128\191\0\0\0\0\0\0\0\0"] = "\32",
["\0\0\0\0\0\0\128\191\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\63\0\0\128\191\0\0\0\0\0\0\0\0"] = "\34",
["\0\0\0\0\0\0\0\0\0\0\128\191\0\0\0\0\0\0\128\191\0\0\0\128\0\0\128\191\0\0\0\0\0\0\0\128"] = "\35",
}
local binaryPropHandlers = {
["string"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
result[i] = s_pack("<I4",#val)..val
end
return concat(result)
end,
["ContentId"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
--if sub(val,1,15) == "rbxgameasset://" then -- This doesn't load anymore
--val = format("https://assetdelivery.roblox.com/v1/asset?universeId=%d&assetName=%s&skipSigningScripts=1",gameId,urlEncode(httpService,sub(val,16)))
--end
result[i] = s_pack("<I4",#val)..val
end
return concat(result)
end,
["BinaryString"] = function(objs,name,func)
if not getbspval then return end
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val = getbspval(objs[i],name) or ""
result[i] = s_pack("<I4",#val)..val
end
return concat(result)
end,
["bool"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
result[i] = val and "\1" or "\0"
end
return concat(result)
end,
["int"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(4*szObjs)
local sep = szObjs-1
for i = 1,szObjs do
local start = i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local bytes = s_pack(">I4", val < 0 and 2 * -val - 1 or 2 * val)
for b = 1,4 do
result[start + b + sep*(b-1)] = sub(bytes,b,b)
end
end
return concat(result)
end,
["float"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(4*szObjs)
local sep = szObjs-1
for i = 1,szObjs do
local start = i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local bytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", val)), 1))
for b = 1,4 do
result[start + b + sep*(b-1)] = sub(bytes,b,b)
end
end
return concat(result)
end,
["double"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
result[i] = s_pack("<d", val)
end
return concat(result)
end,
["UDim"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(2*4*szObjs)
local sep = szObjs-1
local firstArrayEnd = 4*szObjs
for i = 1,szObjs do
local scaleStart = i-1
local offsetStart = firstArrayEnd + i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local offset = val.Offset
local scaleBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", val.Scale)), 1))
local offsetBytes = s_pack(">I4", offset < 0 and 2 * -offset - 1 or 2 * offset)
for b = 1,4 do
result[scaleStart + b + sep*(b-1)] = sub(scaleBytes,b,b)
result[offsetStart + b + sep*(b-1)] = sub(offsetBytes,b,b)
end
end
return concat(result)
end,
["UDim2"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(4*4*szObjs)
local sep = szObjs-1
local firstArrayEnd = 4*szObjs
local secondArrayEnd = 2*4*szObjs
local thirdArrayEnd = 3*4*szObjs
for i = 1,szObjs do
local xScaleStart = i-1
local yScaleStart = firstArrayEnd + i-1
local xOffsetStart = secondArrayEnd + i-1
local yOffsetStart = thirdArrayEnd + i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local x,y = val.X,val.Y
local xOffset = x.Offset
local yOffset = y.Offset
local xScaleBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", x.Scale)), 1))
local xOffsetBytes = s_pack(">I4", xOffset < 0 and 2 * -xOffset - 1 or 2 * xOffset)
local yScaleBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", y.Scale)), 1))
local yOffsetBytes = s_pack(">I4", yOffset < 0 and 2 * -yOffset - 1 or 2 * yOffset)
for b = 1,4 do
result[xScaleStart + b + sep*(b-1)] = sub(xScaleBytes,b,b)
result[xOffsetStart + b + sep*(b-1)] = sub(xOffsetBytes,b,b)
result[yScaleStart + b + sep*(b-1)] = sub(yScaleBytes,b,b)
result[yOffsetStart + b + sep*(b-1)] = sub(yOffsetBytes,b,b)
end
end
return concat(result)
end,
["Ray"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local origin = val.Origin
local dir = val.Direction
result[i] = s_pack("<ffffff", origin.X, origin.Y, origin.Z, dir.X, dir.Y, dir.Z)
end
return concat(result)
end,
["Faces"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local faceInt = (val.Front and 32 or 0) + (val.Bottom and 16 or 0) + (val.Left and 8 or 0) + (val.Back and 4 or 0) + (val.Top and 2 or 0) + (val.Right and 1 or 0)
result[i] = s_pack("b", faceInt)
end
return concat(result)
end,
["Axes"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local axisInt = (val.Z and 4 or 0) + (val.Y and 2 or 0) + (val.X and 1 or 0)
result[i] = s_pack("b", axisInt)
end
return concat(result)
end,
["BrickColor"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(4*szObjs)
local sep = szObjs-1
for i = 1,szObjs do
local start = i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local bytes = s_pack(">I4", val.Number)
for b = 1,4 do
result[start + b + sep*(b-1)] = sub(bytes,b,b)
end
end
return concat(result)
end,
["Color3"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(3*4*szObjs)
local sep = szObjs-1
local firstArrayEnd = 4*szObjs
local secondArrayEnd = 8*szObjs
for i = 1,szObjs do
local rStart = i-1
local gStart = firstArrayEnd + i-1
local bStart = secondArrayEnd + i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local rBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", val.R)), 1))
local gBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", val.G)), 1))
local bBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", val.B)), 1))
for b = 1,4 do
result[rStart + b + sep*(b-1)] = sub(rBytes,b,b)
result[gStart + b + sep*(b-1)] = sub(gBytes,b,b)
result[bStart + b + sep*(b-1)] = sub(bBytes,b,b)
end
end
return concat(result)
end,
["Vector2"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(2*4*szObjs)
local sep = szObjs-1
local firstArrayEnd = 4*szObjs
for i = 1,szObjs do
local xStart = i-1
local yStart = firstArrayEnd + i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local xBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", val.X)), 1))
local yBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", val.Y)), 1))
for b = 1,4 do
result[xStart + b + sep*(b-1)] = sub(xBytes,b,b)
result[yStart + b + sep*(b-1)] = sub(yBytes,b,b)
end
end
return concat(result)
end,
["Vector3"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(3*4*szObjs)
local sep = szObjs-1
local firstArrayEnd = 4*szObjs
local secondArrayEnd = 8*szObjs
for i = 1,szObjs do
local xStart = i-1
local yStart = firstArrayEnd + i-1
local zStart = secondArrayEnd + i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local xBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", val.X)), 1))
local yBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", val.Y)), 1))
local zBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", val.Z)), 1))
for b = 1,4 do
result[xStart + b + sep*(b-1)] = sub(xBytes,b,b)
result[yStart + b + sep*(b-1)] = sub(yBytes,b,b)
result[zStart + b + sep*(b-1)] = sub(zBytes,b,b)
end
end
return concat(result)
end,
["CFrame"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs + 3*4*szObjs)
local sep = szObjs-1
local posStart = szObjs
local firstArrayEnd = posStart + 4*szObjs
local secondArrayEnd = posStart + 8*szObjs
for i = 1,szObjs do
local xStart = posStart + i-1
local yStart = firstArrayEnd + i-1
local zStart = secondArrayEnd + i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local componentStr = s_pack("<fffffffff",select(4,components(val)))
result[i] = binaryCFrameMap[componentStr] or "\0"..componentStr
local pos = val.Position
local xBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", pos.X)), 1))
local yBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", pos.Y)), 1))
local zBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", pos.Z)), 1))
for b = 1,4 do
result[xStart + b + sep*(b-1)] = sub(xBytes,b,b)
result[yStart + b + sep*(b-1)] = sub(yBytes,b,b)
result[zStart + b + sep*(b-1)] = sub(zBytes,b,b)
end
end
return concat(result)
end,
["Enum"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(4*szObjs)
local sep = szObjs-1
for i = 1,szObjs do
local start = i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local bytes = s_pack(">I4", val.Value)
for b = 1,4 do
result[start + b + sep*(b-1)] = sub(bytes,b,b)
end
end
return concat(result)
end,
["Vector3int16"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
result[i] = s_pack("<i2i2i2", val.X, val.Y, val.Z)
end
return concat(result)
end,
["NumberSequence"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local numKeypoints = #val.Keypoints
result[i] = s_pack("<I4"..s_rep("fff",numKeypoints), numKeypoints, unpack(split(tostring(val)," ")))
end
return concat(result)
end,
["ColorSequence"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local numKeypoints = #val.Keypoints
result[i] = s_pack("<I4"..s_rep("fffff",numKeypoints), numKeypoints, unpack(split(tostring(val)," ")))
end
return concat(result)
end,
["NumberRange"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
result[i] = s_pack("<ff", val.Min, val.Max)
end
return concat(result)
end,
["Rect"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(4*4*szObjs)
local sep = szObjs-1
local firstArrayEnd = 4*szObjs
local secondArrayEnd = 2*4*szObjs
local thirdArrayEnd = 3*4*szObjs
for i = 1,szObjs do
local xMinStart = i-1
local yMinStart = firstArrayEnd + i-1
local xMaxStart = secondArrayEnd + i-1
local yMaxStart = thirdArrayEnd + i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local min = val.Min
local max = val.Max
local xMinBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", min.X)), 1))
local yMinBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", min.Y)), 1))
local xMaxBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", max.X)), 1))
local yMaxBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", max.Y)), 1))
for b = 1,4 do
result[xMinStart + b + sep*(b-1)] = sub(xMinBytes,b,b)
result[yMinStart + b + sep*(b-1)] = sub(yMinBytes,b,b)
result[xMaxStart + b + sep*(b-1)] = sub(xMaxBytes,b,b)
result[yMaxStart + b + sep*(b-1)] = sub(yMaxBytes,b,b)
end
end
return concat(result)
end,
["PhysicalProperties"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
if val then
result[i] = "\1"..s_pack("<fffff", val.Density, val.Friction, val.Elasticity, val.FrictionWeight, val.ElasticityWeight)
else
result[i] = "\0"
end
end
return concat(result)
end,
["Color3uint8"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(szObjs)
for i = 1,szObjs do
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
result[i] = "\1"..s_pack("<bbb", val.R, val.G, val.B)
end
return concat(result)
end,
["int64"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(8*szObjs)
local sep = szObjs-1
for i = 1,szObjs do
local start = i-1
local val
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
local bytes = s_pack(">I8", val < 0 and 2 * -val - 1 or 2 * val)
for b = 1,8 do
result[start + b + sep*(b-1)] = sub(bytes,b,b)
end
end
return concat(result)
end,
["OptionalCoordinateFrame"] = function(objs,name,func)
local szObjs = #objs
local result = tableCreate(1 + szObjs + 3*4*szObjs + 1 + szObjs)
local sep = szObjs-1
local posStart = szObjs
local firstArrayEnd = posStart + 4*szObjs
local secondArrayEnd = posStart + 8*szObjs
local thirdArrayEnd = posStart + 12*szObjs
local startOffset = 1
result[1] = "\16"
result[startOffset + thirdArrayEnd + 1] = "\2"
for i = 1,szObjs do
local xStart = startOffset + posStart + i-1
local yStart = startOffset + firstArrayEnd + i-1
local zStart = startOffset + secondArrayEnd + i-1
local boolPos = startOffset + thirdArrayEnd + i+1
local val,exists
if func then val = func(objs[i],name) elseif oldIndex then val = oldIndex(objs[i],name) else val = objs[i][name] end
if not val then exists = false val = CFrame.new() else exists = true end
local componentStr = s_pack("<fffffffff",select(4,components(val)))
result[startOffset + i] = binaryCFrameMap[componentStr] or "\0"..componentStr
local pos = val.Position
local xBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", pos.X)), 1))
local yBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", pos.Y)), 1))
local zBytes = s_pack(">I4", lrotate(s_unpack(">I4", s_pack(">f", pos.Z)), 1))
for b = 1,4 do
result[xStart + b + sep*(b-1)] = sub(xBytes,b,b)
result[yStart + b + sep*(b-1)] = sub(yBytes,b,b)
result[zStart + b + sep*(b-1)] = sub(zBytes,b,b)
end
result[boolPos] = exists and "\1" or "\0"
end
return concat(result)