mirror of
https://github.com/xhacker-zzz/QmcWasm.git
synced 2024-11-25 12:32:16 +00:00
add files for npm package
This commit is contained in:
parent
34522bfe90
commit
eb248bb8cf
1
npm/.npmrc
Normal file
1
npm/.npmrc
Normal file
@ -0,0 +1 @@
|
|||||||
|
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
73
npm/QmcLegacy.d.ts
vendored
Normal file
73
npm/QmcLegacy.d.ts
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
export type WASM_ptr = number;
|
||||||
|
export type WASM_NUMBER = "i8" | "i16" | "i32" | "i64" | "float" | "double";
|
||||||
|
|
||||||
|
export declare interface WASMExportedRuntime {
|
||||||
|
/**
|
||||||
|
* Emscripten HEAP, use this for raw memory access.
|
||||||
|
* @type {Uint8Array}
|
||||||
|
*/
|
||||||
|
HEAPU8: Uint8Array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate a block of {@link size} bytes of memory in Emscripten HEAP
|
||||||
|
* @param size Size of the memory block, in bytes.
|
||||||
|
* @returns {WASM_ptr} Returns a pointer to the beginning of the block.
|
||||||
|
*/
|
||||||
|
_malloc(size: number): WASM_ptr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free an allocated block of memory.
|
||||||
|
* @param ptr Pointer to a memory block previously allocated with `malloc`.
|
||||||
|
*/
|
||||||
|
_free(ptr: WASM_ptr): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write an uint8 array to the Emscripten HEAP.
|
||||||
|
* @param data Data to be written inside the Emscripten HEAP.
|
||||||
|
* @param bufferPointer Address pointer
|
||||||
|
*/
|
||||||
|
writeArrayToMemory(data: Uint8Array, bufferPointer: WASM_ptr): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare interface QmcCrypto extends WASMExportedRuntime {
|
||||||
|
/**
|
||||||
|
* Get error.
|
||||||
|
*/
|
||||||
|
getErr(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get song id.
|
||||||
|
*/
|
||||||
|
getSongId(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decryption preparations using the end-of-file buffer.
|
||||||
|
* @param blob WASM ptr points to the beginning of the end-of-file buffer.
|
||||||
|
* @param blobSize size of {@link blob}.
|
||||||
|
* @param ext extension of the _original file_.
|
||||||
|
*/
|
||||||
|
preDec(
|
||||||
|
blob: WASM_ptr,
|
||||||
|
blobSize: number,
|
||||||
|
ext: string
|
||||||
|
): number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decrypt a block.
|
||||||
|
* @param blob Pointer to buffer allocated using {@link _malloc}.
|
||||||
|
* Data can be written here using {@link writeArrayToMemory}.
|
||||||
|
* @param size Size of the provided buffer.
|
||||||
|
* @param offset Offset of the buffer from _original file_.
|
||||||
|
* This parameter is _required_ to derive correct key.
|
||||||
|
*/
|
||||||
|
decBlob(
|
||||||
|
blob: WASM_ptr,
|
||||||
|
blobSize: number,
|
||||||
|
offset: number
|
||||||
|
): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Factory to initialise QmcCryptoModule.
|
||||||
|
*/
|
||||||
|
export default function QmcCryptoModule(): Promise<QmcCrypto>;
|
73
npm/QmcWasm.d.ts
vendored
Normal file
73
npm/QmcWasm.d.ts
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
export type WASM_ptr = number;
|
||||||
|
export type WASM_NUMBER = "i8" | "i16" | "i32" | "i64" | "float" | "double";
|
||||||
|
|
||||||
|
export declare interface WASMExportedRuntime {
|
||||||
|
/**
|
||||||
|
* Emscripten HEAP, use this for raw memory access.
|
||||||
|
* @type {Uint8Array}
|
||||||
|
*/
|
||||||
|
HEAPU8: Uint8Array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate a block of {@link size} bytes of memory in Emscripten HEAP
|
||||||
|
* @param size Size of the memory block, in bytes.
|
||||||
|
* @returns {WASM_ptr} Returns a pointer to the beginning of the block.
|
||||||
|
*/
|
||||||
|
_malloc(size: number): WASM_ptr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free an allocated block of memory.
|
||||||
|
* @param ptr Pointer to a memory block previously allocated with `malloc`.
|
||||||
|
*/
|
||||||
|
_free(ptr: WASM_ptr): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write an uint8 array to the Emscripten HEAP.
|
||||||
|
* @param data Data to be written inside the Emscripten HEAP.
|
||||||
|
* @param bufferPointer Address pointer
|
||||||
|
*/
|
||||||
|
writeArrayToMemory(data: Uint8Array, bufferPointer: WASM_ptr): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare interface QmcCrypto extends WASMExportedRuntime {
|
||||||
|
/**
|
||||||
|
* Get error.
|
||||||
|
*/
|
||||||
|
getErr(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get song id.
|
||||||
|
*/
|
||||||
|
getSongId(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decryption preparations using the end-of-file buffer.
|
||||||
|
* @param blob WASM ptr points to the beginning of the end-of-file buffer.
|
||||||
|
* @param blobSize size of {@link blob}.
|
||||||
|
* @param ext extension of the _original file_.
|
||||||
|
*/
|
||||||
|
preDec(
|
||||||
|
blob: WASM_ptr,
|
||||||
|
blobSize: number,
|
||||||
|
ext: string
|
||||||
|
): number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decrypt a block.
|
||||||
|
* @param blob Pointer to buffer allocated using {@link _malloc}.
|
||||||
|
* Data can be written here using {@link writeArrayToMemory}.
|
||||||
|
* @param size Size of the provided buffer.
|
||||||
|
* @param offset Offset of the buffer from _original file_.
|
||||||
|
* This parameter is _required_ to derive correct key.
|
||||||
|
*/
|
||||||
|
decBlob(
|
||||||
|
blob: WASM_ptr,
|
||||||
|
blobSize: number,
|
||||||
|
offset: number
|
||||||
|
): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Factory to initialise QmcCryptoModule.
|
||||||
|
*/
|
||||||
|
export default function QmcCryptoModule(): Promise<QmcCrypto>;
|
73
npm/QmcWasmBundle.d.ts
vendored
Normal file
73
npm/QmcWasmBundle.d.ts
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
export type WASM_ptr = number;
|
||||||
|
export type WASM_NUMBER = "i8" | "i16" | "i32" | "i64" | "float" | "double";
|
||||||
|
|
||||||
|
export declare interface WASMExportedRuntime {
|
||||||
|
/**
|
||||||
|
* Emscripten HEAP, use this for raw memory access.
|
||||||
|
* @type {Uint8Array}
|
||||||
|
*/
|
||||||
|
HEAPU8: Uint8Array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate a block of {@link size} bytes of memory in Emscripten HEAP
|
||||||
|
* @param size Size of the memory block, in bytes.
|
||||||
|
* @returns {WASM_ptr} Returns a pointer to the beginning of the block.
|
||||||
|
*/
|
||||||
|
_malloc(size: number): WASM_ptr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free an allocated block of memory.
|
||||||
|
* @param ptr Pointer to a memory block previously allocated with `malloc`.
|
||||||
|
*/
|
||||||
|
_free(ptr: WASM_ptr): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write an uint8 array to the Emscripten HEAP.
|
||||||
|
* @param data Data to be written inside the Emscripten HEAP.
|
||||||
|
* @param bufferPointer Address pointer
|
||||||
|
*/
|
||||||
|
writeArrayToMemory(data: Uint8Array, bufferPointer: WASM_ptr): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare interface QmcCrypto extends WASMExportedRuntime {
|
||||||
|
/**
|
||||||
|
* Get error.
|
||||||
|
*/
|
||||||
|
getErr(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get song id.
|
||||||
|
*/
|
||||||
|
getSongId(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decryption preparations using the end-of-file buffer.
|
||||||
|
* @param blob WASM ptr points to the beginning of the end-of-file buffer.
|
||||||
|
* @param blobSize size of {@link blob}.
|
||||||
|
* @param ext extension of the _original file_.
|
||||||
|
*/
|
||||||
|
preDec(
|
||||||
|
blob: WASM_ptr,
|
||||||
|
blobSize: number,
|
||||||
|
ext: string
|
||||||
|
): number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decrypt a block.
|
||||||
|
* @param blob Pointer to buffer allocated using {@link _malloc}.
|
||||||
|
* Data can be written here using {@link writeArrayToMemory}.
|
||||||
|
* @param size Size of the provided buffer.
|
||||||
|
* @param offset Offset of the buffer from _original file_.
|
||||||
|
* This parameter is _required_ to derive correct key.
|
||||||
|
*/
|
||||||
|
decBlob(
|
||||||
|
blob: WASM_ptr,
|
||||||
|
blobSize: number,
|
||||||
|
offset: number
|
||||||
|
): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Factory to initialise QmcCryptoModule.
|
||||||
|
*/
|
||||||
|
export default function QmcCryptoModule(): Promise<QmcCrypto>;
|
24
npm/package.json
Normal file
24
npm/package.json
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "@xhacker/qmcwasm",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Wasm for Qmc Encryption & Decryption",
|
||||||
|
"main": "QmcWasmBundle.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/xhacker-zzz/QmcWasm.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"unlock-music",
|
||||||
|
"qmc",
|
||||||
|
"WASM"
|
||||||
|
],
|
||||||
|
"author": "xhacker-zzz",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/xhacker-zzz/QmcWasm/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/xhacker-zzz/QmcWasm#readme"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user