Views: 23,103,643 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
12-05-24 07:45 AM |
Guest: |
0 users reading BCSV Editor | 1 bot |
Main - Archived forums - SMG hacking tools development - BCSV Editor | Hide post layouts | New reply |
Marionumber1 |
| ||
Wii U hacker Level: 55 Posts: 2/709 EXP: 1271142 Next: 43047 Since: 07-07-12 Last post: 2440 days ago Last view: 816 days ago |
This is a tool that I made that edits BCSV files. If you don't know what BCSV files are, they are a file format that is used frequently in the Super Mario Galaxy games. BCSV files hold level data, object information, world map layouts, collision data, the songs that are played for each level, a list of objects that can be used in levels, and more.
BCSV Editor: https://www.dropbox.com/s/thc3rep4kvj1q32/BCSVE-v0.7.zip?dl=1 Source Code: https://dl.dropbox.com/s/bvhbohxx3bxvu5u/BCSVECode.zip?dl=1 The current version has the ability to edit any type of BCSV field data (longs, floats, shorts, bytes, and strings). Most BCSV files in SMG1 and SMG2 should work. Tell me if you find any BCSV files that the editor won't open or edit correctly. In order to tell if a file is a valid BCSV file, check its extension. Files with the extension .bcsv, .tbl, .banmt, .bcam, and .pa should work. If a file has no extension, try opening it in the BCSV editor and editing it. If you can successfully open the file, edit it, then reopen it, you can assume that file is a valid BCSV file. If you find any files with extensions I haven't listed that seem to be valid BCSV files, send me a copy of that file. You need Windows to run this, although it may run on Mac or Linux with Wine. lookup.txt needs to be in the same directory as the application. |
Arisotura |
| ||
Star Mario in this room you have a pile of apple pies Level: 165 Posts: 386/9047 EXP: 57970159 Next: 965522 Since: 07-03-12 From: in a box Last post: 38 days ago Last view: 1 day ago |
Since it's C#, I guess it'll run fine on Linux and OSX.
It seems to be a nice tool for editing field properties, however it wouldn't be quite practical to use for editing lots of fields directly. Also, it seems to mess up Japanese strings. Strings in BCSV files are encoded in Shift-JIS, so you know ____________________ NSMBHD - Kafuka - Jul melonDS the most fruity DS emulator there is zafkflzdasd |
Marionumber1 |
| ||
Wii U hacker Level: 55 Posts: 3/709 EXP: 1271142 Next: 43047 Since: 07-07-12 Last post: 2440 days ago Last view: 816 days ago |
It doesn't actually edit field properties yet. That's a planned feature, as soon as everything else in the editor is working. Also, I know they're encoded in Shift-JIS, but I've never been able to get it working. |
Arisotura |
| ||
Star Mario in this room you have a pile of apple pies Level: 165 Posts: 387/9047 EXP: 57970159 Next: 965522 Since: 07-03-12 From: in a box Last post: 38 days ago Last view: 1 day ago |
Marionumber1 |
| ||
Wii U hacker Level: 55 Posts: 4/709 EXP: 1271142 Next: 43047 Since: 07-07-12 Last post: 2440 days ago Last view: 816 days ago |
Looking at your code, it looks like you used the FileBase class and set Encoding to "shift-jis". Is there anyway to convert an ASCII encoded string to a Shift JIS string, without making major changes to my code? |
Shane2100AD |
| ||
Dupe of AstralShane5000. Banned for security reasons. Level: 11 Posts: 13/20 EXP: 5943 Next: 42 Since: 11-02-12 Last post: 4378 days ago Last view: 4361 days ago |
Do you mind if I upload the source onto GitHub? |
Arisotura |
| ||
Star Mario in this room you have a pile of apple pies Level: 165 Posts: 391/9047 EXP: 57970159 Next: 965522 Since: 07-03-12 From: in a box Last post: 38 days ago Last view: 1 day ago |
Posted by Marionumber1 What you have to do in C# is specify the encoding you want to use when you create your BinaryReader/Writer or similar. Java works differently in that regard. For example I'm able to specify the encoding when reading/writing the strings. ____________________ NSMBHD - Kafuka - Jul melonDS the most fruity DS emulator there is zafkflzdasd |
Dirbaio |
| ||
Retired staff Level: 31 Posts: 134/184 EXP: 168059 Next: 17304 Since: 07-07-12 From: Spain Last post: 3970 days ago Last view: 2368 days ago |
Posted by Shane2100AD It's probably a bad idea. GitHub is not a place just to "upload" source code, it's a place to host git repositories. It's the project owner that should own the repository... ____________________ Cool Stuff: Dirbaio.net (my boring site) - The NSMB Hacking Domain - Kuribo64 - ABXD DevBoard |
Marionumber1 |
| ||
Wii U hacker Level: 55 Posts: 5/709 EXP: 1271142 Next: 43047 Since: 07-07-12 Last post: 2440 days ago Last view: 816 days ago |
Posted by Mega-Mario What I do to read a string is read each character from FileStream, and concatenate it to the current string. When I concatenated the character to the string, I used string.Concat. I changed the encoding to System.Text.Encoding.GetEncoding("shift-jis"), but instead of displaying Japanese, it displays ・モ・ス・イ・・・フ・i・] (which is ff fe fb 30 93 ff fb 30 7d ff fb 30 72 ff fb 30 fb 30 fb 30 8c ff fb 30 69 00 fb 30 5d 00 in hex). |
Arisotura |
| ||
Star Mario in this room you have a pile of apple pies Level: 165 Posts: 394/9047 EXP: 57970159 Next: 965522 Since: 07-03-12 From: in a box Last post: 38 days ago Last view: 1 day ago |
That's because this is just not how you read a NULL-terminated string from a file.
You create a BinaryReader with the Shift-JIS encoding, and then use the ReadString() method, which handles everything for you. Alternately, if you don't want to use a BinaryReader, you need to create an array of bytes, and read each byte until you meet a NULL byte. You then feed the byte array to the appropriate text encoding converter to get a String. ____________________ NSMBHD - Kafuka - Jul melonDS the most fruity DS emulator there is zafkflzdasd |
Phantom Wings |
| ||
Normal user Level: 17 Posts: 1/46 EXP: 21005 Next: 3738 Since: 07-08-12 Last post: 3966 days ago Last view: 3966 days ago |
I know this thread is kind of old, but the AnarchGalaxy2 library had a pretty effective BCSV editor. I'm can't remember if I publicly released it or not, but I think it should come in handy.
Also, just in case you're interested, MN1, The method I used to read Unicode strings was Encoding.GetEncoding("Shift-JIS").GetString which allowed you to read a string from either a byte buffer or a raw data pointer. |
NWPlayer123 |
| ||
Member Imma Snuggle You Level: 111 Posts: 97/3604 EXP: 14568241 Next: 300119 Since: 07-07-12 From: Colorado Last post: 3326 days ago Last view: 1483 days ago |
AFAIK Anarchy2 was never found if it was released. I never had it, at least. ____________________ "I hate playing musical chats" ~ Quote of the month |
Marionumber1 |
| ||
Wii U hacker Level: 55 Posts: 18/709 EXP: 1271142 Next: 43047 Since: 07-07-12 Last post: 2440 days ago Last view: 816 days ago |
Thanks for the source code, PhantomWings. I'm going to try to update my BCSV Editor this weekend. |
Marionumber1 |
| ||
Wii U hacker Level: 55 Posts: 26/709 EXP: 1271142 Next: 43047 Since: 07-07-12 Last post: 2440 days ago Last view: 816 days ago |
I've tried reading every byte into a Byte array and using Encoding.GetEncoding("Shift-JIS").GetString to convert it to Shift JIS, but Japanese text is still only displayed in ASCII characters. |
Arisotura |
| ||
Star Mario in this room you have a pile of apple pies Level: 165 Posts: 555/9047 EXP: 57970159 Next: 965522 Since: 07-03-12 From: in a box Last post: 38 days ago Last view: 1 day ago |
Marionumber1 |
| ||
Wii U hacker Level: 55 Posts: 27/709 EXP: 1271142 Next: 43047 Since: 07-07-12 Last post: 2440 days ago Last view: 816 days ago |
I didn't use the BinaryReader method, because I don't like the idea of drastically changing my code. |
Arisotura |
| ||
Star Mario in this room you have a pile of apple pies Level: 165 Posts: 556/9047 EXP: 57970159 Next: 965522 Since: 07-03-12 From: in a box Last post: 38 days ago Last view: 1 day ago |
You should still have a look into it. It has always worked fine for me.
I also wish Java supported an equivalent. It only supports reading Unicode strings. The code I made to get around this is incredibly hackish and also picky. Blarg blarg. And I'm sure it'll be terribly unefficient when dealing with the message files. ____________________ NSMBHD - Kafuka - Jul melonDS the most fruity DS emulator there is zafkflzdasd |
Marionumber1 |
| ||
Wii U hacker Level: 55 Posts: 28/709 EXP: 1271142 Next: 43047 Since: 07-07-12 Last post: 2440 days ago Last view: 816 days ago |
The good news is that the strings in the message files are Unicode. Back on this topic, do you know why the method I tried wouldn't work? |
Phantom Wings |
| ||
Normal user Level: 17 Posts: 2/46 EXP: 21005 Next: 3738 Since: 07-08-12 Last post: 3966 days ago Last view: 3966 days ago |
I forgot that I had added an extension method to the Encoding class to simplify things.
Anyways, the extension method uses the string constructor using the Encoding as one of the parameters. You need to know the number of characters before hand and you need to use an sbyte pointer, but it should properly convert the characters. |
Marionumber1 |
| ||
Wii U hacker Level: 55 Posts: 31/709 EXP: 1271142 Next: 43047 Since: 07-07-12 Last post: 2440 days ago Last view: 816 days ago |
fixed (SByte* strData = bytes.ToArray())
{ str = new String(strData, 0, bytes.ToArray().Length, System.Text.Encoding.GetEncoding("Shift-JIS")); } Now I get an error saying "Pointers and fixed size buffers may only be used in an unsafe context". |
Main - Archived forums - SMG hacking tools development - BCSV Editor | Hide post layouts | New reply |
Page rendered in 0.045 seconds. (2048KB of memory used) MySQL - queries: 29, rows: 236/236, time: 0.009 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |