<commit_before>const manipulateMemory = require('bindings')('Win32ManipulateMyMemory');

// Refer to https://msdn.microsoft.com/en-us/library/windows/desktop/ms684880(v=vs.85).aspx
const PROCESS_ACCESS_RIGHTS = {
    PROCESS_TERMINATE: 0x0001
  , PROCESS_CREATE_THREAD: 0x0002
  , PROCESS_SET_SESSIONID: 0x0004
  , PROCESS_VM_OPERATION: 0x0008
  , PROCESS_VM_READ: 0x0010
  , PROCESS_VM_WRITE: 0x0020
  , PROCESS_DUP_HANDLE: 0x0040
  , PROCESS_CREATE_PROCESS: 0x0080
  , PROCESS_SET_QUOTA: 0x0100
  , PROCESS_SET_INFORMATION: 0x0200
  , PROCESS_QUERY_INFORMATION: 0x0400
  , PROCESS_SUSPEND_RESUME: 0x0800
  , PROCESS_QUERY_LIMITED_INFORMATION: 0x1000
  , PROCESS_SET_LIMITED_INFORMATION: 0x1000
};

function openProcess(desiredAccess, inheritHandle, processId, cb) {
  manipulateMemory.openProcess(desiredAccess, inheritHandle, processId, cb);
}

function openProcessSync(desiredAccess, inheritHandle, processId) {
  return manipulateMemory.openProcessSync(desiredAccess, inheritHandle, processId);
}

function readProcessMemory(handle, address, size, cb) {
  manipulateMemory.readProcessMemory(handle, address, size, cb);
}

function readProcessMemorySync(handle, address, size) {
  return manipulateMemory.readProcessMemory(handle, address, size);
}

function closeHandle(handle, cb) {
  manipulateMemory.closeHandle(handle, cb);
}

function closeHandleSync(handle) {
  return manipulateMemory.closeHandleSync(handle);
}

function findWindow(className, windowName, cb) {
  manipulateMemory.findWindow(className, windowName, cb);
}

function findWindowSync(className, windowName) {
  return manipulateMemory.findWindowSync(className, windowName);
}

function getWindowThreadProcessId(hwnd, cb) {
  manipulateMemory.getWindowThreadProcessId(hwnd, cb);
}

function getWindowThreadProcessIdSync(hwnd) {
  return manipulateMemory.getWindowThreadProcessIdSync(hwnd);
}

module.exports = {
    openProcess
  , openProcessSync
  , readProcessMemory
  , readProcessMemorySync
  , closeHandle
  , closeHandleSync
  , findWindow
  , findWindowSync
  , getWindowThreadProcessId
  , getWindowThreadProcessIdSync
};
<commit_msg>Repair the exports and proxies so it's usable<commit_after>const manipulateMemory = require('bindings')('Win32ManipulateMyMemory');

// Refer to https://msdn.microsoft.com/en-us/library/windows/desktop/ms684880(v=vs.85).aspx
const PROCESS_ACCESS_RIGHTS = {
    PROCESS_TERMINATE: 0x0001
  , PROCESS_CREATE_THREAD: 0x0002
  , PROCESS_SET_SESSIONID: 0x0004
  , PROCESS_VM_OPERATION: 0x0008
  , PROCESS_VM_READ: 0x0010
  , PROCESS_VM_WRITE: 0x0020
  , PROCESS_DUP_HANDLE: 0x0040
  , PROCESS_CREATE_PROCESS: 0x0080
  , PROCESS_SET_QUOTA: 0x0100
  , PROCESS_SET_INFORMATION: 0x0200
  , PROCESS_QUERY_INFORMATION: 0x0400
  , PROCESS_SUSPEND_RESUME: 0x0800
  , PROCESS_QUERY_LIMITED_INFORMATION: 0x1000
  , PROCESS_SET_LIMITED_INFORMATION: 0x1000
};

function openProcess(desiredAccess, inheritHandle, processId, cb) {
  manipulateMemory.openProcess(desiredAccess, inheritHandle, processId, cb);
}

function openProcessSync(desiredAccess, inheritHandle, processId) {
  return manipulateMemory.openProcessSync(desiredAccess, inheritHandle, processId);
}

function readProcessMemory(handle, address, size, cb) {
  manipulateMemory.readProcessMemory(handle, address, size, cb);
}

function readProcessMemorySync(handle, address, size) {
  return manipulateMemory.readProcessMemorySync(handle, address, size);
}

function closeHandle(handle, cb) {
  manipulateMemory.closeHandle(handle, cb);
}

function closeHandleSync(handle) {
  return manipulateMemory.closeHandleSync(handle);
}

function findWindow(className, windowName, cb) {
  manipulateMemory.findWindow(className, windowName, cb);
}

function findWindowSync(className, windowName) {
  return manipulateMemory.findWindowSync(className, windowName);
}

function getWindowThreadProcessId(hwnd, cb) {
  manipulateMemory.getWindowThreadProcessId(hwnd, cb);
}

function getWindowThreadProcessIdSync(hwnd) {
  return manipulateMemory.getWindowThreadProcessIdSync(hwnd);
}

module.exports = {
    PROCESS_ACCESS_RIGHTS
  , openProcess
  , openProcessSync
  , readProcessMemory
  , readProcessMemorySync
  , closeHandle
  , closeHandleSync
  , findWindow
  , findWindowSync
  , getWindowThreadProcessId
  , getWindowThreadProcessIdSync
};

{'fraction_non_alphanumeric': 0.08421526683179464, 'fraction_numerical': 0.03602792163927043, 'mean_word_length': 5.354792560801145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1310952', 'n_tokens_mistral': 1606, 'n_tokens_neox': 1428, 'n_words': 232}