Hacking wwt+wit: Wiimms WBFS+ISO Tools

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
I have comitted a new version of wwt.

Code:
wwt v0.31b r629 -2010-02-08

- wwt+wit: New envrionment variable: WWT_LANG: Define a default language.
- wwt+wit: New option: --lang= : Define the working language.
- wwt FORMAT --recover: Little optimizations.
- Bug fix: Enable cache for all commands if reading from a pipe.
 

pudquick

Member
Newcomer
Joined
Jun 16, 2008
Messages
10
Trophies
0
XP
165
Country
United States
Wiimm said:
I have comitted a new version of wwt.

Code:
wwt v0.31b r629 -2010-02-08

- wwt+wit: New envrionment variable: WWT_LANG: Define a default language.
- wwt+wit: New option: --lang= : Define the working language.
- wwt FORMAT --recover: Little optimizations.
- Bug fix: Enable cache for all commands if reading from a pipe.


Thanks!

Tested - got farther, definitely, but still ran into a problem:
cat geowars.iso | ./iso2wbfs -v - output.wbfs

iso2wbfs v0.31b r629 mac - Dirk Clemens - 2010-02-07

* iso2wbfs: SCRUB - -> RGLP7D.wbfs
!! iso2wbfs: ERROR #28 [FATAL ERROR] in XReadF() @ lib-std.c#2303
!! ASSERTION FAILED !!!

As before, here's some helpful files:

http://dl.dropbox.com/u/514357/_trace-iso2wbfs.tmp
http://dl.dropbox.com/u/514357/RGLP7D.wbfs.cSLpKC

If there's anything else I can do to help, please let me know.
 

pudquick

Member
Newcomer
Joined
Jun 16, 2008
Messages
10
Trophies
0
XP
165
Country
United States
Wiimm said:
@pudquick
Is this only a problem of geowars?

Nope. See below:
cat wlg.iso | ./iso2wbfs -v - output.wbfs

iso2wbfs v0.31b r629 mac - Dirk Clemens - 2010-02-08

* iso2wbfs: SCRUB - -> RWGE08.wbfs
!! iso2wbfs: ERROR #28 [FATAL ERROR] in XReadF() @ lib-std.c#2303
!! ASSERTION FAILED !!!
Different game, same issue.

The .RWGE08.wbfs.I5KmpB temp file it created in the process is the exact same length as with geowars, namely 4194304 bytes at failure.

But for the timestamp difference, the last lines of the trace log are the same as well:
CODEÂÂ 7.465ÂÂLIBWBFS: wd_fix_partition_table(0x0,sel=fffffffb,0x583000)
ÂÂ 7.465ÂÂWBFS: WrapperWriteSector(fd=5,lba=1000,count=1000) sector-size=512
ÂÂ 7.465ÂÂ#S# ---
ÂÂ 7.465ÂÂ#S#ÂÂ WriteF()ÂÂÂÂÂÂ f=5,0x0ÂÂÂÂ200000..ÂÂ 400000ÂÂ 200000
ÂÂ 7.465ÂÂ#S#0# off=200000 cur_of=0 count=200000 fsize=ffff8000
ÂÂ 7.465ÂÂ#F# WriteF()ÂÂÂÂÂÂÂÂ f=5,0x0ÂÂÂÂ200000..ÂÂ 400000ÂÂ 200000
ÂÂ 7.466ÂÂ#S#x# off=ÂÂÂÂÂÂÂÂ0 cur_of=ÂÂ 400000 count=0
ÂÂ 7.466ÂÂ#F# CACHE FOUNDÂÂÂÂÂÂf=4,0x0ÂÂ f800000.. 10000000ÂÂ 800000
ÂÂ 7.466ÂÂ#F# CACHE FOUNDÂÂÂÂÂÂf=4,0x0ÂÂ f800000.. 10000000ÂÂ 800000
ÂÂ 7.466ÂÂÂÂ my_off=200000, count=200000, cptr->off=f800000, cptr->count=800000
ÂÂ 7.466ÂÂ!! ERROR #28 [FATAL ERROR] in XReadF() @ lib-std.c#2303
ÂÂ 7.466ÂÂ!!ÂÂÂÂÂÂÂÂÂÂ ASSERTION FAILED !!!
Both work just fine if I don't use stdin. One's was already scrubbed (geowars), the other isn't.
 

rnld

Member
Newcomer
Joined
Dec 1, 2009
Messages
8
Trophies
0
XP
12
Country
this program was suggested to me as i am having hd problems to check my partition, i have used the windows link from the 1st post when i go into it i presume i am to use the wwt prog but i click and nothing opens, i feel really stupid but can someone explain please hwta i need to do??
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
pudquick said:
Tested - got farther, definitely, but still ran into a problem:
cat geowars.iso | ./iso2wbfs -v - output.wbfs

iso2wbfs v0.31b r629 mac - Dirk Clemens - 2010-02-07

* iso2wbfs: SCRUB - -> RGLP7D.wbfs
!! iso2wbfs: ERROR #28 [FATAL ERROR] in XReadF() @ lib-std.c#2303
!! ASSERTION FAILED !!!
First: iso2wbfs calculates the output filename by itself. So "output.wbfs" is a second input file.

I have tested your command line and have no problems at all. And "wit cmp" says, that source and destination are the same. It must be a bug that only pop up in the mac version -- hard to find for me. I will make a code view of all cache code.
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
rnld said:
this program was suggested to me as i am having hd problems to check my partition, i have used the windows link from the 1st post when i go into it i presume i am to use the wwt prog but i click and nothing opens, i feel really stupid but can someone explain please hwta i need to do??
it is a command line tool without any gui. Open a command window ("cmd" in admin mode) and then say: wwt options... parameters...
 

hetch6

New Member
Newbie
Joined
Jun 25, 2009
Messages
3
Trophies
0
XP
46
Country
New Zealand
Hey, I've been messing around with you great app trying to figure out how to repair or extract my games from my *partially* formatted drive. What happened was I accidently clicked format partition in XP thinking it was another drive......i clicked cancel as soon as i'd clicked format but it obviously did enough damage in that short time to mess things up

first I ran wwt find -l
Code:
carl@mainframe:~$ wwt find -l

typeÂÂwbfs d.usageÂÂÂÂsizeÂÂfile (sizes in MiB)
-----------------------------------------------
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ953870ÂÂ/dev/sda
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ307204ÂÂ/dev/sda1
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂÂÂ4095ÂÂ/dev/sda2
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂÂÂÂÂ 0ÂÂ/dev/sda3
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ320006ÂÂ/dev/sda4
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ 15359ÂÂ/dev/sda5
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ307204ÂÂ/dev/sda6
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ476940ÂÂ/dev/sdb
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ300003ÂÂ/dev/sdb1
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ176935ÂÂ/dev/sdb2
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ305245ÂÂ/dev/sdc
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ102563ÂÂ/dev/sdc1
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ202679ÂÂ/dev/sdc2

I know /dev/sdc1 is/was my wbfs partition

running wwt CHECK /dev/sdc1 it get
Code:
carl@mainframe:~$ wwt CHECK /dev/scd1
*****ÂÂwwt: Wiimms WBFS Tool v0.31a r618 i386 - Dirk Clemens - 2010-01-31ÂÂ*****

!! wwt: ERROR #13 [CAN'T OPEN FILE] in AnalysePartitions() @ wbfs-interface.c#250
!!ÂÂÂÂÂÂCan't open file: /dev/scd1
!!ÂÂÂÂÂÂ-> No such file or directory
!! wwt: ERROR #9 [NO WBFS FOUND] in AnalysePartitions() @ wbfs-interface.c#348
!!ÂÂÂÂÂÂno WBFS partitions found -> abort

i've also tried running wwt -p /dev/sdc1 repair --repair=all
and that gives me
Code:
carl@mainframe:~$ wwt -p /dev/sdc1 repair --repair=all
*****ÂÂwwt: Wiimms WBFS Tool v0.31a r618 i386 - Dirk Clemens - 2010-01-31ÂÂ*****

!! wwt: ERROR #17 [READ FILE FAILED] in AnalysePartitions() @ wbfs-interface.c#337
!!ÂÂÂÂÂÂNo WBFS magic found: /dev/sdc1
!! wwt: ERROR #9 [NO WBFS FOUND] in AnalysePartitions() @ wbfs-interface.c#348
!!ÂÂÂÂÂÂno WBFS partitions found -> abort

So i'm looking for a little bit of help. I'd really like to repair the partition, failing that i'd just like to recover my games

any help would be appreciated
 

hetch6

New Member
Newbie
Joined
Jun 25, 2009
Messages
3
Trophies
0
XP
46
Country
New Zealand
Wiimm said:
try
wwt format -p /dev/sdc1 --recover --force
But if it is not a WBFS the content are lost.
And a second warning: --recover is very new!


thanks for your help.... the result of that command is
CODEcarl@mainframe:~$ sudo wwt format -p /dev/sdc1 --recover --force
[sudo] password for carl:
!! wwt: ERROR #23 [SYNTAX ERROR] in check_command() @ wwt.c#2980
!!ÂÂÂÂÂÂCommand 'FORMAT' don't uses option --part
-> Type 'wwt -h' (or better 'wwt -h|less') for more help.
 

hetch6

New Member
Newbie
Joined
Jun 25, 2009
Messages
3
Trophies
0
XP
46
Country
New Zealand
Well i took the plunge.. i dropped the -p from the command and half a second later it was done. All seems to be working as it was.....brilliant.

Thanks a lot
wink.gif
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
wwt: Wiimms WBFS Tool v0.32a - 2010-02-14
A command line WBFS tool set for various os.


I have updated the tool. The first post with more details is updated too.

Download:Last changes:
Code:
wwt v0.30a r613 - 2010-01-30

- wwt+wit FILETYPE: Print scrubbed size if option --long is set twice.
- New command: wit ISOSIZE: Print scrubbed ISO sizes in up to 4 aspects.

wwt v0.31a r618 - 2010-01-31

- wwt+wit FILETYPE: Print table header.
- wwt FORMAT: new option: --recover: Format a WBFS in recover mode.
ÂÂ The recover feature is EXPERIMENTAL!

wwt v0.32a r632 - 2010-02-14

- wwt+wit: New envrionment variable: WWT_LANG: Define a default language.
- wwt+wit: New option: --lang= : Define the working language.
- wwt FORMAT --recover: Little optimizations.
- Bug fix: Enable cache for all commands if reading from a pipe.

Sources comes with GPL2. Checkout the sources directly from the SVN repository or browse the source.
 

deo

Member
Newcomer
Joined
Jun 20, 2009
Messages
14
Trophies
0
XP
29
Country
Brazil
Hey Wiimm,

looks like there's a few warnings in the current SVN code when compiling on Mac:

Code:
$ make
***ÂÂcreate templates.sed
***ÂÂcreate version.h
***ÂÂobject iso2wbfs.o 
***ÂÂobject dclib-utf8.o 
***ÂÂobject debug.o 
***ÂÂobject lib-sf.o 
***ÂÂobject lib-std.o 
***ÂÂobject lib-wdf.o 
***ÂÂobject libwbfs.o 
***ÂÂobject rijndael.o 
***ÂÂobject titles.o 
***ÂÂobject wbfs-interface.o 
***ÂÂobject wiidisc.o 
***ÂÂÂÂtool iso2wbfs 
***ÂÂobject iso2wdf.o 
***ÂÂÂÂtool iso2wdf 
***ÂÂobject wdf-cat.o 
***ÂÂÂÂtool wdf-cat 
***ÂÂobject wdf-dump.o 
***ÂÂÂÂtool wdf-dump 
***ÂÂobject wdf2iso.o 
***ÂÂÂÂtool wdf2iso 
***ÂÂobject wit.o 
wit.c: In function ‘exec_copy’:
wit.c:1269: warning: field width should have type ‘int’, but argument 6 has type ‘size_t’
wit.c: In function ‘exec_move’:
wit.c:1463: warning: field width should have type ‘int’, but argument 3 has type ‘size_t’
***ÂÂÂÂtool wit 
***ÂÂobject wtest.o 
***ÂÂÂÂtool wtest 
***ÂÂobject wwt.o 
wwt.c: In function ‘exec_add’:
wwt.c:1951: warning: field width should have type ‘int’, but argument 2 has type ‘size_t’
wwt.c:1959: warning: field width should have type ‘int’, but argument 2 has type ‘size_t’
***ÂÂÂÂtool wwt

It has been a few years that I used C for the last time, but this seems to fix the warnings:

Code:
Index: wit.c
===================================================================
--- wit.cÂÂÂÂ(revision 633)
+++ wit.cÂÂÂÂ(working copy)
@@ -1267,7 +1267,7 @@
ÂÂÂÂ char count_buf[100];
ÂÂÂÂ snprintf(count_buf,sizeof(count_buf), "%u", it->source_list.used );
ÂÂÂÂ snprintf(count_buf,sizeof(count_buf), "%*u/%u",
-ÂÂÂÂÂÂÂÂstrlen(count_buf), it->source_index+1, it->source_list.used );
+ÂÂÂÂÂÂÂÂ(int)strlen(count_buf), it->source_index+1, it->source_list.used );

ÂÂÂÂ const bool raw_mode = partition_selector == WHOLE_DISC || !fi->f.id6[0];
ÂÂÂÂ if (testmode)
@@ -1459,7 +1459,7 @@
ÂÂÂÂÂÂÂÂsnprintf(iobuf,sizeof(iobuf), "%u", it->source_list.used );
ÂÂÂÂÂÂÂÂprintf(" - %sMove %*u/%u %s:%s -> %s\n",
ÂÂÂÂÂÂÂÂÂÂÂÂtestmode ? "WOULD " : "",
-ÂÂÂÂÂÂÂÂÂÂÂÂstrlen(iobuf), it->source_index+1, it->source_list.used,
+ÂÂÂÂÂÂÂÂÂÂÂÂ(int)strlen(iobuf), it->source_index+1, it->source_list.used,
ÂÂÂÂÂÂÂÂÂÂÂÂoft_name[fo.oft], fi->f.fname, fo.f.fname );
ÂÂÂÂÂÂÂÂ}

Index: wwt.c
===================================================================
--- wwt.cÂÂÂÂ(revision 633)
+++ wwt.cÂÂÂÂ(working copy)
@@ -1947,7 +1947,7 @@
ÂÂÂÂ {
ÂÂÂÂTRACE("WOULD ADD [%s] %s\n",sf->f.id6,sf->f.fname);
ÂÂÂÂprintf(" - WOULD ADD %*u/%u [%s] %s:%s\n",
-ÂÂÂÂÂÂÂÂstrlen(iobuf), it->source_index+1, it->source_list.used,
+ÂÂÂÂÂÂÂÂ(int)strlen(iobuf), it->source_index+1, it->source_list.used,
ÂÂÂÂÂÂÂÂsf->f.id6, oft_name[sf->oft], sf->f.fname );
ÂÂÂÂ }
ÂÂÂÂ else
@@ -1955,7 +1955,7 @@
ÂÂÂÂTRACE("ADD [%s] %s\n",sf->f.id6,sf->f.fname);
ÂÂÂÂif ( verbose >= 0 || progress > 0 )
ÂÂÂÂÂÂÂÂprintf(" - ADD %*u/%u [%s] %s:%s\n",
-ÂÂÂÂÂÂÂÂÂÂÂÂstrlen(iobuf), it->source_index+1, it->source_list.used,
+ÂÂÂÂÂÂÂÂÂÂÂÂ(int)strlen(iobuf), it->source_index+1, it->source_list.used,
ÂÂÂÂÂÂÂÂÂÂÂÂsf->f.id6, oft_name[sf->oft], sf->f.fname );
ÂÂÂÂfflush(stdout);

At least it compiles with no warnings now. Let me know if you have a better idea to fix it.

Thanks and keep the great work! :-)

-- deo
 

WiiNero

Well-Known Member
Newcomer
Joined
Jan 20, 2010
Messages
80
Trophies
0
Website
twitter.com
XP
3
Country
Gambia, The
Nice Tool, but i've a question.

How to convert a wdf or iso to wbfs files?

Sorry, but i am confused because of the tons of options in wit/wwt ...
wink.gif


Thanks,
WiiNero
 

tiimothy

New Member
Newbie
Joined
Feb 17, 2010
Messages
4
Trophies
0
XP
1
Country
Hi there. This looks like a great set of tools. (should beat wbfs anyway!) Many thanks for your efforts.

I'm trying to compile your code for arm9 processors, so that I can use it on my IcyBox NAS device. I'm no coder, so I struggle when things don't go to plan!

I'm getting the following compilation error:

CODEICE wiimms-wbfs-tool # make
*** create templates.sed
*** create version.h
*** object iso2wbfs.o
*** object dclib-utf8.o
*** object debug.o
*** object lib-sf.o
*** object lib-std.o
*** object lib-wdf.o
*** object libwbfs.o
*** object rijndael.o
*** object titles.o
*** object wbfs-interface.o
*** object wiidisc.o
*** tool iso2wbfs
*** object iso2wdf.o
*** tool iso2wdf
*** object wdf-cat.o
*** tool wdf-cat
*** object wdf-dump.o
*** tool wdf-dump
*** object wdf2iso.o
*** tool wdf2iso
*** object wit.o
*** tool wit
*** object wtest.o
*** tool wtest
*** object wwt.o
wwt.c: In function `CheckOptions':
wwt.c:334: error: unrecognizable insn:
(insn:HI 1158 1156 1163 126 wwt.c:2788 (set (mem/s/j:SI (plus:SI (mult:SI (subreg:SI (reg:DI 154) 0)
(const_int 4 [0x4]))
(reg/f:SI 158)) [0 opt_name_tab S4 A32])
(reg/v/f:SI 443 [ name ])) -1 (insn_list 1138 (nil))
(expr_list:REG_DEAD (reg/v/f:SI 443 [ name ])
(expr_list:REG_EQUAL (symbol_ref/v/f:SI ("*.LC72") [flags 0x2] )
(nil))))
wwt.c:334: internal compiler error: in extract_insn, at recog.c:2083


Is there anything obvious I can do to fix this or is my build environment just too strange?! :-)

Cheers,
Tim

Edit:
Ok, I know this is a bit stupid because I don't understand the code whatsoever (I can just about put a conditional together in bash), but I got impatient. I commented out the line that was causing the error (actually the two lines inside the if{}) and it compiled. It seems to be working without error as I type this.

If the CheckOptions thing isn't important, I can post the binaries for others to use.

If it is important and what I have done is dangerous, please let me know so that I can stop using it!
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
WiiNero said:
Nice Tool, but i've a question.

How to convert a wdf or iso to wbfs files?

Sorry, but i am confused because of the tons of options in wit/wwt ...
wink.gif


Thanks,
WiiNero

CODE# examples:
wit copy *.wdf *.iso --dest dest_dir --wbfs --update -vv --test
# or
wit copy --recurse source_base_dir --dest dest_dir/%X/%I --wbfs --update -vv --test

# remove --test to leave test mode
 

tiimothy

New Member
Newbie
Joined
Feb 17, 2010
Messages
4
Trophies
0
XP
1
Country
Wiimm said:
@tiimothy

I don't understand that error. Neither line 344 nor line 2788 are part of function CheckOptions(). The code is needed to remember the used options.


Strange.. this is the section of code I figured it was talking about:

CODE
ICE> cat -n /opt/gentoo/new_root/usr/src/wiimms-wbfs-tool/wwt.c |grep 2788 -A 5 -B 10
2778 /////////////// check options ///////////////
2779 ///////////////////////////////////////////////////////////////////////////////
2780 //
2781 ccp opt_name_tab[OPT__N_SPECIFIC] = {0};
2782
2783 void SetOption ( int opt_idx, ccp name )
2784 {
2785 if ( opt_idx > 0 && opt_idx < OPT__N_SPECIFIC )
2786 {
2787 // used_options |= 1
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    realtimesave @ realtimesave: they need to have a strong line up on the launch titles too. I think they should move metroid...