Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
This package contains a statemachine based parser to parse GCode in node or (possibly) in the browser.
It's fairly rough around the edges at the moment. No support for parameters
Should be fairly straightforward to use. Require require parser.js:
var gcode = require("./parser.js")
Afterwards, instantiate the parser, with a callback (see below) and optional configuration:
var parser = new gcode.GCode(cb, cfg)
Call parse
on any data / chunks of data you receive. Typically (see
config, below) parse
will emit data for each event to the callback adn
return true
or terminate processing, returning false
after an error
is encountered and error data is emitted.
... get data from somewhere ...
if (!parser.parse(data)) {
.. quit parsing ...
}
The callback you pass to the GCode
constructor will receive data
describing one of the following events:
Data passed to the callback is a hash an will always contain the following parameters:
gcode.Events.BLOCK_START
, ...BLOCK_END
, (...)N
words.ERROR events also have the following parameters: msg
the error message
and state
which is the internal state of the parser and is only useful
for debugging, this will likely be omitted in the future.
WORD events have the following additional parameters: code
the letter
part of the word and value
the value part. Unless you configure the
parser to do otherwise, it will also contain a desc
parameter with a
humanreadable describtion of the command.
COMMENT contains a parameter called comment
containing the text of the
comment, stripped of comment delimiters.
The optinal cfg
parameter that may be passed to the constructor is a
hash which may currently contain two configuration options:
false
from parse
after an error has
been emitted, instead, try to recover (this may void your warranty)desc
parameter to word events.This will be part of a JS based CNC control for the Anykey[1] /Anycnc[2]
Write a proper example driver for anycnc ... Package nicely for npm.
MIT
README.md : this file anycnc.js : example drive, extremly wip test : test fixtures make_json_fixtures.js : pre-parse fixture data for test parser.js : the actual parser test_gcode.js : run tests.
[1] http://www.anykey0x.de [2] http://blog.anykey0x.de/?p=60
FAQs
a module for processing gcode
We found that gcodejs 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.