VtoyTool add cmds.

This commit is contained in:
longpanda
2026-10-08 11:04:39 +08:00
parent 2c4e686293
commit 432152813e
3 changed files with 293 additions and 71 deletions
+8 -6
View File
@@ -7,12 +7,12 @@
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
@@ -38,10 +38,11 @@ int vtoyloader_main(int argc, char **argv);
int vtoyvine_main(int argc, char **argv);
int vtoyksym_main(int argc, char **argv);
int vtoykmod_main(int argc, char **argv);
int vtoygpt_main(int argc, char **argv);
int vtoyexpand_main(int argc, char **argv);
static char *g_vtoytool_name = NULL;
static cmd_def g_cmd_list[] =
static cmd_def g_cmd_list[] =
{
{ "vine_patch_loader", vtoyvine_main },
{ "vtoydump", vtoydump_main },
@@ -51,6 +52,7 @@ static cmd_def g_cmd_list[] =
{ "vtoyksym", vtoyksym_main },
{ "vtoykmod", vtoykmod_main },
{ "vtoyexpand", vtoyexpand_main },
{ "vtoygpt", vtoygpt_main },
{ "--install", vtoytool_install },
};
@@ -60,7 +62,7 @@ int vtoytool_install(int argc, char **argv)
int i;
char toolpath[128];
char filepath[128];
for (i = 0; i < sizeof(g_cmd_list) / sizeof(g_cmd_list[0]); i++)
{
if (g_cmd_list[i].cmd[0] != '-')
@@ -70,14 +72,14 @@ int vtoytool_install(int argc, char **argv)
link(toolpath, filepath);
}
}
return 0;
}
int main(int argc, char **argv)
{
int i;
if ((g_vtoytool_name = strstr(argv[0], "vtoytool")) != NULL)
{
argc--;