#mageec Log for 2013-08-16

--- Log opened Fri Aug 16 00:00:36 2013
-!- jeremybennett_ [~jeremy@188.29.150.181.threembb.co.uk] has joined #mageec10:53
-!- mode/#mageec [+o jeremybennett_] by ChanServ10:53
-!- jeremybennett_ [~jeremy@188.29.150.181.threembb.co.uk] has quit [Ping timeout: 245 seconds]12:07
@simoncookAWhetter: jamespallister: I have some test hash code could you try, http://simoncook.org/tmp/elf.c  I've been compling with 'gcc -g elf.c -lelf -lgcrypt' so you need headers for libelf and libgcrypt. Then run with ./a.out <some binary>14:54
AWhettersimoncook: I needed to change "/tmp/a.out" on line 34 to argv[1], but it works for me with an ARM binary and an x86 binary15:00
AWhetterIt also works on itself :P15:02
@simoncookaah, i added the check for if you added an argument but never used it ^^15:10
@simoncookexcellent, so something like that might be used to give you your binary key for your database entry (we just need to decide what sections to use/not use)15:11
jamespallisterYeh, this looks good15:25
jamespallisterperhaps instead of explicity looking for .data or .text, look for sections marked loadable?15:26
jamespallisteralso the offset of each section, and the start address of the executable might need to be in the hash15:27
@simoncookso for each loadable section, add its header?15:28
jamespallisterwhat else is in the header?15:28
jamespallisterEverything except the file offset?15:30
jamespallisterand the link to the next header15:30
@simoncookActually maybe just what you suggested, as sh_name is an offset, so that might change, so perhaps just loadaddress, flags15:32
@simoncookif you change line 73 to "if (sechdr.sh_type & SHF_ALLOC) {" does that seem right with a few files15:46
jamespallisterhmm15:49
jamespallisterits hashing the symtab and strtabl15:49
@simoncookI'm thinking have a blacklist function to ignore sections based on their name15:50
@simoncookso loadable and not (.foo or .bar)15:51
jamespallisterit also doesn't pick up .text for some reason15:56
jamespallisteror .data15:57
@simoncookoops, fail on my part, try sh_flags instead of sh_type15:58
jamespallisterheh, now it segfaults16:00
jamespallisterah yes16:02
@simoncookaah, yes, that because its trying to copy .bss of size n from nowhere16:02
jamespallistersometimes elfdata->d_buf is NULL, even though it hash a elfdata->d_size > 016:02
jamespallister*has16:03
jamespallisterNULL check? ^_^16:03
@simoncookthe version I have after giving you a link has a size check, obviously missed the NULL ^^16:04
@simoncookthe version at that link now has all the fixes/changes so far16:06
jamespallistercool, looks good16:08
jamespallisterperhaps add dummy 0s for .bss ?16:08
jamespallisterzeroing out a larger area of memory could potentially affect energy usage16:09
jamespallisterso we'd want a different hash16:09
@simoncooki was thinking im going to dump its size in there anywhere (code not there yet) so is there a point?16:10
jamespallisterthat should be fine16:10
-!- jeremybennett_ [~jeremy@87.115.177.203] has joined #mageec19:50
-!- mode/#mageec [+o jeremybennett_] by ChanServ19:50
-!- jeremybennett_ [~jeremy@87.115.177.203] has quit [Ping timeout: 264 seconds]20:03
-!- jeremybennett_ [~jeremy@176.33.112.87.dyn.plus.net] has joined #mageec20:05
-!- mode/#mageec [+o jeremybennett_] by ChanServ20:05
-!- jeremybennett_ [~jeremy@176.33.112.87.dyn.plus.net] has quit [Ping timeout: 246 seconds]20:13
--- Log closed Sat Aug 17 00:00:42 2013

Generated by irclog2html.py 2.12.1 by Marius Gedminas - find it at mg.pov.lt!