Skip to content

Commit 8e0c1c2

Browse files
committed
feat: linux(WIP)
1 parent 0cc8cd1 commit 8e0c1c2

File tree

3 files changed

+23
-24
lines changed

3 files changed

+23
-24
lines changed
0 Bytes
Binary file not shown.
Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
#include <windows.h>
21
#include <string>
2+
#include <windows.h>
33

4-
int wmain(int argc, wchar_t* argv[]) {
5-
if (argc < 4) return 2;
6-
std::wstring msix = argv[1];
7-
std::wstring out = argv[2];
8-
std::wstring dllArg = argv[3];
9-
if (msix.empty() || out.empty() || dllArg.empty()) return 2;
4+
int main(int argc, char **argv) {
5+
if (argc < 4) {
106

11-
HMODULE h = LoadLibraryW(dllArg.c_str());
12-
if (!h) return 3;
13-
typedef int (__stdcall *MIW)(const wchar_t*, const wchar_t*);
14-
typedef int (__stdcall *MIA)(const char*, const char*);
15-
MIW miw = (MIW)GetProcAddress(h, "miHoYoW");
16-
if (miw) {
17-
int rc = miw(msix.c_str(), out.c_str());
18-
FreeLibrary(h);
19-
return rc;
20-
}
21-
MIA mia = (MIA)GetProcAddress(h, "miHoYo");
22-
if (mia) {
23-
int rc = mia(std::string(msix.begin(), msix.end()).c_str(), std::string(out.begin(), out.end()).c_str());
24-
FreeLibrary(h);
25-
return rc;
26-
}
27-
FreeLibrary(h);
7+
return 2;
8+
}
9+
const char *msix = argv[1];
10+
const char *out = argv[2];
11+
const char *dllArg = argv[3];
12+
13+
HMODULE h = LoadLibraryA(dllArg);
14+
if (!h)
2815
return 3;
16+
17+
typedef int(__stdcall * MIA)(const char *, const char *);
18+
19+
MIA mia = (MIA)GetProcAddress(h, "miHoYo");
20+
if (mia) {
21+
int rc = mia(msix, out);
22+
printf("%d", rc);
23+
FreeLibrary(h);
24+
return rc;
25+
}
26+
FreeLibrary(h);
27+
return 3;
2928
}
27.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)