Skip to content

Commit

Permalink
webMAN MOD 1.47.38
Browse files Browse the repository at this point in the history
- Major changes in source code structure
- Fixed various regressions
- Fixed errors in help file (issue #633)
  • Loading branch information
aldostools committed Mar 21, 2022
1 parent 48a17f8 commit cd40f3c
Show file tree
Hide file tree
Showing 120 changed files with 4,670 additions and 5,940 deletions.
2 changes: 1 addition & 1 deletion _Make_pkg.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ title Building webMAN_MOD_latest.pkg ...
call make_update.bat

set ver=1.47
set rev=37
set rev=38

move webMAN_MOD_%ver%.xx_Updater.pkg ..\..\webMAN_MOD_%ver%.%rev%_Installer.pkg
move webMAN_MOD_%ver%.xx_Updater_rebugification_theme.pkg ..\..\webMAN_MOD_%ver%.%rev%_Installer_rebugification_theme.pkg
Expand Down
2 changes: 1 addition & 1 deletion _Projects_/updater/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DATA := data
INCLUDES := include
PKGFILES := $(CURDIR)/pkgfiles

TITLE := webMAN MOD 1.47.37 Installer [Hold R1 for VSH Menu, L1 for Full Edition, X for Lite Edition]
TITLE := webMAN MOD 1.47.38 Installer [Hold R1 for VSH Menu, L1 for Full Edition, X for Lite Edition]
APPID := UPDWEBMOD
CONTENTID := EP0001-$(APPID)_00-0000000000000000

Expand Down
4 changes: 2 additions & 2 deletions _Projects_/updater/make_update.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@ECHO OFF
title make_package_custom
if not exist custom md custom
title Building webMAN_MOD_latest.pkg
if not exist update md update

:: ----------------------------------------------
:: Simple script to build a PKG (by CaptainCPS-X)
Expand Down
Binary file modified _Projects_/updater/pkgfiles/PARAM.SFO
Binary file not shown.
2 changes: 1 addition & 1 deletion _Projects_/updater/pkgfiles/USRDIR/html/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function t2lnks(){
var dev2 =/(\/\b(dev_+.*))/ig;
var htab = txt.innerHTML.indexOf("\t") > 0;
var count = txt.innerHTML.split("\n").length - 1;
txt.innerHTML = "<a href='/'><b>webMAN MOD</b> 1.47.37</a><HR>"+
txt.innerHTML = "<a href='/'><b>webMAN MOD</b> 1.47.38</a><HR>"+
"<style>td+td{width:100px;}</style><table>" +
txt.innerHTML
.replace(url, "<tr><td><a href='$1'>$1</td></tr>")
Expand Down
2 changes: 1 addition & 1 deletion _Projects_/updater/pkgfiles/USRDIR/html/help.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _Projects_/updater/pkgfiles/USRDIR/html/mobile.html
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@
</div>

<div id="menu" style="display:none;">
<div id="header"><a id="nav-close" href="javascript:void(0)" onclick="hideMenu();"><span style="position:absolute;left:10px">&#9664;</span> webMAN MOD 1.47.37</a></div>
<div id="header"><a id="nav-close" href="javascript:void(0)" onclick="hideMenu();"><span style="position:absolute;left:10px">&#9664;</span> webMAN MOD 1.47.38</a></div>
<div id="wrapper-menu">
<div id="scroller">
<ul id="thelist">
Expand Down
2 changes: 1 addition & 1 deletion _Projects_/updater/pkgfiles/USRDIR/html/sman.htm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<head>
<title>wMAN MOD 1.47.37</title>
<title>wMAN MOD 1.47.38</title>
<link rel="stylesheet" type="text/css" href="/dev_hdd0/xmlhost/game_plugin/sman.css"/>
<script src="/dev_hdd0/xmlhost/game_plugin/sman.js"></script>
</head>
Expand Down
Binary file modified _Projects_/updater/pkgfiles/USRDIR/webftp_server_full.sprx
Binary file not shown.
Binary file modified _Projects_/updater/pkgfiles/USRDIR/webftp_server_lite.sprx
Binary file not shown.
Binary file modified _Projects_/updater/pkgfiles/USRDIR/webftp_server_noncobra.sprx
Binary file not shown.
Binary file not shown.
Binary file modified _Projects_/updater/update/dev_hdd0/plugins/webftp_server.sprx
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function t2lnks(){
var dev2 =/(\/\b(dev_+.*))/ig;
var htab = txt.innerHTML.indexOf("\t") > 0;
var count = txt.innerHTML.split("\n").length - 1;
txt.innerHTML = "<a href='/'><b>webMAN MOD</b> 1.47.37</a><HR>"+
txt.innerHTML = "<a href='/'><b>webMAN MOD</b> 1.47.38</a><HR>"+
"<style>td+td{width:100px;}</style><table>" +
txt.innerHTML
.replace(url, "<tr><td><a href='$1'>$1</td></tr>")
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@
</div>

<div id="menu" style="display:none;">
<div id="header"><a id="nav-close" href="javascript:void(0)" onclick="hideMenu();"><span style="position:absolute;left:10px">&#9664;</span> webMAN MOD 1.47.37</a></div>
<div id="header"><a id="nav-close" href="javascript:void(0)" onclick="hideMenu();"><span style="position:absolute;left:10px">&#9664;</span> webMAN MOD 1.47.38</a></div>
<div id="wrapper-menu">
<div id="scroller">
<ul id="thelist">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<head>
<title>wMAN MOD 1.47.37</title>
<title>wMAN MOD 1.47.38</title>
<link rel="stylesheet" type="text/css" href="/dev_hdd0/xmlhost/game_plugin/sman.css"/>
<script src="/dev_hdd0/xmlhost/game_plugin/sman.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions cobra/cobra.c
Original file line number Diff line number Diff line change
Expand Up @@ -1533,9 +1533,9 @@ int cobra_set_psp_umd(char *path, char *umd_root, char *icon_save_path)
unsigned int real_disctype, effective_disctype, iso_disctype;

char title_id[11];
read_file(path, title_id, 10, 0x8373); title_id[10] = 0;
read_file(path, title_id, 10, 0x8373); title_id[10] = '\0';

//memcpy(title_id, sector + 0x373, 10); title_id[10] = 0;
//memcpy(title_id, sector + 0x373, 10); title_id[10] = '\0';

uint8_t is_dir = 1;
uint8_t do_mount = 0;
Expand Down
50 changes: 25 additions & 25 deletions include/_mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ static bool game_mount(char *buffer, char *templn, char *param, char *tempstr, b
// unmount current game
// ---------------------
char *uparam = param + 7;
char *param2 = param + MOUNT_CMD;
char *params = param + MOUNT_CMD;

if(islike(param, "/mount") && (islike(uparam, "ps3/unmount") || islike(param2, "/dev_bdvd") || islike(param2, "/app_home")))
if(islike(param, "/mount") && (islike(uparam, "ps3/unmount") || islike(params, "/dev_bdvd") || islike(params, "/app_home")))
{
if(mount_ps3 || forced_mount || IS_ON_XMB)
{
Expand Down Expand Up @@ -424,7 +424,7 @@ static bool game_mount(char *buffer, char *templn, char *param, char *tempstr, b

if(cp_mode)
{
sprintf(target, "%s", cp_path);
strcpy(target, cp_path);
}
else
if(*target) {if(!isDir(source) && isDir(target)) strcat(target, filename);} // &to=<destination>
Expand All @@ -436,15 +436,15 @@ static bool game_mount(char *buffer, char *templn, char *param, char *tempstr, b
{
struct CellFsStat buf;
if(cellFsStat(source, &buf) != CELL_FS_SUCCEEDED)
sprintf(target, "%s", STR_ERROR);
strcpy(target, STR_ERROR);
else
{
u64 size = buf.st_size;

enable_dev_blind(source);

// for cobra req: /dev_flash/sys/stage2.bin & /dev_flash/sys/lv2_self
sprintf(target, SYS_COBRA_PATH "stage2.bin");
strcpy(target, SYS_COBRA_PATH "stage2.bin");
if(isDir("/dev_flash/rebug/cobra"))
{
if(IS(ext4, ".dex"))
Expand All @@ -455,7 +455,7 @@ static bool game_mount(char *buffer, char *templn, char *param, char *tempstr, b

if(not_exists(target))
{
sprintf(tempstr, "%s", source);
strcpy(tempstr, source);
strcpy(get_filename(tempstr), "/stage2.bin");
if(file_exists(tempstr)) _file_copy(tempstr, target);
}
Expand Down Expand Up @@ -672,21 +672,21 @@ static bool game_mount(char *buffer, char *templn, char *param, char *tempstr, b
if((c < 0x20) || (c > 0x7F)) continue;
if(!strchr("\\\"/<|>:*?", title[i])) title[n++] = title[i];
}
title[n] = 0;
title[n] = '\0';

if(*title_id && (title_id[8] >= '0'))
{
if(strstr(title, " ["))
sprintf(target + 16, "%s", title);
else if(*title)
sprintf(target + 16, "%s [%s]", title, title_id);
if(*title == '\0')
strcpy(target + 16, title_id);
else if(strstr(title, " ["))
strcpy(target + 16, title);
else
sprintf(target + 16, "%s", title_id);
sprintf(target + 16, "%s [%s]", title, title_id);
}
}
}
else
sprintf(target, "/dev_hdd0");
strcpy(target, "/dev_hdd0");

char *p = strchr(source + 9, '/');
if(p) strcat(target, p);
Expand Down Expand Up @@ -807,12 +807,12 @@ static bool game_mount(char *buffer, char *templn, char *param, char *tempstr, b
}
#ifndef LITE_EDITION
#ifdef COBRA_ONLY
if(islike(param2, "/net") && !is_netsrv_enabled(param[4 + MOUNT_CMD])) mlen += sprintf(tempstr + mlen, " /net%c %s", param[4 + MOUNT_CMD], STR_DISABLED);
if(islike(params, "/net") && !is_netsrv_enabled(param[4 + MOUNT_CMD])) mlen += sprintf(tempstr + mlen, " /net%c %s", param[4 + MOUNT_CMD], STR_DISABLED);
#endif
#endif
if(!forced_mount && IS_INGAME)
{
sprintf(tempstr + mlen, " <a href=\"/mount_ps3%s\">/mount_ps3%s</a>", param2, param2);
sprintf(tempstr + mlen, " <a href=\"/mount_ps3%s\">/mount_ps3%s</a>", params, params);
}
}
#ifndef ENGLISH_ONLY
Expand All @@ -830,14 +830,14 @@ static bool game_mount(char *buffer, char *templn, char *param, char *tempstr, b
{
int fd2; u16 pcount = 0; u32 tlen = strlen(buffer) + 8; u8 is_iso = 0;

sprintf(target, "%s", source);
strcpy(target, source);
if(strstr(target, "Sing"))
{
char *pos = strstr(target, "/PS3ISO");
if(pos)
{sprintf(pos, "/PS2DISC"); is_iso = 1;}
{strcpy(pos, "/PS2DISC"); is_iso = 1;}
else if(strstr(target, ".ntfs[PS3ISO]"))
{sprintf(target, "/dev_hdd0/PS2DISC"); is_iso = 1;}
{strcpy(target, "/dev_hdd0/PS2DISC"); is_iso = 1;}
}

// -----------------------------
Expand Down Expand Up @@ -1066,7 +1066,7 @@ static void do_umount(bool clean)

cobra_unload_vsh_plugin(0); // unload external rawseciso / netiso plugins

cellFsChmod((char*)"/dev_bdvd/PS3_GAME/SND0.AT3", MODE); // restore SND0 permissions of game mounted (JB folder)
cellFsChmod("/dev_bdvd/PS3_GAME/SND0.AT3", MODE); // restore SND0 permissions of game mounted (JB folder)

apply_remaps();

Expand Down Expand Up @@ -1201,8 +1201,8 @@ static void cache_icon0_and_param_sfo(char *destpath)
{
for(u8 retry = 0; retry < 10; retry++)
{
if(file_copy((char*)"/dev_bdvd/PS3_GAME/PARAM.SFO", destpath, COPY_WHOLE_FILE) >= CELL_FS_SUCCEEDED) break;
if(file_copy((char*)"/dev_bdvd/PS3_GM01/PARAM.SFO", destpath, COPY_WHOLE_FILE) >= CELL_FS_SUCCEEDED) break;
if(file_copy("/dev_bdvd/PS3_GAME/PARAM.SFO", destpath, COPY_WHOLE_FILE) >= CELL_FS_SUCCEEDED) break;
if(file_copy("/dev_bdvd/PS3_GM01/PARAM.SFO", destpath, COPY_WHOLE_FILE) >= CELL_FS_SUCCEEDED) break;
sys_ppu_thread_usleep(500000);
}
}
Expand All @@ -1213,8 +1213,8 @@ static void cache_icon0_and_param_sfo(char *destpath)
{
for(u8 retry = 0; retry < 10; retry++)
{
if(file_copy((char*)"/dev_bdvd/PS3_GAME/ICON0.PNG", destpath, COPY_WHOLE_FILE) >= CELL_FS_SUCCEEDED) break;
if(file_copy((char*)"/dev_bdvd/PS3_GM01/ICON0.PNG", destpath, COPY_WHOLE_FILE) >= CELL_FS_SUCCEEDED) break;
if(file_copy("/dev_bdvd/PS3_GAME/ICON0.PNG", destpath, COPY_WHOLE_FILE) >= CELL_FS_SUCCEEDED) break;
if(file_copy("/dev_bdvd/PS3_GM01/ICON0.PNG", destpath, COPY_WHOLE_FILE) >= CELL_FS_SUCCEEDED) break;
sys_ppu_thread_usleep(500000);
}
}
Expand Down Expand Up @@ -1246,7 +1246,7 @@ static bool mount_ps_disc_image(char *_path, char *cobra_iso_list[], u8 iso_part
{
const char *cue_ext[4] = {".cue", ".ccd", ".CUE", ".CCD"};
change_ext(_path, 4, cue_ext);
if(not_exists(_path)) sprintf(_path, "%s", cobra_iso_list[0]);
if(not_exists(_path)) strcpy(_path, cobra_iso_list[0]);
}

mount_iso |= file_exists(cobra_iso_list[0]); ret = mount_iso; mount_unk = emu_type;
Expand Down Expand Up @@ -1568,7 +1568,7 @@ static void mount_thread(u64 action)
// remove /PS3_GAME
// -----------------

sprintf(_path, "%s", _path0);
strcpy(_path, _path0);

if(*_path == '/')
{
Expand Down
15 changes: 15 additions & 0 deletions include/cmd/abort.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#if defined(FIX_GAME) || defined(COPY_PS3)
if(strstr(param, ".ps3$abort"))
{
// /copy.ps3$abort
// /fixgame.ps3$abort
do_restart = false;

if(copy_in_progress) {copy_aborted = true; vshNotify_WithIcon(ICON_EXCLAMATION, STR_CPYABORT);} // /copy.ps3$abort
#ifdef FIX_GAME
if(fix_in_progress) {fix_aborted = true; vshNotify_WithIcon(ICON_EXCLAMATION, "Fix aborted!");} // /fixgame.ps3$abort
#endif

strcpy(param, "/");
}
#endif
21 changes: 21 additions & 0 deletions include/cmd/admin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifdef SYS_ADMIN_MODE
if(islike(param, "/admin.ps3"))
{
// /admin.ps3? show status
// /admin.ps3?enable&pwd=<password> enable admin mode
// /admin.ps3?disable disable admin mode
// /admin.ps3?0 disable admin mode

if(param[10] == 0 || param[11] == 0) ; else // show status
if(~param[11] & 1) sys_admin = 0; else // set user mode
{
sys_admin = check_password(param); // set admin mode (if password is ok)
}

sprintf(param, "ADMIN %s", sys_admin ? STR_ENABLED : STR_DISABLED);

if(!mc) keep_alive = http_response(conn_s, header, param, CODE_RETURN_TO_ROOT, param);

goto exit_handleclient_www;
}
#endif
9 changes: 9 additions & 0 deletions include/cmd/chat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifdef WEB_CHAT
if(islike(param, "/chat.ps3"))
{
// /chat.ps3 webchat

is_popup = 1;
goto html_response;
}
#endif
20 changes: 20 additions & 0 deletions include/cmd/consoleid.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifdef SPOOF_CONSOLEID
bool is_psid = islike(param, "/psid.ps3");
bool is_idps = islike(param, "/idps.ps3");

if(islike(param, "/consoleid.ps3")) is_psid = is_idps = true;

if(is_psid | is_idps)
{
// /idps.ps3 copy idps & act.dat (current user) to /dev_usb000 or /dev_hdd0
// /idps.ps3<path> copy idps to <path> (binary file)
// /psid.ps3 copy psid & act.dat (current user) to /dev_usb000 or /dev_hdd0
// /psid.ps3<path> copy psid to <path> (binary file)
// /consoleid.ps3 copy psid, idps & act.dat (current user) to /dev_usb000 or /dev_hdd0

save_idps_psid(is_psid, is_idps, header, param);

keep_alive = http_response(conn_s, header, param, CODE_HTTP_OK, param);
goto exit_handleclient_www;
}
#endif
37 changes: 37 additions & 0 deletions include/cmd/cpursx_tempc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
if(islike(param, "/cpursx_ps3"))
{
char *cpursx = header, *buffer = param; get_cpursx(cpursx);
/* // prevents flickering but cause error 80710336 in ps3 browser (silk mode)
sprintf(buffer, "<meta http-equiv=\"refresh\" content=\"15;URL=%s\">"
"<script>parent.document.getElementById('lbl_cpursx').innerHTML = \"%s\";</script>",
"/cpursx_ps3", cpursx);
*/
int buf_len = sprintf(buffer, "<meta http-equiv=\"refresh\" content=\"15;URL=%s\">"
"%s"
"<a href=\"%s\" target=\"_parent\" style=\"text-decoration:none;\">"
"<font color=\"#fff\">%s</a>",
"/cpursx_ps3", HTML_BODY, "/cpursx.ps3", cpursx);
buf_len = sprintf(header, HTML_RESPONSE_FMT,
CODE_HTTP_OK, "/cpursx_ps3", HTML_HEADER, buffer, HTML_BODY_END);

send(conn_s, header, buf_len, 0); keep_alive = 0;

goto exit_handleclient_www;
}
else if(islike(param, "/tempc.html") || islike(param, "/tempf.html"))
{
u8 t1 = 0, t2 = 0;
get_temperature(0, &t1); // CPU // 3E030000 -> 3E.03°C -> 62.(03/256)°C
get_temperature(1, &t2); // RSX

u8 st, mode, unknown;
sys_sm_get_fan_policy(0, &st, &mode, &fan_speed, &unknown);

sprintf(header, "function setGaugeValues(){"
"cpu=%i;"
"rsx=%i;"
"fan=%i;"
"}", t1, t2, fan_speed * 100 / 255);

save_file(HTML_BASE_PATH "/temp.js", header, SAVE_ALL);
}
34 changes: 34 additions & 0 deletions include/cmd/cpy_cut_paste.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
if(islike(param, "/cpy.ps3") || islike(param, "/cut.ps3"))
{
// /cpy.ps3<path> stores <path> in <cp_path> clipboard buffer for copy with /paste.ps3 (cp_mode = 1)
// /cut.ps3<path> stores <path> in <cp_path> clipboard buffer for move with /paste.ps3 (cp_mode = 2)

cp_mode = islike(param, "/cut.ps3") ? CP_MODE_MOVE : CP_MODE_COPY;
snprintf(cp_path, STD_PATH_LEN, "%s", param + 8);
check_path_alias(cp_path);
if(not_exists(cp_path)) cp_mode = CP_MODE_NONE;

strcpy(param, cp_path); remove_filename(param);

is_binary = FOLDER_LISTING;
goto html_response;
}
else
if(islike(param, "/paste.ps3"))
{
// /paste.ps3<path> performs a copy or move of path stored in <cp_path clipboard> to <path> indicated in url

#define PASTE_CMD 10

char *source = header, *dest = cp_path;
if(file_exists(cp_path))
{
sprintf(source, "/copy.ps3%s", cp_path);
strcpy(dest, param + PASTE_CMD);
strcpy(param, source); strcat(dest, get_filename(param));
is_binary = WEB_COMMAND;
goto html_response;
}
else
if(!mc) {keep_alive = http_response(conn_s, header, "/", CODE_GOBACK, HTML_REDIRECT_TO_BACK); goto exit_handleclient_www;}
}
Loading

0 comments on commit cd40f3c

Please sign in to comment.