Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Definitions of Windows Date Types for node-ffi, node-ffi-napi
npm run repo:init
Package | Version |
---|---|
win32-api | |
win32-def |
Write node-ffi or node-ffi-napi calling win32 native functions code by Typescript with Types support.
npm install win32-def
import * as ffi from 'ffi-napi'
import { DModel as M, DTypes as W, FModel as FM } from 'win32-def'
export interface Win32Fns extends FM.DllFuncsModel {
ClientToScreen(hWnd: M.HWND, lpPoint: M.LPPOINT): M.BOOL
GetAncestor(hwnd: M.HWND, gaFlags: M.UINT): M.HWND
}
export const user32: Win32Fns = ffi.Library('user32.dll', {
ClientToScreen: [W.BOOL, [W.HWND, W.LPPOINT] ],
GetAncestor: [W.HWND, [W.HWND, W.UINT] ],
})
import * as ffi from 'ffi-napi'
import { DModel as M, DTypes as W, FModel as FM } from 'win32-def'
export interface Win32Fns extends FM.DllFuncsModel {
ClientToScreen(hWnd: M.HWND, lpPoint: M.LPPOINT): M.BOOL
GetAncestor(hwnd: M.HWND, gaFlags: M.UINT): M.HWND
}
export const user32: FM.ExpandFnModel<Win32Fns> = ffi.Library('user32.dll', {
ClientToScreen: [W.BOOL, [W.HWND, W.LPPOINT] ],
GetAncestor: [W.HWND, [W.HWND, W.UINT] ],
})
// You can calling with BOTH sync and async method
const hWnd = user32.GetAncestor(hWnd, uint)
user32.GetAncestor.async(handle, uint, (err, hWnd) => {
// typeof hWnd will be the same of ReturnType of sync method
if (err) {
throw err
}
if (hWnd && !ref.isNull(hWnd) && ref.address(hWnd)) {
// ...
}
else {
throw new Error('hWnd invalid')
}
})
12.0.0 (2022-06-28)
FAQs
win32 definitions for node-ffi
The npm package win32-def receives a total of 294 weekly downloads. As such, win32-def popularity was classified as not popular.
We found that win32-def demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.