Update app,js lib/jsunit.js, lib/winlibs.js

This commit is contained in:
Namhyeon Go 2020-07-27 14:56:43 +09:00
parent 81e076e585
commit 0f45cd28ac
5 changed files with 1117 additions and 14 deletions

View File

@ -27,6 +27,7 @@ WelsonJS - Build a Windows desktop apps with JavaScript, HTML, and CSS based on
- lib/service (Windows Service interface)
- lib/oldbrowser (HTML/JS/CSS interface)
- lib/uri (URI scheme interface)
- lib/winlibs (Windows DLL(Dynamic-link library) interface)
- lib/autohotkey ([AutoHotKey](https://catswords.re.kr/go/autohotkey) interface)
- lib/autoit3 ([AutoIt3](https://catswords.re.kr/go/autoit3) interface)
- lib/cloudflare ([Cloudflare Argo Tunnel](https://catswords.re.kr/go/argotunnel) interface)
@ -66,6 +67,8 @@ hello
- [JohnLaTwC's gist](https://catswords.re.kr/go/johnlatwcgist) - JavaScript RAT
- [JSMan-/JS-Framework](https://catswords.re.kr/go/jsmanfw) - No description
- [iconjack/setTimeout-for-windows-script-host](https://catswords.re.kr/go/wshtimer) - Replacement for the missing setTimeout and clearTimeout function in Windows Script Host
- [johnjohnsp1/RegistrationFreeCOM](https://catswords.re.kr/go/actctx) - Inject DLL Prototype using Microsoft.Windows.ACTCTX COM Object
- [kuntashov/jsunit](https://catswords.re.kr/go/wshjsunit) - JSUnit port for Windows Scripting Host
## Contact me
- gnh1201@gmail.com

View File

@ -27,6 +27,7 @@ WelsonJS - Build a Windows desktop apps with JavaScript, HTML, and CSS based on
- lib/service (Windows Service interface)
- lib/oldbrowser (HTML/JS/CSS interface)
- lib/uri (URI scheme interface)
- lib/winlibs (Windows DLL(Dynamic-link library) interface)
- lib/autohotkey ([AutoHotKey](https://catswords.re.kr/go/autohotkey) interface)
- lib/autoit3 ([AutoIt3](https://catswords.re.kr/go/autoit3) interface)
- lib/cloudflare ([Cloudflare Argo Tunnel](https://catswords.re.kr/go/argotunnel) interface)
@ -66,6 +67,8 @@ hello
- [JohnLaTwC's gist](https://catswords.re.kr/go/johnlatwcgist) - JavaScript RAT
- [JSMan-/JS-Framework](https://catswords.re.kr/go/jsmanfw) - No description
- [iconjack/setTimeout-for-windows-script-host](https://catswords.re.kr/go/wshtimer) - Replacement for the missing setTimeout and clearTimeout function in Windows Script Host
- [johnjohnsp1/RegistrationFreeCOM](https://catswords.re.kr/go/actctx) - Inject DLL Prototype using Microsoft.Windows.ACTCTX COM Object
- [kuntashov/jsunit](https://catswords.re.kr/go/wshjsunit) - JSUnit port for Windows Scripting Host
## Contact me
- gnh1201@gmail.com

2
app.js
View File

@ -170,7 +170,7 @@ function init_console() {
var app = require(name);
if (app) {
if (app.main) {
var exitstatus = app.main(args);
var exitstatus = app.main.call(this, args);
if (typeof(exitstatus) !== "undefined") {
exit(exitstatus);
}

1079
lib/jsunit.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,23 +7,41 @@ exports.global = global;
exports.require = global.require;
var SHELL = require("lib/shell");
var FILE = require("lib/file");
exports.loadLibrary = function(LIB) {
return {
call: function(FN, args) {
var cmd = [
"rundll32.exe"
];
if (typeof(FN) === "undefined") {
FN = "DllMain";
var dllManifest = LIB + ".manifest";
if (FILE.fileExists(dllManifest)) {
var actCtx = CreateObject("Microsoft.Windows.ActCtx");
actCtx.Manifest = dllManifest;
try {
var DX = actCtx.CreateObject("MessageBox");
return {
call: function(FN, args) {
return DX[FN].call(this, args);
}
}
cmd.push(LIB + ".dll," + FN);
if (typeof(args) !== "undefined") {
cmd = cmd.concat(args);
}
return SHELL.exec(cmd);
} catch(e) {
// return null;
}
};
} else {
return {
call: function(FN, args) {
var cmd = [
"rundll32.exe"
];
if (typeof(FN) === "undefined") {
FN = "DllMain";
}
cmd.push(LIB + ".dll," + FN);
if (typeof(args) !== "undefined") {
cmd = cmd.concat(args);
}
return SHELL.exec(cmd);
}
};
}
};
exports.SHELL32 = (function() {