Vilsol / ue4pak

ue4pak parses and extracts data from UE4 Pak files
GNU General Public License v3.0
18 stars 9 forks source link

Cannot show class tree for a game I bought off Steam #9

Open JohnMackYouTube05 opened 2 years ago

JohnMackYouTube05 commented 2 years ago

When I run the command to show the class tree for the one pak file in a UE4 game I got off Steam, your program throws an error. The console dump is below:

C:\Users\liljm\Downloads\ue4pak>ue4pak.exe --colors class-tree -p "D:\Games\Steam\steamapps\common\Arcade Redemption\TokensOnly\Content\Paks\TokensOnly-WindowsNoEditor.pak"
2022-03-13T11:51:53-05:00 INF Parsing file: D:\Games\Steam\steamapps\common\Arcade Redemption\TokensOnly\Content\Paks\TokensOnly-WindowsNoEditor.pak
panic: End of stream: 221 < 1071182703

goroutine 1 [running]:
github.com/Vilsol/ue4pak/parser.(*PakParser).Read(0xc00005a0c0, 0x40000000)
        /home/runner/work/ue4pak/ue4pak/parser/parser.go:95 +0x219
github.com/Vilsol/ue4pak/parser.(*PakParser).ReadString(0xc00007c070)
        /home/runner/work/ue4pak/ue4pak/parser/parser_basic.go:21 +0x51
github.com/Vilsol/ue4pak/parser.(*PakParser).DecodeFPakEntry(0xc0000cd988, 0xc00007c070, 0x8)
        /home/runner/work/ue4pak/ue4pak/parser/parser_pak.go:254 +0x2b
github.com/Vilsol/ue4pak/parser.(*PakParser).DecodeLegacyPakEntries(0xb1d600, 0xc00001c120, 0xc00005a100)
        /home/runner/work/ue4pak/ue4pak/parser/parser_pak.go:248 +0x73
github.com/Vilsol/ue4pak/parser.(*PakParser).Parse(0xc00005a0c0, {0xbd5080, 0xc00001c0f0})
        /home/runner/work/ue4pak/ue4pak/parser/parser_pak.go:66 +0x425
github.com/Vilsol/ue4pak/parser.(*PakParser).ProcessPak(0xc00005a0c0, {0xbd5080, 0xc00001c0f0}, 0x0, 0xc000093d88)
        /home/runner/work/ue4pak/ue4pak/parser/parser_types.go:12 +0x5e
github.com/Vilsol/ue4pak/cmd.glob..func1(0xddcb00, {0xb55e15, 0x3, 0x3})
        /home/runner/work/ue4pak/ue4pak/cmd/class-tree.go:62 +0x345
github.com/spf13/cobra.(*Command).execute(0xddcb00, {0xc0000c5fb0, 0x3, 0x3})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xddc880)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
github.com/Vilsol/ue4pak/cmd.Execute()
        /home/runner/work/ue4pak/ue4pak/cmd/root.go:40 +0x25
main.main()
        /home/runner/work/ue4pak/ue4pak/main.go:6 +0x17

Can anyone help me?

Vilsol commented 2 years ago

@JohnMackYouTube05 Can you upload a full log of the the output when you add --log trace flag?

JohnMackYouTube05 commented 2 years ago

@Vilsol here's the full log trace according to the program.

C:\Users\liljm\Downloads\ue4pak>ue4pak.exe --log trace --colors class-tree -p "D:\Games\Steam\steamapps\common\Arcade Redemption\TokensOnly\Content\Paks\TokensOnly-WindowsNoEditor.pak"
2022-03-13T16:07:37-05:00 INF Parsing file: D:\Games\Steam\steamapps\common\Arcade Redemption\TokensOnly\Content\Paks\TokensOnly-WindowsNoEditor.pak
panic: End of stream: 221 < 1071182703

goroutine 1 [running]:
github.com/Vilsol/ue4pak/parser.(*PakParser).Read(0xc00009c1c0, 0x40000000)
        /home/runner/work/ue4pak/ue4pak/parser/parser.go:95 +0x219
github.com/Vilsol/ue4pak/parser.(*PakParser).ReadString(0xc0000c40e0)
        /home/runner/work/ue4pak/ue4pak/parser/parser_basic.go:21 +0x51
github.com/Vilsol/ue4pak/parser.(*PakParser).DecodeFPakEntry(0xc00007f988, 0xc0000c40e0, 0x8)
        /home/runner/work/ue4pak/ue4pak/parser/parser_pak.go:254 +0x2b
github.com/Vilsol/ue4pak/parser.(*PakParser).DecodeLegacyPakEntries(0x84d600, 0xc0000a63f0, 0xc00009c200)
        /home/runner/work/ue4pak/ue4pak/parser/parser_pak.go:248 +0x73
github.com/Vilsol/ue4pak/parser.(*PakParser).Parse(0xc00009c1c0, {0x905080, 0xc0000a63c0})
        /home/runner/work/ue4pak/ue4pak/parser/parser_pak.go:66 +0x425
github.com/Vilsol/ue4pak/parser.(*PakParser).ProcessPak(0xc00009c1c0, {0x905080, 0xc0000a63c0}, 0x0, 0xc000065d88)
        /home/runner/work/ue4pak/ue4pak/parser/parser_types.go:12 +0x5e
github.com/Vilsol/ue4pak/cmd.glob..func1(0xb0cb00, {0x885e15, 0x5, 0x6})
        /home/runner/work/ue4pak/ue4pak/cmd/class-tree.go:62 +0x345
github.com/spf13/cobra.(*Command).execute(0xb0cb00, {0xc0000b6120, 0x5, 0x6})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xb0c880)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
github.com/Vilsol/ue4pak/cmd.Execute()
        /home/runner/work/ue4pak/ue4pak/cmd/root.go:40 +0x25
main.main()
        /home/runner/work/ue4pak/ue4pak/main.go:6 +0x17
frauderik commented 10 months ago

I have the same issue. Here is my golang main.go and the output.

package main

import (
    "context"
    "fmt"
    "os"

    p "github.com/Vilsol/ue4pak/parser"
)

func main() {
    file, err := os.OpenFile("pakchunk1004-WindowsClient.pak", os.O_RDONLY, 0644)
    if err != nil {
        panic(err)
    }
    defer file.Close()

    fmt.Println("file", file.Name(), "opened")

    parser := p.NewParser(file)
    parser.Parse(context.Background())
}
$ go run main.go
file pakchunk1004-WindowsClient.pak opened
panic: End of stream: 221 < 436323551

goroutine 1 [running]:
github.com/Vilsol/ue4pak/parser.(*PakParser).Read(0xc000145f28, 0x1a02039b)
        C:/Users/User/go/pkg/mod/github.com/!vilsol/ue4pak@v0.1.5/parser/parser.go:95 +0x228     
github.com/Vilsol/ue4pak/parser.(*PakParser).ReadString(0xc000145f28?)
        C:/Users/User/go/pkg/mod/github.com/!vilsol/ue4pak@v0.1.5/parser/parser_basic.go:21 +0x51
github.com/Vilsol/ue4pak/parser.(*PakParser).Parse(0xc000145f28, {0x11bde68, 0xc00011a010})      
        C:/Users/User/go/pkg/mod/github.com/!vilsol/ue4pak@v0.1.5/parser/parser_pak.go:55 +0x3a7 
main.main()
        E:/GitHub/pakparser/main.go:21 +0x165
exit status 2
frauderik commented 10 months ago

Nevermind. It is because the pak is encrypted.