Skip to content

zzxdt/node-lunaHook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-lunaHook

👀 lunaHook for nodejs

LunaTextractor is an open-source x86/x64 text hooker for Windows support almost visual novel games

👓 Requirements

  • ✅ LunaHook ver 3.2.1

  • ✅ Need files include

LunaHost64.dll
LunaHost32.dll
LunaHook64.dll
LunaHook32.dll
LunaHostCLI64.exe / LunaHostCLI32.exe

📜 Example

npm i lunahook
import LunaHookTextractor from "lunaHook";
//process pid
const PID = 16064
//need the path of LunaHostCLI64.exe
let textractor = new LunaHookTextractor('../unaTextractor/LunaHostCLI64.exe');
textractor.on('output', output => {
    console.log(`[${output.handle}]: ${output.text}`)
})
textractor.start()
textractor.attach(PID)

✏️ TextOutputObject

{
  handle: number; // hook index
  pid: number; // process ID
  addr: number; // hook address
  ctx: number; // hook context
  ctx2: number; // hook context 2
  name: string; // hook name
  code: string; // hook code
  text: string; // output text
}

🔑 API


💡 LunaHookTextractor(path: string)

The constructor.

Params

   Path to LunaHostCLI64/32.exe

start(): void

   Start LunaHook process.

💡 attach (pid: number): void

Attach text hooker to a specific process.

Params

  pid - Process ID

Throws

  RangeError if pid is invalid

  ReferenceError if Textractor process is not started

💡 detach(pid: number): void

Detach text hooker to a specific process.

Params

  pid - Process ID

Throws

   ReferenceError if the process has not been attached

💡 hook(pid: number, code: string): void

Inject a hook into a specific process. Supports /H hook code and /R read code.

Params

   pid - Process ID

Throws

  ReferenceError if LunaHook process is not started
  ReferenceError if the process has not been attached
  SyntaxError if code is invalid

🔋 on(event: "output", listener: (output: TextOutputObject) => void): this

Specify callback function when text outputs.

Params

  event - Must be "output"
  listener - The callback function

💡 exec(command: string): void

   Execute a command manually.

Params

  command - The command to execute

Throws

  ReferenceError if LunaHook process is not started

💡 stop(): void

  Stop LunaHook process.

🚪 License

MIT

About

use lunaHook to create a npm package

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published