Dark_Agent

RakNet-Spy

May 20th, 2026 (edited)
112
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 43.84 KB | Cybersecurity | 0 0
  1. --[[--
  2.  claude.ai & Discord: jor.sowb (684910725336268807) & Me (Farhat).
  3. --]]--
  4. local game = cloneref(game)
  5. if not game:IsLoaded() then game.Loaded:Wait() end
  6. if getgenv().RakNetSpyExecuted and type(getgenv().RakNetSpyShutdown) == "function" then
  7.     getgenv().RakNetSpyShutdown()
  8. end
  9.  
  10. local Players          = cloneref(game:GetService("Players"))
  11. local RunService       = cloneref(game:GetService("RunService"))
  12. local UserInputService = cloneref(game:GetService("UserInputService"))
  13. local TweenService     = cloneref(game:GetService("TweenService"))
  14. local TextService      = cloneref(game:GetService("TextService"))
  15. local CoreGui          = cloneref(game:GetService("CoreGui"))
  16. local GuiInset         = cloneref(game:GetService("GuiService")):GetGuiInset()
  17.  
  18. local autoexecscript = true
  19. local cloneref     = cloneref     or function(x) return x end
  20. local gethui       = gethui       or function() return CoreGui end
  21. local setclipboard = setclipboard or toclipboard or set_clipboard or function() end
  22.  
  23. local RN, RN_REAL = nil, false
  24. do
  25.     local function canCall(obj, field)
  26.         if obj == nil then return false end
  27.         local ok, v = pcall(function() return obj[field] end)
  28.         return ok and v ~= nil
  29.     end
  30.     local function tryGet(fn)
  31.         local ok, v = pcall(fn)
  32.         if not ok or v == nil then return nil end
  33.         if canCall(v, "add_send_hook") or canCall(v, "add_recv_hook") then return v end
  34.         return nil
  35.     end
  36.     RN = tryGet(function() return raknet end)
  37.         or tryGet(function() return getgenv().raknet end)
  38.         or tryGet(function() return getrenv and getrenv().raknet end)
  39.         or tryGet(function() return Raknet end)
  40.         or tryGet(function() return RakNet end)
  41.         or tryGet(function() return getgenv().RakNet end)
  42.         or tryGet(function() return syn and syn.raknet end)
  43.     if RN then
  44.         RN_REAL = true
  45.     else
  46.         RN = {
  47.             add_send_hook    = function() end,
  48.             add_recv_hook    = function() end,
  49.             remove_send_hook = function() end,
  50.             remove_recv_hook = function() end,
  51.         }
  52.     end
  53. end
  54.  
  55. local function tryInject(buf, priority, reliability, channel)
  56.     if not RN_REAL then return false end
  57.     local ok
  58.     ok = pcall(function() RN.send(buf, priority, reliability, channel) end); if ok then return true end
  59.     ok = pcall(function() RN.send_packet(buf) end);                          if ok then return true end
  60.     ok = pcall(function() RN:send_packet(buf) end);                          if ok then return true end
  61.     ok = pcall(function() raknet.send(buf, priority, reliability, channel) end); if ok then return true end
  62.     return false
  63. end
  64.  
  65. local function readPacket(p)
  66.     if p == nil then return nil, nil end
  67.     do
  68.         local id, buf
  69.         if pcall(function() id = p.PacketId; buf = p.AsBuffer end) and id ~= nil and buf ~= nil then
  70.             return id, buf
  71.         end
  72.     end
  73.     do
  74.         local id, buf
  75.         if pcall(function() id = p.Id; buf = p.Data end) and id ~= nil and buf ~= nil then
  76.             return id, buf
  77.         end
  78.     end
  79.     do
  80.         local id, buf
  81.         if pcall(function() buf = p; id = buffer.readu8(buf, 0) end) and id ~= nil then
  82.             return id, buf
  83.         end
  84.     end
  85.     if type(p) == "string" and #p >= 1 then
  86.         local id  = string.byte(p, 1)
  87.         local buf = buffer.create(#p)
  88.         for i = 1, #p do buffer.writeu8(buf, i - 1, string.byte(p, i)) end
  89.         return id, buf
  90.     end
  91.     return nil, nil
  92. end
  93.  
  94. local PKTNAME = {
  95.     [0x00] = "CONNECTED_PING",
  96.     [0x01] = "UNCONNECTED_PING",
  97.     [0x02] = "UNCONNECTED_PING_OPEN",
  98.     [0x03] = "CONNECTED_PONG",
  99.     [0x04] = "DETECT_LOST_CONN",
  100.     [0x05] = "OPEN_CONN_REQ_1",
  101.     [0x06] = "OPEN_CONN_REPLY_1",
  102.     [0x07] = "OPEN_CONN_REQ_2",
  103.     [0x08] = "OPEN_CONN_REPLY_2",
  104.     [0x09] = "CONNECTION_REQUEST",
  105.     [0x10] = "CONN_REQ_ACCEPTED",
  106.     [0x11] = "CONN_ATTEMPT_FAILED",
  107.     [0x12] = "ALREADY_CONNECTED",
  108.     [0x13] = "NEW_INCOMING_CONN",
  109.     [0x14] = "NO_FREE_INCOMING",
  110.     [0x15] = "DISCONNECT_NOTIF",
  111.     [0x16] = "CONNECTION_LOST",
  112.     [0x17] = "CONNECTION_BANNED",
  113.     [0x18] = "INVALID_PASSWORD",
  114.     [0x19] = "INCOMPATIBLE_PROTOCOL",
  115.     [0x1A] = "IP_RECENTLY_CONNECTED",
  116.     [0x1B] = "TIMESTAMP",
  117.     [0x1C] = "UNCONNECTED_PONG",
  118.     [0x1D] = "ADVERTISE_SYSTEM",
  119.     [0x20] = "DOWNLOAD_PROGRESS",
  120.     [0x51] = "MTU_PING_1",
  121.     [0x52] = "MTU_PING_2",
  122.     [0x53] = "MTU_PING_3",
  123.     [0x54] = "MTU_PONG_1",
  124.     [0x55] = "MTU_PONG_2",
  125.     [0x56] = "MTU_PONG_3",
  126.     [0x81] = "SET_GLOBALS",
  127.     [0x82] = "TEACH_DESCRIPTORS",
  128.     [0x83] = "DATA",
  129.     [0x84] = "MARKER",
  130.     [0x85] = "PHYSICS",
  131.     [0x86] = "TOUCHES",
  132.     [0x87] = "CHAT_ALL",
  133.     [0x88] = "CHAT_TEAM",
  134.     [0x89] = "REPORT_ABUSE",
  135.     [0x8A] = "SUBMIT_TICKET",
  136.     [0x8B] = "CHAT_GAME",
  137.     [0x8C] = "CHAT_PLAYER",
  138.     [0x8D] = "CLUSTER",
  139.     [0x8E] = "PROTOCOL_MISMATCH",
  140.     [0x8F] = "PREFERRED_SPAWN_NAME",
  141.     [0x90] = "PROTOCOL_SYNC",
  142.     [0x91] = "SCHEMA_SYNC",
  143.     [0x92] = "PLACEID_VERIFICATION",
  144.     [0x93] = "DICTIONARY_FORMAT",
  145.     [0x94] = "HASH_MISMATCH",
  146.     [0x95] = "SECURITYKEY_MISMATCH",
  147.     [0x96] = "REQUEST_STATS",
  148.     [0x97] = "NEW_SCHEMA",
  149.     [0x98] = "KICK_MESSAGE",
  150.     [0x9B] = "LUAU_CHALLENGE",
  151.     [0xA2] = "DATA_PING",
  152.     [0xA3] = "DATA_PING_BACK",
  153.     [0xA4] = "UNRELIABLE_DATA_PING",
  154.     [0xA7] = "EARLY_DATA_PING",
  155. }
  156.  
  157. local DATA_SUBNAMES = {
  158.     [0x01] = "DELETE_INST",
  159.     [0x02] = "NEW_INST",
  160.     [0x03] = "PROP",
  161.     [0x04] = "MARKER",
  162.     [0x05] = "PING",
  163.     [0x06] = "PING_BACK",
  164.     [0x07] = "EVENT",
  165.     [0x08] = "REQ_CHAR",
  166.     [0x09] = "ROCKY",
  167.     [0x0A] = "CFRAME_ACK",
  168.     [0x0B] = "JOIN_DATA",
  169.     [0x0C] = "CLIENT_QUOTA",
  170.     [0x0D] = "STREAM_DATA",
  171.     [0x0E] = "REGION_REMOVAL",
  172.     [0x0F] = "INST_REMOVAL",
  173.     [0x10] = "TAG",
  174.     [0x11] = "STATS",
  175.     [0x12] = "HASH",
  176.     [0x13] = "ATOMIC",
  177.     [0x14] = "STREAM_DATA_INFO",
  178.     [0x16] = "SCHEMA_DATA",
  179. }
  180.  
  181. local function getPktName(id)
  182.     return PKTNAME[id] or string.format("UNKNOWN_%02X", id)
  183. end
  184.  
  185. local function bufToBytes(buf)
  186.     local t = {}
  187.     for i = 0, buffer.len(buf) - 1 do t[i + 1] = buffer.readu8(buf, i) end
  188.     return t
  189. end
  190.  
  191. local function hexStrToBytes(str)
  192.     local t = {}
  193.     for tok in str:gmatch("[%da-fA-F]+") do
  194.         local n = tonumber(tok, 16)
  195.         if n then t[#t + 1] = math.clamp(n, 0, 255) end
  196.     end
  197.     return t
  198. end
  199.  
  200. local function bytesToHexStr(t)
  201.     local out = {}
  202.     for _, v in ipairs(t) do out[#out + 1] = string.format("%02X", v) end
  203.     return table.concat(out, " ")
  204. end
  205.  
  206. local function fmtHexDump(buf)
  207.     local n, lines = buffer.len(buf), {}
  208.     local i = 0
  209.     while i < n do
  210.         local hex, asc = {}, {}
  211.         for col = 0, 15 do
  212.             if i + col < n then
  213.                 local b = buffer.readu8(buf, i + col)
  214.                 hex[#hex + 1] = string.format("%02X", b)
  215.                 asc[#asc + 1] = (b >= 32 and b <= 126) and string.char(b) or "."
  216.             else
  217.                 hex[#hex + 1] = "  "
  218.                 asc[#asc + 1] = " "
  219.             end
  220.         end
  221.         lines[#lines + 1] = string.format("%04X   %-47s  |%s|", i, table.concat(hex, " "), table.concat(asc))
  222.         i = i + 16
  223.     end
  224.     return table.concat(lines, "\n")
  225. end
  226.  
  227. local function tryDecodeDataSubs(buf)
  228.     if buffer.len(buf) < 2 then return nil end
  229.     local subId   = buffer.readu8(buf, 1)
  230.     local subName = DATA_SUBNAMES[subId]
  231.     if subName then
  232.         return string.format("  DATA sub: 0x%02X  %s", subId, subName)
  233.     end
  234.     return nil
  235. end
  236.  
  237. local function Create(class, props, children)
  238.     local obj = Instance.new(class)
  239.     for k, v in next, props or {} do obj[k] = v end
  240.     for _, c in next, children or {} do c.Parent = obj end
  241.     return obj
  242. end
  243.  
  244. local MAX_LOG     = 500
  245. local MIN_W       = 460
  246. local MIN_H       = 280
  247. local layoutOrder = 999999999
  248. local remoteLogs  = {}
  249. local selected    = nil
  250. getgenv().blacklist   = {}
  251. getgenv().blocklist   = {}
  252. local connections = {}
  253. local mainClosing = false
  254. local closed      = false
  255. local sideClosing = false
  256. local sideClosed  = false
  257. local capturing   = true
  258.  
  259. local ScreenGui = Create("ScreenGui", {
  260.     ResetOnSpawn       = false,
  261.     Enabled            = false,
  262.     ZIndexBehavior     = Enum.ZIndexBehavior.Sibling,
  263.     IgnoreGuiInset     = false,
  264. })
  265.  
  266. local Background = Create("Frame", {
  267.     Parent               = ScreenGui,
  268.     BackgroundTransparency = 1,
  269.     Position             = UDim2.new(0, 460, 0, 180),
  270.     Size                 = UDim2.new(0, 460, 0, 280),
  271.     ClipsDescendants     = false,
  272. })
  273.  
  274. local TopBar = Create("Frame", {
  275.     Parent          = Background,
  276.     BackgroundColor3 = Color3.fromRGB(37, 35, 38),
  277.     BorderSizePixel = 0,
  278.     Size            = UDim2.new(0, 460, 0, 19),
  279. })
  280.  
  281. local TitleBtn = Create("TextButton", {
  282.     Parent              = TopBar,
  283.     BackgroundTransparency = 1,
  284.     AutoButtonColor     = false,
  285.     Position            = UDim2.new(0, 6, 0, 0),
  286.     Size                = UDim2.new(0, 110, 1, 0),
  287.     Font                = Enum.Font.SourceSansBold,
  288.     Text                = "RakNet Spy",
  289.     TextColor3          = Color3.new(1, 1, 1),
  290.     TextSize            = 14,
  291.     TextXAlignment      = Enum.TextXAlignment.Left,
  292. })
  293.  
  294. local CloseButton = Create("TextButton", {
  295.     Parent          = TopBar,
  296.     BackgroundColor3 = Color3.fromRGB(37, 36, 38),
  297.     BorderSizePixel = 0,
  298.     Position        = UDim2.new(1, -19, 0, 0),
  299.     Size            = UDim2.new(0, 19, 1, 0),
  300.     AutoButtonColor = false,
  301.     Text            = "",
  302. })
  303. Create("ImageLabel", {
  304.     Parent               = CloseButton,
  305.     BackgroundTransparency = 1,
  306.     Position             = UDim2.new(0, 5, 0, 5),
  307.     Size                 = UDim2.new(0, 9, 0, 9),
  308.     Image                = "rbxassetid://5597086202",
  309. })
  310.  
  311. local MaximizeButton = Create("TextButton", {
  312.     Parent          = TopBar,
  313.     BackgroundColor3 = Color3.fromRGB(37, 36, 38),
  314.     BorderSizePixel = 0,
  315.     Position        = UDim2.new(1, -38, 0, 0),
  316.     Size            = UDim2.new(0, 19, 1, 0),
  317.     AutoButtonColor = false,
  318.     Text            = "",
  319. })
  320. Create("ImageLabel", {
  321.     Parent               = MaximizeButton,
  322.     BackgroundTransparency = 1,
  323.     Position             = UDim2.new(0, 5, 0, 5),
  324.     Size                 = UDim2.new(0, 9, 0, 9),
  325.     Image                = "rbxassetid://5597108117",
  326. })
  327.  
  328. local MinimizeButton = Create("TextButton", {
  329.     Parent          = TopBar,
  330.     BackgroundColor3 = Color3.fromRGB(37, 36, 38),
  331.     BorderSizePixel = 0,
  332.     Position        = UDim2.new(1, -57, 0, 0),
  333.     Size            = UDim2.new(0, 19, 1, 0),
  334.     AutoButtonColor = false,
  335.     Text            = "",
  336. })
  337. Create("ImageLabel", {
  338.     Parent               = MinimizeButton,
  339.     BackgroundTransparency = 1,
  340.     Position             = UDim2.new(0, 5, 0, 5),
  341.     Size                 = UDim2.new(0, 9, 0, 9),
  342.     Image                = "rbxassetid://5597105827",
  343. })
  344.  
  345. local LeftPanel = Create("Frame", {
  346.     Parent          = Background,
  347.     BackgroundColor3 = Color3.fromRGB(53, 52, 55),
  348.     BorderSizePixel = 0,
  349.     Position        = UDim2.new(0, 0, 0, 19),
  350.     Size            = UDim2.new(0, 160, 0, 261),
  351. })
  352.  
  353. local TableHeader = Create("Frame", {
  354.     Parent          = LeftPanel,
  355.     BackgroundColor3 = Color3.fromRGB(30, 29, 32),
  356.     BorderSizePixel = 0,
  357.     Size            = UDim2.new(1, 0, 0, 17),
  358. })
  359.  
  360. local function mkHeader(text, xOff, w, xAlign)
  361.     return Create("TextLabel", {
  362.         Parent               = TableHeader,
  363.         BackgroundTransparency = 1,
  364.         Position             = UDim2.new(0, xOff, 0, 0),
  365.         Size                 = UDim2.new(0, w, 1, 0),
  366.         Font                 = Enum.Font.SourceSansBold,
  367.         Text                 = text,
  368.         TextColor3           = Color3.fromRGB(160, 160, 170),
  369.         TextSize             = 11,
  370.         TextXAlignment       = xAlign or Enum.TextXAlignment.Left,
  371.         TextTruncate         = Enum.TextTruncate.AtEnd,
  372.     })
  373. end
  374. mkHeader("  ID",  0,   30)
  375. mkHeader("Name",  32,  90)
  376. mkHeader("Size",  124, 34, Enum.TextXAlignment.Right)
  377.  
  378. local DirLegend = Create("Frame", {
  379.     Parent          = LeftPanel,
  380.     BackgroundColor3 = Color3.fromRGB(30, 29, 32),
  381.     BorderSizePixel = 0,
  382.     Position        = UDim2.new(0, 0, 0, 17),
  383.     Size            = UDim2.new(1, 0, 0, 10),
  384. })
  385. Create("Frame",     {Parent=DirLegend, BackgroundColor3=Color3.fromRGB(99,86,245),
  386.     BorderSizePixel=0, Position=UDim2.new(0,4,0,3),  Size=UDim2.new(0,3,0,4)})
  387. Create("TextLabel", {Parent=DirLegend, BackgroundTransparency=1,
  388.     Position=UDim2.new(0,9,0,0),  Size=UDim2.new(0,28,1,0),
  389.     Font=Enum.Font.SourceSans, Text="SEND", TextColor3=Color3.fromRGB(130,130,200),
  390.     TextSize=9, TextXAlignment=Enum.TextXAlignment.Left})
  391. Create("Frame",     {Parent=DirLegend, BackgroundColor3=Color3.fromRGB(50,200,100),
  392.     BorderSizePixel=0, Position=UDim2.new(0,42,0,3), Size=UDim2.new(0,3,0,4)})
  393. Create("TextLabel", {Parent=DirLegend, BackgroundTransparency=1,
  394.     Position=UDim2.new(0,48,0,0), Size=UDim2.new(0,28,1,0),
  395.     Font=Enum.Font.SourceSans, Text="RECV", TextColor3=Color3.fromRGB(130,200,130),
  396.     TextSize=9, TextXAlignment=Enum.TextXAlignment.Left})
  397. Create("Frame",     {Parent=DirLegend, BackgroundColor3=Color3.fromRGB(255,60,60),
  398.     BorderSizePixel=0, Position=UDim2.new(0,82,0,3), Size=UDim2.new(0,3,0,4)})
  399. Create("TextLabel", {Parent=DirLegend, BackgroundTransparency=1,
  400.     Position=UDim2.new(0,88,0,0), Size=UDim2.new(0,50,1,0),
  401.     Font=Enum.Font.SourceSans, Text="BLOCKED", TextColor3=Color3.fromRGB(255,100,100),
  402.     TextSize=9, TextXAlignment=Enum.TextXAlignment.Left})
  403.  
  404. local LogList = Create("ScrollingFrame", {
  405.     Parent                  = LeftPanel,
  406.     Active                  = true,
  407.     BackgroundTransparency  = 1,
  408.     BorderSizePixel         = 0,
  409.     Position                = UDim2.new(0, 0, 0, 27),
  410.     Size                    = UDim2.new(1, 0, 1, -36),
  411.     CanvasSize              = UDim2.new(0, 0, 0, 0),
  412.     ScrollBarThickness      = 3,
  413.     ScrollBarImageColor3    = Color3.fromRGB(99, 86, 245),
  414. })
  415. Create("UIListLayout", {
  416.     Parent             = LogList,
  417.     SortOrder          = Enum.SortOrder.LayoutOrder,
  418.     HorizontalAlignment = Enum.HorizontalAlignment.Center,
  419. })
  420.  
  421. local StatusBar = Create("Frame", {
  422.     Parent          = LeftPanel,
  423.     BackgroundColor3 = Color3.fromRGB(30, 29, 32),
  424.     BorderSizePixel = 0,
  425.     AnchorPoint     = Vector2.new(0, 1),
  426.     Position        = UDim2.new(0, 0, 1, 0),
  427.     Size            = UDim2.new(1, 0, 0, 9),
  428. })
  429. local StatusLabel = Create("TextLabel", {
  430.     Parent               = StatusBar,
  431.     BackgroundTransparency = 1,
  432.     Position             = UDim2.new(0, 3, 0, 0),
  433.     Size                 = UDim2.new(1, -3, 1, 0),
  434.     Font                 = Enum.Font.SourceSans,
  435.     Text                 = "Ready",
  436.     TextColor3           = Color3.fromRGB(150, 150, 160),
  437.     TextSize             = 9,
  438.     TextXAlignment       = Enum.TextXAlignment.Left,
  439.     TextTruncate         = Enum.TextTruncate.AtEnd,
  440. })
  441.  
  442. local RightPanel = Create("Frame", {
  443.     Parent          = Background,
  444.     BackgroundColor3 = Color3.fromRGB(37, 36, 38),
  445.     BorderSizePixel = 0,
  446.     Position        = UDim2.new(0, 160, 0, 19),
  447.     Size            = UDim2.new(0, 300, 0, 261),
  448. })
  449.  
  450. local CodeBox = Create("Frame", {
  451.     Parent          = RightPanel,
  452.     BackgroundColor3 = Color3.fromRGB(21, 19, 20),
  453.     BorderSizePixel = 0,
  454.     Size            = UDim2.new(1, 0, 0, 155),
  455. })
  456.  
  457. local CodeScroll = Create("ScrollingFrame", {
  458.     Parent                  = CodeBox,
  459.     BackgroundTransparency  = 1,
  460.     BorderSizePixel         = 0,
  461.     Size                    = UDim2.new(1, 0, 1, 0),
  462.     CanvasSize              = UDim2.new(0, 0, 0, 0),
  463.     ScrollBarThickness      = 3,
  464.     ScrollBarImageColor3    = Color3.fromRGB(99, 86, 245),
  465. })
  466.  
  467. local CodeLabel = Create("TextLabel", {
  468.     Parent               = CodeScroll,
  469.     BackgroundTransparency = 1,
  470.     Position             = UDim2.new(0, 4, 0, 2),
  471.     Size                 = UDim2.new(1, -8, 0, 0),
  472.     Font                 = Enum.Font.RobotoMono,
  473.     Text                 = "",
  474.     TextColor3           = Color3.fromRGB(210, 210, 210),
  475.     TextSize             = 11,
  476.     TextXAlignment       = Enum.TextXAlignment.Left,
  477.     TextYAlignment       = Enum.TextYAlignment.Top,
  478.     TextWrapped          = false,
  479.     RichText             = false,
  480. })
  481.  
  482. local ButtonsScroll = Create("ScrollingFrame", {
  483.     Parent               = RightPanel,
  484.     Active               = true,
  485.     BackgroundTransparency = 1,
  486.     BorderSizePixel      = 0,
  487.     Position             = UDim2.new(0, 0, 0, 155),
  488.     Size                 = UDim2.new(1, 0, 1, -155),
  489.     CanvasSize           = UDim2.new(0, 0, 0, 0),
  490.     ScrollBarThickness   = 3,
  491. })
  492.  
  493. local UIGridLayout = Create("UIGridLayout", {
  494.     Parent              = ButtonsScroll,
  495.     HorizontalAlignment = Enum.HorizontalAlignment.Center,
  496.     SortOrder           = Enum.SortOrder.LayoutOrder,
  497.     CellPadding         = UDim2.new(0, 2, 0, 2),
  498.     CellSize            = UDim2.new(0, 94, 0, 27),
  499. })
  500.  
  501. local ResizeHandle = Create("Frame", {
  502.     Parent               = Background,
  503.     BackgroundColor3     = Color3.fromRGB(80, 70, 200),
  504.     BackgroundTransparency = 0.4,
  505.     BorderSizePixel      = 0,
  506.     AnchorPoint          = Vector2.new(1, 1),
  507.     Position             = UDim2.new(1, 0, 1, 0),
  508.     Size                 = UDim2.new(0, 8, 0, 8),
  509.     ZIndex               = 6,
  510. })
  511.  
  512. local ToolTip = Create("Frame", {
  513.     Parent               = ScreenGui,
  514.     BackgroundColor3     = Color3.fromRGB(26, 26, 26),
  515.     BackgroundTransparency = 0.1,
  516.     BorderColor3         = Color3.new(1, 1, 1),
  517.     Size                 = UDim2.new(0, 200, 0, 30),
  518.     ZIndex               = 10,
  519.     Visible              = false,
  520. })
  521. local ToolTipLabel = Create("TextLabel", {
  522.     Parent               = ToolTip,
  523.     BackgroundTransparency = 1,
  524.     Position             = UDim2.new(0, 3, 0, 2),
  525.     Size                 = UDim2.new(1, -6, 1, -4),
  526.     ZIndex               = 10,
  527.     Font                 = Enum.Font.SourceSans,
  528.     Text                 = "",
  529.     TextColor3           = Color3.new(1, 1, 1),
  530.     TextSize             = 13,
  531.     TextWrapped          = true,
  532.     TextXAlignment       = Enum.TextXAlignment.Left,
  533.     TextYAlignment       = Enum.TextYAlignment.Top,
  534. })
  535.  
  536. local function setStatus(txt)
  537.     StatusLabel.Text = txt
  538. end
  539.  
  540. local function setCode(txt)
  541.     CodeLabel.Text = txt
  542.     local ts = TextService:GetTextSize(txt, CodeLabel.TextSize, CodeLabel.Font,
  543.         Vector2.new(math.max(CodeScroll.AbsoluteSize.X - 8, 100), math.huge))
  544.     CodeLabel.Size   = UDim2.new(1, -8, 0, ts.Y + 4)
  545.     CodeScroll.CanvasSize = UDim2.new(0, ts.X + 8, 0, ts.Y + 4)
  546. end
  547.  
  548. local function updateRemoteCanvas()
  549.     local ll = LogList:FindFirstChildOfClass("UIListLayout")
  550.     if ll then
  551.         LogList.CanvasSize = UDim2.fromOffset(ll.AbsoluteContentSize.X, ll.AbsoluteContentSize.Y)
  552.     end
  553. end
  554.  
  555. local function updateButtonCanvas()
  556.     ButtonsScroll.CanvasSize = UDim2.fromOffset(
  557.         UIGridLayout.AbsoluteContentSize.X,
  558.         UIGridLayout.AbsoluteContentSize.Y
  559.     )
  560. end
  561.  
  562. local function makeToolTip(enable, text)
  563.     if enable and text then
  564.         ToolTipLabel.Text = text
  565.         local ts = TextService:GetTextSize(text, 13, Enum.Font.SourceSans, Vector2.new(220, math.huge))
  566.         ToolTip.Size = UDim2.new(0, ts.X + 6, 0, ts.Y + 4)
  567.         if not connections["tooltip_move"] then
  568.             connections["tooltip_move"] = RunService.RenderStepped:Connect(function()
  569.                 local mp = UserInputService:GetMouseLocation()
  570.                 local vp = workspace.CurrentCamera.ViewportSize
  571.                 local tl = mp + Vector2.new(14, -8)
  572.                 local br = tl + ToolTip.AbsoluteSize
  573.                 if br.X > vp.X then tl = Vector2.new(vp.X - ToolTip.AbsoluteSize.X, tl.Y) end
  574.                 if br.Y > vp.Y then tl = Vector2.new(tl.X, mp.Y - ToolTip.AbsoluteSize.Y - 4) end
  575.                 ToolTip.Position = UDim2.fromOffset(tl.X, tl.Y)
  576.             end)
  577.         end
  578.         ToolTip.Visible = true
  579.     else
  580.         ToolTip.Visible = false
  581.         if connections["tooltip_move"] then
  582.             connections["tooltip_move"]:Disconnect()
  583.             connections["tooltip_move"] = nil
  584.         end
  585.     end
  586. end
  587.  
  588. local COL_SEND    = Color3.fromRGB(99,  86,  245)
  589. local COL_RECV    = Color3.fromRGB(50,  200, 100)
  590. local COL_BLOCKED = Color3.fromRGB(255, 60,  60)
  591.  
  592. local function newPacketRow(data)
  593.     if layoutOrder < 1 then layoutOrder = 999999999 end
  594.  
  595.     local idHex    = string.format("%02X", data.packetId)
  596.     local name     = getPktName(data.packetId)
  597.     local sizeS    = tostring(data.size)
  598.     local isBlocked = data.blocked
  599.     local dirClr   = isBlocked and COL_BLOCKED
  600.                      or (data.direction == "RECV" and COL_RECV or COL_SEND)
  601.     local textClr  = isBlocked and Color3.fromRGB(255, 150, 150) or Color3.fromRGB(210, 210, 210)
  602.     local idClr    = isBlocked and Color3.fromRGB(255, 100, 100) or Color3.fromRGB(170, 130, 255)
  603.  
  604.     local Row = Create("Frame", {
  605.         LayoutOrder     = layoutOrder,
  606.         Parent          = LogList,
  607.         BackgroundColor3 = Color3.fromRGB(47, 46, 49),
  608.         BorderSizePixel = 0,
  609.         Size            = UDim2.new(1, 0, 0, 17),
  610.     })
  611.  
  612.     Create("Frame", {
  613.         Parent          = Row,
  614.         BackgroundColor3 = dirClr,
  615.         BorderSizePixel = 0,
  616.         Position        = UDim2.new(0, 0, 0, 1),
  617.         Size            = UDim2.new(0, 3, 1, -2),
  618.     })
  619.     Create("TextLabel", {
  620.         Parent               = Row,
  621.         BackgroundTransparency = 1,
  622.         Position             = UDim2.new(0, 6, 0, 0),
  623.         Size                 = UDim2.new(0, 24, 1, 0),
  624.         Font                 = Enum.Font.RobotoMono,
  625.         Text                 = idHex,
  626.         TextColor3           = idClr,
  627.         TextSize             = 11,
  628.         TextXAlignment       = Enum.TextXAlignment.Left,
  629.     })
  630.     Create("TextLabel", {
  631.         Parent               = Row,
  632.         BackgroundTransparency = 1,
  633.         Position             = UDim2.new(0, 32, 0, 0),
  634.         Size                 = UDim2.new(0, 90, 1, 0),
  635.         Font                 = Enum.Font.SourceSans,
  636.         Text                 = name,
  637.         TextColor3           = textClr,
  638.         TextSize             = 11,
  639.         TextXAlignment       = Enum.TextXAlignment.Left,
  640.         TextTruncate         = Enum.TextTruncate.AtEnd,
  641.     })
  642.     Create("TextLabel", {
  643.         Parent               = Row,
  644.         BackgroundTransparency = 1,
  645.         Position             = UDim2.new(0, 124, 0, 0),
  646.         Size                 = UDim2.new(0, 34, 1, 0),
  647.         Font                 = Enum.Font.RobotoMono,
  648.         Text                 = sizeS,
  649.         TextColor3           = Color3.fromRGB(130, 200, 130),
  650.         TextSize             = 11,
  651.         TextXAlignment       = Enum.TextXAlignment.Right,
  652.     })
  653.  
  654.     local Btn = Create("TextButton", {
  655.         Parent               = Row,
  656.         BackgroundTransparency = 1,
  657.         BorderSizePixel      = 0,
  658.         Size                 = UDim2.new(1, 0, 1, 0),
  659.         AutoButtonColor      = false,
  660.         Text                 = "",
  661.     })
  662.  
  663.     local log = {
  664.         packetId    = data.packetId,
  665.         name        = name,
  666.         size        = data.size,
  667.         priority    = data.priority,
  668.         reliability = data.reliability,
  669.         channel     = data.channel,
  670.         hexStr      = data.hexStr,
  671.         hexDump     = data.hexDump,
  672.         subInfo     = data.subInfo,
  673.         buf         = data.buf,
  674.         time        = data.time,
  675.         direction   = data.direction,
  676.         blocked     = isBlocked,
  677.         Row         = Row,
  678.     }
  679.  
  680.     Btn.MouseButton1Click:Connect(function()
  681.         if selected then
  682.             pcall(function() selected.Row.BackgroundColor3 = Color3.fromRGB(47, 46, 49) end)
  683.         end
  684.         selected = log
  685.         Row.BackgroundColor3 = Color3.fromRGB(65, 63, 100)
  686.  
  687.         local blockedLine = isBlocked and "  *** BLOCKED (return false) ***\n" or ""
  688.         local subLine     = data.subInfo and ("\n" .. data.subInfo) or ""
  689.         local detail = string.format(
  690.             "[%s]  ID: 0x%02X  %s\n%sSize: %d  Priority: %s  Reliability: %s  Channel: %s\nTime: %.4f%s\n\n-- Hex Dump --\n%s",
  691.             data.direction, data.packetId, name,
  692.             blockedLine,
  693.             data.size, tostring(data.priority), tostring(data.reliability), tostring(data.channel),
  694.             data.time, subLine,
  695.             data.hexDump or ""
  696.         )
  697.         setCode(detail)
  698.         if sideClosed then task.spawn(toggleSideTray) end
  699.     end)
  700.  
  701.     Btn.MouseEnter:Connect(function()
  702.         if selected ~= log then
  703.             Row.BackgroundColor3 = Color3.fromRGB(58, 57, 62)
  704.         end
  705.         makeToolTip(true, string.format("[%s%s] 0x%02X  %s  |  %d bytes",
  706.             data.direction, isBlocked and " BLOCKED" or "",
  707.             data.packetId, name, data.size))
  708.     end)
  709.     Btn.MouseLeave:Connect(function()
  710.         if selected ~= log then
  711.             Row.BackgroundColor3 = Color3.fromRGB(47, 46, 49)
  712.         end
  713.         makeToolTip(false)
  714.     end)
  715.  
  716.     layoutOrder -= 1
  717.     table.insert(remoteLogs, 1, Row)
  718.     if #remoteLogs > MAX_LOG then
  719.         local old = table.remove(remoteLogs, #remoteLogs)
  720.         if old and old.Parent then old:Destroy() end
  721.     end
  722.     updateRemoteCanvas()
  723. end
  724.  
  725. local function processPacket(p, direction, blocked)
  726.     if not capturing then return end
  727.     local packetId, buf = readPacket(p)
  728.     if packetId == nil or buf == nil then return end
  729.     if blacklist[packetId] then return end
  730.  
  731.     local sizeVal    = buffer.len(buf)
  732.     local bytes      = bufToBytes(buf)
  733.     local hexStr     = bytesToHexStr(bytes)
  734.     local hexDump    = fmtHexDump(buf)
  735.     local priority, reliability, channel = 0, 0, 0
  736.     pcall(function()
  737.         priority    = p.Priority        or 0
  738.         reliability = p.Reliability     or 0
  739.         channel     = p.OrderingChannel or p.Channel or 0
  740.     end)
  741.  
  742.     local subInfo = nil
  743.     if packetId == 0x83 then
  744.         subInfo = tryDecodeDataSubs(buf)
  745.     end
  746.  
  747.     newPacketRow({
  748.         packetId    = packetId,
  749.         size        = sizeVal,
  750.         priority    = priority,
  751.         reliability = reliability,
  752.         channel     = channel,
  753.         hexStr      = hexStr,
  754.         hexDump     = hexDump,
  755.         subInfo     = subInfo,
  756.         buf         = buf,
  757.         time        = tick(),
  758.         direction   = direction,
  759.         blocked     = blocked or false,
  760.     })
  761. end
  762.  
  763. if RN_REAL then
  764.     pcall(function()
  765.         RN.add_send_hook(function(p)
  766.             local packetId = readPacket(p)
  767.             if packetId ~= nil and blocklist[packetId] then
  768.                 processPacket(p, "SEND", true)
  769.                 return false
  770.             end
  771.             processPacket(p, "SEND", false)
  772.         end)
  773.     end)
  774.     pcall(function()
  775.         RN.add_recv_hook(function(p)
  776.             processPacket(p, "RECV", false)
  777.         end)
  778.     end)
  779. end
  780.  
  781. local function newButton(name, tipFn, onClick)
  782.     local FT = Create("Frame", {
  783.         Parent               = ButtonsScroll,
  784.         BackgroundTransparency = 1,
  785.         Size                 = UDim2.new(0, 94, 0, 23),
  786.     })
  787.     Create("Frame", {
  788.         Parent          = FT,
  789.         BackgroundColor3 = Color3.new(1, 1, 1),
  790.         BorderSizePixel = 0,
  791.         Position        = UDim2.new(0, 6, 0, 8),
  792.         Size            = UDim2.new(0, 5, 0, 16),
  793.         ZIndex          = 2,
  794.     })
  795.     Create("TextLabel", {
  796.         Parent               = FT,
  797.         BackgroundTransparency = 1,
  798.         Position             = UDim2.new(0, 16, 0, 8),
  799.         Size                 = UDim2.new(0, 68, 0, 16),
  800.         Font                 = Enum.Font.SourceSans,
  801.         Text                 = name,
  802.         TextColor3           = Color3.new(1, 1, 1),
  803.         TextSize             = 13,
  804.         TextXAlignment       = Enum.TextXAlignment.Left,
  805.         ZIndex               = 2,
  806.         TextTruncate         = Enum.TextTruncate.AtEnd,
  807.     })
  808.     local Btn = Create("TextButton", {
  809.         Parent               = FT,
  810.         BackgroundColor3     = Color3.new(0, 0, 0),
  811.         BackgroundTransparency = 0.7,
  812.         BorderColor3         = Color3.new(1, 1, 1),
  813.         Position             = UDim2.new(0, 6, 0, 8),
  814.         Size                 = UDim2.new(0, 82, 0, 16),
  815.         AutoButtonColor      = false,
  816.         Text                 = "",
  817.     })
  818.     Btn.MouseEnter:Connect(function() makeToolTip(true,  tipFn()) end)
  819.     Btn.MouseLeave:Connect(function() makeToolTip(false)          end)
  820.     Btn.MouseButton1Click:Connect(onClick)
  821.     updateButtonCanvas()
  822. end
  823.  
  824. local function maximizeSize(speed)
  825.     speed    = speed or 0.05
  826.     local bH = Background.AbsoluteSize.Y - TopBar.AbsoluteSize.Y
  827.     local lW  = LeftPanel.AbsoluteSize.X
  828.     local bW  = Background.AbsoluteSize.X
  829.     TweenService:Create(LeftPanel,     TweenInfo.new(speed), {Size = UDim2.fromOffset(lW,      bH)}):Play()
  830.     TweenService:Create(RightPanel,    TweenInfo.new(speed), {Size = UDim2.fromOffset(bW - lW, bH)}):Play()
  831.     TweenService:Create(TopBar,        TweenInfo.new(speed), {Size = UDim2.fromOffset(bW,      19)}):Play()
  832.     TweenService:Create(CodeBox,       TweenInfo.new(speed), {Size = UDim2.fromOffset(bW - lW, bH - 106)}):Play()
  833.     TweenService:Create(ButtonsScroll, TweenInfo.new(speed), {
  834.         Position = UDim2.fromOffset(0, bH - 106),
  835.         Size     = UDim2.fromOffset(bW - lW, 106),
  836.     }):Play()
  837.     TweenService:Create(LogList,       TweenInfo.new(speed), {Size = UDim2.fromOffset(lW, bH - 36)}):Play()
  838. end
  839.  
  840. local function minimizeSize(speed)
  841.     speed    = speed or 0.05
  842.     local bH = Background.AbsoluteSize.Y - TopBar.AbsoluteSize.Y
  843.     local lW  = LeftPanel.AbsoluteSize.X
  844.     TweenService:Create(LeftPanel,  TweenInfo.new(speed), {Size = UDim2.fromOffset(lW, bH)}):Play()
  845.     TweenService:Create(RightPanel, TweenInfo.new(speed), {Size = UDim2.fromOffset(0,  bH)}):Play()
  846.     TweenService:Create(TopBar,     TweenInfo.new(speed), {Size = UDim2.fromOffset(lW, 19)}):Play()
  847.     TweenService:Create(LogList,    TweenInfo.new(speed), {Size = UDim2.fromOffset(lW, bH - 36)}):Play()
  848. end
  849.  
  850. local function bringBackOnResize()
  851.     local vp  = workspace.CurrentCamera.ViewportSize
  852.     local cx  = Background.AbsolutePosition.X
  853.     local cy  = Background.AbsolutePosition.Y
  854.     local minW = sideClosed and LeftPanel.AbsoluteSize.X or Background.AbsoluteSize.X
  855.     cx = math.clamp(cx, 0, vp.X - minW)
  856.     cy = math.clamp(cy, 0, vp.Y - Background.AbsoluteSize.Y - GuiInset.Y)
  857.     TweenService:Create(Background, TweenInfo.new(0.1), {Position = UDim2.new(0, cx, 0, cy)}):Play()
  858. end
  859.  
  860. local function validateSize()
  861.     local x  = math.max(Background.AbsoluteSize.X, MIN_W)
  862.     local y  = math.max(Background.AbsoluteSize.Y, MIN_H)
  863.     local vp = workspace.CurrentCamera.ViewportSize
  864.     x = math.min(x, vp.X - Background.AbsolutePosition.X)
  865.     y = math.min(y, vp.Y - Background.AbsolutePosition.Y - GuiInset.Y)
  866.     x = math.max(x, MIN_W)
  867.     y = math.max(y, MIN_H)
  868.     Background.Size = UDim2.fromOffset(x, y)
  869. end
  870.  
  871. local function isInResizeRange(mousePos)
  872.     local rel   = mousePos - Background.AbsolutePosition
  873.     local bW    = Background.AbsoluteSize.X
  874.     local bH    = Background.AbsoluteSize.Y
  875.     local range = 6
  876.     local nearX = rel.X >= bW - range and rel.X <= bW + 2
  877.     local nearY = rel.Y >= bH - range and rel.Y <= bH + 2
  878.     if nearX and nearY then return true, "B" end
  879.     if nearX            then return true, "X" end
  880.     if nearY            then return true, "Y" end
  881.     return false, nil
  882. end
  883.  
  884. local function isInDragRange(mousePos)
  885.     local rel  = mousePos - Background.AbsolutePosition
  886.     local maxX = TopBar.AbsoluteSize.X - CloseButton.AbsoluteSize.X * 3
  887.     return rel.X >= 0 and rel.X <= maxX and rel.Y >= 0 and rel.Y <= TopBar.AbsoluteSize.Y
  888. end
  889.  
  890. local function fadeOut(elements)
  891.     local visible = {}
  892.     for _, v in next, elements do
  893.         if typeof(v) == "Instance" and v:IsA("GuiObject") and v.Visible then
  894.             visible[v] = true
  895.             TweenService:Create(v, TweenInfo.new(0.35), {BackgroundTransparency = 1}):Play()
  896.             if v:IsA("TextLabel") or v:IsA("TextButton") then
  897.                 TweenService:Create(v, TweenInfo.new(0.35), {TextTransparency = 1}):Play()
  898.             elseif v:IsA("ImageLabel") or v:IsA("ImageButton") then
  899.                 TweenService:Create(v, TweenInfo.new(0.35), {ImageTransparency = 1}):Play()
  900.             end
  901.             task.delay(0.35, function() v.Visible = false end)
  902.         end
  903.     end
  904.     return function()
  905.         for obj in next, visible do
  906.             task.spawn(function()
  907.                 obj.Visible              = true
  908.                 obj.BackgroundTransparency = 1
  909.                 TweenService:Create(obj, TweenInfo.new(0.35), {BackgroundTransparency = 0}):Play()
  910.                 if obj:IsA("TextLabel") or obj:IsA("TextButton") then
  911.                     obj.TextTransparency = 1
  912.                     TweenService:Create(obj, TweenInfo.new(0.35), {TextTransparency = 0}):Play()
  913.                 elseif obj:IsA("ImageLabel") or obj:IsA("ImageButton") then
  914.                     obj.ImageTransparency = 1
  915.                     TweenService:Create(obj, TweenInfo.new(0.35), {ImageTransparency = 0}):Play()
  916.                 end
  917.             end)
  918.         end
  919.     end
  920. end
  921.  
  922. local remotesFadeIn, rightFadeIn
  923.  
  924. function toggleMinimize(override)
  925.     if mainClosing and not override then return end
  926.     mainClosing = true
  927.     closed = not closed
  928.     if closed then
  929.         if not sideClosed then toggleSideTray(true) end
  930.         remotesFadeIn = fadeOut(LeftPanel:GetDescendants())
  931.         TweenService:Create(LeftPanel, TweenInfo.new(0.35), {Size = UDim2.new(0, 160, 0, 0)}):Play()
  932.         task.wait(0.35)
  933.     else
  934.         TweenService:Create(LeftPanel, TweenInfo.new(0.35), {Size = UDim2.new(0, 160, 0, 261)}):Play()
  935.         task.wait(0.35)
  936.         if remotesFadeIn then remotesFadeIn(); remotesFadeIn = nil end
  937.         bringBackOnResize()
  938.     end
  939.     mainClosing = false
  940. end
  941.  
  942. function toggleSideTray(override)
  943.     if sideClosing and not override then return end
  944.     sideClosing = true
  945.     sideClosed  = not sideClosed
  946.     if sideClosed then
  947.         rightFadeIn = fadeOut(RightPanel:GetDescendants())
  948.         task.wait(0.35)
  949.         minimizeSize(0.35)
  950.         task.wait(0.35)
  951.         RightPanel.Visible = false
  952.     else
  953.         if closed then toggleMinimize(true) end
  954.         RightPanel.Visible = true
  955.         maximizeSize(0.35)
  956.         task.wait(0.35)
  957.         if rightFadeIn then rightFadeIn(); rightFadeIn = nil end
  958.         bringBackOnResize()
  959.     end
  960.     sideClosing = false
  961. end
  962.  
  963. local function backgroundUserInput(input)
  964.     if input.UserInputType ~= Enum.UserInputType.MouseButton1
  965.     and input.UserInputType ~= Enum.UserInputType.Touch then return end
  966.  
  967.     local mousePos   = UserInputService:GetMouseLocation() - GuiInset
  968.     local inResize, resizeType = isInResizeRange(mousePos)
  969.  
  970.     if inResize and not closed then
  971.         local lastPos  = UserInputService:GetMouseLocation()
  972.         local szOffset = Background.AbsoluteSize - lastPos
  973.         if not connections["resize"] then
  974.             connections["resize"] = RunService.RenderStepped:Connect(function()
  975.                 local np = UserInputService:GetMouseLocation()
  976.                 if np == lastPos then return end
  977.                 local newW = (np + szOffset).X
  978.                 local newH = (np + szOffset).Y
  979.                 local curW = Background.AbsoluteSize.X
  980.                 local curH = Background.AbsoluteSize.Y
  981.                 if (resizeType == "X" or resizeType == "B") and not sideClosed then
  982.                     curW = math.max(newW, MIN_W)
  983.                 end
  984.                 if resizeType == "Y" or resizeType == "B" then
  985.                     curH = math.max(newH, MIN_H)
  986.                 end
  987.                 Background.Size = UDim2.fromOffset(curW, curH)
  988.                 validateSize()
  989.                 if sideClosed then minimizeSize() else maximizeSize() end
  990.                 lastPos = np
  991.             end)
  992.         end
  993.         table.insert(connections, UserInputService.InputEnded:Connect(function(ie)
  994.             if ie == input and connections["resize"] then
  995.                 connections["resize"]:Disconnect()
  996.                 connections["resize"] = nil
  997.             end
  998.         end))
  999.  
  1000.     elseif isInDragRange(mousePos) then
  1001.         local lastPos = UserInputService:GetMouseLocation()
  1002.         local offset  = Background.AbsolutePosition - lastPos
  1003.         if not connections["drag"] then
  1004.             connections["drag"] = RunService.RenderStepped:Connect(function()
  1005.                 local np = UserInputService:GetMouseLocation()
  1006.                 if np == lastPos then return end
  1007.                 local vp   = workspace.CurrentCamera.ViewportSize
  1008.                 local minW = sideClosed and LeftPanel.AbsoluteSize.X or TopBar.AbsoluteSize.X
  1009.                 local cx   = math.clamp((offset + np).X, 0, vp.X - minW)
  1010.                 local cy   = math.clamp((offset + np).Y, 0, vp.Y - Background.AbsoluteSize.Y - GuiInset.Y)
  1011.                 lastPos = np
  1012.                 Background.Position = UDim2.new(0, cx, 0, cy)
  1013.             end)
  1014.         end
  1015.         table.insert(connections, UserInputService.InputEnded:Connect(function(ie)
  1016.             if ie == input and connections["drag"] then
  1017.                 connections["drag"]:Disconnect()
  1018.                 connections["drag"] = nil
  1019.             end
  1020.         end))
  1021.     end
  1022. end
  1023.  
  1024. CloseButton.MouseEnter:Connect(function()
  1025.     TweenService:Create(CloseButton, TweenInfo.new(0.2), {BackgroundColor3 = Color3.fromRGB(255,60,60)}):Play()
  1026. end)
  1027. CloseButton.MouseLeave:Connect(function()
  1028.     TweenService:Create(CloseButton, TweenInfo.new(0.2), {BackgroundColor3 = Color3.fromRGB(37,36,38)}):Play()
  1029. end)
  1030. MinimizeButton.MouseButton1Click:Connect(function() task.spawn(toggleMinimize) end)
  1031. MaximizeButton.MouseButton1Click:Connect(function() task.spawn(toggleSideTray) end)
  1032.  
  1033. TitleBtn.MouseEnter:Connect(function()
  1034.     local c = capturing and Color3.fromRGB(252,51,51) or Color3.fromRGB(68,206,91)
  1035.     TweenService:Create(TitleBtn, TweenInfo.new(0.3), {TextColor3 = c}):Play()
  1036. end)
  1037. TitleBtn.MouseLeave:Connect(function()
  1038.     TweenService:Create(TitleBtn, TweenInfo.new(0.3), {TextColor3 = Color3.new(1,1,1)}):Play()
  1039. end)
  1040. TitleBtn.MouseButton1Click:Connect(function()
  1041.     capturing = not capturing
  1042.     setStatus(capturing and "Capturing..." or "Paused")
  1043.     TweenService:Create(TitleBtn, TweenInfo.new(0.3), {
  1044.         TextColor3 = capturing and Color3.new(1,1,1) or Color3.fromRGB(252,51,51)
  1045.     }):Play()
  1046. end)
  1047.  
  1048. newButton("Copy Hex",
  1049.     function() return "Copy raw hex to clipboard" end,
  1050.     function()
  1051.         if selected then setclipboard(selected.hexStr); setStatus("Hex copied!") end
  1052.     end)
  1053.  
  1054. newButton("Copy Script",
  1055.     function() return "Copy raknet.send() script" end,
  1056.     function()
  1057.         if selected then
  1058.             local arr = {}
  1059.             for _, b in ipairs(hexStrToBytes(selected.hexStr)) do
  1060.                 arr[#arr + 1] = string.format("0x%02X", b)
  1061.             end
  1062.             setclipboard(string.format("raknet.send({%s}, %s, %s, %s)",
  1063.                 table.concat(arr, ", "),
  1064.                 tostring(selected.priority),
  1065.                 tostring(selected.reliability),
  1066.                 tostring(selected.channel)))
  1067.             setStatus("Script copied!")
  1068.         end
  1069.     end)
  1070.  
  1071. newButton("Replay",
  1072.     function() return "Re-inject selected packet" end,
  1073.     function()
  1074.         if selected and selected.buf then
  1075.             local ok = tryInject(selected.buf, selected.priority, selected.reliability, selected.channel)
  1076.             setStatus(ok and "Replayed!" or "Replay failed!")
  1077.         else
  1078.             setStatus("Nothing selected!")
  1079.         end
  1080.     end)
  1081.  
  1082. newButton("Hex Dump",
  1083.     function() return "Show hex dump in code panel" end,
  1084.     function()
  1085.         if selected then setCode(selected.hexDump or selected.hexStr or "") end
  1086.     end)
  1087.  
  1088. newButton("Excl. ID",
  1089.     function() return "Exclude this packet ID from logs" end,
  1090.     function()
  1091.         if selected then
  1092.             blacklist[selected.packetId] = true
  1093.             setStatus(string.format("Excl. 0x%02X  %s", selected.packetId, selected.name))
  1094.         end
  1095.     end)
  1096.  
  1097. newButton("Clr Excl.",
  1098.     function() return "Clear all exclusions" end,
  1099.     function()
  1100.         blacklist = {}
  1101.         setStatus("Exclusions cleared!")
  1102.     end)
  1103.  
  1104. newButton("Block ID",
  1105.     function() return "Block this SEND packet ID.\nHook returns false — packet is dropped." end,
  1106.     function()
  1107.         if selected then
  1108.             if selected.direction == "SEND" then
  1109.                 blocklist[selected.packetId] = true
  1110.                 setStatus(string.format("Blocked 0x%02X  %s", selected.packetId, selected.name))
  1111.             else
  1112.                 setStatus("Only SEND packets can be blocked!")
  1113.             end
  1114.         else
  1115.             setStatus("Nothing selected!")
  1116.         end
  1117.     end)
  1118.  
  1119. newButton("Clr Block",
  1120.     function() return "Unblock all blocked packet IDs" end,
  1121.     function()
  1122.         blocklist = {}
  1123.         setStatus("Blocklist cleared!")
  1124.     end)
  1125.  
  1126. newButton("Copy Dump",
  1127.     function() return "Copy full hex dump to clipboard" end,
  1128.     function()
  1129.         if selected and selected.hexDump then
  1130.             setclipboard(selected.hexDump)
  1131.             setStatus("Dump copied!")
  1132.         end
  1133.     end)
  1134.  
  1135. newButton("Clear",
  1136.     function() return "Clear all captured packets" end,
  1137.     function()
  1138.         selected = nil
  1139.         for _, v in ipairs(LogList:GetChildren()) do
  1140.             if not v:IsA("UIListLayout") then v:Destroy() end
  1141.         end
  1142.         table.clear(remoteLogs)
  1143.         setCode("")
  1144.         setStatus("Logs cleared!")
  1145.     end)
  1146.  
  1147. table.insert(connections, UserInputService.InputBegan:Connect(function(input, gpe)
  1148.     if gpe then return end
  1149.     if input.KeyCode == Enum.KeyCode.K then
  1150.         Background.Visible = not Background.Visible
  1151.     end
  1152. end))
  1153.  
  1154. table.insert(connections, UserInputService.InputBegan:Connect(backgroundUserInput))
  1155.  
  1156. local function connectResize()
  1157.     if not workspace.CurrentCamera then
  1158.         workspace:GetPropertyChangedSignal("CurrentCamera"):Wait()
  1159.     end
  1160.     local camCon = workspace.CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(bringBackOnResize)
  1161.     workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
  1162.         camCon:Disconnect()
  1163.         camCon = workspace.CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(bringBackOnResize)
  1164.     end)
  1165. end
  1166.  
  1167. local function shutdown()
  1168.     for _, con in next, connections do
  1169.         if typeof(con) == "RBXScriptConnection" then con:Disconnect() end
  1170.     end
  1171.     table.clear(connections)
  1172.     pcall(function() RN.remove_send_hook() end)
  1173.     pcall(function() RN.remove_recv_hook() end)
  1174.     ScreenGui:Destroy()
  1175.     getgenv().RakNetSpyExecuted = false
  1176. end
  1177.  
  1178. CloseButton.MouseButton1Click:Connect(shutdown)
  1179.  
  1180. if not getgenv().RakNetSpyExecuted then
  1181.     getgenv().RakNetSpyShutdown = shutdown
  1182.     ScreenGui.Enabled = true
  1183.     ScreenGui.Parent  = gethui()
  1184.     connectResize()
  1185.     bringBackOnResize()
  1186.     if RN_REAL then
  1187.         setStatus("API found  |  K=toggle  |  title=pause")
  1188.         setCode("RakNet Spy ready.\nRakNet API detected.\n\nClick title bar to pause/resume.\nPress K to toggle window.\nDrag bottom-right corner to resize.\nBlock ID button drops SEND packets via return false.")
  1189.     else
  1190.         setStatus("WARNING: No RakNet API detected!")
  1191.         setCode("WARNING: RakNet API not found.\nNo packets will be captured.\n\nTried: raknet / getgenv().raknet /\nRakNet / getgenv().RakNet / syn.raknet")
  1192.     end
  1193.     getgenv().RakNetSpyExecuted = true
  1194. else
  1195.     ScreenGui:Destroy()
  1196. end
  1197.  
  1198. if autoexecscript ~= false then
  1199.     Players.LocalPlayer.OnTeleport:Connect(clonefunction(newcclosure(function()
  1200.         clonefunction(queueteleport)("clonefunction(loadstring)(cloneref(game):HttpGet('https://pastebin.com/raw/b1DTcv4n'))()")
  1201.     end)))
  1202. end
  1203.  
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment