sibears / IDAGolangHelper

Set of IDA Pro scripts for parsing GoLang types information stored in compiled binary
1.01k stars 150 forks source link

Error finding LineTable in some binaries #11

Closed FirehaK closed 4 years ago

FirehaK commented 4 years ago

When examining the NotRobin binaries from a FireEye report, the script can't find FB FF FF FF 00 00 and fails due to Gopclntab.findGoPcLn() returning an invalid offset. This function became even more troublesome after updating API calls due to ida_search.find_binary() requiring a start and end offset for the search.

I've made an update that I'll try to push soon that works in every Go binary I've tested so far. Some binaries in the report were also go 1.13.x, so I updated the string search as well. If it's acceptable, below is a quick snippet of my solution for the LineTable search:

end_ea = idc.get_segm_end(0)
possible_loc = ida_search.find_binary(0, end_ea, lookup, 16, idc.SEARCH_DOWN)

EDIT: I hope "LineTable" was the correct term? I'm not familiar with Go and found the term in their source here.