RiseAboveHate

Untitled

Oct 15th, 2025
257
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.82 KB | None | 0 0
  1. local Pawn = {}
  2.  
  3. -- Pawn token types
  4. local TokenType = {
  5.     KEYWORD = 1,
  6.     IDENTIFIER = 2,
  7.     NUMBER = 3,
  8.     STRING = 4,
  9.     OPERATOR = 5,
  10.     PREPROCESSOR = 6,
  11.     COMMENT = 7
  12. }
  13.  
  14. -- Pawn keywords
  15. local KEYWORDS = {
  16.     "new", "enum", "public", "stock", "static", "const", "forward",
  17.     "native", "if", "else", "for", "while", "do", "switch", "case",
  18.     "default", "return", "break", "continue", "sizeof", "state",
  19.     "goto", "tagof", "char", "bool", "int", "float", "void"
  20. }
  21.  
  22. -- Preprocessor directives
  23. local PREPROCESSOR_DIRECTIVES = {
  24.     "#define", "#include", "#if", "#else", "#endif", "#ifdef", "#ifndef",
  25.     "#pragma", "#error", "#warning"
  26. }
  27.  
  28. function Pawn.tokenize(code)
  29.     local tokens = {}
  30.     local pos = 1
  31.     local len = #code
  32.    
  33.     while pos <= len do
  34.         local char = code:sub(pos, pos)
  35.        
  36.         -- Skip whitespace
  37.         if char:match("%s") then
  38.             pos = pos + 1
  39.        
  40.         -- Comments
  41.         elseif char == "/" and code:sub(pos + 1, pos + 1) == "/" then
  42.             local start = pos
  43.             while pos <= len and code:sub(pos, pos) ~= "\n" do
  44.                 pos = pos + 1
  45.             end
  46.             table.insert(tokens, {
  47.                 type = TokenType.COMMENT,
  48.                 value = code:sub(start, pos - 1)
  49.             })
  50.        
  51.         -- Multi-line comments
  52.         elseif char == "/" and code:sub(pos + 1, pos + 1) == "*" then
  53.             local start = pos
  54.             pos = pos + 2
  55.             while pos <= len and not (code:sub(pos, pos) == "*" and code:sub(pos + 1, pos + 1) == "/") do
  56.                 pos = pos + 1
  57.             end
  58.             pos = pos + 2
  59.             table.insert(tokens, {
  60.                 type = TokenType.COMMENT,
  61.                 value = code:sub(start, pos - 1)
  62.             })
  63.        
  64.         -- Preprocessor directives
  65.         elseif char == "#" then
  66.             local start = pos
  67.             while pos <= len and not code:sub(pos, pos):match("%s") and code:sub(pos, pos) ~= "\n" do
  68.                 pos = pos + 1
  69.             end
  70.             local directive = code:sub(start, pos - 1)
  71.             table.insert(tokens, {
  72.                 type = TokenType.PREPROCESSOR,
  73.                 value = directive
  74.             })
  75.        
  76.         -- Strings
  77.         elseif char == '"' then
  78.             local start = pos
  79.             pos = pos + 1
  80.             while pos <= len and code:sub(pos, pos) ~= '"' do
  81.                 if code:sub(pos, pos) == "\\" then
  82.                     pos = pos + 1 -- Skip escape sequences
  83.                 end
  84.                 pos = pos + 1
  85.             end
  86.             pos = pos + 1
  87.             table.insert(tokens, {
  88.                 type = TokenType.STRING,
  89.                 value = code:sub(start, pos - 1)
  90.             })
  91.        
  92.         -- Numbers
  93.         elseif char:match("%d") or (char == "." and code:sub(pos + 1, pos + 1):match("%d")) then
  94.             local start = pos
  95.             while pos <= len and (code:sub(pos, pos):match("%d") or code:sub(pos, pos) == "." or code:sub(pos, pos):match("[eE]") or (code:sub(pos, pos) == "-" and code:sub(pos - 1, pos - 1):match("[eE]"))) do
  96.                 pos = pos + 1
  97.             end
  98.             table.insert(tokens, {
  99.                 type = TokenType.NUMBER,
  100.                 value = code:sub(start, pos - 1)
  101.             })
  102.        
  103.         -- Identifiers and keywords
  104.         elseif char:match("[%a_]") then
  105.             local start = pos
  106.             while pos <= len and code:sub(pos, pos):match("[%w_]") do
  107.                 pos = pos + 1
  108.             end
  109.             local identifier = code:sub(start, pos - 1)
  110.             local isKeyword = false
  111.            
  112.             for _, kw in ipairs(KEYWORDS) do
  113.                 if kw == identifier then
  114.                     isKeyword = true
  115.                     break
  116.                 end
  117.             end
  118.            
  119.             table.insert(tokens, {
  120.                 type = isKeyword and TokenType.KEYWORD or TokenType.IDENTIFIER,
  121.                 value = identifier
  122.             })
  123.        
  124.         -- Operators
  125.         else
  126.             local operators = {"++", "--", "+=", "-=", "*=", "/=", "%=", "==", "!=", ">=", "<=", "&&", "||", ">>", "<<"}
  127.             local found = false
  128.            
  129.             for _, op in ipairs(operators) do
  130.                 if code:sub(pos, pos + #op - 1) == op then
  131.                     table.insert(tokens, {
  132.                         type = TokenType.OPERATOR,
  133.                         value = op
  134.                     })
  135.                     pos = pos + #op
  136.                     found = true
  137.                     break
  138.                 end
  139.             end
  140.            
  141.             if not found then
  142.                 table.insert(tokens, {
  143.                     type = TokenType.OPERATOR,
  144.                     value = char
  145.                 })
  146.                 pos = pos + 1
  147.             end
  148.         end
  149.     end
  150.    
  151.     return tokens
  152. end
  153.  
  154. function Pawn.transpileToLua(pawnCode)
  155.     local tokens = Pawn.tokenize(pawnCode)
  156.     local luaCode = ""
  157.     local i = 1
  158.    
  159.     while i <= #tokens do
  160.         local token = tokens[i]
  161.        
  162.         if token.type == TokenType.PREPROCESSOR then
  163.             if token.value == "#define" then
  164.                 -- Handle #define MACRO value
  165.                 local name = tokens[i + 1] and tokens[i + 1].value or ""
  166.                 local value = tokens[i + 2] and tokens[i + 2].value or ""
  167.                
  168.                 if name:match("^[%a_][%w_]*$") then
  169.                     luaCode = luaCode .. "local " .. name .. " = " .. value .. "\n"
  170.                     i = i + 3
  171.                 else
  172.                     luaCode = luaCode .. "-- " .. token.value .. "\n"
  173.                     i = i + 1
  174.                 end
  175.             else
  176.                 luaCode = luaCode .. "-- " .. token.value .. "\n"
  177.                 i = i + 1
  178.             end
  179.        
  180.         elseif token.type == TokenType.KEYWORD and token.value == "enum" then
  181.             -- Handle enum
  182.             i = i + 1 -- skip enum
  183.             local enumName = tokens[i].value
  184.             i = i + 2 -- skip name and {
  185.            
  186.             local enumValues = {}
  187.             local currentValue = 0
  188.            
  189.             while i <= #tokens and tokens[i].value ~= "}" do
  190.                 if tokens[i].type == TokenType.IDENTIFIER then
  191.                     local name = tokens[i].value
  192.                     i = i + 1
  193.                    
  194.                     if tokens[i] and tokens[i].value == "=" then
  195.                         i = i + 1
  196.                         currentValue = tonumber(tokens[i].value) or 0
  197.                         i = i + 1
  198.                     end
  199.                    
  200.                     table.insert(enumValues, {name = name, value = currentValue})
  201.                     currentValue = currentValue + 1
  202.                    
  203.                     if tokens[i] and tokens[i].value == "," then
  204.                         i = i + 1
  205.                     end
  206.                 else
  207.                     i = i + 1
  208.                 end
  209.             end
  210.            
  211.             i = i + 1 -- skip }
  212.            
  213.             -- Convert enum to Lua table
  214.             luaCode = luaCode .. "local " .. enumName .. " = {\n"
  215.             for _, ev in ipairs(enumValues) do
  216.                 luaCode = luaCode .. "    " .. ev.name .. " = " .. ev.value .. ",\n"
  217.             end
  218.             luaCode = luaCode .. "}\n"
  219.        
  220.         elseif token.type == TokenType.KEYWORD and token.value == "new" then
  221.             -- Handle variable declaration
  222.             i = i + 1 -- skip new
  223.             local varName = tokens[i].value
  224.             i = i + 1
  225.            
  226.             if tokens[i] and tokens[i].value == "[" then
  227.                 -- Array declaration
  228.                 i = i + 1
  229.                 local size = tokens[i].value
  230.                 i = i + 2 -- skip size and ]
  231.                
  232.                 luaCode = luaCode .. "local " .. varName .. " = {}\n"
  233.                 luaCode = luaCode .. "for i = 1, " .. size .. " do\n"
  234.                 luaCode = luaCode .. "    " .. varName .. "[i] = 0\n"
  235.                 luaCode = luaCode .. "end\n"
  236.             else
  237.                 -- Single variable
  238.                 luaCode = luaCode .. "local " .. varName .. " = 0\n"
  239.             end
  240.        
  241.         else
  242.             -- Direct translation for other tokens
  243.             luaCode = luaCode .. token.value .. " "
  244.             i = i + 1
  245.         end
  246.     end
  247.    
  248.     return luaCode
  249. end
  250.  
  251. -- Example usage:
  252. local pawnCode = [[
  253. #define MAX_PLAYERS 500
  254.  
  255. enum pInfo {
  256.     PlayerName[25],
  257.     Kills,
  258.     Level,
  259.     Points
  260. }
  261.  
  262. new PlayerInfo[MAX_PLAYERS][pInfo];
  263.  
  264. public OnPlayerConnect(playerid)
  265. {
  266.     PlayerInfo[playerid][Kills] = 0;
  267.     PlayerInfo[playerid][Level] = 1;
  268.     return 1;
  269. }
  270. ]]
  271.  
  272. local luaCode = Pawn.transpileToLua(pawnCode)
  273. print("Transpiled Lua code:")
  274. print(luaCode)
Advertisement
Comments
  • User was banned
  • User was banned
  • Vormilir
    127 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • User was banned
Add Comment
Please, Sign In to add comment