PCILeechGen
PCILeechGen copied to clipboard
panic: runtime error: invalid memory address or nil pointer dereference
Description
Testing --from-json
root@beelink:~/PCILeechGen# sudo ./bin/pcileechgen build --from-json /root/Archive/dumps/godshark.aud/donor_info.json --board CaptainDMA_100T
2026/03/09 18:25:26 INFO loading device context file=/root/Archive/dumps/godshark.aud/donor_info.json
2026/03/09 18:25:26 INFO build target board=CaptainDMA_100T fpga=xc7a100tfgg484-2 output=pcileech_datastore
2026/03/09 18:25:26 INFO donor device vendor=0000 device=0000 class="Unclassified device" revision=00
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x61f179]
goroutine 1 [running]:
main.printBuildSummary(0xc0000175f0, 0xc000192448)
github.com/sercanarga/pcileechgen/cmd/pcileechgen/build.go:112 +0x479
main.runBuild(0xc00002e400?, {0x6b0823?, 0x4?, 0x6b0827?})
github.com/sercanarga/pcileechgen/cmd/pcileechgen/build.go:58 +0x65
github.com/spf13/cobra.(*Command).execute(0x8fed20, {0xc0000ba4c0, 0x4, 0x4})
github.com/spf13/[email protected]/command.go:1015 +0xb02
github.com/spf13/cobra.(*Command).ExecuteC(0x8ff2e0)
github.com/spf13/[email protected]/command.go:1148 +0x465
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:1071
main.main()
github.com/sercanarga/pcileechgen/cmd/pcileechgen/main.go:25 +0x1a
Error Type
Code 10 (device cannot start)
Device Context File
NA
Windows Event Log
Device Manager Error Details
No response
Terminal Output
the crash happens because your json file is from a different tool and doesn't have the fields pcileechgen needs. fixed it so it shows a proper error now instead of panicking. just a heads up, --from-json only works with json files that pcileechgen itself generated.