├── data ├── signatures │ ├── objc.hs │ ├── ppc.hs │ ├── win32.hs │ ├── signal.h │ ├── gcc2.9.h │ ├── posix │ │ ├── unctrl.h │ │ ├── ulimit.h │ │ ├── sys │ │ │ ├── utsname.h │ │ │ ├── ipc.h │ │ │ ├── statvfs.h │ │ │ ├── sem.h │ │ │ ├── times.h │ │ │ ├── timeb.h │ │ │ ├── shm.h │ │ │ ├── uio.h │ │ │ ├── wait.h │ │ │ ├── resource.h │ │ │ ├── msg.h │ │ │ ├── time.h │ │ │ ├── stat.h │ │ │ └── mman.h │ │ ├── utime.h │ │ ├── fnmatch.h │ │ ├── langinfo.h │ │ ├── monetary.h │ │ ├── re_comp.h │ │ ├── fcntl.h │ │ ├── fmtmsg.h │ │ ├── dlfcn.h │ │ ├── glob.h │ │ ├── libgen.h │ │ ├── syslog.h │ │ ├── regexp.h │ │ ├── poll.h │ │ ├── nl_types.h │ │ ├── ucontext.h │ │ ├── ftw.h │ │ ├── iconv.h │ │ ├── utmpx.h │ │ ├── arpa │ │ │ └── inet.h │ │ ├── netinet │ │ │ └── in.h │ │ ├── dirent.h │ │ ├── strings.h │ │ ├── semaphore.h │ │ ├── aio.h │ │ ├── grp.h │ │ ├── regex.h │ │ ├── ndbm.h │ │ ├── sched.h │ │ ├── stropts.h │ │ ├── pwd.h │ │ └── termios.h │ ├── glu.h │ ├── x86.hs │ ├── stdlib │ │ ├── locale.h │ │ ├── setjmp.h │ │ ├── stddef.h │ │ ├── signal.h │ │ ├── ctype.h │ │ ├── uchar.h │ │ └── fenv.h │ ├── locale.h │ ├── misc.h │ ├── fcntl.h │ ├── gcc_x86.h │ ├── uname_x86.h │ ├── getopt.h │ ├── gcc3.h │ ├── fortran.h │ ├── libintl.h │ ├── socket.h │ ├── netdb.h │ └── glut.h ├── images │ ├── icon1.png │ ├── load1.png │ ├── proc1.png │ ├── closetab.png │ ├── decode.png │ ├── gencode.png │ ├── ico00001.png │ ├── ico00002.png │ ├── id_lproc.png │ ├── rarrow.png │ ├── resume.png │ ├── resume1.png │ ├── suspend.png │ ├── decompile.png │ └── boomerang_icon.png └── samples │ ├── OSX │ ├── fib │ ├── fibo │ ├── loop │ ├── phi │ ├── phi2 │ ├── semi │ ├── set │ ├── uns │ ├── banner │ ├── branch │ ├── fbranch │ ├── fibo2 │ ├── funcptr │ ├── global1 │ ├── global2 │ ├── global3 │ ├── hello │ ├── ifthen │ ├── minmax │ ├── minmax2 │ ├── o4 │ │ ├── fib │ │ ├── fibo │ │ ├── loop │ │ ├── phi │ │ ├── phi2 │ │ ├── semi │ │ ├── set │ │ ├── uns │ │ ├── banner │ │ ├── branch │ │ ├── fibo2 │ │ ├── hello │ │ ├── ifthen │ │ ├── minmax │ │ ├── switch │ │ ├── fbranch │ │ ├── fibo_iter │ │ ├── fromssa2 │ │ ├── frontier │ │ ├── funcptr │ │ ├── global1 │ │ ├── global2 │ │ ├── global3 │ │ ├── minmax2 │ │ ├── printpi │ │ ├── stattest │ │ ├── sumarray │ │ ├── superstat │ │ ├── twoproc │ │ ├── twoproc2 │ │ ├── daysofxmas │ │ ├── manyparams │ │ ├── paramchain │ │ └── condcodexform │ ├── ohello │ ├── printpi │ ├── switch │ ├── twoproc │ ├── fibo_iter │ ├── fromssa2 │ ├── frontier │ ├── stattest │ ├── sumarray │ ├── superstat │ ├── twoproc2 │ ├── daysofxmas │ ├── manyparams │ ├── paramchain │ └── condcodexform │ ├── ppc │ ├── fib │ ├── fibo │ ├── loop │ ├── phi │ ├── phi2 │ ├── semi │ ├── set │ ├── uns │ ├── banner │ ├── branch │ ├── fbranch │ ├── fibo2 │ ├── funcptr │ ├── global1 │ ├── global2 │ ├── global3 │ ├── hello │ ├── ifthen │ ├── minmax │ ├── minmax2 │ ├── o4 │ │ ├── fib │ │ ├── fibo │ │ ├── loop │ │ ├── phi │ │ ├── phi2 │ │ ├── semi │ │ ├── set │ │ ├── uns │ │ ├── banner │ │ ├── branch │ │ ├── fibo2 │ │ ├── hello │ │ ├── ifthen │ │ ├── minmax │ │ ├── switch │ │ ├── fbranch │ │ ├── fibo_iter │ │ ├── fromssa2 │ │ ├── frontier │ │ ├── funcptr │ │ ├── global1 │ │ ├── global2 │ │ ├── global3 │ │ ├── minmax2 │ │ ├── printpi │ │ ├── stattest │ │ ├── sumarray │ │ ├── superstat │ │ ├── twoproc │ │ ├── twoproc2 │ │ ├── daysofxmas │ │ ├── manyparams │ │ ├── paramchain │ │ └── condcodexform │ ├── printpi │ ├── switch │ ├── twoproc │ ├── fibo_iter │ ├── fromssa2 │ ├── frontier │ ├── stattest │ ├── sumarray │ ├── superstat │ ├── twoproc2 │ ├── daysofxmas │ ├── manyparams │ ├── paramchain │ └── condcodexform │ ├── x86 │ ├── fib │ ├── loop │ ├── phi │ ├── phi2 │ ├── semi │ ├── set │ ├── uns │ ├── banner │ ├── branch │ ├── bswap │ ├── encrypt │ ├── fbranch │ ├── fibo-O4 │ ├── fibo2 │ ├── fibo3 │ ├── fibo4 │ ├── funcptr │ ├── global1 │ ├── global2 │ ├── global3 │ ├── hello │ ├── ifthen │ ├── line1 │ ├── minmax │ ├── minmax2 │ ├── minmax3 │ ├── param1 │ ├── printpi │ ├── shared2 │ ├── short1 │ ├── short2 │ ├── testfp │ ├── testset │ ├── twofib │ ├── twoproc │ ├── asgngoto │ ├── callchain │ ├── chararray │ ├── fbranch2 │ ├── fibo_iter │ ├── fromssa2 │ ├── frontier │ ├── line1-o4 │ ├── recursion │ ├── regalias │ ├── regalias2 │ ├── stattest │ ├── sumarray │ ├── superstat │ ├── suse_true │ ├── switch_cc │ ├── twoproc2 │ ├── twoproc3 │ ├── ass2.Linux │ ├── ass3.Linux │ ├── branch-linux │ ├── chararray-O4 │ ├── daysofxmas │ ├── fbranch_sahf │ ├── fedora2_true │ ├── fedora3_true │ ├── localarray │ ├── manyparams │ ├── nestedswitch │ ├── paramchain │ ├── recursion2 │ ├── rux_encrypt │ ├── sumarray-O4 │ ├── switch_gcc │ ├── testarray1 │ ├── testarray2 │ ├── localarray-O4 │ └── restoredparam │ ├── dos │ ├── MAX.EXE │ ├── DHAMP.EXE │ ├── FIBOL.EXE │ ├── FIBOS.EXE │ ├── BENCHFN.EXE │ ├── BENCHLNG.EXE │ ├── BENCHMUL.EXE │ ├── BENCHMUS.EXE │ ├── BENCHSHO.EXE │ ├── BYTEOPS.EXE │ ├── INTOPS.EXE │ ├── LONGOPS.EXE │ ├── MATRIXMU.EXE │ ├── STRLEN.EXE │ └── TESTLONG.EXE │ ├── elf32-ppc │ ├── fibo │ ├── hello │ ├── minmax │ └── switch │ ├── windows │ ├── hello.exe │ ├── fbranch.exe │ ├── typetest.exe │ ├── switch_gcc.exe │ ├── hello_release.exe │ ├── switch_borland.exe │ └── switch_msvc5.exe │ └── elf │ ├── hello-clang4-static │ └── hello-clang4-dynamic ├── .codecov.yml ├── .gitignore ├── tests ├── sources │ └── x86 │ │ ├── fromssa2.sed │ │ ├── stattest.sed │ │ └── fbranch.sed ├── recompilation-tests │ ├── typetest.zip │ ├── hello.c │ ├── printpi.c │ ├── set.c │ ├── manyparams.c │ ├── loop.c │ ├── twoproc2.c │ ├── bswap.c │ ├── testarray1.c │ ├── regalias.c │ ├── regalias2.c │ ├── fib.c │ ├── twoproc.c │ ├── stattest.c │ ├── sumarray.c │ ├── asgngoto.for │ ├── global1.c │ ├── global2.c │ ├── global3.c │ └── funcptr.c ├── regression-tests │ └── expected-outputs │ │ ├── OSX │ │ ├── o4 │ │ │ ├── loop │ │ │ │ └── loop │ │ │ │ │ └── loop.c │ │ │ ├── hello │ │ │ │ └── hello │ │ │ │ │ └── hello.c │ │ │ ├── printpi │ │ │ │ └── printpi │ │ │ │ │ └── printpi.c │ │ │ ├── paramchain │ │ │ │ └── paramchain │ │ │ │ │ └── paramchain.c │ │ │ ├── twoproc │ │ │ │ └── twoproc │ │ │ │ │ └── twoproc.c │ │ │ ├── twoproc2 │ │ │ │ └── twoproc2 │ │ │ │ │ └── twoproc2.c │ │ │ ├── global1 │ │ │ │ └── global1 │ │ │ │ │ └── global1.c │ │ │ ├── global3 │ │ │ │ └── global3 │ │ │ │ │ └── global3.c │ │ │ ├── set │ │ │ │ └── set │ │ │ │ │ └── set.c │ │ │ ├── global2 │ │ │ │ └── global2 │ │ │ │ │ └── global2.c │ │ │ ├── minmax │ │ │ │ └── minmax │ │ │ │ │ └── minmax.c │ │ │ ├── ifthen │ │ │ │ └── ifthen │ │ │ │ │ └── ifthen.c │ │ │ ├── stattest │ │ │ │ └── stattest │ │ │ │ │ └── stattest.c │ │ │ ├── minmax2 │ │ │ │ └── minmax2 │ │ │ │ │ └── minmax2.c │ │ │ ├── sumarray │ │ │ │ └── sumarray │ │ │ │ │ └── sumarray.c │ │ │ ├── fromssa2 │ │ │ │ └── fromssa2 │ │ │ │ │ └── fromssa2.c │ │ │ ├── manyparams │ │ │ │ └── manyparams │ │ │ │ │ └── manyparams.c │ │ │ └── uns │ │ │ │ └── uns │ │ │ │ └── uns.c │ │ ├── hello │ │ │ └── hello │ │ │ │ └── hello.c │ │ ├── printpi │ │ │ └── printpi │ │ │ │ └── printpi.c │ │ ├── ohello │ │ │ └── ohello │ │ │ │ └── ohello.c │ │ ├── loop │ │ │ └── loop │ │ │ │ └── loop.c │ │ ├── fromssa2 │ │ │ └── fromssa2 │ │ │ │ └── fromssa2.c │ │ ├── ifthen │ │ │ └── ifthen │ │ │ │ └── ifthen.c │ │ ├── minmax │ │ │ └── minmax │ │ │ │ └── minmax.c │ │ ├── set │ │ │ └── set │ │ │ │ └── set.c │ │ ├── stattest │ │ │ └── stattest │ │ │ │ └── stattest.c │ │ ├── sumarray │ │ │ └── sumarray │ │ │ │ └── sumarray.c │ │ ├── twoproc │ │ │ └── twoproc │ │ │ │ └── twoproc.c │ │ ├── twoproc2 │ │ │ └── twoproc2 │ │ │ │ └── twoproc2.c │ │ ├── global1 │ │ │ └── global1 │ │ │ │ └── global1.c │ │ ├── global3 │ │ │ └── global3 │ │ │ │ └── global3.c │ │ ├── global2 │ │ │ └── global2 │ │ │ │ └── global2.c │ │ ├── manyparams │ │ │ └── manyparams │ │ │ │ └── manyparams.c │ │ ├── minmax2 │ │ │ └── minmax2 │ │ │ │ └── minmax2.c │ │ └── uns │ │ │ └── uns │ │ │ └── uns.c │ │ ├── ppc │ │ ├── o4 │ │ │ ├── loop │ │ │ │ └── loop │ │ │ │ │ └── loop.c │ │ │ ├── hello │ │ │ │ └── hello │ │ │ │ │ └── hello.c │ │ │ ├── paramchain │ │ │ │ └── paramchain │ │ │ │ │ └── paramchain.c │ │ │ ├── printpi │ │ │ │ └── printpi │ │ │ │ │ └── printpi.c │ │ │ ├── twoproc │ │ │ │ └── twoproc │ │ │ │ │ └── twoproc.c │ │ │ ├── global3 │ │ │ │ └── global3 │ │ │ │ │ └── global3.c │ │ │ ├── twoproc2 │ │ │ │ └── twoproc2 │ │ │ │ │ └── twoproc2.c │ │ │ ├── global2 │ │ │ │ └── global2 │ │ │ │ │ └── global2.c │ │ │ ├── global1 │ │ │ │ └── global1 │ │ │ │ │ └── global1.c │ │ │ ├── stattest │ │ │ │ └── stattest │ │ │ │ │ └── stattest.c │ │ │ ├── set │ │ │ │ └── set │ │ │ │ │ └── set.c │ │ │ ├── minmax │ │ │ │ └── minmax │ │ │ │ │ └── minmax.c │ │ │ ├── ifthen │ │ │ │ └── ifthen │ │ │ │ │ └── ifthen.c │ │ │ ├── manyparams │ │ │ │ └── manyparams │ │ │ │ │ └── manyparams.c │ │ │ ├── funcptr │ │ │ │ └── funcptr │ │ │ │ │ └── funcptr.c │ │ │ ├── minmax2 │ │ │ │ └── minmax2 │ │ │ │ │ └── minmax2.c │ │ │ ├── fromssa2 │ │ │ │ └── fromssa2 │ │ │ │ │ └── fromssa2.c │ │ │ └── phi2 │ │ │ │ └── phi2 │ │ │ │ └── phi2.c │ │ ├── hello │ │ │ └── hello │ │ │ │ └── hello.c │ │ ├── printpi │ │ │ └── printpi │ │ │ │ └── printpi.c │ │ ├── loop │ │ │ └── loop │ │ │ │ └── loop.c │ │ ├── fromssa2 │ │ │ └── fromssa2 │ │ │ │ └── fromssa2.c │ │ ├── manyparams │ │ │ └── manyparams │ │ │ │ └── manyparams.c │ │ ├── ifthen │ │ │ └── ifthen │ │ │ │ └── ifthen.c │ │ ├── minmax │ │ │ └── minmax │ │ │ │ └── minmax.c │ │ ├── set │ │ │ └── set │ │ │ │ └── set.c │ │ ├── twoproc │ │ │ └── twoproc │ │ │ │ └── twoproc.c │ │ ├── sumarray │ │ │ └── sumarray │ │ │ │ └── sumarray.c │ │ ├── twoproc2 │ │ │ └── twoproc2 │ │ │ │ └── twoproc2.c │ │ ├── global1 │ │ │ └── global1 │ │ │ │ └── global1.c │ │ ├── minmax2 │ │ │ └── minmax2 │ │ │ │ └── minmax2.c │ │ ├── uns │ │ │ └── uns │ │ │ │ └── uns.c │ │ ├── global3 │ │ │ └── global3 │ │ │ │ └── global3.c │ │ └── global2 │ │ │ └── global2 │ │ │ └── global2.c │ │ ├── elf32-ppc │ │ └── hello │ │ │ └── hello │ │ │ └── hello.c │ │ ├── x86 │ │ ├── hello │ │ │ └── hello │ │ │ │ └── hello.c │ │ ├── printpi │ │ │ └── printpi │ │ │ │ └── printpi.c │ │ ├── regalias │ │ │ └── regalias │ │ │ │ └── regalias.c │ │ ├── regalias2 │ │ │ └── regalias2 │ │ │ │ └── regalias2.c │ │ ├── set │ │ │ └── set │ │ │ │ └── set.c │ │ ├── loop │ │ │ └── loop │ │ │ │ └── loop.c │ │ ├── manyparams │ │ │ └── manyparams │ │ │ │ └── manyparams.c │ │ ├── localarray │ │ │ └── localarray │ │ │ │ └── localarray.c │ │ ├── stattest │ │ │ └── stattest │ │ │ │ └── stattest.c │ │ ├── ifthen │ │ │ └── ifthen │ │ │ │ └── ifthen.c │ │ ├── minmax │ │ │ └── minmax │ │ │ │ └── minmax.c │ │ ├── restoredparam │ │ │ └── restoredparam │ │ │ │ └── restoredparam.c │ │ ├── testset │ │ │ └── testset │ │ │ │ └── testset.c │ │ ├── twoproc │ │ │ └── twoproc │ │ │ │ └── twoproc.c │ │ ├── sumarray │ │ │ └── sumarray │ │ │ │ └── sumarray.c │ │ ├── chararray │ │ │ └── chararray │ │ │ │ └── chararray.c │ │ ├── testarray1 │ │ │ └── testarray1 │ │ │ │ └── testarray1.c │ │ ├── global1 │ │ │ └── global1 │ │ │ │ └── global1.c │ │ ├── bswap │ │ │ └── bswap │ │ │ │ └── bswap.c │ │ ├── global2 │ │ │ └── global2 │ │ │ │ └── global2.c │ │ ├── global3 │ │ │ └── global3 │ │ │ │ └── global3.c │ │ ├── chararray-O4 │ │ │ └── chararray-O4 │ │ │ │ └── chararray-O4.c │ │ ├── fromssa2 │ │ │ └── fromssa2 │ │ │ │ └── fromssa2.c │ │ ├── localarray-O4 │ │ │ └── localarray-O4 │ │ │ │ └── localarray-O4.c │ │ ├── twoproc2 │ │ │ └── twoproc2 │ │ │ │ └── twoproc2.c │ │ ├── uns │ │ │ └── uns │ │ │ │ └── uns.c │ │ └── twoproc3 │ │ │ └── twoproc3 │ │ │ └── twoproc3.c │ │ ├── elf │ │ └── hello-clang4-dynamic │ │ │ └── hello-clang4-dynamic │ │ │ └── hello-clang4-dynamic.c │ │ └── windows │ │ └── typetest.exe │ │ └── typetest │ │ └── typetest.c └── unit-tests │ ├── boomerang-plugins │ ├── CMakeLists.txt │ ├── loader │ │ ├── MicroX86DisTest.h │ │ └── pe │ │ │ └── Win32BinaryLoaderTest.h │ ├── decoder │ │ ├── CMakeLists.txt │ │ └── ppc │ │ │ └── CapstonePPCDecoderTest.h │ └── frontend │ │ ├── X86FrontEndTest.h │ │ └── CMakeLists.txt │ ├── boomerang │ ├── CMakeLists.txt │ ├── ssl │ │ ├── parser │ │ │ └── ParserTest.h │ │ ├── type │ │ │ ├── TypeTest.h │ │ │ ├── CharTypeTest.h │ │ │ ├── FloatTypeTest.h │ │ │ ├── BooleanTypeTest.h │ │ │ ├── MeetTest.h │ │ │ ├── NamedTypeTest.h │ │ │ └── FuncTypeTest.h │ │ └── statements │ │ │ ├── StatementHelperTest.h │ │ │ └── PhiAssignTest.h │ ├── core │ │ └── CMakeLists.txt │ ├── visitor │ │ └── expmodifier │ │ │ ├── ExpSimplifierTest.h │ │ │ ├── ExpAddrSimplifierTest.h │ │ │ └── ExpArithSimplifierTest.h │ ├── db │ │ ├── GlobalTest.h │ │ └── binary │ │ │ └── BinarySectionTest.h │ ├── type │ │ ├── CMakeLists.txt │ │ └── DataIntervalMapTest.h │ └── util │ │ ├── IntervalSetTest.h │ │ ├── ConnectionGraphTest.h │ │ └── IntervalMapTest.h │ └── boomerang-cli │ └── CommandLineDriverTest.h ├── docs ├── ssl.pdf └── mainpage.dox ├── scripts ├── check-commit.sh ├── apply-clang-format.sh └── clang-tidy.sh ├── AUTHORS ├── src ├── boomerang │ ├── ssl │ │ ├── parser │ │ │ ├── .gitignore │ │ │ └── Table.cpp │ │ ├── statements │ │ │ └── StatementHelper.h │ │ └── exp │ │ │ └── ExpHelp.cpp │ ├── util │ │ ├── ExpSet.cpp │ │ ├── MapIterators.cpp │ │ ├── StatementSet.cpp │ │ ├── DFGWriter.h │ │ ├── ProgSymbolWriter.h │ │ ├── UseGraphWriter.h │ │ ├── CallGraphDotWriter.h │ │ └── log │ │ │ └── ConsoleLogSink.cpp │ ├── db │ │ ├── GraphNode.cpp │ │ ├── module │ │ │ ├── Class.cpp │ │ │ └── ModuleFactory.cpp │ │ └── DebugInfo.h │ ├── core │ │ ├── BoomerangAPI.cpp │ │ └── CMakeLists.txt │ ├── type │ │ └── CMakeLists.txt │ ├── passes │ │ ├── Pass.cpp │ │ ├── dataflow │ │ │ ├── PhiPlacementPass.h │ │ │ ├── DominatorPass.cpp │ │ │ ├── DominatorPass.h │ │ │ └── PhiPlacementPass.cpp │ │ ├── middle │ │ │ ├── ParameterSymbolMapPass.h │ │ │ ├── PreservationAnalysisPass.h │ │ │ ├── StrengthReductionReversalPass.h │ │ │ ├── CallAndPhiFixPass.h │ │ │ ├── DuplicateArgsRemovalPass.h │ │ │ └── SPPreservationPass.h │ │ ├── early │ │ │ └── StatementInitPass.h │ │ ├── late │ │ │ ├── LocalTypeAnalysisPass.h │ │ │ ├── LocalAndParamMapPass.h │ │ │ └── CallLivenessRemovalPass.h │ │ └── call │ │ │ └── CallArgumentUpdatePass.h │ ├── visitor │ │ └── stmtexpvisitor │ │ │ ├── StmtConstFinder.cpp │ │ │ └── StmtConstFinder.h │ ├── frontend │ │ └── CMakeLists.txt │ └── decomp │ │ └── CMakeLists.txt ├── boomerang-plugins │ ├── symbol │ │ ├── c │ │ │ └── parser │ │ │ │ └── .gitignore │ │ └── CMakeLists.txt │ ├── codegen │ │ └── CMakeLists.txt │ └── type │ │ └── CMakeLists.txt └── boomerang-gui │ └── Main.cpp ├── cmake-scripts └── boomerang-dependencies.cmake └── .github └── ISSUE_TEMPLATE.md /data/signatures/objc.hs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | comment: off 2 | -------------------------------------------------------------------------------- /data/signatures/ppc.hs: -------------------------------------------------------------------------------- 1 | stat_ppc.h 2 | -------------------------------------------------------------------------------- /data/signatures/win32.hs: -------------------------------------------------------------------------------- 1 | windows.h 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *.kdev4 3 | *.i64 4 | -------------------------------------------------------------------------------- /data/signatures/signal.h: -------------------------------------------------------------------------------- 1 | int kill(pid_t pid, int sig); 2 | -------------------------------------------------------------------------------- /tests/sources/x86/fromssa2.sed: -------------------------------------------------------------------------------- 1 | /%pc +=/d 2 | /%pc =/d 3 | -------------------------------------------------------------------------------- /data/signatures/gcc2.9.h: -------------------------------------------------------------------------------- 1 | void *__builtin_new(int bytes); 2 | -------------------------------------------------------------------------------- /data/signatures/posix/unctrl.h: -------------------------------------------------------------------------------- 1 | 2 | char *unctrl(chtype c); 3 | -------------------------------------------------------------------------------- /data/signatures/glu.h: -------------------------------------------------------------------------------- 1 | char *gluErrorString(GLenum errorCode); 2 | -------------------------------------------------------------------------------- /data/signatures/posix/ulimit.h: -------------------------------------------------------------------------------- 1 | 2 | long ulimit(int cmd, ...); 3 | -------------------------------------------------------------------------------- /data/signatures/x86.hs: -------------------------------------------------------------------------------- 1 | gcc_x86.h 2 | stat_x86.h 3 | uname_x86.h 4 | -------------------------------------------------------------------------------- /data/signatures/stdlib/locale.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct _lconv lconv; 3 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/utsname.h: -------------------------------------------------------------------------------- 1 | 2 | int uname(struct utsname *name); 3 | -------------------------------------------------------------------------------- /data/signatures/locale.h: -------------------------------------------------------------------------------- 1 | char *setlocale(int category, const char *locale); 2 | -------------------------------------------------------------------------------- /docs/ssl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/docs/ssl.pdf -------------------------------------------------------------------------------- /data/signatures/posix/utime.h: -------------------------------------------------------------------------------- 1 | 2 | int utime(const char *path, const struct utimbuf *times); 3 | -------------------------------------------------------------------------------- /scripts/check-commit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd build 5 | cmake .. 6 | make -j$(nproc) 7 | -------------------------------------------------------------------------------- /data/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/icon1.png -------------------------------------------------------------------------------- /data/images/load1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/load1.png -------------------------------------------------------------------------------- /data/images/proc1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/proc1.png -------------------------------------------------------------------------------- /data/samples/OSX/fib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/fib -------------------------------------------------------------------------------- /data/samples/OSX/fibo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/fibo -------------------------------------------------------------------------------- /data/samples/OSX/loop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/loop -------------------------------------------------------------------------------- /data/samples/OSX/phi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/phi -------------------------------------------------------------------------------- /data/samples/OSX/phi2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/phi2 -------------------------------------------------------------------------------- /data/samples/OSX/semi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/semi -------------------------------------------------------------------------------- /data/samples/OSX/set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/set -------------------------------------------------------------------------------- /data/samples/OSX/uns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/uns -------------------------------------------------------------------------------- /data/samples/ppc/fib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/fib -------------------------------------------------------------------------------- /data/samples/ppc/fibo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/fibo -------------------------------------------------------------------------------- /data/samples/ppc/loop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/loop -------------------------------------------------------------------------------- /data/samples/ppc/phi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/phi -------------------------------------------------------------------------------- /data/samples/ppc/phi2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/phi2 -------------------------------------------------------------------------------- /data/samples/ppc/semi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/semi -------------------------------------------------------------------------------- /data/samples/ppc/set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/set -------------------------------------------------------------------------------- /data/samples/ppc/uns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/uns -------------------------------------------------------------------------------- /data/samples/x86/fib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fib -------------------------------------------------------------------------------- /data/samples/x86/loop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/loop -------------------------------------------------------------------------------- /data/samples/x86/phi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/phi -------------------------------------------------------------------------------- /data/samples/x86/phi2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/phi2 -------------------------------------------------------------------------------- /data/samples/x86/semi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/semi -------------------------------------------------------------------------------- /data/samples/x86/set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/set -------------------------------------------------------------------------------- /data/samples/x86/uns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/uns -------------------------------------------------------------------------------- /data/signatures/misc.h: -------------------------------------------------------------------------------- 1 | 2 | typedef int main(int argc, char *argv[]); 3 | void __stack_chk_fail(void); 4 | -------------------------------------------------------------------------------- /data/signatures/posix/fnmatch.h: -------------------------------------------------------------------------------- 1 | 2 | int fnmatch(const char *pattern, const char *string, int flags); 3 | -------------------------------------------------------------------------------- /data/signatures/posix/langinfo.h: -------------------------------------------------------------------------------- 1 | 2 | typedef int nl_item; 3 | 4 | char *nl_langinfo(nl_item item); 5 | -------------------------------------------------------------------------------- /data/signatures/posix/monetary.h: -------------------------------------------------------------------------------- 1 | 2 | ssize_t strfmon(char *s, size_t maxsize, const char *format, ...); 3 | -------------------------------------------------------------------------------- /tests/sources/x86/stattest.sed: -------------------------------------------------------------------------------- 1 | 1{ 2 | i\ 3 | #include \ 4 | #include 5 | } 6 | -------------------------------------------------------------------------------- /data/images/closetab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/closetab.png -------------------------------------------------------------------------------- /data/images/decode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/decode.png -------------------------------------------------------------------------------- /data/images/gencode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/gencode.png -------------------------------------------------------------------------------- /data/images/ico00001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/ico00001.png -------------------------------------------------------------------------------- /data/images/ico00002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/ico00002.png -------------------------------------------------------------------------------- /data/images/id_lproc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/id_lproc.png -------------------------------------------------------------------------------- /data/images/rarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/rarrow.png -------------------------------------------------------------------------------- /data/images/resume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/resume.png -------------------------------------------------------------------------------- /data/images/resume1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/resume1.png -------------------------------------------------------------------------------- /data/images/suspend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/suspend.png -------------------------------------------------------------------------------- /data/samples/OSX/banner: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/banner -------------------------------------------------------------------------------- /data/samples/OSX/branch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/branch -------------------------------------------------------------------------------- /data/samples/OSX/fbranch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/fbranch -------------------------------------------------------------------------------- /data/samples/OSX/fibo2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/fibo2 -------------------------------------------------------------------------------- /data/samples/OSX/funcptr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/funcptr -------------------------------------------------------------------------------- /data/samples/OSX/global1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/global1 -------------------------------------------------------------------------------- /data/samples/OSX/global2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/global2 -------------------------------------------------------------------------------- /data/samples/OSX/global3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/global3 -------------------------------------------------------------------------------- /data/samples/OSX/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/hello -------------------------------------------------------------------------------- /data/samples/OSX/ifthen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/ifthen -------------------------------------------------------------------------------- /data/samples/OSX/minmax: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/minmax -------------------------------------------------------------------------------- /data/samples/OSX/minmax2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/minmax2 -------------------------------------------------------------------------------- /data/samples/OSX/o4/fib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/fib -------------------------------------------------------------------------------- /data/samples/OSX/o4/fibo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/fibo -------------------------------------------------------------------------------- /data/samples/OSX/o4/loop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/loop -------------------------------------------------------------------------------- /data/samples/OSX/o4/phi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/phi -------------------------------------------------------------------------------- /data/samples/OSX/o4/phi2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/phi2 -------------------------------------------------------------------------------- /data/samples/OSX/o4/semi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/semi -------------------------------------------------------------------------------- /data/samples/OSX/o4/set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/set -------------------------------------------------------------------------------- /data/samples/OSX/o4/uns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/uns -------------------------------------------------------------------------------- /data/samples/OSX/ohello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/ohello -------------------------------------------------------------------------------- /data/samples/OSX/printpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/printpi -------------------------------------------------------------------------------- /data/samples/OSX/switch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/switch -------------------------------------------------------------------------------- /data/samples/OSX/twoproc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/twoproc -------------------------------------------------------------------------------- /data/samples/dos/MAX.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/MAX.EXE -------------------------------------------------------------------------------- /data/samples/ppc/banner: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/banner -------------------------------------------------------------------------------- /data/samples/ppc/branch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/branch -------------------------------------------------------------------------------- /data/samples/ppc/fbranch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/fbranch -------------------------------------------------------------------------------- /data/samples/ppc/fibo2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/fibo2 -------------------------------------------------------------------------------- /data/samples/ppc/funcptr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/funcptr -------------------------------------------------------------------------------- /data/samples/ppc/global1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/global1 -------------------------------------------------------------------------------- /data/samples/ppc/global2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/global2 -------------------------------------------------------------------------------- /data/samples/ppc/global3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/global3 -------------------------------------------------------------------------------- /data/samples/ppc/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/hello -------------------------------------------------------------------------------- /data/samples/ppc/ifthen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/ifthen -------------------------------------------------------------------------------- /data/samples/ppc/minmax: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/minmax -------------------------------------------------------------------------------- /data/samples/ppc/minmax2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/minmax2 -------------------------------------------------------------------------------- /data/samples/ppc/o4/fib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/fib -------------------------------------------------------------------------------- /data/samples/ppc/o4/fibo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/fibo -------------------------------------------------------------------------------- /data/samples/ppc/o4/loop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/loop -------------------------------------------------------------------------------- /data/samples/ppc/o4/phi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/phi -------------------------------------------------------------------------------- /data/samples/ppc/o4/phi2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/phi2 -------------------------------------------------------------------------------- /data/samples/ppc/o4/semi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/semi -------------------------------------------------------------------------------- /data/samples/ppc/o4/set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/set -------------------------------------------------------------------------------- /data/samples/ppc/o4/uns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/uns -------------------------------------------------------------------------------- /data/samples/ppc/printpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/printpi -------------------------------------------------------------------------------- /data/samples/ppc/switch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/switch -------------------------------------------------------------------------------- /data/samples/ppc/twoproc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/twoproc -------------------------------------------------------------------------------- /data/samples/x86/banner: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/banner -------------------------------------------------------------------------------- /data/samples/x86/branch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/branch -------------------------------------------------------------------------------- /data/samples/x86/bswap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/bswap -------------------------------------------------------------------------------- /data/samples/x86/encrypt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/encrypt -------------------------------------------------------------------------------- /data/samples/x86/fbranch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fbranch -------------------------------------------------------------------------------- /data/samples/x86/fibo-O4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fibo-O4 -------------------------------------------------------------------------------- /data/samples/x86/fibo2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fibo2 -------------------------------------------------------------------------------- /data/samples/x86/fibo3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fibo3 -------------------------------------------------------------------------------- /data/samples/x86/fibo4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fibo4 -------------------------------------------------------------------------------- /data/samples/x86/funcptr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/funcptr -------------------------------------------------------------------------------- /data/samples/x86/global1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/global1 -------------------------------------------------------------------------------- /data/samples/x86/global2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/global2 -------------------------------------------------------------------------------- /data/samples/x86/global3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/global3 -------------------------------------------------------------------------------- /data/samples/x86/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/hello -------------------------------------------------------------------------------- /data/samples/x86/ifthen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/ifthen -------------------------------------------------------------------------------- /data/samples/x86/line1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/line1 -------------------------------------------------------------------------------- /data/samples/x86/minmax: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/minmax -------------------------------------------------------------------------------- /data/samples/x86/minmax2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/minmax2 -------------------------------------------------------------------------------- /data/samples/x86/minmax3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/minmax3 -------------------------------------------------------------------------------- /data/samples/x86/param1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/param1 -------------------------------------------------------------------------------- /data/samples/x86/printpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/printpi -------------------------------------------------------------------------------- /data/samples/x86/shared2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/shared2 -------------------------------------------------------------------------------- /data/samples/x86/short1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/short1 -------------------------------------------------------------------------------- /data/samples/x86/short2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/short2 -------------------------------------------------------------------------------- /data/samples/x86/testfp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/testfp -------------------------------------------------------------------------------- /data/samples/x86/testset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/testset -------------------------------------------------------------------------------- /data/samples/x86/twofib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/twofib -------------------------------------------------------------------------------- /data/samples/x86/twoproc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/twoproc -------------------------------------------------------------------------------- /data/images/decompile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/decompile.png -------------------------------------------------------------------------------- /data/samples/OSX/fibo_iter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/fibo_iter -------------------------------------------------------------------------------- /data/samples/OSX/fromssa2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/fromssa2 -------------------------------------------------------------------------------- /data/samples/OSX/frontier: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/frontier -------------------------------------------------------------------------------- /data/samples/OSX/o4/banner: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/banner -------------------------------------------------------------------------------- /data/samples/OSX/o4/branch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/branch -------------------------------------------------------------------------------- /data/samples/OSX/o4/fibo2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/fibo2 -------------------------------------------------------------------------------- /data/samples/OSX/o4/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/hello -------------------------------------------------------------------------------- /data/samples/OSX/o4/ifthen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/ifthen -------------------------------------------------------------------------------- /data/samples/OSX/o4/minmax: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/minmax -------------------------------------------------------------------------------- /data/samples/OSX/o4/switch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/switch -------------------------------------------------------------------------------- /data/samples/OSX/stattest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/stattest -------------------------------------------------------------------------------- /data/samples/OSX/sumarray: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/sumarray -------------------------------------------------------------------------------- /data/samples/OSX/superstat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/superstat -------------------------------------------------------------------------------- /data/samples/OSX/twoproc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/twoproc2 -------------------------------------------------------------------------------- /data/samples/dos/DHAMP.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/DHAMP.EXE -------------------------------------------------------------------------------- /data/samples/dos/FIBOL.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/FIBOL.EXE -------------------------------------------------------------------------------- /data/samples/dos/FIBOS.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/FIBOS.EXE -------------------------------------------------------------------------------- /data/samples/ppc/fibo_iter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/fibo_iter -------------------------------------------------------------------------------- /data/samples/ppc/fromssa2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/fromssa2 -------------------------------------------------------------------------------- /data/samples/ppc/frontier: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/frontier -------------------------------------------------------------------------------- /data/samples/ppc/o4/banner: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/banner -------------------------------------------------------------------------------- /data/samples/ppc/o4/branch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/branch -------------------------------------------------------------------------------- /data/samples/ppc/o4/fibo2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/fibo2 -------------------------------------------------------------------------------- /data/samples/ppc/o4/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/hello -------------------------------------------------------------------------------- /data/samples/ppc/o4/ifthen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/ifthen -------------------------------------------------------------------------------- /data/samples/ppc/o4/minmax: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/minmax -------------------------------------------------------------------------------- /data/samples/ppc/o4/switch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/switch -------------------------------------------------------------------------------- /data/samples/ppc/stattest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/stattest -------------------------------------------------------------------------------- /data/samples/ppc/sumarray: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/sumarray -------------------------------------------------------------------------------- /data/samples/ppc/superstat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/superstat -------------------------------------------------------------------------------- /data/samples/ppc/twoproc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/twoproc2 -------------------------------------------------------------------------------- /data/samples/x86/asgngoto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/asgngoto -------------------------------------------------------------------------------- /data/samples/x86/callchain: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/callchain -------------------------------------------------------------------------------- /data/samples/x86/chararray: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/chararray -------------------------------------------------------------------------------- /data/samples/x86/fbranch2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fbranch2 -------------------------------------------------------------------------------- /data/samples/x86/fibo_iter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fibo_iter -------------------------------------------------------------------------------- /data/samples/x86/fromssa2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fromssa2 -------------------------------------------------------------------------------- /data/samples/x86/frontier: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/frontier -------------------------------------------------------------------------------- /data/samples/x86/line1-o4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/line1-o4 -------------------------------------------------------------------------------- /data/samples/x86/recursion: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/recursion -------------------------------------------------------------------------------- /data/samples/x86/regalias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/regalias -------------------------------------------------------------------------------- /data/samples/x86/regalias2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/regalias2 -------------------------------------------------------------------------------- /data/samples/x86/stattest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/stattest -------------------------------------------------------------------------------- /data/samples/x86/sumarray: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/sumarray -------------------------------------------------------------------------------- /data/samples/x86/superstat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/superstat -------------------------------------------------------------------------------- /data/samples/x86/suse_true: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/suse_true -------------------------------------------------------------------------------- /data/samples/x86/switch_cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/switch_cc -------------------------------------------------------------------------------- /data/samples/x86/twoproc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/twoproc2 -------------------------------------------------------------------------------- /data/samples/x86/twoproc3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/twoproc3 -------------------------------------------------------------------------------- /data/signatures/posix/re_comp.h: -------------------------------------------------------------------------------- 1 | 2 | char *re_comp(const char *string); 3 | int re_exec(const char *string); 4 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/ipc.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct _key_t key_t; 3 | 4 | key_t ftok(const char *path, int id); 5 | -------------------------------------------------------------------------------- /data/samples/OSX/daysofxmas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/daysofxmas -------------------------------------------------------------------------------- /data/samples/OSX/manyparams: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/manyparams -------------------------------------------------------------------------------- /data/samples/OSX/o4/fbranch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/fbranch -------------------------------------------------------------------------------- /data/samples/OSX/o4/fibo_iter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/fibo_iter -------------------------------------------------------------------------------- /data/samples/OSX/o4/fromssa2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/fromssa2 -------------------------------------------------------------------------------- /data/samples/OSX/o4/frontier: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/frontier -------------------------------------------------------------------------------- /data/samples/OSX/o4/funcptr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/funcptr -------------------------------------------------------------------------------- /data/samples/OSX/o4/global1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/global1 -------------------------------------------------------------------------------- /data/samples/OSX/o4/global2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/global2 -------------------------------------------------------------------------------- /data/samples/OSX/o4/global3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/global3 -------------------------------------------------------------------------------- /data/samples/OSX/o4/minmax2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/minmax2 -------------------------------------------------------------------------------- /data/samples/OSX/o4/printpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/printpi -------------------------------------------------------------------------------- /data/samples/OSX/o4/stattest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/stattest -------------------------------------------------------------------------------- /data/samples/OSX/o4/sumarray: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/sumarray -------------------------------------------------------------------------------- /data/samples/OSX/o4/superstat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/superstat -------------------------------------------------------------------------------- /data/samples/OSX/o4/twoproc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/twoproc -------------------------------------------------------------------------------- /data/samples/OSX/o4/twoproc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/twoproc2 -------------------------------------------------------------------------------- /data/samples/OSX/paramchain: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/paramchain -------------------------------------------------------------------------------- /data/samples/dos/BENCHFN.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/BENCHFN.EXE -------------------------------------------------------------------------------- /data/samples/dos/BENCHLNG.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/BENCHLNG.EXE -------------------------------------------------------------------------------- /data/samples/dos/BENCHMUL.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/BENCHMUL.EXE -------------------------------------------------------------------------------- /data/samples/dos/BENCHMUS.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/BENCHMUS.EXE -------------------------------------------------------------------------------- /data/samples/dos/BENCHSHO.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/BENCHSHO.EXE -------------------------------------------------------------------------------- /data/samples/dos/BYTEOPS.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/BYTEOPS.EXE -------------------------------------------------------------------------------- /data/samples/dos/INTOPS.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/INTOPS.EXE -------------------------------------------------------------------------------- /data/samples/dos/LONGOPS.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/LONGOPS.EXE -------------------------------------------------------------------------------- /data/samples/dos/MATRIXMU.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/MATRIXMU.EXE -------------------------------------------------------------------------------- /data/samples/dos/STRLEN.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/STRLEN.EXE -------------------------------------------------------------------------------- /data/samples/dos/TESTLONG.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/dos/TESTLONG.EXE -------------------------------------------------------------------------------- /data/samples/elf32-ppc/fibo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/elf32-ppc/fibo -------------------------------------------------------------------------------- /data/samples/elf32-ppc/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/elf32-ppc/hello -------------------------------------------------------------------------------- /data/samples/elf32-ppc/minmax: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/elf32-ppc/minmax -------------------------------------------------------------------------------- /data/samples/elf32-ppc/switch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/elf32-ppc/switch -------------------------------------------------------------------------------- /data/samples/ppc/daysofxmas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/daysofxmas -------------------------------------------------------------------------------- /data/samples/ppc/manyparams: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/manyparams -------------------------------------------------------------------------------- /data/samples/ppc/o4/fbranch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/fbranch -------------------------------------------------------------------------------- /data/samples/ppc/o4/fibo_iter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/fibo_iter -------------------------------------------------------------------------------- /data/samples/ppc/o4/fromssa2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/fromssa2 -------------------------------------------------------------------------------- /data/samples/ppc/o4/frontier: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/frontier -------------------------------------------------------------------------------- /data/samples/ppc/o4/funcptr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/funcptr -------------------------------------------------------------------------------- /data/samples/ppc/o4/global1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/global1 -------------------------------------------------------------------------------- /data/samples/ppc/o4/global2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/global2 -------------------------------------------------------------------------------- /data/samples/ppc/o4/global3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/global3 -------------------------------------------------------------------------------- /data/samples/ppc/o4/minmax2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/minmax2 -------------------------------------------------------------------------------- /data/samples/ppc/o4/printpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/printpi -------------------------------------------------------------------------------- /data/samples/ppc/o4/stattest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/stattest -------------------------------------------------------------------------------- /data/samples/ppc/o4/sumarray: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/sumarray -------------------------------------------------------------------------------- /data/samples/ppc/o4/superstat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/superstat -------------------------------------------------------------------------------- /data/samples/ppc/o4/twoproc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/twoproc -------------------------------------------------------------------------------- /data/samples/ppc/o4/twoproc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/twoproc2 -------------------------------------------------------------------------------- /data/samples/ppc/paramchain: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/paramchain -------------------------------------------------------------------------------- /data/samples/x86/ass2.Linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/ass2.Linux -------------------------------------------------------------------------------- /data/samples/x86/ass3.Linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/ass3.Linux -------------------------------------------------------------------------------- /data/samples/x86/branch-linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/branch-linux -------------------------------------------------------------------------------- /data/samples/x86/chararray-O4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/chararray-O4 -------------------------------------------------------------------------------- /data/samples/x86/daysofxmas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/daysofxmas -------------------------------------------------------------------------------- /data/samples/x86/fbranch_sahf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fbranch_sahf -------------------------------------------------------------------------------- /data/samples/x86/fedora2_true: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fedora2_true -------------------------------------------------------------------------------- /data/samples/x86/fedora3_true: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/fedora3_true -------------------------------------------------------------------------------- /data/samples/x86/localarray: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/localarray -------------------------------------------------------------------------------- /data/samples/x86/manyparams: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/manyparams -------------------------------------------------------------------------------- /data/samples/x86/nestedswitch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/nestedswitch -------------------------------------------------------------------------------- /data/samples/x86/paramchain: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/paramchain -------------------------------------------------------------------------------- /data/samples/x86/recursion2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/recursion2 -------------------------------------------------------------------------------- /data/samples/x86/rux_encrypt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/rux_encrypt -------------------------------------------------------------------------------- /data/samples/x86/sumarray-O4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/sumarray-O4 -------------------------------------------------------------------------------- /data/samples/x86/switch_gcc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/switch_gcc -------------------------------------------------------------------------------- /data/samples/x86/testarray1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/testarray1 -------------------------------------------------------------------------------- /data/samples/x86/testarray2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/testarray2 -------------------------------------------------------------------------------- /data/images/boomerang_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/images/boomerang_icon.png -------------------------------------------------------------------------------- /data/samples/OSX/condcodexform: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/condcodexform -------------------------------------------------------------------------------- /data/samples/OSX/o4/daysofxmas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/daysofxmas -------------------------------------------------------------------------------- /data/samples/OSX/o4/manyparams: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/manyparams -------------------------------------------------------------------------------- /data/samples/OSX/o4/paramchain: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/paramchain -------------------------------------------------------------------------------- /data/samples/ppc/condcodexform: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/condcodexform -------------------------------------------------------------------------------- /data/samples/ppc/o4/daysofxmas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/daysofxmas -------------------------------------------------------------------------------- /data/samples/ppc/o4/manyparams: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/manyparams -------------------------------------------------------------------------------- /data/samples/ppc/o4/paramchain: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/paramchain -------------------------------------------------------------------------------- /data/samples/windows/hello.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/windows/hello.exe -------------------------------------------------------------------------------- /data/samples/x86/localarray-O4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/localarray-O4 -------------------------------------------------------------------------------- /data/samples/x86/restoredparam: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/x86/restoredparam -------------------------------------------------------------------------------- /data/signatures/fcntl.h: -------------------------------------------------------------------------------- 1 | int open(const char *path, int flags, ...); 2 | int creat(const char *pathname, unsigned int mode); 3 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Grerald Krol 2 | Trent Waddington 3 | Mike Van Emmerik 4 | Anderson Lizardo 5 | Markus Gothe 6 | -------------------------------------------------------------------------------- /data/samples/OSX/o4/condcodexform: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/OSX/o4/condcodexform -------------------------------------------------------------------------------- /data/samples/ppc/o4/condcodexform: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/ppc/o4/condcodexform -------------------------------------------------------------------------------- /data/samples/windows/fbranch.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/windows/fbranch.exe -------------------------------------------------------------------------------- /data/samples/windows/typetest.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/windows/typetest.exe -------------------------------------------------------------------------------- /tests/sources/x86/fbranch.sed: -------------------------------------------------------------------------------- 1 | s/double local0/float local0/ 2 | s/a is %f, b is %f\\n.*/a is %f, b is %f\\n\", 5.0, local0);/ 3 | -------------------------------------------------------------------------------- /data/samples/elf/hello-clang4-static: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/elf/hello-clang4-static -------------------------------------------------------------------------------- /data/samples/windows/switch_gcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/windows/switch_gcc.exe -------------------------------------------------------------------------------- /data/samples/elf/hello-clang4-dynamic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/elf/hello-clang4-dynamic -------------------------------------------------------------------------------- /data/samples/windows/hello_release.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/windows/hello_release.exe -------------------------------------------------------------------------------- /data/samples/windows/switch_borland.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/windows/switch_borland.exe -------------------------------------------------------------------------------- /data/samples/windows/switch_msvc5.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/data/samples/windows/switch_msvc5.exe -------------------------------------------------------------------------------- /src/boomerang/ssl/parser/.gitignore: -------------------------------------------------------------------------------- 1 | SSL2Parser.cpp 2 | SSL2Parser.hpp 3 | SSL2Scanner.cpp 4 | location.hh 5 | position.hh 6 | stack.hh 7 | 8 | -------------------------------------------------------------------------------- /tests/recompilation-tests/typetest.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoomerangDecompiler/boomerang/HEAD/tests/recompilation-tests/typetest.zip -------------------------------------------------------------------------------- /data/signatures/posix/sys/statvfs.h: -------------------------------------------------------------------------------- 1 | 2 | int statvfs(const char *path, struct statvfs *buf); 3 | int fstatvfs(int fildes, struct statvfs *buf); 4 | -------------------------------------------------------------------------------- /data/signatures/stdlib/setjmp.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct _jmp_buf jmp_buf; 3 | 4 | void longjmp(jmp_buf env, int val); 5 | int setjmp(jmp_buf env); 6 | -------------------------------------------------------------------------------- /data/signatures/stdlib/stddef.h: -------------------------------------------------------------------------------- 1 | 2 | typedef long ptrdiff_t; 3 | 4 | typedef unsigned int size_t; 5 | // max_align_t 6 | typedef void *nullptr_t; 7 | -------------------------------------------------------------------------------- /src/boomerang-plugins/symbol/c/parser/.gitignore: -------------------------------------------------------------------------------- 1 | AnsiCParser.cpp 2 | AnsiCParser.hpp 3 | AnsiCScanner.cpp 4 | location.hh 5 | position.hh 6 | stack.hh 7 | -------------------------------------------------------------------------------- /data/signatures/posix/fcntl.h: -------------------------------------------------------------------------------- 1 | 2 | int creat(const char *path, mode_t mode); 3 | int fcntl(int fildes, int cmd, ...); 4 | int open(const char *path, int oflag, ...); 5 | -------------------------------------------------------------------------------- /data/signatures/posix/fmtmsg.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | int fmtmsg(long classification, const char *label, int severity, 4 | const char *text, const char *action, const char *tag); 5 | -------------------------------------------------------------------------------- /data/signatures/stdlib/signal.h: -------------------------------------------------------------------------------- 1 | typedef int sig_atomic_t; 2 | 3 | typedef void (*sigfunc_t)(int param); 4 | 5 | void signal(int sig, sigfunc_t sigfunc); 6 | int raise(int sig); 7 | -------------------------------------------------------------------------------- /data/signatures/posix/dlfcn.h: -------------------------------------------------------------------------------- 1 | 2 | void *dlopen(const char *file, int mode); 3 | void *dlsym(void *handle, const char *name); 4 | int dlclose(void *handle); 5 | char *dlerror(void); 6 | -------------------------------------------------------------------------------- /data/signatures/posix/glob.h: -------------------------------------------------------------------------------- 1 | 2 | typedef _glob_t glob_t; 3 | 4 | int glob(const char *pattern, int flags, int(*errfunc)(const char *epath, int errno), glob_t *pglob); 5 | void globfree(glob_t *pglob); 6 | -------------------------------------------------------------------------------- /data/signatures/posix/libgen.h: -------------------------------------------------------------------------------- 1 | 2 | char *basename(char *path); 3 | char *dirname(char *path); 4 | char *regcmp(const char *string1, ...); 5 | char *regex(const char *re, const char *subject, ...); 6 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/sem.h: -------------------------------------------------------------------------------- 1 | 2 | int semctl(int semid, int semnum, int cmd, ...); 3 | int semget(key_t key, int nsems, int semflg); 4 | int semop(int semid, struct sembuf *sops, size_t nsops); 5 | -------------------------------------------------------------------------------- /data/signatures/posix/syslog.h: -------------------------------------------------------------------------------- 1 | 2 | void closelog(void); 3 | void openlog(const char *ident, int logopt, int facility); 4 | int setlogmask(int maskpri); 5 | void syslog(int priority, const char *message, ...); 6 | -------------------------------------------------------------------------------- /data/signatures/posix/regexp.h: -------------------------------------------------------------------------------- 1 | 2 | int advance(const char *string, const char *expbuf); 3 | char *compile(char *instring, char *expbuf, const char *endbuf, int eof); 4 | int step(const char *string, const char *expbuf); 5 | -------------------------------------------------------------------------------- /data/signatures/posix/poll.h: -------------------------------------------------------------------------------- 1 | 2 | typedef unsigned int nfds_t; 3 | 4 | struct pollfd 5 | { 6 | int fd; 7 | short events; 8 | short revents; 9 | }; 10 | 11 | int poll(pollfd fds[], nfds_t nfds, int timeout); 12 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/times.h: -------------------------------------------------------------------------------- 1 | 2 | struct tms 3 | { 4 | clock_t tms_utime; 5 | clock_t tms_stime; 6 | clock_t tms_cutime; 7 | clock_t tms_cstime; 8 | }; 9 | 10 | clock_t times(struct tms *buffer); 11 | -------------------------------------------------------------------------------- /data/signatures/posix/nl_types.h: -------------------------------------------------------------------------------- 1 | 2 | typedef unsigned int nl_catd; 3 | 4 | int catclose(nl_catd catd); 5 | char *catgets(nl_catd catd, int set_id, int msg_id, const char *s); 6 | nl_catd catopen(const char *name, int oflag); 7 | -------------------------------------------------------------------------------- /scripts/apply-clang-format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | git clean -fdx src 5 | ./scripts/run-clang-format.py -r src -e *machO/objc* | git apply -p0 &>/dev/null && git commit -a --amend --no-edit || true 6 | ./scripts/check-commit.sh 7 | -------------------------------------------------------------------------------- /data/signatures/gcc_x86.h: -------------------------------------------------------------------------------- 1 | 2 | int _IO_putc(char c) PREFER int putchar(1); 3 | int __xstat(int __ver, const char *__filename, struct stat *__stat_buf) PREFER int stat(2, 3); 4 | int __isoc99_scanf(const char *format, ...) PREFER int scanf(1); 5 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/timeb.h: -------------------------------------------------------------------------------- 1 | 2 | struct timeb 3 | { 4 | time_t time; 5 | unsigned short millitm; 6 | short timezone; 7 | short dstflag; 8 | }; 9 | 10 | int ftime(struct timeb *tp); 11 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/shm.h: -------------------------------------------------------------------------------- 1 | 2 | void *shmat(int shmid, const void *shmaddr, int shmflg); 3 | int shmctl(int shmid, int cmd, struct shmid_ds *buf); 4 | int shmdt(const void *shmaddr); 5 | int shmget(key_t key, size_t size, int shmflg); 6 | -------------------------------------------------------------------------------- /data/signatures/posix/ucontext.h: -------------------------------------------------------------------------------- 1 | 2 | int getcontext(ucontext_t *ucp); 3 | int setcontext(const ucontext_t *ucp); 4 | void makecontext(ucontext_t *ucp, void (*func)(), int argc, ...); 5 | int swapcontext(ucontext_t *oucp, const ucontext_t *ucp); 6 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/loop/loop/loop.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d64 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("%i\n", 10); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/loop/loop/loop.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("%i\n", 10); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /data/signatures/uname_x86.h: -------------------------------------------------------------------------------- 1 | struct utsname 2 | { 3 | char sysname[65]; 4 | char nodename[65]; 5 | char release[65]; 6 | char version[65]; 7 | char machine[65]; 8 | char domainname[65]; 9 | }; 10 | 11 | int uname(struct utsname *buf); 12 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/hello/hello/hello.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d60 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello, world!\n"); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/hello/hello/hello.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d68 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | puts("Hello, world!"); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/elf32-ppc/hello/hello/hello.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000408 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | puts("Hello, world!"); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/hello/hello/hello.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello, world!\n"); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/hello/hello/hello.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000414 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | puts("Hello, world!"); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/hello/hello/hello.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048328 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello, world!\n"); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /scripts/clang-tidy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | for f in $(find src -type f -name "*.cpp" -o -name "*.h" | grep -iv scanner | grep -iv parser | grep -iv macho | sort -u) 5 | do 6 | echo $f 7 | clang-tidy -p build/compile_commands.json $f 8 | done 9 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/uio.h: -------------------------------------------------------------------------------- 1 | 2 | struct iovec 3 | { 4 | void *iov_base; 5 | size_t iov_len; 6 | }; 7 | 8 | ssize_t readv(int fildes, const struct iovec *iov, int iovcnt); 9 | ssize_t writev(int fildes, const struct iovec *iov, int iovcnt); 10 | -------------------------------------------------------------------------------- /data/signatures/getopt.h: -------------------------------------------------------------------------------- 1 | int getopt_long(int argc, char *argv[], const char *optstring, 2 | const struct option *longopts, int *longindex); 3 | int getopt_long_only(int argc, char *argv[], const char *optstring, 4 | const struct option *longopts, int *longindex); 5 | -------------------------------------------------------------------------------- /data/signatures/gcc3.h: -------------------------------------------------------------------------------- 1 | void *_Znwj(int bytes); 2 | void *_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(void *stream, char *str); 3 | void *_ZNSolsEm(void *stream, int u); 4 | void *_ZNSolsEPFRSoS_E(void *stream, void *string); 5 | void *_ZNSolsEl(void *stream, int l); 6 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/wait.h: -------------------------------------------------------------------------------- 1 | 2 | pid_t wait(int *stat_loc); 3 | pid_t wait3(int *stat_loc, int options, struct rusage *resource_usage); 4 | int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options); 5 | pid_t waitpid(pid_t pid, int *stat_loc, int options); 6 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/printpi/printpi/printpi.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d44 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Pi is about %.5f\n", 3.1415925); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/printpi/printpi/printpi.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d28 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Pi is about %.5f\n", 3.1415925); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/printpi/printpi/printpi.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048328 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Pi is about %.5f\n", 3.1415925); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /data/signatures/posix/ftw.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct _FTW FTW; 3 | 4 | int ftw(const char *path, int (*fn)(const char *path, const stat *ptr, int flag), int ndirs); 5 | int nftw(const char *path, int (*fn)(const char *path, const stat *ptr, int flag, FTW *ftw), int depth, int flags); 6 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/paramchain/paramchain/paramchain.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d40 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Fifty five is %d\n", 55); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/paramchain/paramchain/paramchain.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000438 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Fifty five is %d\n", 55); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/printpi/printpi/printpi.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Pi is about %.5f\n", 2.5243549e-29); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/twoproc/twoproc/twoproc.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001dac */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | 9 | g3 = printf("%i\n", 7); 10 | return g3; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/ohello/ohello/ohello.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00002cf4 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | objc_msgSend(); 8 | bb0x2d34: 9 | objc_msgSend(); 10 | goto bb0x2d34; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/twoproc/twoproc/twoproc.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000420 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | 9 | g3 = printf("%i\n", 7); 10 | return g3; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /data/signatures/posix/iconv.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct _iconv iconv; 3 | 4 | iconv_t iconv_open(const char *tocode, const char *fromcode); 5 | size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, 6 | char **outbuf, size_t *outbytesleft); 7 | int iconv_close(iconv_t cd); 8 | -------------------------------------------------------------------------------- /data/signatures/fortran.h: -------------------------------------------------------------------------------- 1 | void f_setarg(int argc, char *argv[]); 2 | void f_setsig(); 3 | void f_init(); 4 | void f_exit(); 5 | 6 | int s_wsle(void *a); 7 | int s_rsle(void *a); 8 | 9 | int e_rsle(); 10 | int e_wsle(); 11 | 12 | void do_lio(void *arg0, void *arg1, char *arg2, int arg3); 13 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/resource.h: -------------------------------------------------------------------------------- 1 | 2 | int getpriority(int which, id_t who); 3 | int getrlimit(int resource, struct rlimit *rlp); 4 | int getrusage(int who, struct rusage *r_usage); 5 | int setpriority(int which, id_t who, int nice); 6 | int setrlimit(int resource, const struct rlimit *rlp); 7 | -------------------------------------------------------------------------------- /data/signatures/posix/utmpx.h: -------------------------------------------------------------------------------- 1 | 2 | void endutxent(void); 3 | struct utmpx *getutxent(void); 4 | struct utmpx *getutxid(const struct utmpx *id); 5 | struct utmpx *getutxline(const struct utmpx *line); 6 | struct utmpx *pututxline(const struct utmpx *utmpx); 7 | void setutxent(void); 8 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/elf/hello-clang4-dynamic/hello-clang4-dynamic/hello-clang4-dynamic.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x080483f0 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello world!\n"); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/msg.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | int msgctl(int msqid, int cmd, struct msqid_ds *buf); 4 | int msgget(key_t key, int msgflg); 5 | ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); 6 | int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); 7 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/windows/typetest.exe/typetest/typetest.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00401bfc */ 5 | int main(int argc, char *argv[]) 6 | { 7 | __size32 eax; // r24 8 | 9 | eax = MFC42_DLL_1576(); 10 | return eax; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/printpi/printpi/printpi.c: -------------------------------------------------------------------------------- 1 | int main(int argc, union { double; char *[] *; } argv); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, union { double; char *[] *; } argv) 6 | { 7 | printf("Pi is about %.5f\n", argv); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /data/signatures/libintl.h: -------------------------------------------------------------------------------- 1 | 2 | char *textdomain(const char *domainname); 3 | char *bindtextdomain(const char *domainname, const char *dirname); 4 | char *gettext(const char *msgid); 5 | char *dgettext(const char *domainname, const char *msgid); 6 | char *dcgettext(const char *domainname, const char *msgid, int category); 7 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/regalias/regalias/regalias.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048364 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int eax; // r24 8 | 9 | eax = printf("%08X\n", (unsigned int)0x87653412); 10 | return eax; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/twoproc2/twoproc2/twoproc2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d60 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | 9 | printf("%i\n", 7); 10 | g3 = printf("%i\n", 11); 11 | return g3; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/global3/global3/global3.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | int b = 7; 4 | 5 | /** address: 0x100004a8 */ 6 | int main(int argc, char *argv[]) 7 | { 8 | b = 12; 9 | printf("a = %lld\n", 12); 10 | printf("b = %i\n", b); 11 | return 0; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/twoproc2/twoproc2/twoproc2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000420 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | 9 | printf("%i\n", 7); 10 | g3 = printf("%i\n", 11); 11 | return g3; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/regalias2/regalias2/regalias2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048370 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int eax; // r24 8 | 9 | eax = printf("%08X\n", (unsigned int)0x87653412); 10 | return eax; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/global1/global1/global1.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | int a; 4 | int b; 5 | 6 | /** address: 0x00001ce0 */ 7 | int main(int argc, char *argv[]) 8 | { 9 | b = 12; 10 | printf("a = %i\n", a); 11 | printf("b = %i\n", b); 12 | return 0; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/set/set/set.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048328 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | char dl; // r10 8 | 9 | dl = (argc > 1) ? 1 : 0; 10 | printf("Result is %d\n", (int) dl); 11 | return (int) dl; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/global2/global2/global2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | int b = 7; 4 | 5 | /** address: 0x10000498 */ 6 | int main(int argc, char *argv[]) 7 | { 8 | b = 12; 9 | printf("a = %f\n", 1.6815582e-44); 10 | printf("b = %i\n", b); 11 | return 0; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/boomerang/util/ExpSet.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "ExpSet.h" 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/global3/global3/global3.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | long long a; 4 | int b; 5 | 6 | /** address: 0x00001cc4 */ 7 | int main(int argc, char *argv[]) 8 | { 9 | b = 12; 10 | printf("a = %lld\n", a); 11 | printf("b = %i\n", b); 12 | return 0; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/global1/global1/global1.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | int b = 7; 4 | int a = 5; 5 | 6 | /** address: 0x10000498 */ 7 | int main(int argc, char *argv[]) 8 | { 9 | b = 12; 10 | printf("a = %i\n", a); 11 | printf("b = %i\n", b); 12 | return 0; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/boomerang/db/GraphNode.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "GraphNode.h" 11 | -------------------------------------------------------------------------------- /src/boomerang/core/BoomerangAPI.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "BoomerangAPI.h" 11 | -------------------------------------------------------------------------------- /src/boomerang/util/MapIterators.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "MapIterators.h" 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/set/set/set.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d54 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g30; // r30 8 | 9 | g30 = 1; 10 | if (argc <= 1) { 11 | g30 = 0; 12 | } 13 | printf("Result is %d\n", g30); 14 | return g30; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang-plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | add_subdirectory(decoder) 10 | add_subdirectory(loader) 11 | add_subdirectory(frontend) 12 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/loop/loop/loop.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d40 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int local0; // m[g1 - 32] 8 | 9 | local0 = 0; 10 | while (local0 <= 9) { 11 | local0++; 12 | } 13 | printf("%i\n", local0); 14 | return 0; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/global2/global2/global2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | int b; 4 | 5 | /** address: 0x00001ca4 */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int g4; // r4 9 | 10 | g4 = *0x2020; 11 | b = 12; 12 | printf("a = %f\n", g4); 13 | printf("b = %i\n", b); 14 | return 0; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/loop/loop/loop.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int local0; // m[g1 - 24] 8 | 9 | local0 = 0; 10 | while (local0 <= 9) { 11 | local0++; 12 | } 13 | printf("%i\n", local0); 14 | return 0; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/loop/loop/loop.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048390 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int local0; // m[esp - 8] 8 | 9 | local0 = 0; 10 | while (local0 <= 9) { 11 | local0++; 12 | } 13 | printf("%i\n", local0); 14 | return 0; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /data/signatures/socket.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct 3 | { 4 | unsigned char sa_len; 5 | sa_family_t sa_family; 6 | char sa_data[14]; 7 | } sockaddr; 8 | 9 | typedef int socklen_t; 10 | 11 | int getsockname(int s, sockaddr *name, socklen_t *namelen); 12 | int socket(int domain, int type, int protocol); 13 | int connect(int s, const sockaddr *name, socklen_t namelen); 14 | -------------------------------------------------------------------------------- /data/signatures/posix/arpa/inet.h: -------------------------------------------------------------------------------- 1 | 2 | typedef unsigned int in_addr_t; 3 | 4 | in_addr_t inet_addr(const char *cp); 5 | in_addr_t inet_lnaof(struct in_addr in); 6 | struct in_addr inet_makeaddr(in_addr_t net, in_addr_t lna); 7 | in_addr_t inet_netof(struct in_addr in); 8 | in_addr_t inet_network(const char *cp); 9 | char *inet_ntoa(struct in_addr in); 10 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/manyparams/manyparams/manyparams.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048328 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Many parameters: %d, %.1f, %d, %.1f, %d, %.1f, %d, %.1f\n", 1, -1.5881868e-23, 0x3ff19999, 2.8025969e-45, 0x9999999a, 2.0249999, 3, 2.720083e+23); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /data/signatures/posix/netinet/in.h: -------------------------------------------------------------------------------- 1 | 2 | typedef unsigned short in_port_t; 3 | typedef unsigned int in_addr_t; 4 | typedef unsigned int sa_family_t; 5 | 6 | struct in_addr 7 | { 8 | in_addr_t s_addr; 9 | }; 10 | 11 | struct sockaddr_in 12 | { 13 | sa_family_t sin_family; 14 | in_port_t sin_port; 15 | struct in_addr sin_addr; 16 | unsigned char sin_zero[8]; 17 | }; 18 | -------------------------------------------------------------------------------- /data/signatures/posix/dirent.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct _DIR DIR; 3 | 4 | int closedir(DIR *dirp); 5 | DIR *opendir(const char *dirname); 6 | struct dirent *readdir(DIR *dirp); 7 | int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); 8 | void rewinddir(DIR *dirp); 9 | void seekdir(DIR *dirp, long loc); 10 | long telldir(DIR *dirp); 11 | -------------------------------------------------------------------------------- /tests/recompilation-tests/hello.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int main() 14 | { 15 | printf("Hello, world!\n"); 16 | return EXIT_SUCCESS; 17 | } 18 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/localarray/localarray/localarray.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048334 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int local0; // m[esp - 272] 8 | 9 | local0 = 0; 10 | while (local0 <= 63) { 11 | *(__size32*)(esp + local0 * 4 - 268) = 0; 12 | local0++; 13 | } 14 | return 0; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /data/signatures/posix/strings.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | int bcmp(const void *s1, const void *s2, size_t n); 4 | void bcopy(const void *s1, void *s2, size_t n); 5 | void bzero(void *s, size_t n); 6 | int ffs(int i); 7 | char *index(const char *s, int c); 8 | char *rindex(const char *s, int c); 9 | int strcasecmp(const char *s1, const char *s2); 10 | int strncasecmp(const char *s1, const char *s2, size_t n); 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/stattest/stattest/stattest.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000440 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | int g3_1; // r3 9 | int local0; // m[g1 - 68] 10 | 11 | g3_1 = __xstat(); 12 | printf("Stat returns %d; size of file is %d\n", g3_1, local0); 13 | return g3; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/time.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct _fd_set fd_set; 3 | 4 | int getitimer(int which, struct itimerval *value); 5 | int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue); 6 | int gettimeofday(timeval *tp, void *tzp); 7 | int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout); 8 | int utimes(const char *path, const timeval times[2]); 9 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/set/set/set.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | 9 | if (argc <= 1) { 10 | printf("Result is %d\n", 0); 11 | g3 = 0; 12 | } 13 | else { 14 | printf("Result is %d\n", 1); 15 | g3 = 1; 16 | } 17 | return g3; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/boomerang/ssl/parser/Table.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "Table.h" 11 | 12 | 13 | Table::Table(const std::deque &recs) 14 | : Records(recs) 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/fromssa2/fromssa2/fromssa2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d18 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int local0; // m[g1 - 32] 8 | 9 | local0 = 0; 10 | do { 11 | local0++; 12 | printf("%d ", local0); 13 | } while (local0 <= 9); 14 | printf("a is %d, x is %d\n", local0, local0); 15 | return 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/fromssa2/fromssa2/fromssa2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int local0; // m[g1 - 24] 8 | 9 | local0 = 0; 10 | do { 11 | local0++; 12 | printf("%d ", local0); 13 | } while (local0 <= 9); 14 | printf("a is %d, x is %d\n", local0, local0); 15 | return 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/minmax/minmax/minmax.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d30 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g4; // r4 8 | 9 | g4 = argc; 10 | if (argc < -2) { 11 | g4 = -2; 12 | } 13 | if (g4 > 3) { 14 | g4 = 3; 15 | } 16 | printf("MinMax adjusted number of arguments is %d\n", g4); 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/minmax/minmax/minmax.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g4; // r4 8 | 9 | g4 = argc; 10 | if (argc < -2) { 11 | g4 = -2; 12 | } 13 | if (g4 > 3) { 14 | g4 = 3; 15 | } 16 | printf("MinMax adjusted number of arguments is %d\n", g4); 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /data/signatures/netdb.h: -------------------------------------------------------------------------------- 1 | typedef struct 2 | { 3 | int ai_flags; 4 | int ai_family; 5 | int ai_socktype; 6 | int ai_protocol; 7 | size_t ai_addrlen; 8 | char *ai_canonname; 9 | sockaddr *ai_addr; 10 | addrinfo *ai_next; 11 | } addrinfo; 12 | 13 | int getaddrinfo(const char *nodename, const char *servname, const addrinfo *hints, addrinfo **res); 14 | void freeaddrinfo(addrinfo *ai); 15 | char *gai_strerror(int ecode); 16 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/ifthen/ifthen/ifthen.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000468 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | __size32 LR; // r300 8 | int g4; // r4 9 | 10 | puts("Figure 19.2"); 11 | putchar('1'); 12 | g4 = 0; 13 | if (argc <= 3) { 14 | g4 = argc; 15 | } 16 | printf("C is %d\n", g4 + argc); 17 | return LR; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /data/signatures/posix/semaphore.h: -------------------------------------------------------------------------------- 1 | 2 | typedef unsigned int sem_t; 3 | 4 | int sem_close(sem_t *sem); 5 | int sem_destroy(sem_t *sem); 6 | int sem_getvalue(sem_t *sem, int *sval); 7 | int sem_init(sem_t *sem, int pshared, unsigned int value); 8 | sem_t *sem_open(const char *name, int oflag, ...); 9 | int sem_post(sem_t *sem); 10 | int sem_trywait(sem_t *sem); 11 | int sem_unlink(const char *name); 12 | int sem_wait(sem_t *sem); 13 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/ifthen/ifthen/ifthen.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001cf4 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g29; // r29 8 | int g3; // r3 9 | 10 | g29 = 0; 11 | puts("Figure 19.2"); 12 | putchar('1'); 13 | if (argc <= 3) { 14 | g29 = argc; 15 | } 16 | g3 = printf("C is %d\n", g29 + argc); 17 | return g3; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /data/signatures/stdlib/ctype.h: -------------------------------------------------------------------------------- 1 | 2 | // character classification functions 3 | int isalnum(int c); 4 | int isalpha(int c); 5 | int isblank(int c); 6 | int iscntrl(int c); 7 | int isdigit(int c); 8 | int isgraph(int c); 9 | int islower(int c); 10 | int isprint(int c); 11 | int ispunct(int c); 12 | int isspace(int c); 13 | int isupper(int c); 14 | int isxdigit(int c); 15 | 16 | // character conversion functions 17 | int tolower(int c); 18 | int toupper(int c); 19 | -------------------------------------------------------------------------------- /tests/recompilation-tests/printpi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int main() 14 | { 15 | const float pi = 3.1415926; 16 | printf("Pi is about %.5f\n", pi); 17 | return EXIT_SUCCESS; 18 | } 19 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/manyparams/manyparams/manyparams.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g10; // r10 8 | int g8; // r8 9 | double local0; // m[g1 - 24] 10 | 11 | printf("Many parameters: %d, %.1f, %d, %.1f, %d, %.1f, %d, %.1f\n", 1, 2.8025969e-45, 3, 5.6051939e-45, g8, 2.5243549e-29, g10, local0); 12 | return 0; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/stattest/stattest/stattest.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x0804835c */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int eax; // r24 8 | struct stat local0; // m[esp - 108] 9 | int local1; // m[esp - 64] 10 | 11 | eax = stat(3, "test/source/stattest.c", &local0); 12 | printf("Stat returns %d; size of file is %d\n", eax, local1); 13 | return eax; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | 10 | # add submodules for testing 11 | add_subdirectory(core) 12 | add_subdirectory(db) 13 | add_subdirectory(ssl) 14 | add_subdirectory(type) 15 | add_subdirectory(util) 16 | add_subdirectory(visitor) 17 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/stat.h: -------------------------------------------------------------------------------- 1 | 2 | int chmod(const char *path, mode_t mode); 3 | int fchmod(int fildes, mode_t mode); 4 | int fstat(int fildes, struct stat *buf); 5 | int lstat(const char *path, struct stat *buf); 6 | int mkdir(const char *path, mode_t mode); 7 | int mkfifo(const char *path, mode_t mode); 8 | int mknod(const char *path, mode_t mode, dev_t dev); 9 | int stat(const char *path, struct stat *buf); 10 | mode_t umask(mode_t cmask); 11 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/ifthen/ifthen/ifthen.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001cdc */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | int local0; // m[g1 - 28] 9 | 10 | printf("Figure 19.2\n"); 11 | local0 = 0; 12 | printf("1"); 13 | if (argc <= 3) { 14 | local0 = argc; 15 | } 16 | g3 = printf("C is %d\n", local0 + argc); 17 | return g3; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/ifthen/ifthen/ifthen.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | int local0; // m[g1 - 32] 9 | 10 | printf("Figure 19.2\n"); 11 | local0 = 0; 12 | printf("1"); 13 | if (argc <= 3) { 14 | local0 = argc; 15 | } 16 | g3 = printf("C is %d\n", local0 + argc); 17 | return g3; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /data/signatures/glut.h: -------------------------------------------------------------------------------- 1 | void glutInit(int *argcp, char **argv); 2 | int glutCreateWindow(const char *title); 3 | void glutInitDisplayMode(unsigned int mode); 4 | void glutMainLoop(); 5 | void glutSpecialFunc(void (*func)(int key, int x, int y)); 6 | void glutDisplayFunc(void (*func)(void)); 7 | void glutKeyboardFunc(void (*func)(char key, int x, int y)); 8 | void glutReshapeFunc(void (*func)(int width, int height)); 9 | void glutBitmapCharacter(void *font, int character); 10 | -------------------------------------------------------------------------------- /data/signatures/stdlib/uchar.h: -------------------------------------------------------------------------------- 1 | 2 | typedef unsigned short char16_t; 3 | typedef unsigned int char32_t; 4 | typedef unsigned int size_t; 5 | 6 | typedef struct _mbstate_t mbstate_t; 7 | 8 | size_t c16rtomb(char *pmb, char16_t c16, mbstate_t *ps); 9 | size_t c32rtomb(char *pmb, char32_t c32, mbstate_t *ps); 10 | 11 | size_t mbrtoc16(char16_t *pc16, const char *pmb, size_t max, mbstate_t *ps); 12 | size_t mbrtoc32(char32_t *pc32, const char *pmb, size_t max, mbstate_t *ps); 13 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/minmax/minmax/minmax.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d10 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int local0; // m[g1 + 24] 8 | 9 | local0 = argc; 10 | if (argc < -2) { 11 | local0 = -2; 12 | } 13 | if (local0 > 3) { 14 | local0 = 3; 15 | } 16 | printf("MinMax adjusted number of arguments is %d\n", local0); 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/minmax/minmax/minmax.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int local0; // m[g1 - 24] 8 | 9 | local0 = argc; 10 | if (argc < -2) { 11 | local0 = -2; 12 | } 13 | if (local0 > 3) { 14 | local0 = 3; 15 | } 16 | printf("MinMax adjusted number of arguments is %d\n", local0); 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/ifthen/ifthen/ifthen.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048328 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int eax; // r24 8 | int local1; // m[esp - 12] 9 | 10 | printf("Figure 19.2\n"); 11 | local1 = 0; 12 | printf("1"); 13 | if (argc <= 3) { 14 | local1 = argc; 15 | } 16 | eax = printf("C is %d\n", argc + local1); 17 | return eax; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/boomerang/db/module/Class.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "Class.h" 11 | 12 | 13 | Class::Class(const QString &name, Prog *_prog) 14 | : Module(name, _prog) 15 | , m_type(CompoundType::get()) 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /tests/recompilation-tests/set.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | /* Generate a set instruction (x86) */ 9 | 10 | #include 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | const char c = (argc > 1) ? 1 : 0; 15 | printf("Result is %d\n", c); 16 | return c; 17 | } 18 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/set/set/set.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d28 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | unsigned char local0; // m[g1 - 31] 8 | unsigned char local1; // m[g1 - 32] 9 | 10 | local0 = 1; 11 | if (argc <= 1) { 12 | local0 = 0; 13 | } 14 | local1 = (char) (local0); 15 | printf("Result is %d\n", (int) (local1)); 16 | return (int) (local1); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/manyparams/manyparams/manyparams.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int LR; // r300 8 | int g10; // r10 9 | int g9; // r9 10 | double local0; // m[g1 - 8] 11 | 12 | printf("Many parameters: %d, %.1f, %d, %.1f, %d, %.1f, %d, %.1f\n", 1, 2.8025969e-45, 3, 5.6051939e-45, LR, g9, g10, local0); 13 | return 0; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/set/set/set.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | unsigned char local0; // m[g1 - 19] 8 | unsigned char local1; // m[g1 - 20] 9 | 10 | local0 = 1; 11 | if (argc <= 1) { 12 | local0 = 0; 13 | } 14 | local1 = (char) (local0); 15 | printf("Result is %d\n", (local1) & 0xff); 16 | return (local1) & 0xff; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/stattest/stattest/stattest.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001cf4 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | int g3_1; // r3 9 | struct stat local0; // m[g1 - 112] 10 | int local1; // m[g1 - 64] 11 | 12 | g3_1 = stat("test/source/stattest.c", &local0); 13 | printf("Stat returns %d; size of file is %d\n", g3_1, local1); 14 | return g3; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/stattest/stattest/stattest.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001ce0 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | int g3_1; // r3 9 | struct stat local0; // m[g1 - 128] 10 | int local1; // m[g1 - 80] 11 | 12 | g3_1 = stat("test/source/stattest.c", &local0); 13 | printf("Stat returns %d; size of file is %d\n", g3_1, local1); 14 | return g3; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/minmax/minmax/minmax.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x080488f0 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int eax; // r24 8 | 9 | eax = argc; 10 | if (argc >= -2) { 11 | if (argc > 3) { 12 | eax = 3; 13 | } 14 | } 15 | else { 16 | eax = -2; 17 | } 18 | printf("MinMax adjusted number of arguments is %d\n", eax); 19 | return 0; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/sumarray/sumarray/sumarray.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | __size32 a[]; 4 | 5 | /** address: 0x00001d0c */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int local0; // m[g1 - 32] 9 | int local1; // m[g1 - 28] 10 | 11 | local0 = 0; 12 | local1 = 0; 13 | while (local1 <= 9) { 14 | local0 += a[local1]; 15 | local1++; 16 | } 17 | printf("Sum is %d\n", local0); 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/twoproc/twoproc/twoproc.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | __size32 proc1(__size32 param1, __size32 param2); 3 | 4 | 5 | /** address: 0x00001d80 */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int g3; // r3 9 | 10 | g3 = proc1(11, 4); 11 | printf("%i\n", g3); 12 | return g3; 13 | } 14 | 15 | /** address: 0x00001d50 */ 16 | __size32 proc1(__size32 param1, __size32 param2) 17 | { 18 | return param1 - param2; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/twoproc/twoproc/twoproc.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | __size32 proc1(__size32 param1, __size32 param2); 3 | 4 | 5 | /** address: 0x1000044c */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int g3; // r3 9 | 10 | g3 = proc1(11, 4); 11 | printf("%i\n", g3); 12 | return g3; 13 | } 14 | 15 | /** address: 0x10000418 */ 16 | __size32 proc1(__size32 param1, __size32 param2) 17 | { 18 | return param1 - param2; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/restoredparam/restoredparam/restoredparam.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | __size32 twice(__size32 param1); 3 | 4 | 5 | /** address: 0x0804837c */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int eax; // r24 9 | 10 | eax = twice(argc); 11 | printf("Result is %d\n", eax); 12 | return 0; 13 | } 14 | 15 | /** address: 0x08048396 */ 16 | __size32 twice(__size32 param1) 17 | { 18 | return param1 + param1; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/boomerang/type/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | 10 | list(APPEND boomerang-type-sources 11 | type/DataIntervalMap 12 | ) 13 | 14 | BOOMERANG_LIST_APPEND_FOREACH(boomerang-type-sources ".cpp") 15 | 16 | set(boomerang-sources "${boomerang-sources};${boomerang-type-sources}" PARENT_SCOPE) 17 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/testset/testset/testset.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048370 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | unsigned char cl; // r9 8 | unsigned char dl; // r10 9 | 10 | printf("Hello, set\n"); 11 | dl = ((unsigned int)argc < 3) ? 1 : 0; 12 | printf("argc = 4) ? 1 : 0; 14 | printf("(argc - 4) >= 0: %d\n", (cl)); 15 | return 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/recompilation-tests/manyparams.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int main() 14 | { 15 | printf("Many parameters: %d, %.1f, %d, %.1f, %d, %.1f, %d, %.1f\n", 16 | 1, 1.1, 2, 2.2, 3, 3.3, 4, 4.4); 17 | return EXIT_SUCCESS; 18 | } 19 | -------------------------------------------------------------------------------- /tests/recompilation-tests/loop.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | int i; 16 | for (i = 0; i < 10; i++) { 17 | ; 18 | } 19 | 20 | printf("%i\n", i); 21 | return EXIT_SUCCESS; 22 | } 23 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/twoproc/twoproc/twoproc.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | __size32 proc1(__size32 param1, __size32 param2); 3 | 4 | 5 | /** address: 0x08048375 */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int eax; // r24 9 | 10 | eax = proc1(11, 4); 11 | eax = printf("%i\n", eax); 12 | return eax; 13 | } 14 | 15 | /** address: 0x08048368 */ 16 | __size32 proc1(__size32 param1, __size32 param2) 17 | { 18 | return param1 - param2; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/boomerang/passes/Pass.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "Pass.h" 11 | 12 | #include 13 | 14 | 15 | IPass::IPass(const QString &name, PassID type) 16 | : m_name(name) 17 | , m_type(type) 18 | { 19 | assert(!name.isEmpty()); 20 | } 21 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/funcptr/funcptr/funcptr.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | void hello(); 3 | void world(); 4 | 5 | 6 | /** address: 0x10000440 */ 7 | int main(int argc, char *argv[]) 8 | { 9 | hello(); 10 | world(); 11 | return 0; 12 | } 13 | 14 | /** address: 0x10000490 */ 15 | void hello() 16 | { 17 | printf("Hello, "); 18 | return; 19 | } 20 | 21 | /** address: 0x10000468 */ 22 | void world() 23 | { 24 | puts("world!"); 25 | return; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /data/signatures/posix/aio.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct _aiocb aiocb; 3 | typedef int ssize_t; 4 | 5 | int aio_cancel(int fildes, aiocb *aiocbp); 6 | int aio_error(const aiocb *aiocbp); 7 | int aio_fsync(int op, aiocb *aiocbp); 8 | int aio_read(aiocb *aiocbp); 9 | ssize_t aio_return(aiocb *aiocbp); 10 | int aio_suspend(const aiocb *list[], int nent, const struct timespec *timeout); 11 | int aio_write(aiocb *aiocbp); 12 | int lio_listio(int mode, aiocb *list[], int nent, struct sigevent *sig); 13 | -------------------------------------------------------------------------------- /data/signatures/posix/grp.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct _group group; 3 | 4 | group *getgrgid(gid_t gid); 5 | group *getgrnam(const char *name); 6 | int getgrgid_r(gid_t gid, group *grp, char *buffer, 7 | size_t bufsize, group **result); 8 | int getgrnam_r(const char *name, group *grp, char *buffer, 9 | size_t bufsize, group **result); 10 | group *getgrent(void); 11 | void endgrent(void); 12 | void setgrent(void); 13 | -------------------------------------------------------------------------------- /data/signatures/posix/regex.h: -------------------------------------------------------------------------------- 1 | 2 | struct regex_t 3 | { 4 | size_t re_nsub; 5 | }; 6 | 7 | typedef ssize_t regoff_t; 8 | 9 | struct regmatch_t 10 | { 11 | regoff_t rm_so; 12 | regoff_t rm_eo; 13 | }; 14 | 15 | int regcomp(regex_t *preg, const char *pattern, int cflags); 16 | int regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags); 17 | size_t regerror(nt errcode, const regex_t *preg, char *errbuf, size_t errbuf_size); 18 | void regfree(regex_t *preg); 19 | -------------------------------------------------------------------------------- /docs/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** \mainpage Introduction 2 | * 3 | * \section Introduction 4 | * 5 | * Welcome to the Doxygen generated documentation for the 6 | * %Boomerang Decompiler. Not all classes and functions have been documented 7 | * yet, but eventually they will. If you have figured out what a function is doing 8 | * please update the documentation and submit it as a pull request. 9 | * 10 | * More information on the original %Boomerang Decompiler can be found at 11 | * http://boomerang.sourceforge.net. 12 | */ 13 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/ssl/parser/ParserTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class ParserTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testRead(); 22 | }; 23 | -------------------------------------------------------------------------------- /tests/recompilation-tests/twoproc2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int proc1(int a, int b) 14 | { 15 | return a + b; 16 | } 17 | 18 | 19 | int main() 20 | { 21 | printf("%i\n", proc1(3, 4)); 22 | printf("%i\n", proc1(5, 6)); 23 | return EXIT_SUCCESS; 24 | } 25 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/sumarray/sumarray/sumarray.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | __size32 a[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; 4 | 5 | /** address: 0x10000418 */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int local0; // m[g1 - 24] 9 | int local1; // m[g1 - 20] 10 | 11 | local0 = 0; 12 | local1 = 0; 13 | while (local1 <= 9) { 14 | local0 += a[local1]; 15 | local1++; 16 | } 17 | printf("Sum is %d\n", local0); 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/sumarray/sumarray/sumarray.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | __size32 a[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; 4 | 5 | /** address: 0x08048328 */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int local0; // m[esp - 8] 9 | int local1; // m[esp - 12] 10 | 11 | local0 = 0; 12 | local1 = 0; 13 | while (local1 <= 9) { 14 | local0 += a[local1]; 15 | local1++; 16 | } 17 | printf("Sum is %d\n", local0); 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /data/signatures/posix/sys/mman.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | int mlock(const void *addr, size_t len); 4 | int mlockall(int flags); 5 | void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off); 6 | int mprotect(void *addr, size_t len, int prot); 7 | int msync(void *addr, size_t len, int flags); 8 | int munlock(const void * addr, size_t len); 9 | int munlockall(void); 10 | int munmap(void *addr, size_t len); 11 | int shm_open(const char *name, int oflag, mode_t mode); 12 | int shm_unlink(const char *name); 13 | -------------------------------------------------------------------------------- /src/boomerang/visitor/stmtexpvisitor/StmtConstFinder.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "StmtConstFinder.h" 11 | 12 | #include "boomerang/visitor/expvisitor/ConstFinder.h" 13 | 14 | 15 | StmtConstFinder::StmtConstFinder(ConstFinder *v) 16 | : StmtExpVisitor(v) 17 | { 18 | } 19 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/chararray/chararray/chararray.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048334 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | __size32 eax; // r24 8 | union { int; __size8 *; } esp; // r28 9 | union { int; __size8 *; } local0; // m[esp - 80] 10 | 11 | local0 = 0; 12 | while (local0 <= 63) { 13 | eax = esp + local0 - 76; 14 | *(__size8*)(esp + local0 - 76) = 0; 15 | local0++; 16 | } 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /data/signatures/posix/ndbm.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct _DBM DBM; 3 | 4 | struct datum 5 | { 6 | void *dptr; 7 | size_t dsize; 8 | }; 9 | 10 | int dbm_clearerr(DBM *db); 11 | void dbm_close(DBM *db); 12 | int dbm_delete(DBM *db, datum key); 13 | int dbm_error(DBM *db); 14 | datum dbm_fetch(DBM *db, datum key); 15 | datum dbm_firstkey(DBM *db); 16 | datum dbm_nextkey(DBM *db); 17 | DBM *dbm_open(const char *file, int open_flags, mode_t file_mode); 18 | int dbm_store(DBM *db, datum key, datum content, int store_mode); 19 | -------------------------------------------------------------------------------- /tests/recompilation-tests/bswap.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int bswap(int x) 14 | { 15 | __asm__("bswapl %0;" : "=r" (x) : "r" (x)); 16 | return x; 17 | } 18 | 19 | 20 | int main() 21 | { 22 | printf("Output is %x\n", bswap(0x12345678U)); 23 | return EXIT_SUCCESS; 24 | } 25 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/twoproc2/twoproc2/twoproc2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | __size32 proc1(__size32 param1, __size32 param2); 3 | 4 | 5 | /** address: 0x00001d3c */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int g3; // r3 9 | 10 | g3 = proc1(3, 4); 11 | printf("%i\n", g3); 12 | g3 = proc1(5, 6); 13 | printf("%i\n", g3); 14 | return g3; 15 | } 16 | 17 | /** address: 0x00001d0c */ 18 | __size32 proc1(__size32 param1, __size32 param2) 19 | { 20 | return param1 + param2; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/twoproc2/twoproc2/twoproc2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | __size32 proc1(__size32 param1, __size32 param2); 3 | 4 | 5 | /** address: 0x1000044c */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int g3; // r3 9 | 10 | g3 = proc1(3, 4); 11 | printf("%i\n", g3); 12 | g3 = proc1(5, 6); 13 | printf("%i\n", g3); 14 | return g3; 15 | } 16 | 17 | /** address: 0x10000418 */ 18 | __size32 proc1(__size32 param1, __size32 param2) 19 | { 20 | return param1 + param2; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/testarray1/testarray1/testarray1.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048368 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int edx; // r26 8 | int local0; // m[esp - 12] 9 | int local1; // m[esp - 8] 10 | 11 | local0 = 0; 12 | local1 = 0; 13 | while (local1 <= 4) { 14 | edx = (int) *(local1 + 0x80495bc); 15 | local0 += edx; 16 | local1++; 17 | } 18 | printf("Sum is %d\n", local0); 19 | return 0; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /src/boomerang/util/StatementSet.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "StatementSet.h" 11 | 12 | 13 | bool lessAssign::operator()(const std::shared_ptr &as1, 14 | const std::shared_ptr &as2) const 15 | { 16 | return *as1->getLeft() < *as2->getLeft(); 17 | } 18 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/global1/global1/global1.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | void foo1(); 3 | void foo2(); 4 | 5 | int a; 6 | int b; 7 | 8 | /** address: 0x00001d50 */ 9 | int main(int argc, char *argv[]) 10 | { 11 | foo1(); 12 | printf("b = %i\n", b); 13 | return 0; 14 | } 15 | 16 | /** address: 0x00001d24 */ 17 | void foo1() 18 | { 19 | foo2(); 20 | return; 21 | } 22 | 23 | /** address: 0x00001ccc */ 24 | void foo2() 25 | { 26 | b = 12; 27 | printf("a = %i\n", a); 28 | return; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /cmake-scripts/boomerang-dependencies.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | find_package(Qt5 COMPONENTS Core REQUIRED HINTS $ENV{QTDIR}) 10 | if (Qt5_FOUND) 11 | mark_as_advanced(Qt5_DIR Qt5Core_DIR) 12 | endif (Qt5_FOUND) 13 | 14 | find_package(Threads) 15 | find_package(Capstone 4.0.1 REQUIRED) 16 | 17 | find_package(FLEX 2.6 REQUIRED) 18 | find_package(BISON 3.3 REQUIRED) 19 | -------------------------------------------------------------------------------- /data/signatures/posix/sched.h: -------------------------------------------------------------------------------- 1 | 2 | struct sched_param 3 | { 4 | int sched_priority; 5 | }; 6 | 7 | 8 | int sched_get_priority_max(int policy); 9 | int sched_get_priority_min(int policy); 10 | int sched_getparam(pid_t pid, struct sched_param *param); 11 | int sched_getscheduler(pid_t pid); 12 | int sched_rr_get_interval(pid_t pid, struct timespec *interval); 13 | int sched_setparam(pid_t pid, const struct sched_param *param); 14 | int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param); 15 | int sched_yield(void); 16 | -------------------------------------------------------------------------------- /tests/recompilation-tests/testarray1.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | char gca[5] = {2, 4, 6, 8, 10}; 14 | 15 | 16 | int main() 17 | { 18 | int i, sum = 0; 19 | for (i=0; i < 5; i++) { 20 | sum += gca[i]; 21 | } 22 | 23 | printf("Sum is %d\n", sum); 24 | return EXIT_SUCCESS; 25 | } 26 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/global3/global3/global3.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | void foo1(); 3 | void foo2(); 4 | 5 | long long a; 6 | int b; 7 | 8 | /** address: 0x00001d4c */ 9 | int main(int argc, char *argv[]) 10 | { 11 | foo1(); 12 | printf("b = %i\n", b); 13 | return 0; 14 | } 15 | 16 | /** address: 0x00001d20 */ 17 | void foo1() 18 | { 19 | foo2(); 20 | return; 21 | } 22 | 23 | /** address: 0x00001cc4 */ 24 | void foo2() 25 | { 26 | b = 12; 27 | printf("a = %lld\n", a); 28 | return; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/global1/global1/global1.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | void foo1(); 3 | void foo2(); 4 | 5 | int a = 5; 6 | int b = 7; 7 | 8 | /** address: 0x10000498 */ 9 | int main(int argc, char *argv[]) 10 | { 11 | foo1(); 12 | printf("b = %i\n", b); 13 | return 0; 14 | } 15 | 16 | /** address: 0x10000468 */ 17 | void foo1() 18 | { 19 | foo2(); 20 | return; 21 | } 22 | 23 | /** address: 0x10000418 */ 24 | void foo2() 25 | { 26 | b = 12; 27 | printf("a = %i\n", a); 28 | return; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/global1/global1/global1.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | void foo1(); 3 | void foo2(); 4 | 5 | int a = 5; 6 | int b = 7; 7 | 8 | /** address: 0x0804835d */ 9 | int main(int argc, char *argv[]) 10 | { 11 | foo1(); 12 | printf("b = %i\n", b); 13 | return 0; 14 | } 15 | 16 | /** address: 0x08048350 */ 17 | void foo1() 18 | { 19 | foo2(); 20 | return; 21 | } 22 | 23 | /** address: 0x08048328 */ 24 | void foo2() 25 | { 26 | b = 12; 27 | printf("a = %i\n", a); 28 | return; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | 10 | include(boomerang-utils) 11 | 12 | BOOMERANG_ADD_TEST( 13 | NAME ProjectTest 14 | SOURCES ProjectTest.h ProjectTest.cpp 15 | LIBRARIES boomerang ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} 16 | DEPENDENCIES 17 | boomerang-ElfLoader 18 | boomerang-X86FrontEnd 19 | ) 20 | -------------------------------------------------------------------------------- /src/boomerang/util/DFGWriter.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/core/BoomerangAPI.h" 14 | 15 | 16 | class UserProc; 17 | class QString; 18 | 19 | 20 | class BOOMERANG_API DFGWriter 21 | { 22 | public: 23 | void printDFG(const UserProc *proc, const QString &fname); 24 | }; 25 | -------------------------------------------------------------------------------- /tests/recompilation-tests/regalias.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int main() 14 | { 15 | int r; 16 | __asm__("movl $0x87654321, %%eax;" 17 | "movb $0x12, %%al;" 18 | "movb $0x34, %%ah" 19 | : "=a" (r)); 20 | 21 | printf("%08X\n", r); 22 | return EXIT_SUCCESS; 23 | } 24 | -------------------------------------------------------------------------------- /tests/recompilation-tests/regalias2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int main() 14 | { 15 | int r; 16 | __asm__("movl $0x87654321, %%edx;" 17 | "movb $0x12, %%dl;" 18 | "movb $0x34, %%dh" 19 | : "=d" (r)); 20 | 21 | printf("%08X\n", r); 22 | return EXIT_SUCCESS; 23 | } 24 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang-plugins/loader/MicroX86DisTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class MicroX86DisTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testMicroDis1(); 22 | void testMicroDis2(); 23 | }; 24 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/bswap/bswap/bswap.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | __size32 bswap(int param1); 3 | 4 | 5 | /** address: 0x0804837a */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int eax; // r24 9 | 10 | eax = bswap(0x12345678); 11 | printf("Output is %x\n", eax); 12 | return 0; 13 | } 14 | 15 | /** address: 0x08048370 */ 16 | __size32 bswap(int param1) 17 | { 18 | return (param1 & 0xff) << 24 | (param1 & 0xff00) << 8 | (unsigned int)(param1 & 0xff0000) >> 8 | (unsigned int)(param1 & ~0xffffff) >> 24; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tests/recompilation-tests/fib.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int fib(int x) 14 | { 15 | if (x <= 1) { 16 | return x; 17 | } 18 | else { 19 | return fib(x - 1) + fib(x - 2); 20 | } 21 | } 22 | 23 | 24 | int main() 25 | { 26 | printf("%i\n", fib(10)); 27 | return EXIT_SUCCESS; 28 | } 29 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/global2/global2/global2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | void foo1(); 3 | void foo2(); 4 | 5 | union { double; __size32; } a; 6 | int b; 7 | 8 | /** address: 0x00001d50 */ 9 | int main(int argc, char *argv[]) 10 | { 11 | foo1(); 12 | printf("b = %i\n", b); 13 | return 0; 14 | } 15 | 16 | /** address: 0x00001d24 */ 17 | void foo1() 18 | { 19 | foo2(); 20 | return; 21 | } 22 | 23 | /** address: 0x00001cb8 */ 24 | void foo2() 25 | { 26 | b = 12; 27 | printf("a = %f\n", a); 28 | return; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/visitor/expmodifier/ExpSimplifierTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class ExpSimplifierTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testSimplify(); 22 | void testSimplify_data(); 23 | }; 24 | -------------------------------------------------------------------------------- /src/boomerang/util/ProgSymbolWriter.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | class Prog; 14 | class QString; 15 | 16 | 17 | /** 18 | * Prints symbols of a Prog to a file. 19 | */ 20 | class ProgSymbolWriter 21 | { 22 | public: 23 | bool writeSymbolsToFile(const Prog *prog, const QString &dstFileName); 24 | }; 25 | -------------------------------------------------------------------------------- /tests/recompilation-tests/twoproc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | /* Compile with gcc -O4 -fno-inline -o ... or cc -xO4 -xinline= -o ... */ 9 | 10 | #include 11 | #include 12 | 13 | 14 | int proc1(int a, int b) 15 | { 16 | return a - b; 17 | } 18 | 19 | 20 | int main() 21 | { 22 | printf("%i\n", proc1(11, 4)); 23 | return EXIT_SUCCESS; 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/global2/global2/global2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | void foo1(); 3 | void foo2(); 4 | 5 | union { double; __size32; } a; 6 | int b = 7; 7 | 8 | /** address: 0x08048363 */ 9 | int main(int argc, char *argv[]) 10 | { 11 | foo1(); 12 | printf("b = %i\n", b); 13 | return 0; 14 | } 15 | 16 | /** address: 0x08048356 */ 17 | void foo1() 18 | { 19 | foo2(); 20 | return; 21 | } 22 | 23 | /** address: 0x08048328 */ 24 | void foo2() 25 | { 26 | b = 12; 27 | printf("a = %f\n", a); 28 | return; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/global3/global3/global3.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | void foo1(); 3 | void foo2(); 4 | 5 | long long a = 0x7048860ddf79LL; 6 | int b = 7; 7 | 8 | /** address: 0x08048363 */ 9 | int main(int argc, char *argv[]) 10 | { 11 | foo1(); 12 | printf("b = %i\n", b); 13 | return 0; 14 | } 15 | 16 | /** address: 0x08048356 */ 17 | void foo1() 18 | { 19 | foo2(); 20 | return; 21 | } 22 | 23 | /** address: 0x08048328 */ 24 | void foo2() 25 | { 26 | b = 12; 27 | printf("a = %lld\n", a); 28 | return; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang-cli/CommandLineDriverTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class CommandLineDriverTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void initTestCase(); 22 | void testApplyCommandline(); 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /src/boomerang/util/UseGraphWriter.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/core/BoomerangAPI.h" 14 | 15 | 16 | class UserProc; 17 | class QString; 18 | 19 | 20 | class BOOMERANG_API UseGraphWriter 21 | { 22 | public: 23 | void writeUseGraph(const UserProc *proc, const QString &fileName); 24 | }; 25 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/minmax2/minmax2/minmax2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001ccc */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g4; // r4 8 | 9 | printf("MinMax result %d\n", -2); 10 | printf("MinMax result %d\n", -2); 11 | printf("MinMax result %d\n", 0); 12 | g4 = argc; 13 | if (argc < -2) { 14 | g4 = -2; 15 | } 16 | if (g4 > 3) { 17 | g4 = 3; 18 | } 19 | printf("MinMax result %d\n", g4); 20 | printf("MinMax result %d\n", 3); 21 | return 0; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/minmax2/minmax2/minmax2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000460 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g4; // r4 8 | 9 | printf("MinMax result %d\n", -2); 10 | printf("MinMax result %d\n", -2); 11 | printf("MinMax result %d\n", 0); 12 | g4 = argc; 13 | if (argc < -2) { 14 | g4 = -2; 15 | } 16 | if (g4 > 3) { 17 | g4 = 3; 18 | } 19 | printf("MinMax result %d\n", g4); 20 | printf("MinMax result %d\n", 3); 21 | return 0; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/ssl/type/TypeTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class TypeTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testNotEqual(); 22 | void testIsCString(); 23 | void testNewIntegerLikeType(); 24 | }; 25 | -------------------------------------------------------------------------------- /src/boomerang/ssl/statements/StatementHelper.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/ssl/statements/Statement.h" 14 | 15 | // Common to BranchStatement and BoolAssign 16 | // Return true if this is now a floating point branch 17 | bool BOOMERANG_API condToRelational(SharedExp &condExp, BranchType jtCond); 18 | -------------------------------------------------------------------------------- /src/boomerang/util/CallGraphDotWriter.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/core/BoomerangAPI.h" 14 | 15 | 16 | class Prog; 17 | class QString; 18 | 19 | 20 | class BOOMERANG_API CallGraphDotWriter 21 | { 22 | public: 23 | bool writeCallGraph(const Prog *prog, const QString &dstFileName); 24 | }; 25 | -------------------------------------------------------------------------------- /tests/recompilation-tests/stattest.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | int main(int argc, char* argv[]) 15 | { 16 | struct stat st; 17 | const int res = stat("test/source/stattest.c", &st); 18 | 19 | printf("Stat returns %d; size of file is %d\n", res, st.st_size); 20 | 21 | return res; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tests/recompilation-tests/sumarray.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int a[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; 14 | 15 | 16 | int main() 17 | { 18 | int sum = 0; 19 | int i; 20 | 21 | for (i=0; i < 10; i++) { 22 | sum += a[i]; 23 | } 24 | 25 | printf("Sum is %d\n", sum); 26 | return EXIT_SUCCESS; 27 | } 28 | -------------------------------------------------------------------------------- /src/boomerang-plugins/symbol/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | include(boomerang-utils) 10 | 11 | include_directories( 12 | "${CMAKE_SOURCE_DIR}/src" 13 | ) 14 | 15 | add_subdirectory(c/parser) 16 | 17 | BOOMERANG_ADD_SYMBOLPROVIDER( 18 | NAME "C" 19 | SOURCES 20 | c/CSymbolProvider.cpp 21 | c/CSymbolProvider.h 22 | LIBRARIES 23 | boomerang-ansic-parser 24 | ) 25 | -------------------------------------------------------------------------------- /tests/recompilation-tests/asgngoto.for: -------------------------------------------------------------------------------- 1 | program asgngoto 2 | 3 | integer num, dest 4 | 5 | print*, 'Input num:' 6 | read*, num 7 | 8 | assign 10 to dest 9 | if (num .eq. 2) assign 20 to dest 10 | if (num .eq. 3) assign 30 to dest 11 | if (num .eq. 4) assign 40 to dest 12 | 13 | * Here is the computed goto: 14 | goto dest, (20, 30, 40) 15 | 16 | 10 print*, 'Input out of range' 17 | return 18 | 20 print*, 'Two!' 19 | return 20 | 30 print*, 'Three!' 21 | return 22 | 40 print*, 'Four!' 23 | return 24 | end 25 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/sumarray/sumarray/sumarray.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d30 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g11; // r11 8 | int g4; // r4 9 | __size32 g4_1; // r4{4} 10 | int g5; // r5 11 | 12 | g4 = 0; 13 | g11 = 0x2020; 14 | if (SETFLAGS0(1)) { 15 | } 16 | do { 17 | g4_1 = g4; 18 | g5 = *g11; 19 | g11++; 20 | g4 = g4_1 + g5; 21 | } while (SETFLAGS0(1)); 22 | printf("Sum is %d\n", g4_1 + g5); 23 | return 0; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang-plugins/decoder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | include(boomerang-utils) 10 | 11 | BOOMERANG_ADD_TEST( 12 | NAME CapstonePPCDecoderTest 13 | SOURCES 14 | ppc/CapstonePPCDecoderTest.h 15 | ppc/CapstonePPCDecoderTest.cpp 16 | LIBRARIES 17 | boomerang-CapstonePPCDecoder 18 | DEPENDENCIES 19 | boomerang-CapstonePPCDecoder 20 | ) 21 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/visitor/expmodifier/ExpAddrSimplifierTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class ExpAddrSimplifierTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testSimplifyUnary(); 22 | void testSimplifyLocation(); 23 | }; 24 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/visitor/expmodifier/ExpArithSimplifierTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class ExpArithSimplifierTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testSimplifyUnary(); 22 | void testSimplifyBinary(); 23 | }; 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | **OS:** 5 | 6 | 7 | **Boomerang version or git hash:** 8 | 9 | 10 | 11 | **Steps to reproduce:** 12 | 1. 13 | 2. 14 | 15 | **Expected behaviour/output:** 16 | [...] 17 | 18 | **Actual behaviour/output:** 19 | [...] 20 | 21 | **Additional comments:** 22 | 23 | [...] 24 | 25 | -------------------------------------------------------------------------------- /data/signatures/posix/stropts.h: -------------------------------------------------------------------------------- 1 | 2 | int isastream(int fildes); 3 | int getmsg(int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp); 4 | int getpmsg(int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp, int *flagsp); 5 | int ioctl(int fildes, int request, ...); 6 | int putmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int flags); 7 | int putpmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int band, int flags); 8 | int fattach(int fildes, const char *path); 9 | int fdetach(const char *path); 10 | -------------------------------------------------------------------------------- /src/boomerang/util/log/ConsoleLogSink.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "ConsoleLogSink.h" 11 | 12 | #include 13 | 14 | #include 15 | 16 | 17 | void ConsoleLogSink::write(const QString &s) 18 | { 19 | std::cout << qPrintable(s); 20 | } 21 | 22 | 23 | void ConsoleLogSink::flush() 24 | { 25 | std::cout.flush(); 26 | } 27 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/chararray-O4/chararray-O4/chararray-O4.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048340 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | __size32 eax; // r24 8 | __size32 eax_1; // r24{5} 9 | __size32 eax_2; // r24{7} 10 | __size32 local0; // eax_1{5} 11 | 12 | eax = 0; 13 | local0 = eax; 14 | do { 15 | eax_1 = local0; 16 | *(__size8*)(eax_1 + esp - 76) = 0; 17 | eax_2 = eax_1 + 1; 18 | local0 = eax_2; 19 | } while (eax_1 + 1 <= 63); 20 | return 0; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang-plugins/loader/pe/Win32BinaryLoaderTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class Win32BinaryLoaderTest : public BoomerangTestWithPlugins 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | /// Test loading Windows programs 22 | void testWinLoad(); 23 | }; 24 | -------------------------------------------------------------------------------- /src/boomerang/db/DebugInfo.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/util/Address.h" 14 | 15 | #include 16 | 17 | 18 | class QString; 19 | 20 | using SharedType = std::shared_ptr; 21 | 22 | 23 | namespace DebugInfo 24 | { 25 | SharedType typeFromDebugInfo(const QString &name, Address addr); 26 | } 27 | -------------------------------------------------------------------------------- /src/boomerang/passes/dataflow/PhiPlacementPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | class PhiPlacementPass final : public IPass 17 | { 18 | public: 19 | PhiPlacementPass(); 20 | 21 | public: 22 | /// \copydoc IPass::execute 23 | bool execute(UserProc *proc) override; 24 | }; 25 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/db/GlobalTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class GlobalTest : public BoomerangTestWithPlugins 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testContainsAddress(); 22 | void testGetInitialValue(); 23 | void testReadInitialValue(); 24 | }; 25 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/ssl/statements/StatementHelperTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class StatementHelperTest : public BoomerangTestWithProject 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testCondToRelational(); 22 | void testCondToRelational_data(); 23 | }; 24 | -------------------------------------------------------------------------------- /data/signatures/posix/pwd.h: -------------------------------------------------------------------------------- 1 | 2 | struct passwd 3 | { 4 | char *pw_name; 5 | uid_t pw_uid; 6 | gid_t pw_gid; 7 | char *pw_dir; 8 | char *pw_shell; 9 | }; 10 | 11 | passwd *getpwnam(const char *name); 12 | passwd *getpwuid(uid_t uid); 13 | int getpwnam_r(const char *nam, struct passwd *pwd, char *buffer, 14 | size_t bufsize, struct passwd **result); 15 | int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, 16 | size_t bufsize, struct passwd **result); 17 | void endpwent(void); 18 | passwd *getpwent(void); 19 | void setpwent(void); 20 | -------------------------------------------------------------------------------- /tests/recompilation-tests/global1.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | int a = 5; 14 | int b = 7; 15 | 16 | 17 | void foo2() 18 | { 19 | b = 12; 20 | printf("a = %i\n", a); 21 | } 22 | 23 | 24 | void foo1() 25 | { 26 | foo2(); 27 | } 28 | 29 | 30 | int main() 31 | { 32 | foo1(); 33 | printf("b = %i\n", b); 34 | return EXIT_SUCCESS; 35 | } 36 | -------------------------------------------------------------------------------- /src/boomerang/passes/middle/ParameterSymbolMapPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | class ParameterSymbolMapPass final : public IPass 17 | { 18 | public: 19 | ParameterSymbolMapPass(); 20 | 21 | public: 22 | /// \copydoc IPass::execute 23 | bool execute(UserProc *proc) override; 24 | }; 25 | -------------------------------------------------------------------------------- /tests/recompilation-tests/global2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | double a = 5.2; 14 | int b = 7; 15 | 16 | 17 | void foo2() 18 | { 19 | b = 12; 20 | printf("a = %f\n", a); 21 | } 22 | 23 | 24 | void foo1() 25 | { 26 | foo2(); 27 | } 28 | 29 | 30 | int main() 31 | { 32 | foo1(); 33 | printf("b = %i\n", b); 34 | return EXIT_SUCCESS; 35 | } 36 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/fromssa2/fromssa2/fromssa2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001d34 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g9; // r9 8 | __size32 g9_1; // r9{2} 9 | __size32 g9_2; // r9{4} 10 | __size32 local0; // g9_1{2} 11 | 12 | g9 = 0; 13 | local0 = g9; 14 | do { 15 | g9_1 = local0; 16 | printf("%d ", g9_1 + 1); 17 | g9_2 = g9_1 + 1; 18 | local0 = g9_2; 19 | } while (g9_1 + 1 <= 9); 20 | printf("a is %d, x is %d\n", g9_1 + 1, g9_1 + 1); 21 | return 0; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/fromssa2/fromssa2/fromssa2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g9; // r9 8 | __size32 g9_1; // r9{2} 9 | __size32 g9_2; // r9{4} 10 | __size32 local0; // g9_1{2} 11 | 12 | g9 = 0; 13 | local0 = g9; 14 | do { 15 | g9_1 = local0; 16 | printf("%d ", g9_1 + 1); 17 | g9_2 = g9_1 + 1; 18 | local0 = g9_2; 19 | } while (g9_1 + 1 <= 9); 20 | printf("a is %d, x is %d\n", g9_1 + 1, g9_1 + 1); 21 | return 0; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/type/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | 10 | include(boomerang-utils) 11 | 12 | set(TESTS 13 | DataIntervalMapTest 14 | ) 15 | 16 | 17 | foreach(t ${TESTS}) 18 | BOOMERANG_ADD_TEST( 19 | NAME ${t} 20 | SOURCES ${t}.h ${t}.cpp 21 | LIBRARIES 22 | ${DEBUG_LIB} 23 | boomerang 24 | ${CMAKE_THREAD_LIBS_INIT} 25 | ) 26 | endforeach() 27 | -------------------------------------------------------------------------------- /src/boomerang/passes/middle/PreservationAnalysisPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | class PreservationAnalysisPass final : public IPass 17 | { 18 | public: 19 | PreservationAnalysisPass(); 20 | 21 | public: 22 | /// \copydoc IPass::execute 23 | bool execute(UserProc *proc) override; 24 | }; 25 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/fromssa2/fromssa2/fromssa2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048328 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | __size32 ebx; // r27 8 | __size32 ebx_1; // r27{2} 9 | __size32 ebx_2; // r27{3} 10 | __size32 local3; // ebx_1{2} 11 | 12 | ebx = 0; 13 | local3 = ebx; 14 | do { 15 | ebx_1 = local3; 16 | ebx_2 = ebx_1 + 1; 17 | local3 = ebx_2; 18 | printf("%d ", ebx_1 + 1); 19 | } while (ebx_1 + 1 <= 9); 20 | printf("a is %d, x is %d\n", 10, 10); 21 | return 0; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/localarray-O4/localarray-O4/localarray-O4.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048340 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | unsigned int eax; // r24 8 | unsigned int eax_1; // r24{3} 9 | unsigned int eax_2; // r24{5} 10 | unsigned int local0; // eax_1{3} 11 | 12 | eax = 0; 13 | local0 = eax; 14 | do { 15 | eax_1 = local0; 16 | *(__size32*)(esp + eax_1 * 4 - 268) = 0; 17 | eax_2 = eax_1 + 1; 18 | local0 = eax_2; 19 | } while (eax_1 + 1 <= 63); 20 | return 0; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/boomerang-plugins/codegen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | include(boomerang-utils) 10 | 11 | include_directories( 12 | "${CMAKE_SOURCE_DIR}/src" 13 | ) 14 | 15 | BOOMERANG_ADD_CODEGEN( 16 | NAME "C" 17 | SOURCES 18 | c/CCodeGenerator.cpp 19 | c/CCodeGenerator.h 20 | c/CodeWriter.cpp 21 | c/CodeWriter.h 22 | c/ControlFlowAnalyzer.cpp 23 | c/ControlFlowAnalyzer.h 24 | ) 25 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/manyparams/manyparams/manyparams.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | int global_0x00001fec = 0x9999999a; 4 | union { double; __size32; } global_0x00001ff4; 5 | 6 | /** address: 0x00001ca8 */ 7 | int main(int argc, char *argv[]) 8 | { 9 | double g5_1; // r5{3} 10 | long long g8_1; // r8{4} 11 | double local0; // m[g1 - 120] 12 | 13 | g5_1 = *0x1fe8; 14 | g8_1 = *0x1ff0; 15 | printf("Many parameters: %d, %.1f, %d, %.1f, %d, %.1f, %d, %.1f\n", 1, g5_1, global_0x00001fec, 2.8025969e-45, g8_1, global_0x00001ff4, 3, local0); 16 | return 0; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/twoproc2/twoproc2/twoproc2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | __size32 proc1(__size32 param1, __size32 param2); 3 | 4 | 5 | /** address: 0x08048333 */ 6 | int main(int argc, char *argv[]) 7 | { 8 | int eax; // r24 9 | 10 | eax = proc1(3, 4); 11 | printf("%i\n", eax); 12 | eax = proc1(5, 6); 13 | eax = printf("%i\n", eax); 14 | return eax; 15 | } 16 | 17 | /** address: 0x08048328 */ 18 | __size32 proc1(__size32 param1, __size32 param2) 19 | { 20 | __size32 eax; // r24 21 | 22 | eax = param2 + param1; 23 | return param2 + param1; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/boomerang/frontend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | 10 | list(APPEND boomerang-frontend-sources 11 | frontend/DefaultFrontEnd 12 | frontend/LiftedInstruction 13 | frontend/MachineInstruction 14 | frontend/SigEnum 15 | frontend/TargetQueue 16 | ) 17 | 18 | BOOMERANG_LIST_APPEND_FOREACH(boomerang-frontend-sources ".cpp") 19 | 20 | set(boomerang-sources "${boomerang-sources};${boomerang-frontend-sources}" PARENT_SCOPE) 21 | -------------------------------------------------------------------------------- /tests/recompilation-tests/global3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | long long a = 123456789012345; 14 | int b = 7; 15 | 16 | 17 | void foo2() 18 | { 19 | b = 12; 20 | printf("a = %lld\n", a); 21 | } 22 | 23 | 24 | void foo1() 25 | { 26 | foo2(); 27 | } 28 | 29 | 30 | int main() 31 | { 32 | foo1(); 33 | printf("b = %i\n", b); 34 | return EXIT_SUCCESS; 35 | } 36 | -------------------------------------------------------------------------------- /data/signatures/posix/termios.h: -------------------------------------------------------------------------------- 1 | 2 | speed_t cfgetispeed(const struct termios *termios_p); 3 | speed_t cfgetospeed(const struct termios *termios_p); 4 | int cfsetispeed(struct termios *termios_p, speed_t speed); 5 | int cfsetospeed(struct termios *termios_p, speed_t speed); 6 | int tcdrain(int fildes); 7 | int tcflow(int fildes, int action); 8 | int tcflush(int fildes, int queue_selector); 9 | int tcgetattr(int fildes, struct termios *termios_p); 10 | pid_t tcgetsid(int fildes); 11 | int tcsendbreak(int fildes, int duration); 12 | int tcsetattr(int fildes, int optional_actions, const struct termios *termios_p); 13 | -------------------------------------------------------------------------------- /src/boomerang/passes/dataflow/DominatorPass.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "DominatorPass.h" 11 | 12 | #include "boomerang/db/proc/UserProc.h" 13 | 14 | 15 | DominatorPass::DominatorPass() 16 | : IPass("Dominator", PassID::Dominators) 17 | { 18 | } 19 | 20 | 21 | bool DominatorPass::execute(UserProc *proc) 22 | { 23 | return proc->getDataFlow()->calculateDominators(); 24 | } 25 | -------------------------------------------------------------------------------- /src/boomerang/passes/middle/StrengthReductionReversalPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | class StrengthReductionReversalPass final : public IPass 17 | { 18 | public: 19 | StrengthReductionReversalPass(); 20 | 21 | public: 22 | /// \copydoc IPass::execute 23 | bool execute(UserProc *proc) override; 24 | }; 25 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/util/IntervalSetTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class IntervalSetTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testIsEmpty(); 22 | void testClear(); 23 | void testInsert(); 24 | void testEqualRange(); 25 | void testIsContained(); 26 | }; 27 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/manyparams/manyparams/manyparams.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | union { double; __size32; } global_0x00001fe8; 4 | int global_0x00001fec = 0x9999999a; 5 | long long global_0x00001ff0 = 0x400199999999999aLL; 6 | union { double; __size32; } global_0x00001ff4; 7 | 8 | /** address: 0x00001c78 */ 9 | int main(int argc, char *argv[]) 10 | { 11 | double local0; // m[g1 - 104] 12 | 13 | printf("Many parameters: %d, %.1f, %d, %.1f, %d, %.1f, %d, %.1f\n", 1, global_0x00001fe8, global_0x00001fec, 2.8025969e-45, global_0x00001ff0, global_0x00001ff4, 3, local0); 14 | return 0; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang-plugins/frontend/X86FrontEndTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class X86FrontEndTest : public BoomerangTestWithPlugins 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void test1(); 22 | void test2(); 23 | void test3(); 24 | void testFindMain(); 25 | void testBranch(); 26 | }; 27 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/ssl/type/CharTypeTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class CharTypeTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testConstruct(); 22 | void testEquals(); 23 | void testLess(); 24 | void testGetCtype(); 25 | void testIsCompatibleWith(); 26 | }; 27 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/ssl/type/FloatTypeTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class FloatTypeTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testConstruct(); 22 | void testEquals(); 23 | void testLess(); 24 | void testGetCtype(); 25 | void testIsCompatibleWith(); 26 | }; 27 | -------------------------------------------------------------------------------- /src/boomerang-plugins/type/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | include(boomerang-utils) 10 | 11 | include_directories( 12 | "${CMAKE_SOURCE_DIR}/src" 13 | ) 14 | 15 | BOOMERANG_ADD_TYPERECOVERY( 16 | NAME "DFA" 17 | SOURCES 18 | dfa/DFATypeAnalyzer.cpp 19 | dfa/DFATypeAnalyzer.h 20 | dfa/DFATypeRecovery.cpp 21 | dfa/DFATypeRecovery.h 22 | dfa/TypeRecovery.cpp 23 | dfa/TypeRecovery.h 24 | ) 25 | 26 | -------------------------------------------------------------------------------- /src/boomerang/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | 10 | list(APPEND boomerang-core-sources 11 | core/BoomerangAPI 12 | core/Project 13 | core/Settings 14 | core/Watcher 15 | core/plugin/Plugin 16 | core/plugin/PluginHandle 17 | core/plugin/PluginManager 18 | ) 19 | 20 | BOOMERANG_LIST_APPEND_FOREACH(boomerang-core-sources ".cpp") 21 | 22 | set(boomerang-sources "${boomerang-sources};${boomerang-core-sources}" PARENT_SCOPE) 23 | -------------------------------------------------------------------------------- /src/boomerang/passes/dataflow/DominatorPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | /// Calculates dominators for each Basic Block 17 | class DominatorPass final : public IPass 18 | { 19 | public: 20 | DominatorPass(); 21 | 22 | public: 23 | /// \copydoc IPass::execute 24 | bool execute(UserProc *proc) override; 25 | }; 26 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/ssl/type/BooleanTypeTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class BooleanTypeTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testConstruct(); 22 | void testEquals(); 23 | void testLess(); 24 | void testGetCtype(); 25 | void testIsCompatibleWith(); 26 | }; 27 | -------------------------------------------------------------------------------- /data/signatures/stdlib/fenv.h: -------------------------------------------------------------------------------- 1 | 2 | // Types 3 | typedef struct _fenv_t fenv_t; 4 | typedef struct _fexcept_t fexcept_t; 5 | 6 | // FP exceptions 7 | int feclearexcept(int excepts); 8 | int feraiseexcept(int excepts); 9 | int fegetexceptflag(fexcept_t *flagp, int excepts); 10 | int fesetexceptflag(const fexcept_t *flagp, int excepts); 11 | 12 | // rounding mode 13 | int fegetround(void); 14 | int fesetround(int rdir); 15 | 16 | // Entire FP environment 17 | int fegetenv(fenv_t *envp); 18 | int fesetenv(const fenv_t *envp); 19 | int feholdexcept(fenv_t *envp); 20 | int feupdateenv(const fenv_t *envp); 21 | 22 | // Other 23 | int fetestexcept(int excepts); 24 | -------------------------------------------------------------------------------- /src/boomerang/passes/dataflow/PhiPlacementPass.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "PhiPlacementPass.h" 11 | 12 | #include "boomerang/db/proc/UserProc.h" 13 | 14 | 15 | PhiPlacementPass::PhiPlacementPass() 16 | : IPass("PhiPlacement", PassID::PhiPlacement) 17 | { 18 | } 19 | 20 | 21 | bool PhiPlacementPass::execute(UserProc *proc) 22 | { 23 | return proc->getDataFlow()->placePhiFunctions(); 24 | } 25 | -------------------------------------------------------------------------------- /src/boomerang/passes/early/StatementInitPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | /// Initializes statements before decompilation. 17 | class StatementInitPass final : public IPass 18 | { 19 | public: 20 | StatementInitPass(); 21 | 22 | public: 23 | /// \copydoc IPass::execute 24 | bool execute(UserProc *proc) override; 25 | }; 26 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/o4/uns/uns/uns.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001c98 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | if ((unsigned int)argc > (unsigned int)0xee6b27ff) { 8 | printf("Population exceeds %u\n", (unsigned int)0xee6b2800); 9 | } 10 | if ((unsigned int)argc <= (unsigned int)0xefffffff) { 11 | printf("The mask is %x\n", (unsigned int)0xf0000000); 12 | } 13 | if ((unsigned int)argc > 1) { 14 | puts("Arguments supplied"); 15 | } 16 | if (0 - argc < -2) { 17 | puts("Three or more arguments"); 18 | } 19 | return 0; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /src/boomerang/passes/late/LocalTypeAnalysisPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | /// Executes type analysis on a function. 17 | class LocalTypeAnalysisPass final : public IPass 18 | { 19 | public: 20 | LocalTypeAnalysisPass(); 21 | 22 | public: 23 | /// \copydoc IPass::execute 24 | bool execute(UserProc *proc) override; 25 | }; 26 | -------------------------------------------------------------------------------- /tests/recompilation-tests/funcptr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Boomerang Decompiler. 3 | * 4 | * See the file "LICENSE.TERMS" for information on usage and 5 | * redistribution of this file, and for a DISCLAIMER OF ALL 6 | * WARRANTIES. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | 13 | typedef void (*FPTR)(); 14 | 15 | 16 | void hello() 17 | { 18 | printf("Hello, "); 19 | } 20 | 21 | 22 | void world() 23 | { 24 | printf("world!\n"); 25 | } 26 | 27 | 28 | int main() 29 | { 30 | FPTR p; 31 | 32 | p = hello; 33 | (*p)(); 34 | 35 | p = world; 36 | (*p)(); 37 | 38 | return EXIT_SUCCESS; 39 | } 40 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/minmax2/minmax2/minmax2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | void test(int param1); 3 | 4 | 5 | /** address: 0x00001d44 */ 6 | int main(int argc, char *argv[]) 7 | { 8 | test(-5); 9 | test(-2); 10 | test(0); 11 | test(argc); 12 | test(5); 13 | return 0; 14 | } 15 | 16 | /** address: 0x00001cd0 */ 17 | void test(int param1) 18 | { 19 | int local0; // m[g1 + 24] 20 | 21 | local0 = param1; 22 | if (param1 < -2) { 23 | local0 = -2; 24 | } 25 | if (local0 > 3) { 26 | local0 = 3; 27 | } 28 | printf("MinMax result %d\n", local0); 29 | return; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/OSX/uns/uns/uns.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x00001c94 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | if ((unsigned int)argc > (unsigned int)0xee6b27ff) { 8 | printf("Population exceeds %u\n", (unsigned int)0xee6b2800); 9 | } 10 | if ((unsigned int)argc <= (unsigned int)0xefffffff) { 11 | printf("The mask is %x\n", (unsigned int)0xf0000000); 12 | } 13 | if ((unsigned int)argc > 1) { 14 | printf("Arguments supplied\n"); 15 | } 16 | if (0 - argc < -2) { 17 | printf("Three or more arguments\n"); 18 | } 19 | return 0; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/minmax2/minmax2/minmax2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | void test(int param1); 3 | 4 | 5 | /** address: 0x1000048c */ 6 | int main(int argc, char *argv[]) 7 | { 8 | test(-5); 9 | test(-2); 10 | test(0); 11 | test(argc); 12 | test(5); 13 | return 0; 14 | } 15 | 16 | /** address: 0x10000418 */ 17 | void test(int param1) 18 | { 19 | int local0; // m[g1 - 24] 20 | 21 | local0 = param1; 22 | if (param1 < -2) { 23 | local0 = -2; 24 | } 25 | if (local0 > 3) { 26 | local0 = 3; 27 | } 28 | printf("MinMax result %d\n", local0); 29 | return; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/uns/uns/uns.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x10000418 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | if ((unsigned int)argc > (unsigned int)0xee6b27ff) { 8 | printf("Population exceeds %u\n", (unsigned int)0xee6b2800); 9 | } 10 | if ((unsigned int)argc <= (unsigned int)0xefffffff) { 11 | printf("The mask is %x\n", (unsigned int)0xf0000000); 12 | } 13 | if ((unsigned int)argc > 1) { 14 | printf("Arguments supplied\n"); 15 | } 16 | if (0 - argc < -2) { 17 | printf("Three or more arguments\n"); 18 | } 19 | return 0; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/uns/uns/uns.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x08048328 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | if ((unsigned int)argc > (unsigned int)0xee6b27ff) { 8 | printf("Population exceeds %u\n", (unsigned int)0xee6b2800); 9 | } 10 | if ((unsigned int)argc <= (unsigned int)0xefffffff) { 11 | printf("The mask is %x\n", (unsigned int)0xf0000000); 12 | } 13 | if ((unsigned int)argc > 1) { 14 | printf("Arguments supplied\n"); 15 | } 16 | if (0 - argc < -2) { 17 | printf("Three or more arguments\n"); 18 | } 19 | return 0; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /src/boomerang/passes/late/LocalAndParamMapPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | /// Map expressions to locals and initial parameters 17 | class LocalAndParamMapPass final : public IPass 18 | { 19 | public: 20 | LocalAndParamMapPass(); 21 | 22 | public: 23 | /// \copydoc IPass::execute 24 | bool execute(UserProc *proc) override; 25 | }; 26 | -------------------------------------------------------------------------------- /src/boomerang/passes/middle/CallAndPhiFixPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | /// Perform call and phi statement bypassing at all depths 17 | class CallAndPhiFixPass final : public IPass 18 | { 19 | public: 20 | CallAndPhiFixPass(); 21 | 22 | public: 23 | /// \copydoc IPass::execute 24 | bool execute(UserProc *proc) override; 25 | }; 26 | -------------------------------------------------------------------------------- /src/boomerang/visitor/stmtexpvisitor/StmtConstFinder.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/visitor/stmtexpvisitor/StmtExpVisitor.h" 14 | 15 | 16 | class ConstFinder; 17 | 18 | 19 | /** 20 | * 21 | */ 22 | class BOOMERANG_API StmtConstFinder : public StmtExpVisitor 23 | { 24 | public: 25 | StmtConstFinder(ConstFinder *v); 26 | virtual ~StmtConstFinder() = default; 27 | }; 28 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/x86/twoproc3/twoproc3/twoproc3.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | __size32 getDevice(__size32 param1); 3 | 4 | 5 | /** address: 0x0804847f */ 6 | int main(int argc, char *argv[]) 7 | { 8 | pciVideoRec *eax; // r24 9 | pciVideoRec **eax_1; // r24 10 | int eax_2; // r24 11 | 12 | eax_1 = xf86GetPciVideoInfo(); 13 | eax = *eax_1; 14 | eax_2 = getDevice(eax); 15 | printf("%i\n", eax_2); 16 | return 0; 17 | } 18 | 19 | /** address: 0x08048474 */ 20 | __size32 getDevice(__size32 param1) 21 | { 22 | __size32 eax; // r24 23 | 24 | eax = *(param1 + 24); 25 | return eax; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/boomerang/db/module/ModuleFactory.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "ModuleFactory.h" 11 | 12 | #include "boomerang/db/module/Class.h" 13 | 14 | 15 | Module *DefaultModFactory::create(const QString &name, Prog *prog) const 16 | { 17 | return new Module(name, prog); 18 | } 19 | 20 | 21 | Module *ClassModFactory::create(const QString &name, Prog *prog) const 22 | { 23 | return new Class(name, prog); 24 | } 25 | -------------------------------------------------------------------------------- /src/boomerang/passes/middle/DuplicateArgsRemovalPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | /// Eliminates duplicate arguments of calls. 17 | class DuplicateArgsRemovalPass final : public IPass 18 | { 19 | public: 20 | DuplicateArgsRemovalPass(); 21 | 22 | public: 23 | /// \copydoc IPass::execute 24 | bool execute(UserProc *proc) override; 25 | }; 26 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/global3/global3/global3.c: -------------------------------------------------------------------------------- 1 | int main(int argc, union { long long; char *[] *; } argv); 2 | void foo1(long long param1); 3 | void foo2(long long param1); 4 | 5 | int b = 7; 6 | 7 | /** address: 0x100004a0 */ 8 | int main(int argc, union { long long; char *[] *; } argv) 9 | { 10 | foo1(argv); 11 | printf("b = %i\n", b); 12 | return 0; 13 | } 14 | 15 | /** address: 0x10000470 */ 16 | void foo1(long long param1) 17 | { 18 | foo2(param1); 19 | return; 20 | } 21 | 22 | /** address: 0x10000418 */ 23 | void foo2(long long param1) 24 | { 25 | b = 12; 26 | printf("a = %lld\n", param1); 27 | return; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/db/binary/BinarySectionTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class BinarySectionTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testIsAddressBss(); 22 | void testAnyDefinedValues(); 23 | void testResize(); 24 | void testAddDefinedArea(); 25 | 26 | void testAttributes(); 27 | }; 28 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/ssl/type/MeetTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | /** 17 | * Tests the Data Flow based type analysis code 18 | */ 19 | class MeetTest : public BoomerangTest 20 | { 21 | Q_OBJECT 22 | 23 | private slots: 24 | /// Test meeting IntegerTypes with various other types 25 | void testMeet(); 26 | void testMeet_data(); 27 | }; 28 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/type/DataIntervalMapTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class DataIntervalMapTest : public BoomerangTestWithPlugins 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testDataInterval(); 22 | void testDataIntervalOverlaps(); 23 | 24 | void testIsClear(); 25 | void testFind(); 26 | void testInsert(); 27 | }; 28 | -------------------------------------------------------------------------------- /src/boomerang/passes/late/CallLivenessRemovalPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | /// Remove all liveness info in UseCollectors in calls 17 | class CallLivenessRemovalPass final : public IPass 18 | { 19 | public: 20 | CallLivenessRemovalPass(); 21 | 22 | public: 23 | /// \copydoc IPass::execute 24 | bool execute(UserProc *proc) override; 25 | }; 26 | -------------------------------------------------------------------------------- /src/boomerang/passes/middle/SPPreservationPass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | /// Analyze whether the stack pointer is preserved by a function. 17 | class SPPreservationPass final : public IPass 18 | { 19 | public: 20 | SPPreservationPass(); 21 | 22 | public: 23 | /// \copydoc IPass::execute 24 | bool execute(UserProc *proc) override; 25 | }; 26 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/ssl/type/NamedTypeTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class NamedTypeTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testConstruct(); 22 | void testEquals(); 23 | void testLess(); 24 | void testGetCtype(); 25 | void testResolvesTo(); 26 | void testIsCompatibleWith(); 27 | }; 28 | -------------------------------------------------------------------------------- /src/boomerang-gui/Main.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | 11 | 12 | #include "boomerang-gui/MainWindow.h" 13 | 14 | #include "boomerang/util/log/Log.h" 15 | 16 | #include 17 | 18 | 19 | int main(int argc, char *argv[]) 20 | { 21 | QApplication app(argc, argv); 22 | app.setWindowIcon(QIcon(":/boomerang_icon.png")); 23 | MainWindow mainWindow; 24 | 25 | mainWindow.show(); 26 | return app.exec(); 27 | } 28 | -------------------------------------------------------------------------------- /src/boomerang/passes/call/CallArgumentUpdatePass.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "boomerang/passes/Pass.h" 14 | 15 | 16 | class UserProc; 17 | 18 | 19 | /// Update arguments in calls 20 | class CallArgumentUpdatePass final : public IPass 21 | { 22 | public: 23 | CallArgumentUpdatePass(); 24 | 25 | public: 26 | /// \copydoc IPass::execute 27 | bool execute(UserProc *proc) override; 28 | }; 29 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/ssl/type/FuncTypeTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class FuncTypeTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testConstruct(); 22 | void testEquals(); 23 | void testLess(); 24 | void testGetCtype(); 25 | void testGetReturnAndParam(); 26 | void testIsCompatibleWith(); 27 | }; 28 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/o4/phi2/phi2/phi2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char *argv[]); 2 | 3 | 4 | /** address: 0x100004f0 */ 5 | int main(int argc, char *argv[]) 6 | { 7 | int g3; // r3 8 | unsigned int g30; // r30 9 | unsigned int g31; // r31 10 | unsigned int g3_1; // r3 11 | int g5; // r5 12 | 13 | g5 = *(argv + 4); 14 | if (argc > 2) { 15 | g3_1 = strlen(g5); 16 | g31 = g3; 17 | g30 = g3; 18 | printf("%d", g3 * 2); 19 | } 20 | else { 21 | g3_1 = strlen(g5); 22 | g31 = g3_1; 23 | } 24 | printf("%d, %d", g31, g30); 25 | printf("%d\n", g31); 26 | return 0; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang-plugins/decoder/ppc/CapstonePPCDecoderTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class CapstonePPCDecoderTest : public BoomerangTestWithPlugins 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void initTestCase(); 22 | 23 | void testInstructions(); 24 | void testInstructions_data(); 25 | 26 | private: 27 | IDecoder *m_decoder; 28 | }; 29 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang-plugins/frontend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | 10 | include(boomerang-utils) 11 | 12 | 13 | BOOMERANG_ADD_TEST( 14 | NAME X86FrontEndTest 15 | SOURCES X86FrontEndTest.h X86FrontEndTest.cpp 16 | LIBRARIES 17 | ${DEBUG_LIB} 18 | boomerang 19 | ${CMAKE_DL_LIBS} 20 | ${CMAKE_THREAD_LIBS_INIT} 21 | boomerang-X86FrontEnd 22 | DEPENDENCIES 23 | boomerang-ElfLoader 24 | boomerang-X86FrontEnd 25 | ) 26 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/ssl/statements/PhiAssignTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class PhiAssignTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testClone(); 22 | void testGetDefinitions(); 23 | void testDefinesLoc(); 24 | void testSearch(); 25 | void testSearchAll(); 26 | void testSearchAndReplace(); 27 | }; 28 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/util/ConnectionGraphTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class ConnectionGraphTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testAdd(); 22 | void testConnect(); 23 | void testCount(); 24 | void testIsConnected(); 25 | void testAllRefsHaveDefs(); 26 | void testUpdateConnection(); 27 | }; 28 | -------------------------------------------------------------------------------- /tests/unit-tests/boomerang/util/IntervalMapTest.h: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #pragma once 11 | 12 | 13 | #include "TestUtils.h" 14 | 15 | 16 | class IntervalMapTest : public BoomerangTest 17 | { 18 | Q_OBJECT 19 | 20 | private slots: 21 | void testIsEmpty(); 22 | void testClear(); 23 | void testInsert(); 24 | void testErase(); 25 | void testEraseAll(); 26 | void testFind(); 27 | void testEqualRange(); 28 | }; 29 | -------------------------------------------------------------------------------- /tests/regression-tests/expected-outputs/ppc/global2/global2/global2.c: -------------------------------------------------------------------------------- 1 | int main(int argc, union { double; char *[] *; } argv); 2 | void foo1(union { double; __size32; } param1); 3 | void foo2(double param1); 4 | 5 | int b = 7; 6 | 7 | /** address: 0x10000498 */ 8 | int main(int argc, union { double; char *[] *; } argv) 9 | { 10 | foo1(argv); 11 | printf("b = %i\n", b); 12 | return 0; 13 | } 14 | 15 | /** address: 0x10000468 */ 16 | void foo1(union { double; __size32; } param1) 17 | { 18 | foo2(param1); 19 | return; 20 | } 21 | 22 | /** address: 0x10000418 */ 23 | void foo2(double param1) 24 | { 25 | b = 12; 26 | printf("a = %f\n", param1); 27 | return; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/boomerang/decomp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of the Boomerang Decompiler. 3 | # 4 | # See the file "LICENSE.TERMS" for information on usage and 5 | # redistribution of this file, and for a DISCLAIMER OF ALL 6 | # WARRANTIES. 7 | # 8 | 9 | 10 | list(APPEND boomerang-decomp-sources 11 | decomp/CFGCompressor 12 | decomp/IndirectJumpAnalyzer 13 | decomp/InterferenceFinder 14 | decomp/LivenessAnalyzer 15 | decomp/ProcDecompiler 16 | decomp/ProgDecompiler 17 | decomp/UnusedReturnRemover 18 | ) 19 | 20 | BOOMERANG_LIST_APPEND_FOREACH(boomerang-decomp-sources ".cpp") 21 | 22 | set(boomerang-sources "${boomerang-sources};${boomerang-decomp-sources}" PARENT_SCOPE) 23 | -------------------------------------------------------------------------------- /src/boomerang/ssl/exp/ExpHelp.cpp: -------------------------------------------------------------------------------- 1 | #pragma region License 2 | /* 3 | * This file is part of the Boomerang Decompiler. 4 | * 5 | * See the file "LICENSE.TERMS" for information on usage and 6 | * redistribution of this file, and for a DISCLAIMER OF ALL 7 | * WARRANTIES. 8 | */ 9 | #pragma endregion License 10 | #include "ExpHelp.h" 11 | 12 | #include "boomerang/ssl/exp/Exp.h" 13 | #include "boomerang/ssl/statements/Assign.h" 14 | #include "boomerang/util/log/Log.h" 15 | 16 | 17 | // A helper class for comparing Exp*'s sensibly 18 | bool lessExpStar::operator()(const SharedConstExp &left, const SharedConstExp &right) const 19 | { 20 | return (*left < *right); // Compare the actual Exps 21 | } 22 | --------------------------------------------------------------------------------