Closed Datura123 closed 1 month ago
In the old version B03, this error is not encountered
Please click on Details and send its text
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.IOException: Cannot create a file when that file already exists.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateCore(SafeFileHandle fileHandle, String mapName, HandleInheritability inheritability, MemoryMappedFileSecurity memoryMappedFileSecurity, MemoryMappedFileAccess access, MemoryMappedFileOptions options, Int64 capacity)
at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateFromFile(String path, FileMode mode, String mapName, Int64 capacity, MemoryMappedFileAccess access)
at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateFromFile(String path, FileMode mode, String mapName)
at UEcastocLib.Packer.PackFilesToUcas(List`1 files, Manifest m, String dir, String outFilename, String compression) in C:\Users\PCMOD\source\repos\rm-NoobInCoding\UnrealUnZen\UnrealUnZen\UEcastocLib\Pack.cs:line 133
at UEcastocLib.Packer.PackToCasToc(String dir, Manifest m, String outFilename, String compression, Byte[] aes) in C:\Users\PCMOD\source\repos\rm-NoobInCoding\UnrealUnZen\UnrealUnZen\UEcastocLib\Pack.cs:line 422
at UEcastocLib.Packer.PackGameFiles(String dirPath, Manifest manifest, String outFile, String compressionMethod, String AESKey) in C:\Users\PCMOD\source\repos\rm-NoobInCoding\UnrealUnZen\UnrealUnZen\UEcastocLib\Pack.cs:line 48
at UnrealUnZen.MainTool.RepackBTN_Click(Object sender, EventArgs e) in C:\Users\PCMOD\source\repos\rm-NoobInCoding\UnrealUnZen\UnrealUnZen\MainTool.cs:line 93
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I tried deleting the file with the same name and it worked
If there are 2 files with the same name in that common folder, it will encounter an error, for example: DroidSansMono.uasset
"Engine/Content/EngineFonts/Faces/DroidSansMono.uasset", "Engine/Content/EngineFonts/DroidSansMono.uasset"
I tried deleting the file with the same name and it worked
If there are 2 files with the same name in that common folder, it will encounter an error, for example: DroidSansMono.uasset
"Engine/Content/EngineFonts/Faces/DroidSansMono.uasset", "Engine/Content/EngineFonts/DroidSansMono.uasset"
This is definitely a bug. It's totally possible to have a lot of files with the same name in the same package. For example:
And there is no deleting the files for me. I just checked, I have 5980 duplicated files.
This issue is happening because of the line:
MemoryMappedFile = MemoryMappedFile.CreateFromFile(pathToread, FileMode.Open, Path.GetFileNameWithoutExtension(pathToread));
In pack.cs#L133. This is happening is because you're calling MemoryMappedFile.CreateFromFile overload with mapName: you're creating a MemoryMappedFile and assigning it a mapName for a file. And so you can't have a file with the same mapName loaded twice in the memory. The quick fix is to use a different overload and just not pass the mapName
to CreateFromFile
function:
MemoryMappedFile = MemoryMappedFile.CreateFromFile(pathToread, FileMode.Open);
This fixes the bug: I packed 51000 files with 5980 files with duplicated names. But why are you even using MemoryMappedFile? MemoryMappedFile is made for big heavy files, so the file can be shared across running processes and wouldn't have to be loaded twice into each process. It's useless for this kind of a use case where you have one process just iterating over a bunch of files, reading them into memory, then archiving them and then forgetting about them, all without using them even twice around the program. In fact, it's using more memory than a simple Stream, because it's a much more complex type than a simple Stream. Just use File.Open.
Created pull request with the fix. And before the official release is created, here's the zip of program with the fix: UnrealUnZen.zip
Created pull request with the fix. And before the official release is created, here's the zip of program with the fix: UnrealUnZen.zip
sorry but, it can't repack over 2GB file
sorry but, it can't repack over 2GB file
Right. That's why MemoryMappedFile was used. Try this one then: UnrealUnZen.zip
I tried this, it still doesn't work
sorry but, it can't repack over 2GB file
Right. That's why MemoryMappedFile was used. Try this one then: UnrealUnZen.zip
I tried this, it still doesn't work. can't repack over 2GB file
I tried this, it still doesn't work. can't repack over 2GB file
I think I might have zipped this last version before I built the solution after going back one commit where there is no issue with over 2 GB files. That's my bad.
Try again: UnrealUnZen.zip
Yesterday I unpacked and then packed back two 11 GB packages after fixing this problem with "cannot create a file when that file already exists".
I think I might have zipped this last version before I built the solution after going back one commit where there is no issue with over 2 GB files. That's my bad.
Try again: UnrealUnZen.zip
Yesterday I unpacked and then packed back two 11 GB packages after fixing this problem with "cannot create a file when that file already exists".
Unfortunately, I tried many times, it still cannot repack over 2 GB file, I used oodle compression, maybe this compression method doesn't work?
Here Details:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.IOException: The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size.
at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost)
at UEcastocLib.Packer.PackToCasToc(String dir, Manifest m, String outFilename, String compression, Byte[] aes) in D:\Projects\Reversing\UE4\UnrealUnZen\UnrealUnZen\UEcastocLib\Pack.cs:line 424
at UEcastocLib.Packer.PackGameFiles(String dirPath, Manifest manifest, String outFile, String compressionMethod, String AESKey) in D:\Projects\Reversing\UE4\UnrealUnZen\UnrealUnZen\UEcastocLib\Pack.cs:line 48
at UnrealUnZen.MainTool.RepackBTN_Click(Object sender, EventArgs e) in D:\Projects\Reversing\UE4\UnrealUnZen\UnrealUnZen\MainTool.cs:line 93
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
我尝试了这个,仍然不起作用。无法重新打包超过 2GB 的文件
我想在返回一次提交(其中超过 2 GB 文件没有问题)之后构建解决方案之前,我可能已经压缩了最后一个版本。那是我的不好。
再试一次:UnrealUnZen.zip
昨天,在解决“当文件已存在时无法创建文件”的问题后,我解压并打包了两个 11 GB 的包。
cannot repack over 2 GB file
Ok, I've now implemented some fixes for the problems with packing more than 2 GB files. The previous versions I posted only included the fix for "cannot create a file when that file already exists" error.
Try it out and let me know if it works: UnrealUnZen.zip
I've just now packed 2.5 GB .ucas with encryption enabled this time.
Ok, I've now implemented some fixes for the problems with packing more than 2 GB files. The previous versions I posted only included the fix for "cannot create a file when that file already exists" error.
Try it out and let me know if it works: UnrealUnZen.zip
I've just now packed 2.5 GB .ucas with encryption enabled this time.
thank you, it worked!
The packed utoc cannot be opened
Did you define AES KEY in FModel?
yes
Game Name Dead Island 2 AES KEY =0x014AEC0148FBDEE9640633AAB67521AAB4E1083A98F76FF33DDCF78DAD05BE66
Can you send repacked Toc file?
Thank @rm-NoobInCoding for fix B03, but it appeared another error the new version B04