summaryrefslogtreecommitdiffhomepage
path: root/dev/base/RunDLL64/src/Main.cc
diff options
context:
space:
mode:
authorAmlal <amlal@el-mahrouss-logic.com>2024-10-24 18:30:07 +0200
committerAmlal <amlal@el-mahrouss-logic.com>2024-10-24 18:30:07 +0200
commit52b4044ab4956597aee4c629ba5fe5ec8966beac (patch)
tree447eeb6e3ddd082a866080ff7776de3e5ff4e45d /dev/base/RunDLL64/src/Main.cc
parent6e3be96bb9a9b3047aee59da639819453eaab6ac (diff)
META: Bumping source code.
Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'dev/base/RunDLL64/src/Main.cc')
-rw-r--r--dev/base/RunDLL64/src/Main.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/dev/base/RunDLL64/src/Main.cc b/dev/base/RunDLL64/src/Main.cc
new file mode 100644
index 00000000..ee3cdfa6
--- /dev/null
+++ b/dev/base/RunDLL64/src/Main.cc
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2024 ZKA Web Services Co
+ */
+
+#include <sci/sci_base.h>
+
+typedef int (*MainKind)(int, char**);
+
+int main(int argc, char* argv[])
+{
+ if (argc < 3)
+ return -1;
+
+ auto mainDll = LdrOpenDLL(argv[1], argv[2]);
+
+ int (*entrypointOff)(int, char**) = (MainKind)LdrGetDLLProc(argv[3], mainDll);
+
+ if (!entrypointOff)
+ return -1;
+
+ int ret = entrypointOff(argc, argv);
+
+ LdrCloseDLL(mainDll);
+
+ return ret;
+}