Comments (9)
same, + the following when trying to list
Traceback (most recent call last):
File "u4pak.py", line 1720, in <module>
main(sys.argv[1:])
File "u4pak.py", line 1609, in main
pak = read_index(stream,args.check_integrity)
File "u4pak.py", line 792, in read_index
mount_point = read_path(stream)
File "u4pak.py", line 538, in read_path
return stream.read(path_len).rstrip(b'\0').decode('utf-8').replace('/',os.path.sep)
OverflowError: cannot fit 'int' into an index-sized integer
from u4pak.
I somehow missed the first report: I cannot reproduce that on Linux with Python 3.7.3.
For the second: That is strange. Maybe the file is damaged or in some (sub-)format I don't know about or I have a bug that somehow only gets triggered by your file. Please rewrite the read_path()
function on line 536
like this and tell me what the new output is:
def read_path(stream):
path_len, = st_unpack('<I',stream.read(4))
print(path_len)
print(stream.read(8).rstrip(b'\0').decode('utf-8'))
stream.seek(-8, 1)
return stream.read(path_len).rstrip(b'\0').decode('utf-8').replace('/',os.path.sep)
from u4pak.
I somehow missed the first report: I cannot reproduce that on Linux with Python 3.7.3.
For the second: That is strange. Maybe the file is damaged or in some (sub-)format I don't know about or I have a bug that somehow only gets triggered by your file. Please rewrite theread_path()
function on line536
like this and tell me what the new output is:def read_path(stream): path_len, = st_unpack('<I',stream.read(4)) print(path_len) print(stream.read(8).rstrip(b'\0').decode('utf-8')) stream.seek(-8, 1) return stream.read(path_len).rstrip(b'\0').decode('utf-8').replace('/',os.path.sep)
Before was
Traceback (most recent call last): File u4pak.py, line 1743, in <module> main(sys.argv[1:]) File u4pak.py, line 1618, in main if args.command == 'list': AttributeError: 'Namespace' object has no attribute 'command'
And now
Traceback (most recent call last): File u4pak.py, line 1743, in <module> main(sys.argv[1:]) File u4pak.py, line 1618, in main if args.command == 'list': AttributeError: 'Namespace' object has no attribute 'command'
from u4pak.
Wait, how do you call the program?
from u4pak.
I just figured out that you get that error message if you don't pass any arguments to u4pak.py
. I fixed it so that it will print the help message in that case.
from u4pak.
I just figured out that you get that error message if you don't pass any arguments to
u4pak.py
. I fixed it so that it will print the help message in that case.
Thanks
`
C:\MOD>u4pak.py pack file.pak folder
usage: u4pak.py [-h] command ...
unpack, list and mount Unreal Engine 4 .pak archives
positional arguments:
command
unpack (x)
unpack archive
pack (c) pack archive
list (l) list archive contens
info (i) print archive summary info
test (t) test archive integrity
mount (m)
fuse mount archive
optional arguments:
-h, --help show this help message and exit
`
from u4pak.
It prints that help message for you when you try to pack a folder? Weird, it doesn't for me. Sorry, I don't have Windows, so I can't reproduce that problem. :(
panzi@panzi tmp$ mkdir folder
panzi@panzi tmp$ echo foo > folder/foo.txt
panzi@panzi tmp$ echo bar > folder/bar.txt
panzi@panzi tmp$ ~/src/python/u4pak/u4pak.py pack file.pak folder
panzi@panzi tmp$ ~/src/python/u4pak/u4pak.py list file.pak
folder/bar.txt
folder/foo.txt
from u4pak.
It seems to be a weird bug with argument parsing. This only happens when you omit "python", and just run the script directly. The arguments are read, but the first argument doesn't get parsed properly, even though it's in argv.
u4pak.py pack test.pak test
args:
Namespace(archive='test.pak', archive_version=3, check_integrity=False, command=Non
e, encoding='UTF-8', files=['test'], mount_point='..\..\..\', print0=Fa
lse, progress=False, verbose=False, zlib=False)
argv:
['pack', 'test.pak', 'test']
python u4pak.py pack test.pak test
args:
Namespace(archive='test.pak', archive_version=3, check_integrity=False, command='pa
ck', encoding='UTF-8', files=['test'], mount_point='..\..\..\', print0=
False, progress=False, verbose=False, zlib=False)
argv:
['pack', 'test.pak', 'test']
Go to the line "if args.command is None:", and just above it add "args.command = argv[0]". That fixes it.
from u4pak.
Btw. I've also written a new tool now that doesn't require Python, but instead I provide a compiled Windows binary. It is faster, but has slightly different command line arguments and a feature for Windows users that don't want to use a terminal. That means you can write a text file that contains what you otherwise would write as the command line arguments, change the extension from .txt to .u4pak and drop that file onto u4pak.exe (or you can also associate the .u4pak extension with u4pak.exe so that a double-click will automatically open it with that). This should also keep the window open after it is done (until you press ENTER). Though I haven't tested it under Windows since I'm on Linux.
from u4pak.
Related Issues (20)
- Unable to Pack a file HOT 6
- Unsure if the .bat file was created correct.. HOT 1
- i can't make a pak using "u4pak" HOT 1
- U4pak.py error HOT 4
- Variable referenced before assignment error in latest version HOT 1
- Error reading certain pak (incomplete or truncated stream) HOT 9
- u4pak runs on command prompt, but does nothing when i use pack/unpack commands HOT 3
- Can't unpack Dead by Daylight Sounds - not compatible? HOT 10
- it seems that doesn't work in 4.26? HOT 2
- How to pack it again to .pak file i decrypt it now its a lot of .dat file i change some value but now i am not able to repack it HOT 3
- Fix non-ASCII path handling HOT 3
- Errno 13 while trying to unpack HOT 6
- Problem with packing the game with python script HOT 6
- [Errno 22] Invalid argument HOT 10
- Unsupported version 10 HOT 1
- [ADD FEATURE] please support to pubg mobile HOT 3
- Can't seems to pack the files HOT 1
- [ASK] do you know about paks 10 version?? HOT 4
- [Request] I am looking for a program for DeadByDaylight to extract and classify the audios. HOT 3
- pack.bat and unpack.bat is missing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from u4pak.