mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-14 05:31:03 +00:00
fix
This commit is contained in:
parent
4c68780e87
commit
c9bc48ad88
|
@ -1,13 +1,13 @@
|
||||||
////////////////////////////////////////////////////////////////////////
|
// autoit.js
|
||||||
// AutoIt (AutoIt3, AutoItX) API
|
// AutoIt (AutoIt3, AutoItX) API interface for WelsonJS framework
|
||||||
////////////////////////////////////////////////////////////////////////
|
// Namhyeon Go (Catswords Research) <abuse@catswords.net>
|
||||||
|
// https://github.com/gnh1201/welsonjs
|
||||||
function AutoItObject() {
|
function AutoItObject() {
|
||||||
this.interface = null;
|
this._interface = null;
|
||||||
|
|
||||||
this.create = function() {
|
this.create = function() {
|
||||||
try {
|
try {
|
||||||
this.interface = CreateObject("AutoItX3.Control");
|
this._interface = CreateObject("AutoItX3.Control");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("AutoIt_CreateObject() ->", e.message);
|
console.error("AutoIt_CreateObject() ->", e.message);
|
||||||
}
|
}
|
||||||
|
@ -37,10 +37,10 @@ function AutoItObject() {
|
||||||
this.callFunction = function(functionName, args) {
|
this.callFunction = function(functionName, args) {
|
||||||
console.log("Calling AutoItX function...", functionName);
|
console.log("Calling AutoItX function...", functionName);
|
||||||
|
|
||||||
if (this.interface != null) {
|
if (this._interface != null) {
|
||||||
try {
|
try {
|
||||||
//this.interface[functionName].apply(null, args);
|
//this._interface[functionName].apply(null, args);
|
||||||
eval("this.interface." + functionName + "(\"" + args.map(addslashes).join("\", \"") + "\")");
|
eval("this._interface." + functionName + "(\"" + args.map(addslashes).join("\", \"") + "\")");
|
||||||
sleep(300);
|
sleep(300);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("AutoItObject.callFunction() ->", e.message);
|
console.error("AutoItObject.callFunction() ->", e.message);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// chrome.js
|
// chrome.js
|
||||||
|
// Chrome Web Browser Debugging Interface for WelsonJS framework
|
||||||
// Namhyeon Go <abuse@catswords.net>
|
// Namhyeon Go <abuse@catswords.net>
|
||||||
// This code is part of WelsonJS framework
|
|
||||||
// https://github.com/gnh1201/welsonjs
|
// https://github.com/gnh1201/welsonjs
|
||||||
|
|
||||||
var STD = require("lib/std");
|
var STD = require("lib/std");
|
||||||
|
@ -17,10 +17,9 @@ var ExtraMath = require("lib/extramath");
|
||||||
// for remote debugging
|
// for remote debugging
|
||||||
var pageEventId = 0;
|
var pageEventId = 0;
|
||||||
|
|
||||||
var ChromeObject = function(interfaces) {
|
var ChromeObject = function() {
|
||||||
STD.EventTarget.apply(this, arguments); // Set event-attachable object
|
STD.EventTarget.apply(this, arguments); // Set event-attachable object
|
||||||
|
|
||||||
this.interfaces = (typeof interfaces !== "undefined" ? interfaces : []);
|
|
||||||
this.vendor = "Chrome";
|
this.vendor = "Chrome";
|
||||||
this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\Google\\:installedDir\\Application";
|
this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\Google\\:installedDir\\Application";
|
||||||
this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\Google\\:installedDir\\Application\\chrome.exe";
|
this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\Google\\:installedDir\\Application\\chrome.exe";
|
||||||
|
@ -1406,7 +1405,7 @@ exports.startDebugInPrivate = function(url, proxy, profileName, debuggingPort, i
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.4.8";
|
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.4.9";
|
||||||
exports.AUTHOR = "abuse@catswords.net";
|
exports.AUTHOR = "abuse@catswords.net";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// pipe-ipc.js
|
// pipe-ipc.js
|
||||||
|
// Pipe based IPC implementation for WelsonJS framework
|
||||||
|
// Namhyeon Go (Catswords Research) <abuse@catswords.net>
|
||||||
// https://github.com/gnh1201/welsonjs
|
// https://github.com/gnh1201/welsonjs
|
||||||
|
|
||||||
var STD = require("lib/std");
|
var STD = require("lib/std");
|
||||||
|
|
||||||
// https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/opentextfile-method
|
// https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/opentextfile-method
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
// toolkit.js
|
// toolkit.js
|
||||||
|
// WelsonJS native component interface for WelsonJS framework
|
||||||
// Namhyeon Go <abuse@catswords.net>
|
// Namhyeon Go <abuse@catswords.net>
|
||||||
// https://github.com/gnh1201/welsonjs
|
// https://github.com/gnh1201/welsonjs
|
||||||
|
|
||||||
function ToolkitObject() {
|
function ToolkitObject() {
|
||||||
this.interface = null;
|
this._interface = null;
|
||||||
|
|
||||||
this.create = function() {
|
this.create = function() {
|
||||||
try {
|
try {
|
||||||
this.interface = CreateObject("WelsonJS.Toolkit");
|
this._interface = CreateObject("WelsonJS.Toolkit");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.info("WelsonJS.Toolkit not installed");
|
console.info("WelsonJS.Toolkit not installed");
|
||||||
console.info("It could be download from https://github.com/gnh1201/welsonjs");
|
console.info("It could be download from https://github.com/gnh1201/welsonjs");
|
||||||
|
@ -17,7 +18,7 @@ function ToolkitObject() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getInterface = function() {
|
this.getInterface = function() {
|
||||||
return this.interface;
|
return this._interface;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.create();
|
this.create();
|
||||||
|
@ -114,7 +115,7 @@ exports.closeProcess = closeProcess;
|
||||||
exports.encryptStringHIGHT = encryptStringHIGHT;
|
exports.encryptStringHIGHT = encryptStringHIGHT;
|
||||||
exports.decryptStringHIGHT = decryptStringHIGHT;
|
exports.decryptStringHIGHT = decryptStringHIGHT;
|
||||||
|
|
||||||
exports.VERSIONINFO = "WelsonJS native component (WelsonJS.Toolkit) version 0.3.5";
|
exports.VERSIONINFO = "WelsonJS native component interface (WelsonJS.Toolkit) version 0.3.6";
|
||||||
exports.AUTHOR = "abuse@catswords.net";
|
exports.AUTHOR = "abuse@catswords.net";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
20
lib/wmi.js
20
lib/wmi.js
|
@ -1,24 +1,24 @@
|
||||||
////////////////////////////////////////////////////////////////////////
|
// wmi.js
|
||||||
// WMI(Windows Management Instrumentation) API
|
// WMI(Windows Management Instrumentation) API interface for WelsonJS framework
|
||||||
////////////////////////////////////////////////////////////////////////
|
// Namhyeon Go (Catswords Research) <abuse@catswords.net>
|
||||||
|
// https://github.com/gnh1201/welsonjs
|
||||||
var WMIQueryObject = function() {
|
var WMIQueryObject = function() {
|
||||||
var wbemFlagReturnImmediately = 0x10;
|
var wbemFlagReturnImmediately = 0x10;
|
||||||
var wbemFlagForwardOnly = 0x20;
|
var wbemFlagForwardOnly = 0x20;
|
||||||
|
|
||||||
this.computer = ".";
|
this.computer = ".";
|
||||||
this.namespace = "root\\cimv2";
|
this.namespace = "root\\cimv2";
|
||||||
this.interface = null;
|
this._interface = null;
|
||||||
this.cursor = {};
|
this.cursor = {};
|
||||||
this.current = {};
|
this.current = {};
|
||||||
|
|
||||||
this.create = function() {
|
this.create = function() {
|
||||||
try {
|
try {
|
||||||
if (typeof(GetObject) === "function") {
|
if (typeof(GetObject) === "function") {
|
||||||
this.interface = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\" + this.computer + "\\" + this.namespace);
|
this._interface = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\" + this.computer + "\\" + this.namespace);
|
||||||
} else {
|
} else {
|
||||||
var objLocator = CreateObject("WbemScripting.SWbemLocator");
|
var objLocator = CreateObject("WbemScripting.SWbemLocator");
|
||||||
this.interface = objLocator.ConnectServer(this.computer, this.namespace);
|
this._interface = objLocator.ConnectServer(this.computer, this.namespace);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e.message);
|
console.error(e.message);
|
||||||
|
@ -38,7 +38,7 @@ var WMIQueryObject = function() {
|
||||||
|
|
||||||
this.execQuery = function(query) {
|
this.execQuery = function(query) {
|
||||||
try {
|
try {
|
||||||
var result = this.interface.ExecQuery(query, "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);
|
var result = this._interface.ExecQuery(query, "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);
|
||||||
this.cursor = new Enumerator(result);
|
this.cursor = new Enumerator(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e.message);
|
console.error(e.message);
|
||||||
|
@ -70,7 +70,7 @@ var WMIQueryObject = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
var WMIClassObject = function() {
|
var WMIClassObject = function() {
|
||||||
this.interface = (new WMIQueryObject()).interface;
|
this._interface = (new WMIQueryObject()).interface;
|
||||||
this.classObject = null;
|
this.classObject = null;
|
||||||
this.className = "";
|
this.className = "";
|
||||||
this.instance = null;
|
this.instance = null;
|
||||||
|
@ -82,7 +82,7 @@ var WMIClassObject = function() {
|
||||||
// Instance
|
// Instance
|
||||||
this.setClass = function(className) {
|
this.setClass = function(className) {
|
||||||
this.className = className;
|
this.className = className;
|
||||||
this.classObject = this.interface.Get(className);
|
this.classObject = this._interface.Get(className);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user