// https://github.com/wwog/easyWin import ffi from 'ffi-napi' import hmc from 'hmc-win32'; function 测试ffi_napi() { // var libm = ffi.Library('libm', { // 'ceil': [ 'double', [ 'double' ] ] // }); // libm.ceil(1.5); // 2 // You can also access just functions in the current process by passing a null // var current = ffi.Library(null, { // 'atoi': [ 'int', [ 'string' ] ] // }); // current.atoi('1234'); // 1234 var current = ffi.Library('user32.dll', { 'MessageBoxA': [ 'int', [ 'int', 'int' , 'int' , 'int' ] ] }); current.MessageBoxA(0,0,0,0); // 1234 // NTSTATUS NTAPI NtSuspendProcess(HANDLE ProcessHandle) var ntdll = ffi.Library('ntdll.dll', { 'NtSuspendProcess': [ 'int', [ 'int' ] ] }); ntdll.NtSuspendProcess(-1); } function 测试hmc() { // console.log(hmc) let procList = hmc.Process.getDetailsList() console.log(procList) } 测试hmc()