
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
assemblyscript-loader
Advanced tools
AssemblyScript's loader component to run and work with compiled WebAssembly modules, as a stand-alone module.
$> npm install assemblyscript-loader
import load from "assemblyscript-loader"; // JS: var load = require("assemblyscript-loader").load;
load("path/to/myModule.wasm", {
imports: {
...
}
}).then(module => {
...
// i.e. call module.exports.main()
});
Alternatively, when LoadOptions#exports
is specified, the respective object is pre-initialized
with the (always present) ready
promise that is resolved when loading is complete:
// myModule.js (CommonJS)
require("assemblyscript-loader").load("path/to/myModule.wasm", { exports: module.exports });
// otherModule.js (CommonJS)
var myModule = require("./myModule.js");
myModule.ready.then(() => {
...
});
load(file: string | Uint8Array | ArrayBuffer
, options: LoadOptions
): Promise<Module>
Loads a WebAssembly module either from a file or a buffer and returns a promise for the loaded Module
.
LoadOptions
Options to set up the environment created by load
.
WebAssembly.Memory
{ [key: string]: any }
{ [key: string]: any }
Module
Common module interface as returned by load
.
Imports
Exports
Memory
LogType
, message: string
): void
Imports
An object of imported functions.
Exports
An object of exported functions (plus the ready
promise).
LogType
An enum of log types:
Key | Value |
---|---|
LOG | 0 |
INFO | 1 |
WARN | 2 |
ERROR | 3 |
Memory extends WebAssembly.Memory
The WebAssembly Memory
instance populated with additional accessors for more convenient memory access.
NumberAccessor
NumberAccessor
NumberAccessor
NumberAccessor
NumberAccessor
NumberAccessor
LongAccessor
LongAccessor
NumberAccessor
NumberAccessor
ArrayAccessor
StringAccessor
NumberAccessor
Number memory accessor.
number
): number
number
, value: number
): void
LongAccessor
Long memory accessor. See also: long.js
number
): Long
number
, value: Long
): void
ArrayAccessor
Array memory accessor.
number
): { length: number, base: number }
number
, elementByteSize: number
): { ptr: number, base: number }
StringAccessor
String memory accessor.
number
): string
string
): number
initializeMemory(memoryInstance: WebAssembly.Memory
, malloc: Function
, memset: Function
): Memory
Just populates a WebAssembly Memory instance with the AssemblyScript-typical accessors.
xfetch(file: string
): Promise<Response>
Underlying fetch
implementation that also works under node.js.
Note that the create
methods of array and string accessors require an exported or imported
implementation of malloc
, memset
, free
etc. to be present. Also remember that memory is
unmanaged here and that free
must be called manually to clean up memory, just like in C. Once
WebAssembly exposes the garbage collector natively, there will be other options as well.
The long.js dependency can be safely excluded if working with
long/ulong values isn't needed. In this case, the implementation will still accept and produce
Long-like objects having a low
and a high
property representing the respective low and high
32-bits.
Clone the GitHub repository and install the development dependencies:
$> git clone https://github.com/AssemblyScript/loader.git
$> cd loader
$> npm install
Afterwards, to build the distribution files to dist/, run:
$> npm run build
FAQs
AssemblyScript's loader component as a stand-alone module.
The npm package assemblyscript-loader receives a total of 7 weekly downloads. As such, assemblyscript-loader popularity was classified as not popular.
We found that assemblyscript-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.