arras - build parser

use window.build to get the current player build! note: with release of future builds pointer to values may change

Versione datata 22/09/2025. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        arras - build parser
// @namespace   Violentmonkey Scripts
// @match       https://arras.io/*
// @grant       none
// @version     1.1
// @author      ales
// @description use window.build to get the current player build! note: with release of future builds pointer to values may change
// @run-at      document-start
// @license MIT
// ==/UserScript==

// prevent randomness in encoded values
crypto.getRandomValues = () => [0]

let WebAssembly_instantiateStreaming = WebAssembly.instantiateStreaming
WebAssembly.instantiateStreaming = async function(wasm, imports) {

  let instance = await WebAssembly_instantiateStreaming.call(this, wasm, imports)
  window.exports = instance.instance.exports
  let memory_export = instance.instance.exports.g // "g" might change with future builds but ¯\_(ツ)_/¯

  Object.defineProperty(window, "HEAPU32", { get() { return new Uint32Array(memory_export.buffer) } })

  return instance
}

let ptr = 328264

Object.defineProperty(window, "build", {
  get() {

    let c
    let build

    c = HEAPU32[ptr + 1]
    max_health = ((c >> 16) & 0xFF) ^ 159 // max health
    body_damage = (c & 0xFF) ^ 213 // body damage

    c = HEAPU32[ptr + 2]
    bullet_health = ((c >> 16) & 0xFF) - 193 // bullet health
    bullet_speed = (c & 0xFF) - 240 // bullet speed

    c = HEAPU32[ptr + 3]
    bullet_damage = ((c >> 16) & 0xFF) ^ 43 // bullet damage
    bullet_penetration = (c & 0xFF) ^ 199 // bullet penetration

    c = HEAPU32[ptr + 4]
    movement_speed = ((c >> 16) & 0xFF) - 47 // movement speed
    reload = (c & 0xFF) - 214 // reload

    c = HEAPU32[ptr + 5]
    shield_capacity = ((c >> 16) & 0xFF) ^ 86 // shield capacity
    shield_regeneration = (c & 0xFF) ^ 41 // shield regeneration

    build = new Uint8Array([body_damage, max_health, bullet_speed, bullet_health, bullet_penetration, bullet_damage, reload, movement_speed, shield_regeneration, shield_capacity])

    return {
      build_points: HEAPU32[ptr] - 1607198298,
      body_damage: build[0],
      max_health: build[1],
      bullet_speed: build[2],
      bullet_health: build[3],
      bullet_penetration: build[4],
      bullet_damage: build[5],
      reload: build[6],
      movement_speed: build[7],
      shield_regeneration: build[8],
      shield_capacity: build[9],
      string: `${build[0]}/${build[1]}/${build[2]}/${build[3]}/${build[4]}/${build[5]}/${build[6]}/${build[7]}/${build[8]}/${build[9]}`
    }
  }
})