Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

WZ [Release][Universal] HaRepacker - New version

Everything is possible~
Member
Joined
Jan 9, 2008
Messages
818
Reaction score
847
Hey Haha01haha01, I found a bug in the export code when using the PNG option: it exports the folder twice:
Character.wz/Longcoat/Longcoat/01050023.img/01050023.img/{actual images here}

:)
 
Have Fun!
Joined
Nov 2, 2008
Messages
481
Reaction score
70
Good to see you again haha01. I always liked your work. :)
I found a little bug quite some time ago, really long ago actually. Not something too serious, but might be useful:
When you play a sound file from Sound.wz, if you use your mouse middle-button to scroll, the playing position will shift as well. If you scroll to a poisition before the beginning or after the end, it will crash HaReapcker.

Best of luck with whatever you do. :)
 
FutureLegend's Owner
Joined
Feb 10, 2011
Messages
470
Reaction score
99
Gonna release a new version soon, with lots of new feature !
Thanks for this, ' haha ' - although, I already had your source...
 
Initiate Mage
Joined
Mar 21, 2009
Messages
15
Reaction score
71
Just a quick update, I've been away since my last post here and I'm going to be absent for long periods of time from now on due to some personal issues. I've read the bug reports but I don't have the time to fix them.
Regarding FightDesign's post: forks are always welcomed, but you need to comply with the terms of the GPL license (the primary part is that source code must always be available)
 
Joined
Apr 5, 2008
Messages
663
Reaction score
537
For anyone having issues with wz files created by koolk's map editor but doesn't want to hassle with koolk-breaker, here is a quick patch that will fix everything magically.
Code:
From 50e753cb4bfac4a0912d7c15e5ecab461a429680 Mon Sep 17 00:00:00 2001
From: retep998 <retep998@verizon.net>
Date: Wed, 1 May 2013 00:27:08 -0400
Subject: [PATCH] Fixed issue with koolk files


Signed-off-by: retep998 <retep998@verizon.net>
---
 WzLib/WzFile.cs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


diff --git a/WzLib/WzFile.cs b/WzLib/WzFile.cs
index 2b3622f..df5c925 100644
--- a/WzLib/WzFile.cs
+++ b/WzLib/WzFile.cs
@@ -177,14 +177,15 @@ namespace MapleLib.WzLib
 				Helpers.ErrorLogger.Log(Helpers.ErrorLevel.Critical, "[Error] Path is null");
 				return;
 			}
 
-			WzBinaryReader reader = new WzBinaryReader(File.Open(this.path, FileMode.Open), WzIv);
+			FileStream file = File.Open(this.path, FileMode.Open);
+			WzBinaryReader reader = new WzBinaryReader(file, WzIv);
 
 			this.Header = new WzHeader();
 			this.Header.Ident = reader.ReadString(4);
 			this.Header.FSize = reader.ReadUInt64();
 			this.Header.FStart = reader.ReadUInt32();
 			this.Header.Copyright = reader.ReadNullTerminatedString();
+			file.Seek(this.Header.FStart, SeekOrigin.Begin);
 			reader.ReadBytes((int)(Header.FStart - reader.BaseStream.Position));
 			reader.Header = this.Header;
 			this.version = reader.ReadInt16();
-- 
1.8.0.msysgit.0
 
Elite Diviner
Joined
Jun 4, 2011
Messages
493
Reaction score
123
For anyone having issues with wz files created by koolk's map editor but doesn't want to hassle with koolk-breaker, here is a quick patch that will fix everything magically.
Code:
From 50e753cb4bfac4a0912d7c15e5ecab461a429680 Mon Sep 17 00:00:00 2001
From: retep998 <retep998@verizon.net>
Date: Wed, 1 May 2013 00:27:08 -0400
Subject: [PATCH] Fixed issue with koolk files


Signed-off-by: retep998 <retep998@verizon.net>
---
 WzLib/WzFile.cs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


diff --git a/WzLib/WzFile.cs b/WzLib/WzFile.cs
index 2b3622f..df5c925 100644
--- a/WzLib/WzFile.cs
+++ b/WzLib/WzFile.cs
@@ -177,14 +177,15 @@ namespace MapleLib.WzLib
 				Helpers.ErrorLogger.Log(Helpers.ErrorLevel.Critical, "[Error] Path is null");
 				return;
 			}
 
-			WzBinaryReader reader = new WzBinaryReader(File.Open(this.path, FileMode.Open), WzIv);
+			FileStream file = File.Open(this.path, FileMode.Open);
+			WzBinaryReader reader = new WzBinaryReader(file, WzIv);
 
 			this.Header = new WzHeader();
 			this.Header.Ident = reader.ReadString(4);
 			this.Header.FSize = reader.ReadUInt64();
 			this.Header.FStart = reader.ReadUInt32();
 			this.Header.Copyright = reader.ReadNullTerminatedString();
+			file.Seek(this.Header.FStart, SeekOrigin.Begin);
 			reader.ReadBytes((int)(Header.FStart - reader.BaseStream.Position));
 			reader.Header = this.Header;
 			this.version = reader.ReadInt16();
-- 
1.8.0.msysgit.0
Thank You retep you helped me a lot last night.
 
Initiate Mage
Joined
Jun 4, 2013
Messages
7
Reaction score
1
Voice modding

Hi,

I'm considerably new to modding Maplestory, but I think that HaRepacker might be having some difficulties rebuilding IMGs containing voices (SkillVoice).

I was trying to port the Japanese Angelic Buster voices over from JMS to SEA. Unfortunately, changing any one voice with HaRepacker (even if the voice was merely extracted and re-inserted) just caused all voices in that image to be played at a really high sample rate.

Please feel to correct me if I am wrong here though! Maybe there's already a known explanation for that, but I just haven't found it.

As for what I did on my end to get voice replacement working, I got the halfword/short at 0x36 set to 0x01 instead of 0x02 and the 32-bit word at 0x3C set to 0x0bb8 instead of 0x2710.

Here are all the differences in the structures that I've noticed when comparing the headers of the SkillVoice files against the reference soundHeaderMask structure:
Code:
Differences (header vs soundHeaderMask):
0x36  (short)  -    0x01    0x02        (01 = voice, 02 = BGM, seems to be a sound channel selector).
0x38 (word)    -    (Sample rate)
0x3C (word)    -    0x0bb8    0x2710    (Seems to be some round number like 1000, 3000 or 6000. Sample buffer length?)
0x4C    -    0x4E    0x00
0x4D    -    0x00    0x0A
0x4E    -    0x01    0x02
0x4F    -    0x00    0x01
0x50    -    0x71    0x00
0x51    -    0x05    0x00

Note: header refers to the header that precedes the MP3 file itself, which is the same for all voices under SkillVoice.

Halfword/short 0x36 seems to be a channel selector. Perhaps 0x02 causes it to be played under the BGM channel, causing it to be played back with the parameters of the BGM (Which presumably has a higher sample rate).

I'm not sure about the word at 0x3C. While just changing byte 0x36 to 0x01 allows voices to be played at their right sample rates... I noticed that the voices were cut off. Setting it to 0xBB0 solved that, although I'm not sure what that actually does.

On a side note, it seems like not all sounds are MP3 files. It appears that normal skill sounds are headerless wave files and the headers that precede these files are no different from their SkillVoice counterparts... on at least SEA.

I don't know about how well this works on other Maplestory versions like JMS, although I could possibly test on JMS if required. (JMS seems to have more variations in its voice MP3 header fields too, BTW)

Thank you for reading!
 
Last edited:
Initiate Mage
Joined
Jun 1, 2013
Messages
4
Reaction score
0
Re: Voice modding

Hi,

I'm considerably new to modding Maplestory, but I think that HaRepacker might be having some difficulties rebuilding IMGs containing voices (SkillVoice).

I was trying to port the Japanese Angelic Buster voices over from JMS to SEA. Unfortunately, changing any one voice with HaRepacker (even if the voice was merely extracted and re-inserted) just caused all voices in that image to be played at a really high sample rate.

Please feel to correct me if I am wrong here though! Maybe there's already a known explanation for that, but I just haven't found it.

As for what I did on my end to get voice replacement working, I got the halfword/short at 0x36 set to 0x01 instead of 0x02 and the 32-bit word at 0x3C set to 0x0bb8 instead of 0x2710.

Here are all the differences in the structures that I've noticed when comparing the headers of the SkillVoice files against the reference soundHeaderMask structure:
Code:
Differences (header vs soundHeaderMask):
0x36  (short)  -    0x01    0x02        (01 = voice, 02 = BGM, seems to be a sound channel selector).
0x38 (word)    -    (Sample rate)
0x3C (word)    -    0x0bb8    0x2710    (Seems to be some round number like 1000, 3000 or 6000. Sample buffer length?)
0x4C    -    0x4E    0x00
0x4D    -    0x00    0x0A
0x4E    -    0x01    0x02
0x4F    -    0x00    0x01
0x50    -    0x71    0x00
0x51    -    0x05    0x00

Note: header refers to the header that precedes the MP3 file itself, which is the same for all voices under SkillVoice.

Halfword/short 0x36 seems to be a channel selector. Perhaps 0x02 causes it to be played under the BGM channel, causing it to be played back with the parameters of the BGM (Which presumably has a higher sample rate).

I'm not sure about the word at 0x3C. While just changing byte 0x36 to 0x01 allows voices to be played at their right sample rates... I noticed that the voices were cut off. Setting it to 0xBB0 solved that, although I'm not sure what that actually does.

On a side note, it seems like not all sounds are MP3 files. It appears that normal skill sounds are headerless wave files and the headers that precede these files are no different from their SkillVoice counterparts... on at least SEA.

I don't know about how well this works on other Maplestory versions like JMS, although I could possibly test on JMS if required. (JMS seems to have more variations in its voice MP3 header fields too, BTW)

Thank you for reading!

Thanks for giving more technical information then I could have ever given. I also reported the same thing over in this thread: http://forum.ragezone.com/f701/encountered-problem-replacing-skill-voices-935343/

Just wondering if the type of mp3 file makes a difference? Since i mentioned in my thread

I noticed that MSEA uses MPEG Version 2 Layer 3, 24.0kbps bitrate for their audio file while JMS uses MPEG Version 1 Layer3, 48.0kbps bitrate and encoded with LAME3.97 for that same audio file, so I tried converting (yea, mass quality degradation) the JMS files to the same specs as MSEA's using Audacity. Same problem.
Thanks for any replies :)

or it doesn't matter?
 
Initiate Mage
Joined
Jun 4, 2013
Messages
7
Reaction score
1
Re: Voice modding

Thanks for giving more technical information then I could have ever given. I also reported the same thing over in this thread: http://forum.ragezone.com/f701/encountered-problem-replacing-skill-voices-935343/

Just wondering if the type of mp3 file makes a difference? Since i mentioned in my thread



or it doesn't matter?

Wow. Finally, someone else across the Internet who has run into this issue as well. Thank you!

No, it doesn't. I tried re-encoding the AB's voices with Audacity with the exact same parameters used for the SEA voices, and there was no effect. After encoding, the resulting audio file is a MP3 version 2 file as well.

Besides, I wrote in my post above that this problem happens even with the original files you extract from SEA (Extracting and reinserting any one voice will screw all of them up, even if you don't touch the others).

Since both JMS and MapleSEA are MapleStory games, the engines should be similar enough, so I don't see why they would take the effort to bother changing the supported audio formats anyway.

If one was to take the JMS Sounds.wz pack and modify it for use with the SEA client (By swapping the file version numbers), the sounds all play properly in the SEA client (With the exception of missing sounds). This proves that the MP3 file format version doesn't matter, Wz repacking probably isn't a problem... but IMG file repacking has some issue.

On a side note, I'm also curious to know whether there's a way to re-add the missing FAIL sign that appears when your soul battery runs out, and the sounds that play whenever you can't use a skill and when your soul battery recharges. :/
 
Last edited:
<3
Joined
Feb 4, 2011
Messages
481
Reaction score
123
I haven't done any "serious" WZ editing in years. However, during the time that I did, I figured that JMS had some weird things going on. As haha01haha01 mentioned, their encryption is different from other versions as in it can't easily be predicted, hence the support for JMS is kinda mediocre. HaRepacker may be able to open one JMS WZ file, and be unable to open the others. Or sometimes, more than one encryption is used in the same WZ file. And the second thing that I realized is that many of JMS's "exclusive" sounds exceed the "typical" bit rate from GMS/SEA/KMS. I can't recall any from the top of my head as it's been years, but I remember seeing a few of their login screen music having bit rates that were higher than those of GMS/SEA/KMS. Anyways, back in the days, we had to insert a certain HEX string for certain bit rates. Perhaps, you should try experimenting and figuring out what HEX String you should insert for the bit rate of that sound.

As for the "FAIL" sign, I think it'd be located in Effect.wz. Probably Effect.wz > BasicEff.img. Not certain as I haven't done any WZ editing recently. I am just taking a guess here. Also, what are you planning to do with this? Are you trying to WZ edit jobs in? The best you can do is a skill cover rather than adding an entire job.
 
Last edited:
Initiate Mage
Joined
Jun 1, 2013
Messages
4
Reaction score
0
I haven't done any "serious" WZ editing in years. However, during the time that I did, I figured that JMS had some weird things going on. As haha01haha01 mentioned, their encryption is different from other versions as in it can't easily be predicted, hence the support for JMS is kinda mediocre. HaRepacker may be able to open one JMS WZ file, and be unable to open the others. Or sometimes, more than one encryption is used in the same WZ file. And the second thing that I realized is that many of JMS's "exclusive" sounds exceed the "typical" bit rate from GMS/SEA/KMS. I can't recall any from the top of my head as it's been years, but I remember seeing a few of their login screen music having bit rates that were higher than those of GMS/SEA/KMS. Anyways, back in the days, we had to insert a certain HEX string for certain bit rates. Perhaps, you should try experimenting and figuring out what HEX String you should insert for the bit rate of that sound.

As for the "FAIL" sign, I think it'd be located in Effect.wz. Probably Effect.wz > BasicEff.img. Not certain as I haven't done any WZ editing recently. I am just taking a guess here. Also, what are you planning to do with this? Are you trying to WZ edit jobs in? The best you can do is a skill cover rather than adding an entire job.

Well, the thing is we are trying to modify MSEA voice files, we tried using Audacity converted audio files with the same bitrate as MSEA client's original file so we are not really dealing with JMS files anymore, and even tried exporting and reimporting the same ORIGINAL file but the problem still persisted.

Rather than trying to edit jobs in(we are modifying wz files for use for the OFFICIAL service), I think he's trying to fix client sided bugs since Asiasoft, which is MSEA's distributor, has a nasty track record of bad translations and poorly implemented buggy patches and the latest patch is no different, most notably our version's Evolution System's interface with off centered text and buttons and even lots of untranslated text showing up as question marks.
 
<3
Joined
Feb 4, 2011
Messages
481
Reaction score
123
I see. Fortunately for you guys, I had a v134 GMS Setup on my computer, so I installed it, and checked out some Angelic Burster stuff. I've found the "Fail" effect when the soul battery is completely depleted. It is located in:

Effect.wz > BasicEff.img > RechargeFail

As for the other stuff, I will get back to you on that.

EDIT: Here is a GMS Skill.img from Sound.wz:

Try replacing your Skill.img in Sound.wz with this. Remember to keep a backup just in case it doesn't work!
 
Last edited:
Joined
Apr 5, 2008
Messages
663
Reaction score
537
I find it kind of odd that MapleStory uses that extra header data to determine how to play mp3 audio. With NoLifeStory I've always been able to just skip the header and pass the mp3 data directly to whatever mp3 library I had and it would work perfectly. I suppose the only way to fix this problem, short of simply switching to NoLifeStory, would be to add methods to maplelib2 and harepacker to access this extra header information.
 
Initiate Mage
Joined
Jun 4, 2013
Messages
7
Reaction score
1
@LordKeima has already explained why we're doing this, so I won't repeat what he said.

I haven't done any "serious" WZ editing in years. However, during the time that I did, I figured that JMS had some weird things going on. As haha01haha01 mentioned, their encryption is different from other versions as in it can't easily be predicted, hence the support for JMS is kinda mediocre.

I'm aware about that, but so far it seems to be fine on my end (Haven't found anything that won't be unpacked properly, although I won't say that their files will be repacked properly).

And the second thing that I realized is that many of JMS's "exclusive" sounds exceed the "typical" bit rate from GMS/SEA/KMS. I can't recall any from the top of my head as it's been years, but I remember seeing a few of their login screen music having bit rates that were higher than those of GMS/SEA/KMS. Anyways, back in the days, we had to insert a certain HEX string for certain bit rates. Perhaps, you should try experimenting and figuring out what HEX String you should insert for the bit rate of that sound.

HaRepacker seems to be doing that automatically nowadays. Hence my experiment on HaRepacker was with adjusting this header that it automatically inserts.

The sample rate field is being taken care of by HaRepacker, but there are only a handful of other values that seem to be different from the normal BGM sounds (see my post above).

I've replaced the login screen BGM with the OP of Neptune MkII and it works properly, so I realized that it wasn't a problem with the sample rate or bit rate being different (or even the fact that it was encoded by a different tool from the one they used). Plus it also means that HaRepacker is handling BGM MP3s properly, at least.

I see. Fortunately for you guys, I had a v134 GMS Setup on my computer, so I installed it, and checked out some Angelic Burster stuff. I've found the "Fail" effect when the soul battery is completely depleted. It is located in:

Effect.wz > BasicEff.img > RechargeFail

As for the other stuff, I will get back to you on that.

EDIT: Here is a GMS Skill.img from Sound.wz:

Try replacing your Skill.img in Sound.wz with this. Remember to keep a backup just in case it doesn't work!

Thank you!

EDIT: Replacing Skill.img does nothing. :(

I did find the RechargeFail animation in the JMS Effect.wz file, but copying it over to the SEA equivalent does nothing... meaning that a more significant mod needs to be done (Which requires a skill that I haven't acquired yet). :mellow:

EDIT: Not really meaning to rant here... but I'm curious to know: in GMS, there aren't a huge number of typos? In SEA, nearly all the dialogs have a problem with the apostrophe character replaced with a 'f' instead, and there are grammatical errors in some dialogs.

Tear once said "Are you hungries again?". D:

Not to mention that the game became really, really unstable after the Angelic Buster patch.

I find it kind of odd that MapleStory uses that extra header data to determine how to play mp3 audio. With NoLifeStory I've always been able to just skip the header and pass the mp3 data directly to whatever mp3 library I had and it would work perfectly. I suppose the only way to fix this problem, short of simply switching to NoLifeStory, would be to add methods to maplelib2 and harepacker to access this extra header information.

I did notice that the normal skill sounds are headerless waveform sounds (not MP3s, so haRepacker partially backfires when dealing with them), so perhaps that was why they designed their storage file format to have a mandatory header in front of their sound files.

HaRepacker inserts the same static header for every file it deals with, which is why this probably isn't going to work well if some fields vary depending on the purpose of the inserted sound.
 
Last edited:
Joined
Apr 5, 2008
Messages
663
Reaction score
537
I did notice that the normal skill sounds are headerless waveform sounds (not MP3s, so haRepacker partially backfires when dealing with them), so perhaps that was why they designed their storage file format to have a mandatory header in front of their sound files.
Wait, really?
What's the path to one of these example sounds, and version/region for that matter? I need to check this out for myself.
 
Initiate Mage
Joined
Jun 4, 2013
Messages
7
Reaction score
1
Wait, really?
What's the path to one of these example sounds, and version/region for that matter? I need to check this out for myself.

In JMS, the Angelic Buster's skill sounds under Sound.wz/skill.img/65****** are all headerless WAV files. They have a sample rate of 22050 Hz, and are signed 16-bit, mono samples. HaRepacker can't play these files (either no sound is played or you get an exception), but extracting them and reading them with Audacity as raw audio data works.

SEA v1.3.1 doesn't seem to have the same files. They are regular MP3s in there.

I'm using JMS v3.1.2. Other skill sounds seem to be headerless WAV files as well, although I didn't check every single one of them.

EDIT: To elaborate, the extracted files do not seem to have a valid header, hence why I said that they are headerless. If they are compressed MP3s, Audacity wouldn't have been able to play them back as they wouldn't be valid sound samples (you'll just get noise).
 
Last edited:
<3
Joined
Feb 4, 2011
Messages
481
Reaction score
123
EDIT: Replacing Skill.img does nothing. :(

I did find the RechargeFail animation in the JMS Effect.wz file, but copying it over to the SEA equivalent does nothing... meaning that a more significant mod needs to be done (Which requires a skill that I haven't acquired yet). :mellow:

EDIT: Not really meaning to rant here... but I'm curious to know: in GMS, there aren't a huge number of typos? In SEA, nearly all the dialogs have a problem with the apostrophe character replaced with a 'f' instead, and there are grammatical errors in some dialogs.

Tear once said "Are you hungries again?". D:

Not to mention that the game became really, really unstable after the Angelic Buster patch.

What do you mean that replacing it does nothing? As in there is no sound whatsoever, or what's the case here?

Also, for the recharge fail, if the effect is not showing up, it means that the client doesn't have the information to know where to load the 'recharge fail' effect from. In other words, it would require a client edit, which we are unable to do. At least, 99% of us are unable to do. :p

Also, to answer you, in GMS, we do have a few mistakes, but it is still WAY better than SEA.

In JMS, the Angelic Buster's skill sounds under Sound.wz/skill.img/65****** are all headerless WAV files. They have a sample rate of 22050 Hz, and are signed 16-bit, mono samples. HaRepacker can't play these files (either no sound is played or you get an exception), but extracting them and reading them with Audacity as raw audio data works.

I have checked the sound files that you stated for GMS. And I've found that they are headerless MP3 files.
 
Last edited:
Initiate Mage
Joined
Jun 4, 2013
Messages
7
Reaction score
1
What do you mean that replacing it does nothing? As in there is no sound whatsoever, or what's the case here?

Exactly. Still no sound when the soul battery depletes and recharges, at least it seemed that way to me.

Also, for the recharge fail, if the effect is not showing up, it means that the client doesn't have the information to know where to load the 'recharge fail' effect from. In other words, it would require a client edit, which we are unable to do. At least, 99% of us are unable to do. :p

If you really mean that the main executable of the client has to be modded, it won't be possible for us anyway since we're on the official service and they check the client's integrity (according to my understanding so far).

Also, to answer you, in GMS, we do have a few mistakes, but it is still WAY better than SEA.

I noticed that they have some quests (From Edelstein) that have times written in PDT, so I believed at one point that they copied the files from GMS. I guess not.

I have checked the sound files that you stated for GMS. And I've found that they are headerless MP3 files.

Pardon me if you actually know what you're talking about here (I'm assuming that you assumed that they are headerless because they look headerless), but MP3 files may look headerless because they really don't have a header. I don't know... if the format is headerless, can we consider them headerless (when we say something is "headerless", it usually means that the header is missing when it is usually present)? :p

If they are MP3s, it means that you're seeing the same thing that I'm seeing for the SEA client. Which probably means that only JMS has them. :/

(But, since I usually don't deal with MP3 files, please correct me if I'm wrong here... and that MP3 files can actually have a header)

Thank you for sharing!
 
Joined
Apr 5, 2008
Messages
663
Reaction score
537
When I tested those sounds using GMS v135 with NoLifeStory, they were not mp3 data and libmpg123 would choke on them and refuse to play them. When I instead sent the data as is to the sound system as raw samples, it played just fine, although I manually had to specify sample rate and channel count.
 
Back
Top