Giter VIP home page Giter VIP logo

ue4pak's Issues

Memory Leak when trying to read UAsset

paks, err := filepath.Glob("paks/*.pak")
if err != nil {
  panic(err)
}

for _, f := range paks {
fmt.Println("Parsing file:", f)

file, err := os.OpenFile(f, os.O_RDONLY, 0644)
if err != nil {
  panic(err)
}

p := parser.NewParser(file)
pak, err := p.Parse()
if err != nil {
  panic(err)
}

summaries := make(map[string]*parser.FPackageFileSummary)

for _, record := range pak.Index.Records {
  fmt.Println("Parsing file:", record.FileName)

  if !strings.Contains(record.FileName, ".uasset") {
    continue
  }

  content := record.ReadUAsset(pak, p)
  fmt.Println("Content:", content.FolderName)

  summaries[content.FolderName] = content
}

image

Cannot show class tree for a game I bought off Steam

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/[email protected]/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xddc880)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/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?

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.