Coder Social home page Coder Social logo

lastbattle / harepacker-resurrected Goto Github PK

View Code? Open in Web Editor NEW
398.0 20.0 154.0 6.1 MB

All in one .wz file/map editor for MapleStory game files

License: Mozilla Public License 2.0

Python 0.03% C# 51.19% HTML 0.23% C++ 4.21% C 44.33% Makefile 0.01%
maplestory wz nexon wizet

harepacker-resurrected's Introduction

HaSuite / Harepacker resurrected

Github total downloads Github All Releases Github All Issues

A collection of tools for MapleStory, including a .wz file and level/field/map editor.

Original thread: HaSuite - HaCreator 2.1/HaRepacker 4.2.3 | Ragezone

Discussion thread: Ragezone


Project contents

  • HaCreator - MapleStory level editor
  • HaRepacker - MapleStory .wz file editor
  • HaSharedLibrary - A shared library between HaRepacker & HaCreator for mostly GUI
  • squish-1.11\apng - (Unused for now, might consider .NET Core implementation of SIMD for images in future releases) info
  • spine-csharp 2.1.25 - 2D animation library official website | official website, spine demo | MapleStory dev's note
  • UnitTest_WzFile - For testing of wz file across versions.
MapleLib2 by haha01haha01;
  • is based on MapleLib by Snow, WzLib by JonyLeeson, and information from Fiel\Koolk

BUILD

To build HaSuite, you need

To run HaSuite, you need

  • Microsoft .NET Framework 4.8 (usually already pre-installed in Windows 10, just do a Windows update) otherwise, install here

Modules / Submodules used

Cloning

git clone https://github.com/lastbattle/Harepacker-resurrected.git
git submodule init
git submodule update

Development

Please note that this is a community-driven project that I work on in my free time. Don't expect any issues to be fixed or new features to be added quickly.

Want to support the development?

BTC: 3AEEJKaTNuw8KoafKNevpMsP2tVmaip4Fx

Would you like to contribute to this project instead? If so, you can fork the project and create a pull request. It's all free!


Harepacker

Image preview

Spine image preview

Limen: Where the world ends

Rainbow Street Amherst

Oblivion Lake


License

MIT

Copyright (c) 2018~2023, LastBattle https://github.com/lastbattle
Copyright (c) 2010~2013, haha01haha http://forum.ragezone.com/f701/release-universal-harepacker-version-892005/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

harepacker-resurrected's People

Contributors

454020312 avatar arnuh avatar davipk avatar ertrii avatar genment avatar lapig avatar lastbattle avatar piezoelectric avatar shavitush avatar soulgirljp avatar souna avatar taida957789 avatar v3921358 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

harepacker-resurrected's Issues

the minimap issue

hi, it seems the minimap issue be fixed following changing 5 days ago? I use the latest release version in October 2020 and fount that I cannot go to the map otherwise the client will close and I found the reason is the minimap in wz. So I delete minimap then I can go to the new map. Idk how to fix this problem, QaQ just lookning for help !! many thanks !!!

HaCreator ,Before BB, there will be two serious bugs

The bug is as follows:

1: When using hacreator to save the edited content, the PNG of the mini map will be lost.
2: When using mapsimulation, it crashes.

Both of the above two bugs occur on the client before BB. The client after BB can use mapsimulation, and then there will still be a bug in which the PNG of the mini map is lost. The map cannot be accessed.

_link . _outlink

hope that you can export the xml with the _link and _outlink directories in the classic format. The pictures should be there so that they do not flicker on the client.

Parameter is not valid

When trying to extract Mob001.wz, (in bulk) I got that error. Here's the log. My newest folder was 8880002.img, but 8880001.img only has 2 files
None of them are the the problem, successfully extracted all the way from 8880000 to 8880010 I was also able to successfully extract everything a second time? I'll leave this open in case this is something else other than my RAM acting up or something

Feature Request: Ability to dump all files

It now have only dumping method XML, PNG, MP3, and IMG files.
For now, I have problem opening img files, and maplestory now adds lots of other formats, my request thing is not just dumping (png/mp3)s, dump all data even if it isn't those formats.

Object reference not set to an instance of an object (HaCreator)

This error pops out when I attempt to save the wz & repack the map.wz
image

from the errors.txt

Starting error log on 28/5/2020 12:00:00 AM
IncorrectStructure: [ExtractSoundFile] Error parsing sound, BgmTW.img file.
Error: System.InvalidCastException: Unable to cast object of type 'MapleLib.WzLib.WzProperties.WzUOLProperty' to type 'MapleLib.WzLib.WzProperties.WzBinaryProperty'.
at HaCreator.Wz.WzFileManager.ExtractSoundFile(String soundWzFile) in C:\Users\Fam\Desktop\Harepacker-resurrected\HaCreator\Wz\WzFileManager.cs:line 237
:
[ExtractSoundFile] Error parsing sound, BgmTW.img file.
Error: System.InvalidCastException: Unable to cast object of type 'MapleLib.WzLib.WzProperties.WzUOLProperty' to type 'MapleLib.WzLib.WzProperties.WzBinaryProperty'.
at HaCreator.Wz.WzFileManager.ExtractSoundFile(String soundWzFile) in C:\Users\Fam\Desktop\Harepacker-resurrected\HaCreator\Wz\WzFileManager.cs:line 237

Editing XML externally and reimporting corrupts that IMG?

Hi,
I am working on v95 and exporting Mob img as XML and editing them and reimporting them. Here is an example of my use case:

  1. Dump 0100101.img as Classic XML.
  2. Edit it. Reimport it into Mob.wz and save.
  3. Entering a map with 0100101 crashes the game with no error code. I've tried making the same changes as I did in the XML via HaRepacker and this works. I compared the XML of the Mob img that was changed via HaRepacker with the one I made. They are both identical in binary.

Object reference not set to an instance of an object when import Mob img

Hi,

I dumped a Mob image (such as 0100100.img) from v90 and I was trying to import it back to v83. However, when I do so I get the following error:

The file "C:\Nexon\v90\MapleStory\v90 Mob IMG\0100100.img" is invalid and will be skipped. Error: Object reference not set to an instance of an object.

No EMS options when choosing version

I'm currently working on a v.76 EMS application (GMS v.95 equivalent). Using the drop down menu, what works for this version is MSEA/Taiwan (old).

EMS (old) should be added as well to avoid confusion.

Also, why not just let the program guess the version? I'm not too familiar with WZ files as I'm only coding server things - but I guess the file header should tell you which version it is?

No support for LUA extraction

I'm currently working on my own python unpacker and my program crashed when reading a certain file. I wanted to collaborate with you on my findings since I see your unpacker doesn't support it, really.

I would write this myself, but it would require an overhaul in some areas, so instead I'll just tell you how to do it.

GMS/Etc.wz/Script/BattleScene.lua

This entire file looks like:
01 80 6C 10 01 00

A few interesting things to notes:

  1. 99.99% of the time, you're extracting a 0x73 as the first byte to extract a Property. However, this time the first byte is 0x01. The 0x01 implies a reference to a previous string, but there are no previous strings (as it's the first byte). Finally, a 0x01 backreference should be followed by a signed 32 bit integer, but this one is followed by a PackedInt. These issues will cause a parser to fail.

  2. The is a string which must be decrypted using only the KMS AES stream (IV = [B9 7D 63 E9]). Do not use the ASCII traditional (0xAA + i) over the KMS stream. You use only the KMS AES stream to decrypt it. The decryption churns out a LUA file which has Latin and Japanese text. These LUA files break a lot of parsers because they assume that the same AESIV will be used everywhere in the file, and that is no longer the case.

I have some logic which you can use to work with such files that won't cause string errors:

  • If the filePath ends in .lua, extract this 0x01 file type specially in whatever dumpString function you have by checking for the .lua file extension there.
  • If there's a 0x01 back-reference but it's the first byte of the file, use the alternate logic for parsing a 0x01 byte. This works best if you have access to a binarystream.peek() function

Finally, you can see a thread at RageZone where they discuss these files. Code snippets are provided: https://forum.ragezone.com/f941/wzimage-nodes-1115819/

Harepacker unable to open latest MSEA Skill001.wz and Skill.wz consistently, maxes out ram usage

Update

Look at Edit 3 below for quick fix, but this prevents backwards compatibility with older versions of maple *.wz files. The ram usage and long processing time seems to be due to WzFile.cs Line 222, the checking of every version and hash is inefficient and might be the cause of memory runaway issue i was facing.

Hello, the latest patch of v196 in MSEA cause harepacker to be unable to open either skill or skill001.wz, if it does not hang or crash outright. It will loop the loading screen, but task manager shows the program increasing ram usage until it maxes out ram, which then switches over to writing and reading from the disk.

It is repeatable everytime i open skill001.wz everytime, and only successfully loads maybe once every 10 tries. Only version of harepacker which can open it successfully without maxing out ram is the original harepacker that this project is forked from.

image

Edit: I have downloaded the latest version of the required submodules and programs required to build and test your master. Still facing the same issues. Also, changing to black theme causes the program to not open and throw exceptions.

************** Exception Text **************
System.InvalidOperationException: 'button_animateSelectedCanvas' name cannot be found in the name scope of 'System.Windows.Controls.DockPanel'.
   at System.Windows.Media.Animation.Storyboard.ResolveTargetName(String targetName, INameScope nameScope, DependencyObject element)
   at System.Windows.Media.Animation.Storyboard.ClockTreeWalkRecursive(Clock currentClock, DependencyObject containingObject, INameScope nameScope, DependencyObject parentObject, String parentObjectName, PropertyPath parentPropertyPath, HandoffBehavior handoffBehavior, HybridDictionary clockMappings, Int64 layer)
   at System.Windows.Media.Animation.Storyboard.ClockTreeWalkRecursive(Clock currentClock, DependencyObject containingObject, INameScope nameScope, DependencyObject parentObject, String parentObjectName, PropertyPath parentPropertyPath, HandoffBehavior handoffBehavior, HybridDictionary clockMappings, Int64 layer)
   at System.Windows.Media.Animation.Storyboard.BeginCommon(DependencyObject containingObject, INameScope nameScope, HandoffBehavior handoffBehavior, Boolean isControllable, Int64 layer)
   at System.Windows.VisualStateGroup.StartNewThenStopOld(FrameworkElement element, Storyboard[] newStoryboards)
   at System.Windows.VisualStateManager.GoToStateInternal(FrameworkElement control, FrameworkElement stateGroupsRoot, VisualStateGroup group, VisualState state, Boolean useTransitions)
   at System.Windows.VisualStateManager.GoToStateCommon(FrameworkElement control, FrameworkElement stateGroupsRoot, String stateName, Boolean useTransitions)
   at HaRepacker.GUI.Panels.MainPanel..ctor() in C:\Users\mervi\Documents\GitHub\Harepacker-resurrected\HaRepacker\GUI\Panels\MainPanel.xaml.cs:line 60
   at HaRepacker.GUI.MainForm.AddTabsInternal(String defaultName) in C:\Users\mervi\Documents\GitHub\Harepacker-resurrected\HaRepacker\GUI\MainForm.cs:line 522
   at HaRepacker.GUI.MainForm..ctor(String wzToLoad, Boolean usingPipes, Boolean firstrun) in C:\Users\mervi\Documents\GitHub\Harepacker-resurrected\HaRepacker\GUI\MainForm.cs:line 46
   at HaRepacker.Program.Main(String[] args) in C:\Users\mervi\Documents\GitHub\Harepacker-resurrected\HaRepacker\Program.cs:line 73

Edit 2: Google drive link added for Skill001.wz
https://drive.google.com/file/d/1B6ty6lwwO_mgXTDoy0frycGkaFTUzkpF/view?usp=sharing

Edit 3: Wzfile.cs line 222, i changed int j = 190 so it doesnt check so many times.

for (int j = 190; j < MAX_PATCH_VERSION; j++)
                {
                    this.mapleStoryPatchVersion = (short)j;
                    this.versionHash = GetVersionHash(version, mapleStoryPatchVersion);
                    if (this.versionHash == 0)
                    {
                        continue;
                    }
                    reader.Hash = this.versionHash;
                    long position = reader.BaseStream.Position; // save position to rollback to, if should parsing fail from here
                    WzDirectory testDirectory;

New Map.wz -> Map002.wz

Would you be able to fix the map rendering for the new Map WZ files? Looks like all the maps are now being placed into the Map002.wz for the newer gMS versions. Also, for some reason after editing any of the maps creates an error -> buffer cannot be null.

Cannot extract files

I had "successfully" extracted MapleStory's files a few months ago (I'm that guy who made the post about illegal characters in Windows), they were for a project I was making. Now, when I try to export .wz files to get newer versions of everything I get "Not enough quota is available to process this command" every time, on at least 2 files (Character.wz and Map.wz). This happened on both my old version I had before and latest release. Here's the full log.

2 important issues...

when i open a v83 .wz file with (old) gms encryption, lets say character.wz (201 MB) and attempt to save it somewhere else with my own encrypt keys, the result is a small (261 KB) unusable .wz file :/

There's also the 'System.Object[]' to type 'System.Int32[]' problem that doesn't allows you to extract a .wz's .img files.

tried compiling it by myself, even tried with the released compiled .exe, and the problem is always there, i even tried in a clean OS with the required runtime cores and .NET and still no luck.

it would be nice to be able to save .wz files with my own keys AND then being able to extract those .wz's encypted .img files (with my keys) in order to load them directly from .img files in the client.

even tried to compile a 4.2.4 HaRepacker with my own keys, but i keep getting random errors related with WinFormsUI and DockPanel when trying to save a .wz with my custom keys...

a fix for this in HaRepacker-Ressurected would be awesome :D

NULL bitmap

Hi All,

After encrypting a Mob.wz file, it appears some images are not properly parsing/saving.
The repacker itself works for all other files, but it appears it doesn't work well with encrypting Mob.wz files.

I debugged, went to a node that wasn't getting images saved, and received the following error:

unknown

Dumping Map.wz error

Seems like there is some sort of error dumping v97 Map.wz. It seems to be stuck (no exception has popped up however).

Deleting FH's with HaCreator

If you delete FH's and save the map, it renames the FH's. This might not really be an "issue" for some. But for the purpose I'm using it for, it causes a crash when I load my server.
But if you do it through HaRepacker, it doesn't rename or cause a crash and honestly, that's how I think it should work for HaCreator too.

Cannot access a closed pipe.

I'm able to just click Continue and go on like normal, but that error happens when I open an additional file after one's already opened through double-clicking file set to auto open in HaRepacker. Error log (Also tested on latest release and the same happens)

export animations?

Presently you can view animations by more>animate, but is there any way to export them as a single animated image?

GMS v0.35 compatibility

Do you think it's possible to add support for such old versions? Right now, it just loads in a bunch of unreadable names.

Top is v35, bottom is v62 I reckon:

When I want read kms1.2.95

System.NullReferenceException: Object reference not set to an instance of an object.
location: HaRepacker.Converter.BitmapToImageSource.ToWpfBitmap(Bitmap bitmap) files C:\Users\TAIGA\Desktop\Harepacker-resurrected-master\Harepacker-resurrected-master\HaRepacker\Converter\BitmapToImageSource.cs:line 35
location: HaRepacker.GUI.Panels.MainPanel.ShowObjectValue(WzObject obj) files C:\Users\TAIGA\Desktop\Harepacker-resurrected-master\Harepacker-resurrected-master\HaRepacker\GUI\Panels\MainPanel.xaml.cs:line 1357
location: HaRepacker.GUI.Panels.MainPanel.DataTree_AfterSelect(Object sender, TreeViewEventArgs e) files C:\Users\TAIGA\Desktop\Harepacker-resurrected-master\Harepacker-resurrected-master\HaRepacker\GUI\Panels\MainPanel.xaml.cs:line 118
location: System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
location: HaRepacker.TreeViewMS.OnAfterSelect(TreeViewEventArgs e) files C:\Users\TAIGA\Desktop\Harepacker-resurrected-master\Harepacker-resurrected-master\HaRepacker\TreeViewMS.cs:line 187

This error message is displayed (the iv value is custom).
IV VLAUE: 2E,2B,33,01
But PNG doesn't work at all.

This repacker works, but there are many features that are not supported because it is out of date.
And I will attach an example wz.
Please reply. Thank you

kms_95_Repacker.zip

NPC.WZ
https://drive.google.com/file/d/1A-nKwtKVPA6TYYTp231qqsFdlyL_Zyzm/view?usp=drive_web
https://drive.google.com/file/d/16XeOBr-HH3FgGi5rlZyrgxOKdnT4hViS/view?usp=drive_web
https://drive.google.com/file/d/1pC5Fn_jRaPtT-zf4EDeeav7VeKhESbeW/view?usp=drive_web
https://drive.google.com/file/d/1aLPeSzvpQkfW7T2oUuYcDmDd1dWg-j7R/view?usp=drive_web

Memory Leak in Insert IMG mode

When I try to insert a lot of IMG, the memory will continue to grow and will not be collected, I had to keep restarting the program to get enough memory.
8(H9VII 3G4IZ21}1 $UL8Q

Something is wrong with image....

something want wrong with the image, it's not related to harepacker but to maplelib since i load it with maplelib (from this repo) and only with logo.img (nexon/wizet):
https://i.imgur.com/jzHwOg9.png
it work fine with the HaSuite-211 through :x
using v83 or latest version from steam, it's the same issues

HaCreator

Hi has the download point of compiled HaCreator Releases?

Harepacker-resurrected does not compile when initially cloned

To reproduce the error:
(1) Git clone a fresh repository
(2) compile it

My VSCommunity 2017 had several complaints about it. It complained about files in Harepacker-resurrected/Spine that didn't exist:

<Compile Include="Spine\SpriteBatchItem.cs" />

Then there's also the requirement to install the DockPanel suite which is not documented anywhere.

Can someone create a compile guide of all requirements? I'm too scared to run down dependency hell to get this thing to compile.

v83 request - wz files over 2gig

any chance of fixing the bug with creator not able to use map wz over 2 gig.
we got img patch working on v83 so this would help us

support for v83?

i noticed all support for preBB clients was all removed any reason to this and any chance of it coming back?

"The given path's format is not supported"

When trying to extract UI.wz/AllianceUI.img/ChallengeUI/button:help I get the following error log. Note that : is a forbidden character in Windows \ / : * ? " < > | (I also get that on GuildUI and FarmUI, basically anywhere that has said character), I am using latest release.

On a side note I also get this error sometimes: (Tried to extract Charater.wz)
Unable to cast object of type 'System.Object[]' to type 'System.Int32[]'.

Unable to open certain files

Came across this issue quite randomly while editing my UI and Map files (GMS v84).
I somehow managed to break my UI and Map files to the point that the current MapleLib is unable to open the files, however ancient versions of MapleLib are able to open it fine under "MSEA (old)" encryption.
Seems to happen also if the file only has a single image inside it.

Harepacker-resurrected:
image

Ancient version of the original HaRepacker:
image

Resurrected still seems to open and edit the rest of my files perfectly fine (under "GMS (old)" encryption) -- not sure what went wrong!

Sample of the WZ file that Harepacker-resurrected is unable to parse:
UI_Test.zip

The exception seems to be thrown by this line of code:

reader.ReadBytes((int)(Header.FStart - reader.BaseStream.Position));

Also.. the MapleStory client is still able to parse the file correctly.

Unknown property type at ParsePropertyList, ptype = x

I keep running into this error when opening certain IMGs:
Unknown property type at ParsePropertyList, ptype = (insert number here)

For example, I get the number ptype = 184 when opening clean v83 Item.wz > Etc > 0400.img

However, the same error does not occur when I try open that node using the old HaRepacker 4.2.4

portals dont link due to door ids

i found out why maps break with linked portals
if u place say portal a b c then place doors then play portal d
client bugs out cuz of portal d
its cuz when saving portal ids the edit needs to set in this order

  1. spawnpoints
  2. warps
  3. hidden portals
  4. doors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.