
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
boilerplate-compiler
Advanced tools
This is a compiler for boilerplate. It has two parts:
Caveats:
npm install boilerplate-compiler
Then compile something:
compiler = require('boilerplate-compiler');
// Compile the grid in "myfile.json"
compiler.compileFile("myfile.json", opts);
// Compile the specified grid
var grid = {"0,0":"shuttle","1,0":"nothing","2,0":"negative"};
compiler.compileGrid(grid, opts);
Options is optional, and can contain:
The compiler output produces a module which returns an object with
{states:[0,1,3,1,...], step:function(){...})}
. The states array is
initialized with all shuttles in the positions specified in the initial grid.
The step function reads from & writes back new states to the state array.
Internally, the compiled code calculates the pressure of lots of regions. However, it doesn't expose these values yet.
The parser produces a (somewhat giant) structure of data through the course of analysing the grid. The format of this structure is still in flux, and it may change between compiler minor versions.
You can parse data using:
compiler = require('boilerplate-compiler');
// parse the grid in "myfile.json"
var ast = compiler.parseFile("myfile.json");
// Compile the specified grid
var grid = {"0,0":"shuttle","1,0":"nothing","2,0":"negative"};
var ast = compiler.parse(grid);
At a glance, it contains:
Each shuttle is flood filled to find all the cells the shuttle could occupy. We do this even if its impossible for the shuttle to actually move there (there's no engines, for example). The result is that part of the grid is occupied by a sort of probability cloud of the shuttle's states.
Each state that the shuttle could move to is numbered from 0. States are always sorted top-to-bottom then left-to-right.
The parser outputs the shuttle list as:
{x:x,y:y,v:value (shuttle/thinshuttle)}
in the
shuttle in its initial position{dx, dy, pushedBy}
. dx/dy specify how the shuttle has moved from the base
state. pushedBy
is a list of regions which push the shuttle in this state.x,y
to a state list. Each list value is truthy if that cell is
impassable in the state corresponding to the list index.x,y
to a state list. Each list value specifies the
index of a region which connects through this grid cell.{x,y}
specifying which directions the shuttle can move. Eg,
{x:true, y:false}
.{rid, mx, my}
for each region which pushes the
shuttle consistently in all shuttle states.The space is flood filled from the edges of each cell to find regions. Each region is a set of edges which always share the same pressure value. Regions cannot touch each other directly (then they should be joined!).
Regions have a list of connections to other regions. The connections list other regions which this region will be joined to if some particular shuttle is in one of a set of states. Connections are bidirectional - each connection from A to B has a corresponding connection from B to A. (And the connection will appear in both A.connections and B.connections).
Each region in the AST has the following properties:
{rid:otherRegionId, sid:shuttleId, inStates:[...]}
Each engine in the grid is listed in the AST. For simulation, engines have the interesting property that they can only be counted once for each connected space, regardless of how many faces of the engine are used. If two connected regions both touch different faces of an engine, the pressure only changes by
Each engine in the engine list contains {x, y, pressure:-1 or 1, regions:[list of region ids], exclusive:true if the engine only touches one region}
The compiler comes with a bunch of utility methods for printing ascii art grids
and updating grids based on shuttle states. There's going to be churn in these
methods - but they're exposed for convenience via
require('boilerplate-compiler').util
.
FAQs
Boilerplate compiler
The npm package boilerplate-compiler receives a total of 5 weekly downloads. As such, boilerplate-compiler popularity was classified as not popular.
We found that boilerplate-compiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.