Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

More Standard Definitions #44

Closed
bannsec opened this issue Feb 1, 2016 · 5 comments
Closed

More Standard Definitions #44

bannsec opened this issue Feb 1, 2016 · 5 comments

Comments

@bannsec
Copy link

bannsec commented Feb 1, 2016

Hey,

Tried using this again today. I think i was playing around with this maybe a year or so ago. bin_descend still seg faults on me. get_cfg works, however cfg_to_bc gives the following error:

Could not find external function: __isoc99_scanf

I checked the standard defs file and it's not in there. That said, I also couldn't find any documentation on how to add to that file when need be. Unfortunately, so far I have not been able to have a single successful lifting to LLVM-IR with this tool.

@dguido
Copy link
Member

dguido commented Feb 1, 2016

The standard advice when mcsema fails with bin_descend is to try using it with IDA. Can you name the specific binary you're trying to recover?

@bannsec
Copy link
Author

bannsec commented Feb 1, 2016

It was the donfos binary in the HackIM contest:

https://github.com/ctfs/write-ups-2016/raw/master/nullcon-hackim-2016/re/donfos-500/donfos_reversing

Any suggestion on how to add the isoc99_scanf into the std defs file?

@pgoodman
Copy link
Collaborator

pgoodman commented Feb 1, 2016

I took a quickly googled for the prototypes of isoc99_scanf: http://www.ic.unicamp.br/~islene/2s2008-mo806/libc/stdio-common/isoc99_scanf.c and scanf: http://www.tutorialspoint.com/c_standard_library/c_function_scanf.htm and they are the same. We've also already got a different named version of the function here: https://github.com/trailofbits/mcsema/blob/master/mc-sema/std_defs/std_defs.txt#L774

My suggestion: copy that line, rename the function, and submit a commit / pull request ;-)

@bannsec
Copy link
Author

bannsec commented Feb 1, 2016

Worked. Thanks!

@dguido
Copy link
Member

dguido commented Feb 1, 2016

Cool! I'll make sure that a ton of new standard definitions are added to the next big feature push.

@dguido dguido closed this as completed Feb 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants