diff --git a/SConscript b/SConscript index 4b3050630087c5566a8f628c9f776e6c5d69dc0c..d1e4df9eb9ea88945b4b0ec705499622cd125c19 100644 --- a/SConscript +++ b/SConscript @@ -67,15 +67,23 @@ libcapstone=os.environ['SECURITY_TRANSFORMS_HOME']+"/lib/libcapstone.so" libehp=env.SConscript("libehp/SConscript", variant_dir='scons_build/libehp') libehp=env.Install("$SECURITY_TRANSFORMS_HOME/lib", libehp); -libtransform=SConscript("libtransform/SConscript", variant_dir='scons_build/libtransform') + +libIRDBcore=env.SConscript("libIRDB-core/src/SConscript", variant_dir='scons_build/libIRDB-core') +Depends(libIRDBcore,libcapstone) + +libIRDBcfg=env.SConscript("libIRDB-cfg/src/SConscript", variant_dir='scons_build/libIRDB-cfg') +libIRDButil=env.SConscript("libIRDB-util/src/SConscript", variant_dir='scons_build/libIRDB-util') +libIRDBsyscall=env.SConscript("libIRDB-syscall/src/SConscript", variant_dir='scons_build/libIRDB-syscall') +libElfDep=SConscript("libIRDB-elfdep/src/SConscript", variant_dir='scons_build/libIRDB-elfdep') +libtransform=SConscript("libIRDB-transform/src/SConscript", variant_dir='scons_build/libIRDB-transform') libEXEIO=SConscript("libEXEIO/SConscript", variant_dir='scons_build/libEXEIO') #libbea=SConscript("beaengine/SConscript", variant_dir='scons_build/beaengine') + libMEDSannotation=SConscript("libMEDSannotation/SConscript", variant_dir='scons_build/libMEDSannotation') # libxform=SConscript("xform/SConscript", variant_dir='scons_build/libxform') -libIRDB=SConscript("libIRDB/SConscript", variant_dir='scons_build/libIRDB') -Depends(libIRDB,libcapstone) +# libIRDB=SConscript("libIRDB/SConscript", variant_dir='scons_build/libIRDB') +# Depends(libIRDB,libcapstone) libStructDiv=SConscript("libStructDiv/SConscript", variant_dir='scons_build/libStructDiv') -libElfDep=SConscript("libElfDep/SConscript", variant_dir='scons_build/libElfDep') thanos=SConscript("thanos/SConscript", variant_dir='scons_build/thanos') rida=SConscript("rida/SConscript", variant_dir='scons_build/rida') meds2pdb=SConscript("meds2pdb/SConscript", variant_dir='scons_build/meds2pdb') @@ -91,10 +99,10 @@ if 'build_tools' not in env or env['build_tools'] is None or int(env['build_tool Depends(pedi,tools) if "PEDI_HOME" in os.environ: - Depends(pedi, (libehp,libtransform,libEXEIO,libMEDSannotation,libIRDB,libStructDiv,libElfDep, libcapstone, thanos, rida, meds2pdb, dump_map, dump_insns, ir_builders)) + Depends(pedi, (libIRDBcore, libIRDBcfg, libIRDButil, libIRDBcore, libehp,libtransform,libEXEIO,libMEDSannotation,libStructDiv,libElfDep, libcapstone, thanos, rida, meds2pdb, dump_map, dump_insns, ir_builders)) Default( pedi ) else: - Default(libehp,libtransform,libEXEIO,libMEDSannotation,libIRDB,libStructDiv,libElfDep, libcapstone, thanos, rida, meds2pdb, dump_map, dump_insns, ir_builders) + Default(libIRDBcore, libIRDBcfg, libIRDButil, libIRDBcore, libehp,libtransform,libEXEIO,libMEDSannotation,libStructDiv,libElfDep, libcapstone, thanos, rida, meds2pdb, dump_map, dump_insns, ir_builders) if 'build_tools' not in env or env['build_tools'] is None or int(env['build_tools']) == 1: Default(tools) diff --git a/libIRDB/include/cfg/BasicBlock.hpp b/libIRDB-cfg/include/BasicBlock.hpp similarity index 100% rename from libIRDB/include/cfg/BasicBlock.hpp rename to libIRDB-cfg/include/BasicBlock.hpp diff --git a/libIRDB/include/cfg/CFG.hpp b/libIRDB-cfg/include/CFG.hpp similarity index 100% rename from libIRDB/include/cfg/CFG.hpp rename to libIRDB-cfg/include/CFG.hpp diff --git a/libIRDB/include/cfg/callgraph.hpp b/libIRDB-cfg/include/callgraph.hpp similarity index 100% rename from libIRDB/include/cfg/callgraph.hpp rename to libIRDB-cfg/include/callgraph.hpp diff --git a/libIRDB/include/cfg/criticaledge.hpp b/libIRDB-cfg/include/criticaledge.hpp similarity index 100% rename from libIRDB/include/cfg/criticaledge.hpp rename to libIRDB-cfg/include/criticaledge.hpp diff --git a/libIRDB/include/cfg/domgraph.hpp b/libIRDB-cfg/include/domgraph.hpp similarity index 100% rename from libIRDB/include/cfg/domgraph.hpp rename to libIRDB-cfg/include/domgraph.hpp diff --git a/libIRDB/include/libIRDB-cfg.hpp b/libIRDB-cfg/include/libIRDB-cfg.hpp similarity index 86% rename from libIRDB/include/libIRDB-cfg.hpp rename to libIRDB-cfg/include/libIRDB-cfg.hpp index 25ed68d1d8b8bc9cedcb1cc068115e6c9daa9a7a..003113796c76bed60fd626b097b7ad11b00bef7d 100644 --- a/libIRDB/include/libIRDB-cfg.hpp +++ b/libIRDB-cfg/include/libIRDB-cfg.hpp @@ -31,11 +31,11 @@ #include <map> #include <ostream> -#include <cfg/BasicBlock.hpp> -#include <cfg/CFG.hpp> -#include <cfg/callgraph.hpp> -#include <cfg/domgraph.hpp> -#include <cfg/criticaledge.hpp> +#include <BasicBlock.hpp> +#include <CFG.hpp> +#include <callgraph.hpp> +#include <domgraph.hpp> +#include <criticaledge.hpp> #endif diff --git a/libIRDB/src/cfg/BasicBlock.cpp b/libIRDB-cfg/src/BasicBlock.cpp similarity index 100% rename from libIRDB/src/cfg/BasicBlock.cpp rename to libIRDB-cfg/src/BasicBlock.cpp diff --git a/libIRDB/src/cfg/CFG.cpp b/libIRDB-cfg/src/CFG.cpp similarity index 100% rename from libIRDB/src/cfg/CFG.cpp rename to libIRDB-cfg/src/CFG.cpp diff --git a/libIRDB/src/cfg/Makefile b/libIRDB-cfg/src/Makefile similarity index 100% rename from libIRDB/src/cfg/Makefile rename to libIRDB-cfg/src/Makefile diff --git a/libIRDB/src/cfg/SConscript b/libIRDB-cfg/src/SConscript similarity index 86% rename from libIRDB/src/cfg/SConscript rename to libIRDB-cfg/src/SConscript index b5caf9dea11d804cab8703c5bd541c44af958f66..b09d70d762d99825fdab5b46b0f48e86eedcdefd 100644 --- a/libIRDB/src/cfg/SConscript +++ b/libIRDB-cfg/src/SConscript @@ -13,7 +13,8 @@ files= ''' cpppath=''' $IRDB_SDK/include/ $SECURITY_TRANSFORMS_HOME/include/ - $SECURITY_TRANSFORMS_HOME/libIRDB/include/ + $SECURITY_TRANSFORMS_HOME/libIRDB-core/include/ + $SECURITY_TRANSFORMS_HOME/libIRDB-cfg/include/ ''' libpath=''' $SECURITY_TRANSFORMS_HOME/lib diff --git a/libIRDB/src/cfg/SConstruct b/libIRDB-cfg/src/SConstruct similarity index 100% rename from libIRDB/src/cfg/SConstruct rename to libIRDB-cfg/src/SConstruct diff --git a/libIRDB/src/cfg/callgraph.cpp b/libIRDB-cfg/src/callgraph.cpp similarity index 100% rename from libIRDB/src/cfg/callgraph.cpp rename to libIRDB-cfg/src/callgraph.cpp diff --git a/libIRDB/src/cfg/criticaledge.cpp b/libIRDB-cfg/src/criticaledge.cpp similarity index 100% rename from libIRDB/src/cfg/criticaledge.cpp rename to libIRDB-cfg/src/criticaledge.cpp diff --git a/libIRDB/src/cfg/domgraph.cpp b/libIRDB-cfg/src/domgraph.cpp similarity index 100% rename from libIRDB/src/cfg/domgraph.cpp rename to libIRDB-cfg/src/domgraph.cpp diff --git a/libIRDB/include/core/IRDB_Objects.hpp b/libIRDB-core/include/IRDB_Objects.hpp similarity index 100% rename from libIRDB/include/core/IRDB_Objects.hpp rename to libIRDB-core/include/IRDB_Objects.hpp diff --git a/libIRDB/include/core/address.hpp b/libIRDB-core/include/address.hpp similarity index 100% rename from libIRDB/include/core/address.hpp rename to libIRDB-core/include/address.hpp diff --git a/libIRDB/include/core/archdesc.hpp b/libIRDB-core/include/archdesc.hpp similarity index 100% rename from libIRDB/include/core/archdesc.hpp rename to libIRDB-core/include/archdesc.hpp diff --git a/libIRDB/include/core/baseobj.hpp b/libIRDB-core/include/baseobj.hpp similarity index 100% rename from libIRDB/include/core/baseobj.hpp rename to libIRDB-core/include/baseobj.hpp diff --git a/libIRDB/include/core/basetypes.hpp b/libIRDB-core/include/basetypes.hpp similarity index 100% rename from libIRDB/include/core/basetypes.hpp rename to libIRDB-core/include/basetypes.hpp diff --git a/libIRDB/include/core/dbinterface.hpp b/libIRDB-core/include/dbinterface.hpp similarity index 100% rename from libIRDB/include/core/dbinterface.hpp rename to libIRDB-core/include/dbinterface.hpp diff --git a/libIRDB/include/core/decode.hpp b/libIRDB-core/include/decode.hpp similarity index 100% rename from libIRDB/include/core/decode.hpp rename to libIRDB-core/include/decode.hpp diff --git a/libIRDB/include/core/decode_base.hpp b/libIRDB-core/include/decode_base.hpp similarity index 100% rename from libIRDB/include/core/decode_base.hpp rename to libIRDB-core/include/decode_base.hpp diff --git a/libIRDB/include/core/decode_csarm.hpp b/libIRDB-core/include/decode_csarm.hpp similarity index 100% rename from libIRDB/include/core/decode_csarm.hpp rename to libIRDB-core/include/decode_csarm.hpp diff --git a/libIRDB/include/core/decode_csx86.hpp b/libIRDB-core/include/decode_csx86.hpp similarity index 100% rename from libIRDB/include/core/decode_csx86.hpp rename to libIRDB-core/include/decode_csx86.hpp diff --git a/libIRDB/include/core/decode_dispatch.hpp b/libIRDB-core/include/decode_dispatch.hpp similarity index 100% rename from libIRDB/include/core/decode_dispatch.hpp rename to libIRDB-core/include/decode_dispatch.hpp diff --git a/libIRDB/include/core/doip.hpp b/libIRDB-core/include/doip.hpp similarity index 100% rename from libIRDB/include/core/doip.hpp rename to libIRDB-core/include/doip.hpp diff --git a/libIRDB/include/core/eh.hpp b/libIRDB-core/include/eh.hpp similarity index 100% rename from libIRDB/include/core/eh.hpp rename to libIRDB-core/include/eh.hpp diff --git a/libIRDB/include/core/file.hpp b/libIRDB-core/include/file.hpp similarity index 100% rename from libIRDB/include/core/file.hpp rename to libIRDB-core/include/file.hpp diff --git a/libIRDB/include/core/fileir.hpp b/libIRDB-core/include/fileir.hpp similarity index 100% rename from libIRDB/include/core/fileir.hpp rename to libIRDB-core/include/fileir.hpp diff --git a/libIRDB/include/core/function.hpp b/libIRDB-core/include/function.hpp similarity index 100% rename from libIRDB/include/core/function.hpp rename to libIRDB-core/include/function.hpp diff --git a/libIRDB/include/core/icfs.hpp b/libIRDB-core/include/icfs.hpp similarity index 100% rename from libIRDB/include/core/icfs.hpp rename to libIRDB-core/include/icfs.hpp diff --git a/libIRDB/include/core/instruction.hpp b/libIRDB-core/include/instruction.hpp similarity index 100% rename from libIRDB/include/core/instruction.hpp rename to libIRDB-core/include/instruction.hpp diff --git a/libIRDB/include/libIRDB-core.hpp b/libIRDB-core/include/libIRDB-core.hpp similarity index 64% rename from libIRDB/include/libIRDB-core.hpp rename to libIRDB-core/include/libIRDB-core.hpp index 157bc00bb63852bbb2f13c8e2d5371f2b69f90f9..681d93a330914a1953761dee21fb246b913d08b4 100644 --- a/libIRDB/include/libIRDB-core.hpp +++ b/libIRDB-core/include/libIRDB-core.hpp @@ -34,26 +34,26 @@ // include SDK #include <irdb-core> -#include <core/basetypes.hpp> -#include <core/dbinterface.hpp> -#include <core/doip.hpp> -#include <core/baseobj.hpp> -#include <core/reloc.hpp> -#include <core/address.hpp> -#include <core/icfs.hpp> -#include <core/instruction.hpp> -#include <core/file.hpp> -#include <core/function.hpp> -#include <core/variantid.hpp> -#include <core/archdesc.hpp> -#include <core/type.hpp> -#include <core/scoop.hpp> -#include <core/eh.hpp> -#include <core/fileir.hpp> -#include <core/pqxxdb.hpp> -#include <core/IRDB_Objects.hpp> -#include <core/transform_step.h> -#include <core/decode.hpp> +#include <basetypes.hpp> +#include <dbinterface.hpp> +#include <doip.hpp> +#include <baseobj.hpp> +#include <reloc.hpp> +#include <address.hpp> +#include <icfs.hpp> +#include <instruction.hpp> +#include <file.hpp> +#include <function.hpp> +#include <variantid.hpp> +#include <archdesc.hpp> +#include <type.hpp> +#include <scoop.hpp> +#include <eh.hpp> +#include <fileir.hpp> +#include <pqxxdb.hpp> +#include <IRDB_Objects.hpp> +#include <transform_step.h> +#include <decode.hpp> int command_to_stream(const std::string& command, std::ostream& stream); diff --git a/libIRDB/include/core/operand_base.hpp b/libIRDB-core/include/operand_base.hpp similarity index 100% rename from libIRDB/include/core/operand_base.hpp rename to libIRDB-core/include/operand_base.hpp diff --git a/libIRDB/include/core/operand_csarm.hpp b/libIRDB-core/include/operand_csarm.hpp similarity index 100% rename from libIRDB/include/core/operand_csarm.hpp rename to libIRDB-core/include/operand_csarm.hpp diff --git a/libIRDB/include/core/operand_csx86.hpp b/libIRDB-core/include/operand_csx86.hpp similarity index 100% rename from libIRDB/include/core/operand_csx86.hpp rename to libIRDB-core/include/operand_csx86.hpp diff --git a/libIRDB/include/core/operand_dispatch.hpp b/libIRDB-core/include/operand_dispatch.hpp similarity index 100% rename from libIRDB/include/core/operand_dispatch.hpp rename to libIRDB-core/include/operand_dispatch.hpp diff --git a/libIRDB/include/core/pqxxdb.hpp b/libIRDB-core/include/pqxxdb.hpp similarity index 100% rename from libIRDB/include/core/pqxxdb.hpp rename to libIRDB-core/include/pqxxdb.hpp diff --git a/libIRDB/include/core/reloc.hpp b/libIRDB-core/include/reloc.hpp similarity index 100% rename from libIRDB/include/core/reloc.hpp rename to libIRDB-core/include/reloc.hpp diff --git a/libIRDB/include/core/scoop.hpp b/libIRDB-core/include/scoop.hpp similarity index 100% rename from libIRDB/include/core/scoop.hpp rename to libIRDB-core/include/scoop.hpp diff --git a/libIRDB/include/core/transform_step.h b/libIRDB-core/include/transform_step.h similarity index 100% rename from libIRDB/include/core/transform_step.h rename to libIRDB-core/include/transform_step.h diff --git a/libIRDB/include/core/type.hpp b/libIRDB-core/include/type.hpp similarity index 100% rename from libIRDB/include/core/type.hpp rename to libIRDB-core/include/type.hpp diff --git a/libIRDB/include/core/variantid.hpp b/libIRDB-core/include/variantid.hpp similarity index 100% rename from libIRDB/include/core/variantid.hpp rename to libIRDB-core/include/variantid.hpp diff --git a/libIRDB/src/core/IRDB_Objects.cpp b/libIRDB-core/src/IRDB_Objects.cpp similarity index 100% rename from libIRDB/src/core/IRDB_Objects.cpp rename to libIRDB-core/src/IRDB_Objects.cpp diff --git a/libIRDB/src/core/SConscript b/libIRDB-core/src/SConscript similarity index 95% rename from libIRDB/src/core/SConscript rename to libIRDB-core/src/SConscript index 0e17eb064a5c485e4c2e5bbbda8c560c73dc2a3b..a98b3d156e385fe8ccc4ceeb536ca852bcd7969f 100644 --- a/libIRDB/src/core/SConscript +++ b/libIRDB-core/src/SConscript @@ -41,7 +41,7 @@ cpppath=''' . $IRDB_SDK/include/ $SECURITY_TRANSFORMS_HOME/include/ - $SECURITY_TRANSFORMS_HOME/libIRDB/include/ + $SECURITY_TRANSFORMS_HOME/libIRDB-core/include/ $SECURITY_TRANSFORMS_HOME/libcapstone/include/capstone/ ''' libpath=''' diff --git a/libIRDB/src/core/SConstruct b/libIRDB-core/src/SConstruct similarity index 100% rename from libIRDB/src/core/SConstruct rename to libIRDB-core/src/SConstruct diff --git a/libIRDB/src/core/address.cpp b/libIRDB-core/src/address.cpp similarity index 100% rename from libIRDB/src/core/address.cpp rename to libIRDB-core/src/address.cpp diff --git a/libIRDB/src/core/all.hpp b/libIRDB-core/src/all.hpp similarity index 100% rename from libIRDB/src/core/all.hpp rename to libIRDB-core/src/all.hpp diff --git a/libIRDB/src/core/baseobj.cpp b/libIRDB-core/src/baseobj.cpp similarity index 100% rename from libIRDB/src/core/baseobj.cpp rename to libIRDB-core/src/baseobj.cpp diff --git a/libIRDB/src/core/dbinterface.cpp b/libIRDB-core/src/dbinterface.cpp similarity index 100% rename from libIRDB/src/core/dbinterface.cpp rename to libIRDB-core/src/dbinterface.cpp diff --git a/libIRDB/src/core/decode_base.cpp b/libIRDB-core/src/decode_base.cpp similarity index 92% rename from libIRDB/src/core/decode_base.cpp rename to libIRDB-core/src/decode_base.cpp index ea40fe099c1c6c8d77c09c41b5cee9e3b21120e7..25e996b556c895ec1755e67804667818d5d279c3 100644 --- a/libIRDB/src/core/decode_base.cpp +++ b/libIRDB-core/src/decode_base.cpp @@ -1,11 +1,11 @@ #include <libIRDB-core.hpp> -#include <core/decode_base.hpp> -#include <core/operand_base.hpp> -#include <core/decode_csx86.hpp> -#include <core/operand_csx86.hpp> -#include <core/decode_csarm.hpp> -#include <core/operand_csarm.hpp> +#include <decode_base.hpp> +#include <operand_base.hpp> +#include <decode_csx86.hpp> +#include <operand_csx86.hpp> +#include <decode_csarm.hpp> +#include <operand_csarm.hpp> #include <exception> using namespace std; diff --git a/libIRDB/src/core/decode_csarm.cpp b/libIRDB-core/src/decode_csarm.cpp similarity index 98% rename from libIRDB/src/core/decode_csarm.cpp rename to libIRDB-core/src/decode_csarm.cpp index d48057dd32f4cf4ab28f25c0306071e32d299af0..497d92b2abdfc0f5d903baac223fc2e388b1253a 100644 --- a/libIRDB/src/core/decode_csarm.cpp +++ b/libIRDB-core/src/decode_csarm.cpp @@ -1,9 +1,9 @@ #include <libIRDB-core.hpp> -#include <core/decode_base.hpp> -#include <core/decode_csarm.hpp> -#include <core/operand_base.hpp> -#include <core/operand_csarm.hpp> +#include <decode_base.hpp> +#include <decode_csarm.hpp> +#include <operand_base.hpp> +#include <operand_csarm.hpp> #include <capstone.h> diff --git a/libIRDB/src/core/decode_csx86.cpp b/libIRDB-core/src/decode_csx86.cpp similarity index 99% rename from libIRDB/src/core/decode_csx86.cpp rename to libIRDB-core/src/decode_csx86.cpp index 9b2e5e20a7238f8e43ddbbf9a18b7ae46db9b4b5..c261c069e16dfca79dc32f723d2b53337adb4f31 100644 --- a/libIRDB/src/core/decode_csx86.cpp +++ b/libIRDB-core/src/decode_csx86.cpp @@ -1,9 +1,9 @@ #include <libIRDB-core.hpp> -#include <core/decode_base.hpp> -#include <core/decode_csx86.hpp> -#include <core/operand_base.hpp> -#include <core/operand_csx86.hpp> +#include <decode_base.hpp> +#include <decode_csx86.hpp> +#include <operand_base.hpp> +#include <operand_csx86.hpp> #include <capstone.h> #include <x86.h> diff --git a/libIRDB/src/core/decode_dispatch.cpp b/libIRDB-core/src/decode_dispatch.cpp similarity index 91% rename from libIRDB/src/core/decode_dispatch.cpp rename to libIRDB-core/src/decode_dispatch.cpp index 2f0c405e2c86f8a1894e31d8dfafe35d0c9cf259..97631d5cbad1dacf76a3a569b157251ee08f4c68 100644 --- a/libIRDB/src/core/decode_dispatch.cpp +++ b/libIRDB-core/src/decode_dispatch.cpp @@ -1,15 +1,15 @@ #include <libIRDB-core.hpp> -#include <core/decode_base.hpp> -#include <core/decode_csx86.hpp> -#include <core/decode_csarm.hpp> +#include <decode_base.hpp> +#include <decode_csx86.hpp> +#include <decode_csarm.hpp> -#include <core/operand_base.hpp> -#include <core/operand_csx86.hpp> -#include <core/operand_csarm.hpp> +#include <operand_base.hpp> +#include <operand_csx86.hpp> +#include <operand_csarm.hpp> -#include <core/decode_dispatch.hpp> -#include <core/operand_dispatch.hpp> +#include <decode_dispatch.hpp> +#include <operand_dispatch.hpp> using namespace libIRDB; diff --git a/libIRDB/src/core/eh.cpp b/libIRDB-core/src/eh.cpp similarity index 100% rename from libIRDB/src/core/eh.cpp rename to libIRDB-core/src/eh.cpp diff --git a/libIRDB/src/core/file.cpp b/libIRDB-core/src/file.cpp similarity index 100% rename from libIRDB/src/core/file.cpp rename to libIRDB-core/src/file.cpp diff --git a/libIRDB/src/core/fileir.cpp b/libIRDB-core/src/fileir.cpp similarity index 100% rename from libIRDB/src/core/fileir.cpp rename to libIRDB-core/src/fileir.cpp diff --git a/libIRDB/src/core/function.cpp b/libIRDB-core/src/function.cpp similarity index 100% rename from libIRDB/src/core/function.cpp rename to libIRDB-core/src/function.cpp diff --git a/libIRDB/src/core/generate_spri.cpp b/libIRDB-core/src/generate_spri.cpp similarity index 100% rename from libIRDB/src/core/generate_spri.cpp rename to libIRDB-core/src/generate_spri.cpp diff --git a/libIRDB/src/core/icfs.cpp b/libIRDB-core/src/icfs.cpp similarity index 100% rename from libIRDB/src/core/icfs.cpp rename to libIRDB-core/src/icfs.cpp diff --git a/libIRDB/src/core/instruction.cpp b/libIRDB-core/src/instruction.cpp similarity index 100% rename from libIRDB/src/core/instruction.cpp rename to libIRDB-core/src/instruction.cpp diff --git a/libIRDB/src/core/operand_csarm.cpp b/libIRDB-core/src/operand_csarm.cpp similarity index 98% rename from libIRDB/src/core/operand_csarm.cpp rename to libIRDB-core/src/operand_csarm.cpp index cd628548e760f2bc118f3bd730ac7915d399c8b0..01a20a17d5061ca3ed15f602c074ed6b06caeea2 100644 --- a/libIRDB/src/core/operand_csarm.cpp +++ b/libIRDB-core/src/operand_csarm.cpp @@ -1,10 +1,10 @@ #include <libIRDB-core.hpp> #include <memory> -#include <core/decode_base.hpp> -#include <core/decode_csarm.hpp> -#include <core/operand_base.hpp> -#include <core/operand_csarm.hpp> +#include <decode_base.hpp> +#include <decode_csarm.hpp> +#include <operand_base.hpp> +#include <operand_csarm.hpp> using namespace std; diff --git a/libIRDB/src/core/operand_csx86.cpp b/libIRDB-core/src/operand_csx86.cpp similarity index 99% rename from libIRDB/src/core/operand_csx86.cpp rename to libIRDB-core/src/operand_csx86.cpp index dec388b07b4f393592162d8e480c4359cd31e130..ce863a9ef45d60a35f2354a6fc2a5f81e0b65e91 100644 --- a/libIRDB/src/core/operand_csx86.cpp +++ b/libIRDB-core/src/operand_csx86.cpp @@ -1,10 +1,10 @@ #include <libIRDB-core.hpp> #include <memory> -#include <core/decode_base.hpp> -#include <core/decode_csx86.hpp> -#include <core/operand_base.hpp> -#include <core/operand_csx86.hpp> +#include <decode_base.hpp> +#include <decode_csx86.hpp> +#include <operand_base.hpp> +#include <operand_csx86.hpp> diff --git a/libIRDB/src/core/operand_dispatch.cpp b/libIRDB-core/src/operand_dispatch.cpp similarity index 93% rename from libIRDB/src/core/operand_dispatch.cpp rename to libIRDB-core/src/operand_dispatch.cpp index bf6c75146437dcc21322981d4655caa927e19e11..0790f4677cdeb2637ee5ce37efe3a3df004b59c5 100644 --- a/libIRDB/src/core/operand_dispatch.cpp +++ b/libIRDB-core/src/operand_dispatch.cpp @@ -1,9 +1,9 @@ #include <libIRDB-core.hpp> -#include <core/operand_csx86.hpp> -#include <core/decode_csx86.hpp> -#include <core/operand_dispatch.hpp> -#include <core/decode_dispatch.hpp> +#include <operand_csx86.hpp> +#include <decode_csx86.hpp> +#include <operand_dispatch.hpp> +#include <decode_dispatch.hpp> using namespace std; using namespace libIRDB; diff --git a/libIRDB/src/core/pqxxdb.cpp b/libIRDB-core/src/pqxxdb.cpp similarity index 100% rename from libIRDB/src/core/pqxxdb.cpp rename to libIRDB-core/src/pqxxdb.cpp diff --git a/libIRDB/src/core/reloc.cpp b/libIRDB-core/src/reloc.cpp similarity index 100% rename from libIRDB/src/core/reloc.cpp rename to libIRDB-core/src/reloc.cpp diff --git a/libIRDB/src/core/scoop.cpp b/libIRDB-core/src/scoop.cpp similarity index 100% rename from libIRDB/src/core/scoop.cpp rename to libIRDB-core/src/scoop.cpp diff --git a/libIRDB/src/core/type.cpp b/libIRDB-core/src/type.cpp similarity index 100% rename from libIRDB/src/core/type.cpp rename to libIRDB-core/src/type.cpp diff --git a/libIRDB/src/core/variantid.cpp b/libIRDB-core/src/variantid.cpp similarity index 100% rename from libIRDB/src/core/variantid.cpp rename to libIRDB-core/src/variantid.cpp diff --git a/libElfDep/SConscript b/libIRDB-elfdep/SConscript similarity index 100% rename from libElfDep/SConscript rename to libIRDB-elfdep/SConscript diff --git a/libElfDep/SConstruct b/libIRDB-elfdep/SConstruct similarity index 100% rename from libElfDep/SConstruct rename to libIRDB-elfdep/SConstruct diff --git a/libElfDep/src/SConscript b/libIRDB-elfdep/src/SConscript similarity index 100% rename from libElfDep/src/SConscript rename to libIRDB-elfdep/src/SConscript diff --git a/libElfDep/src/SConstruct b/libIRDB-elfdep/src/SConstruct similarity index 100% rename from libElfDep/src/SConstruct rename to libIRDB-elfdep/src/SConstruct diff --git a/libElfDep/src/elfdep.cpp b/libIRDB-elfdep/src/elfdep.cpp similarity index 94% rename from libElfDep/src/elfdep.cpp rename to libIRDB-elfdep/src/elfdep.cpp index 64d60dc87af3d49d78617429d3f581ef9c909327..91cd97a15a2c9306a19878c6249f26103645275f 100644 --- a/libElfDep/src/elfdep.cpp +++ b/libIRDB-elfdep/src/elfdep.cpp @@ -22,7 +22,6 @@ #include <irdb-core> #include <irdb-transform> #include <irdb-elfdep> -#include <libIRDB-core.hpp> #include <stdlib.h> #include <memory> #include <math.h> @@ -33,7 +32,13 @@ using namespace libIRDB; using namespace std; + +// use some of IRDB_SDK, without committing to all of it. +// it's too confusing to use libIRDB namespace as well as the IRDB_SDK namespace; using IRDB_SDK::VirtualOffset_t; +using IRDB_SDK::Relocation_t; +using IRDB_SDK::Instruction_t; +using IRDB_SDK::DataScoop_t; // defines #define REV_ALLOF(a) rbegin(a), rend(a) @@ -98,7 +103,7 @@ static void insert_into_scoop_at(const string &str, IRDB_SDK::DataScoop_t* scoop // so assert if we find something else for_each(firp->getRelocations().begin(), firp->getRelocations().end(), [scoop](IRDB_SDK::Relocation_t* reloc) { - auto wrt=dynamic_cast<libIRDB::DataScoop_t*>(reloc->getWRT()); + auto wrt=dynamic_cast<IRDB_SDK::DataScoop_t*>(reloc->getWRT()); assert(wrt != scoop || reloc->getType()=="dataptr_to_scoop"); }); @@ -109,7 +114,7 @@ static void insert_into_scoop_at(const string &str, IRDB_SDK::DataScoop_t* scoop for_each(scoop_to_update->getRelocations().begin(), scoop_to_update->getRelocations().end(), [&str,scoop,firp,scoop_to_update,at](IRDB_SDK::Relocation_t* reloc) { // if it's a reloc that's wrt scoop - auto wrt=dynamic_cast<libIRDB::DataScoop_t*>(reloc->getWRT()); + auto wrt=dynamic_cast<IRDB_SDK::DataScoop_t*>(reloc->getWRT()); if(wrt==scoop) { // then we need to update the scoop @@ -204,10 +209,14 @@ IRDB_SDK::Instruction_t* ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_El auto newinsn=addNewAssembly(labelstream.str()+": jmp [rel "+labelstream.str()+"]"); + /* auto newreloc=new Relocation_t(BaseObj_t::NOT_IN_DATABASE, 0, "pcrel", got_scoop); dynamic_cast<libIRDB::Instruction_t*>(newinsn)->GetRelocations().insert(newreloc); dynamic_cast<libIRDB::FileIR_t*>(getFileIR())->GetRelocations().insert(newreloc); + */ + auto newreloc=getFileIR()->addNewRelocation(newinsn, 0,"pcrel", got_scoop); + (void)newreloc; // just give to IR. newinsn->getAddress()->setFileID(getFileIR()->getFile()->getBaseID()); return newinsn; @@ -242,7 +251,7 @@ IRDB_SDK::Instruction_t* ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_El template<typename T_Elf_Sym, typename T_Elf_Rela, typename T_Elf_Dyn, int reloc_type, int rela_shift, int ptrsize> IRDB_SDK::DataScoop_t* ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_Elf_Rela,T_Elf_Dyn,reloc_type,rela_shift,ptrsize>::add_got_entry(const std::string& name) { - const auto firp=dynamic_cast<libIRDB::FileIR_t*>(getFileIR()); + const auto firp=getFileIR(); // dynamic_cast<libIRDB::FileIR_t*>(getFileIR()); // find relevant scoops auto dynamic_scoop=find_scoop(firp,".dynamic"); // auto gotplt_scoop=find_scoop(firp,".got.plt"); @@ -265,6 +274,7 @@ IRDB_SDK::DataScoop_t* ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_Elf_ // create a new, unpinned, rw+relro scoop that's an empty pointer. + /* auto start_addr=new AddressID_t(BaseObj_t::NOT_IN_DATABASE, firp->getFile()->getBaseID(), 0); auto end_addr=new AddressID_t(BaseObj_t::NOT_IN_DATABASE, firp->getFile()->getBaseID(), ptrsize-1); auto external_func_addr_scoop=new DataScoop_t(BaseObj_t::NOT_IN_DATABASE, @@ -273,6 +283,10 @@ IRDB_SDK::DataScoop_t* ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_Elf_ firp->GetAddresses().insert(start_addr); firp->GetAddresses().insert(end_addr); firp->GetDataScoops().insert(external_func_addr_scoop); + */ + auto start_addr=firp->addNewAddress(firp->getFile()->getBaseID(), 0); + auto end_addr =firp->addNewAddress(firp->getFile()->getBaseID(), ptrsize-1); + auto external_func_addr_scoop=firp->addNewDataScoop(name,start_addr,end_addr,NULL,6,true,new_got_entry_str); // add string to string table auto dl_str_pos=add_to_scoop(name+'\0', dynstr_scoop); @@ -316,9 +330,13 @@ IRDB_SDK::DataScoop_t* ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_Elf_ unsigned int at=rela_count*sizeof(T_Elf_Rela); insert_into_scoop_at<ptrsize>(dl_rel_str, relscoop, firp, at); + /* auto dl_reloc=new Relocation_t(BaseObj_t::NOT_IN_DATABASE, at+((uintptr_t)&dl_rel.r_offset -(uintptr_t)&dl_rel), "dataptr_to_scoop", external_func_addr_scoop); dynamic_cast<libIRDB::DataScoop_t*>(relscoop)->GetRelocations().insert(dl_reloc); firp->GetRelocations().insert(dl_reloc); + */ + auto dl_reloc=firp->addNewRelocation(relscoop,at+((uintptr_t)&dl_rel.r_offset -(uintptr_t)&dl_rel), "dataptr_to_scoop", external_func_addr_scoop); + (void)dl_reloc; // just give to IR; for(int i=0;i+sizeof(T_Elf_Dyn)<dynamic_scoop->getSize(); i+=sizeof(T_Elf_Dyn)) { @@ -418,7 +436,7 @@ bool ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_Elf_Rela,T_Elf_Dyn,rel template<typename T_Elf_Sym, typename T_Elf_Rela, typename T_Elf_Dyn, int reloc_type, int rela_shift, int ptrsize> void ElfDependencies_t::ElfDependenciesImpl_t<T_Elf_Sym,T_Elf_Rela,T_Elf_Dyn,reloc_type,rela_shift,ptrsize>::appendLibraryDepedencies(const string &libraryName) { - const auto firp=dynamic_cast<FileIR_t*>(getFileIR()); + const auto firp=getFileIR(); // dynamic_cast<FileIR_t*>(getFileIR()); auto dynamic_scoop=find_scoop(firp,".dynamic"); auto dynstr_scoop=find_scoop(firp,".dynstr"); diff --git a/libElfDep/src/libElfDep.hpp b/libIRDB-elfdep/src/libElfDep.hpp similarity index 100% rename from libElfDep/src/libElfDep.hpp rename to libIRDB-elfdep/src/libElfDep.hpp diff --git a/libElfDep/test/.gitignore b/libIRDB-elfdep/test/.gitignore similarity index 100% rename from libElfDep/test/.gitignore rename to libIRDB-elfdep/test/.gitignore diff --git a/libElfDep/test/SConscript b/libIRDB-elfdep/test/SConscript similarity index 100% rename from libElfDep/test/SConscript rename to libIRDB-elfdep/test/SConscript diff --git a/libElfDep/test/SConstruct b/libIRDB-elfdep/test/SConstruct similarity index 100% rename from libElfDep/test/SConstruct rename to libIRDB-elfdep/test/SConstruct diff --git a/libElfDep/test/edt.cpp b/libIRDB-elfdep/test/edt.cpp similarity index 100% rename from libElfDep/test/edt.cpp rename to libIRDB-elfdep/test/edt.cpp diff --git a/libElfDep/test/edt.hpp b/libIRDB-elfdep/test/edt.hpp similarity index 100% rename from libElfDep/test/edt.hpp rename to libIRDB-elfdep/test/edt.hpp diff --git a/libElfDep/test/edt_driver.cpp b/libIRDB-elfdep/test/edt_driver.cpp similarity index 100% rename from libElfDep/test/edt_driver.cpp rename to libIRDB-elfdep/test/edt_driver.cpp diff --git a/libElfDep/test/elf_dep_test.cpp b/libIRDB-elfdep/test/elf_dep_test.cpp similarity index 100% rename from libElfDep/test/elf_dep_test.cpp rename to libIRDB-elfdep/test/elf_dep_test.cpp diff --git a/libElfDep/test/test-elfdep.sh b/libIRDB-elfdep/test/test-elfdep.sh similarity index 100% rename from libElfDep/test/test-elfdep.sh rename to libIRDB-elfdep/test/test-elfdep.sh diff --git a/libIRDB/include/libIRDB-syscall.hpp b/libIRDB-syscall/include/libIRDB-syscall.hpp similarity index 96% rename from libIRDB/include/libIRDB-syscall.hpp rename to libIRDB-syscall/include/libIRDB-syscall.hpp index 4bd14ca59e190f323421090634005a7f2461dfd1..3ac7c4ccc9e94ae0436d7d16567bd9650a6dd135 100644 --- a/libIRDB/include/libIRDB-syscall.hpp +++ b/libIRDB-syscall/include/libIRDB-syscall.hpp @@ -30,7 +30,7 @@ #include <ostream> -#include <syscall/syscall.hpp> +#include <syscall.hpp> #endif diff --git a/libIRDB/include/syscall/syscall.hpp b/libIRDB-syscall/include/syscall.hpp similarity index 100% rename from libIRDB/include/syscall/syscall.hpp rename to libIRDB-syscall/include/syscall.hpp diff --git a/libIRDB/src/syscall/SConscript b/libIRDB-syscall/src/SConscript similarity index 85% rename from libIRDB/src/syscall/SConscript rename to libIRDB-syscall/src/SConscript index 687cc3632df5e4569196782b1a4437fb08014d09..b1d91ed7655ef3401ee373c067c1d06a7fefa917 100644 --- a/libIRDB/src/syscall/SConscript +++ b/libIRDB-syscall/src/SConscript @@ -12,7 +12,8 @@ files= ''' cpppath=''' $IRDB_SDK/include/ $SECURITY_TRANSFORMS_HOME/include/ - $SECURITY_TRANSFORMS_HOME/libIRDB/include/ + $SECURITY_TRANSFORMS_HOME/libIRDB-core/include/ + $SECURITY_TRANSFORMS_HOME/libIRDB-syscall/include/ ''' #myenv.Append(CCFLAGS=" -Wall -W -Wextra -Wconversion ") diff --git a/libIRDB/src/syscall/SConstruct b/libIRDB-syscall/src/SConstruct similarity index 100% rename from libIRDB/src/syscall/SConstruct rename to libIRDB-syscall/src/SConstruct diff --git a/libIRDB/src/syscall/syscall.cpp b/libIRDB-syscall/src/syscall.cpp similarity index 100% rename from libIRDB/src/syscall/syscall.cpp rename to libIRDB-syscall/src/syscall.cpp diff --git a/libtransform/Makefile b/libIRDB-transform/Makefile similarity index 100% rename from libtransform/Makefile rename to libIRDB-transform/Makefile diff --git a/libtransform/SConscript b/libIRDB-transform/SConscript similarity index 100% rename from libtransform/SConscript rename to libIRDB-transform/SConscript diff --git a/libtransform/SConstruct b/libIRDB-transform/SConstruct similarity index 100% rename from libtransform/SConstruct rename to libIRDB-transform/SConstruct diff --git a/libtransform/include-unused-delete-later/Makefile.in b/libIRDB-transform/include-unused-delete-later/Makefile.in similarity index 100% rename from libtransform/include-unused-delete-later/Makefile.in rename to libIRDB-transform/include-unused-delete-later/Makefile.in diff --git a/libtransform/include-unused-delete-later/Rewrite_Utility.hpp b/libIRDB-transform/include-unused-delete-later/Rewrite_Utility.hpp similarity index 100% rename from libtransform/include-unused-delete-later/Rewrite_Utility.hpp rename to libIRDB-transform/include-unused-delete-later/Rewrite_Utility.hpp diff --git a/libtransform/include-unused-delete-later/integertransform.cpp b/libIRDB-transform/include-unused-delete-later/integertransform.cpp similarity index 100% rename from libtransform/include-unused-delete-later/integertransform.cpp rename to libIRDB-transform/include-unused-delete-later/integertransform.cpp diff --git a/libtransform/include-unused-delete-later/integertransform.hpp b/libIRDB-transform/include-unused-delete-later/integertransform.hpp similarity index 100% rename from libtransform/include-unused-delete-later/integertransform.hpp rename to libIRDB-transform/include-unused-delete-later/integertransform.hpp diff --git a/libtransform/include-unused-delete-later/integertransform32.cpp b/libIRDB-transform/include-unused-delete-later/integertransform32.cpp similarity index 100% rename from libtransform/include-unused-delete-later/integertransform32.cpp rename to libIRDB-transform/include-unused-delete-later/integertransform32.cpp diff --git a/libtransform/include-unused-delete-later/integertransform32.hpp b/libIRDB-transform/include-unused-delete-later/integertransform32.hpp similarity index 100% rename from libtransform/include-unused-delete-later/integertransform32.hpp rename to libIRDB-transform/include-unused-delete-later/integertransform32.hpp diff --git a/libtransform/include-unused-delete-later/integertransform64.cpp b/libIRDB-transform/include-unused-delete-later/integertransform64.cpp similarity index 100% rename from libtransform/include-unused-delete-later/integertransform64.cpp rename to libIRDB-transform/include-unused-delete-later/integertransform64.cpp diff --git a/libtransform/include-unused-delete-later/integertransform64.hpp b/libIRDB-transform/include-unused-delete-later/integertransform64.hpp similarity index 100% rename from libtransform/include-unused-delete-later/integertransform64.hpp rename to libIRDB-transform/include-unused-delete-later/integertransform64.hpp diff --git a/libtransform/include-unused-delete-later/leapattern.cpp b/libIRDB-transform/include-unused-delete-later/leapattern.cpp similarity index 100% rename from libtransform/include-unused-delete-later/leapattern.cpp rename to libIRDB-transform/include-unused-delete-later/leapattern.cpp diff --git a/libtransform/include-unused-delete-later/leapattern.hpp b/libIRDB-transform/include-unused-delete-later/leapattern.hpp similarity index 100% rename from libtransform/include-unused-delete-later/leapattern.hpp rename to libIRDB-transform/include-unused-delete-later/leapattern.hpp diff --git a/libtransform/include-unused-delete-later/pointercheck64.cpp b/libIRDB-transform/include-unused-delete-later/pointercheck64.cpp similarity index 100% rename from libtransform/include-unused-delete-later/pointercheck64.cpp rename to libIRDB-transform/include-unused-delete-later/pointercheck64.cpp diff --git a/libtransform/include-unused-delete-later/pointercheck64.hpp b/libIRDB-transform/include-unused-delete-later/pointercheck64.hpp similarity index 100% rename from libtransform/include-unused-delete-later/pointercheck64.hpp rename to libIRDB-transform/include-unused-delete-later/pointercheck64.hpp diff --git a/libtransform/include-unused-delete-later/transform.hpp b/libIRDB-transform/include-unused-delete-later/transform.hpp similarity index 100% rename from libtransform/include-unused-delete-later/transform.hpp rename to libIRDB-transform/include-unused-delete-later/transform.hpp diff --git a/libtransform/src/SConscript b/libIRDB-transform/src/SConscript similarity index 80% rename from libtransform/src/SConscript rename to libIRDB-transform/src/SConscript index 2c81a4a305584ad72c67e29a9cfd5bc4b24de7f3..0c250bfeb153f70a9b77739937e968904158601a 100644 --- a/libtransform/src/SConscript +++ b/libIRDB-transform/src/SConscript @@ -11,7 +11,9 @@ files="rewrite_util.cpp transform.cpp" cpppath=''' $IRDB_SDK/include $SECURITY_TRANSFORMS_HOME/include - $SECURITY_TRANSFORMS_HOME/libIRDB/include + $SECURITY_TRANSFORMS_HOME/libIRDB-core/include + $SECURITY_TRANSFORMS_HOME/libIRDB-cfg/include + $SECURITY_TRANSFORMS_HOME/libIRDB-util/include $SECURITY_TRANSFORMS_HOME/libMEDSannotation/include/ ''' diff --git a/libtransform/src/SConstruct b/libIRDB-transform/src/SConstruct similarity index 100% rename from libtransform/src/SConstruct rename to libIRDB-transform/src/SConstruct diff --git a/libtransform/src/rewrite_util.cpp b/libIRDB-transform/src/rewrite_util.cpp similarity index 100% rename from libtransform/src/rewrite_util.cpp rename to libIRDB-transform/src/rewrite_util.cpp diff --git a/libtransform/src/transform.cpp b/libIRDB-transform/src/transform.cpp similarity index 100% rename from libtransform/src/transform.cpp rename to libIRDB-transform/src/transform.cpp diff --git a/libtransform/tests/Makefile b/libIRDB-transform/tests/Makefile similarity index 100% rename from libtransform/tests/Makefile rename to libIRDB-transform/tests/Makefile diff --git a/libtransform/tests/Makefile.pointers b/libIRDB-transform/tests/Makefile.pointers similarity index 100% rename from libtransform/tests/Makefile.pointers rename to libIRDB-transform/tests/Makefile.pointers diff --git a/libtransform/tests/austin/array.c b/libIRDB-transform/tests/austin/array.c similarity index 100% rename from libtransform/tests/austin/array.c rename to libIRDB-transform/tests/austin/array.c diff --git a/libtransform/tests/austin/branch.c b/libIRDB-transform/tests/austin/branch.c similarity index 100% rename from libtransform/tests/austin/branch.c rename to libIRDB-transform/tests/austin/branch.c diff --git a/libtransform/tests/austin/malloc.c b/libIRDB-transform/tests/austin/malloc.c similarity index 100% rename from libtransform/tests/austin/malloc.c rename to libIRDB-transform/tests/austin/malloc.c diff --git a/libtransform/tests/austin/memcpy.c b/libIRDB-transform/tests/austin/memcpy.c similarity index 100% rename from libtransform/tests/austin/memcpy.c rename to libIRDB-transform/tests/austin/memcpy.c diff --git a/libtransform/tests/austin/memset.c b/libIRDB-transform/tests/austin/memset.c similarity index 100% rename from libtransform/tests/austin/memset.c rename to libIRDB-transform/tests/austin/memset.c diff --git a/libtransform/tests/c++/prog.c b/libIRDB-transform/tests/c++/prog.c similarity index 100% rename from libtransform/tests/c++/prog.c rename to libIRDB-transform/tests/c++/prog.c diff --git a/libtransform/tests/clark1.c b/libIRDB-transform/tests/clark1.c similarity index 100% rename from libtransform/tests/clark1.c rename to libIRDB-transform/tests/clark1.c diff --git a/libtransform/tests/false_positives/cat.err b/libIRDB-transform/tests/false_positives/cat.err similarity index 100% rename from libtransform/tests/false_positives/cat.err rename to libIRDB-transform/tests/false_positives/cat.err diff --git a/libtransform/tests/false_positives/cat.out b/libIRDB-transform/tests/false_positives/cat.out similarity index 100% rename from libtransform/tests/false_positives/cat.out rename to libIRDB-transform/tests/false_positives/cat.out diff --git a/libtransform/tests/false_positives/cat.shared.orig b/libIRDB-transform/tests/false_positives/cat.shared.orig similarity index 100% rename from libtransform/tests/false_positives/cat.shared.orig rename to libIRDB-transform/tests/false_positives/cat.shared.orig diff --git a/libtransform/tests/false_positives/cat.shared.orig.peasoup b/libIRDB-transform/tests/false_positives/cat.shared.orig.peasoup similarity index 100% rename from libtransform/tests/false_positives/cat.shared.orig.peasoup rename to libIRDB-transform/tests/false_positives/cat.shared.orig.peasoup diff --git a/libtransform/tests/false_positives/ls.err b/libIRDB-transform/tests/false_positives/ls.err similarity index 100% rename from libtransform/tests/false_positives/ls.err rename to libIRDB-transform/tests/false_positives/ls.err diff --git a/libtransform/tests/false_positives/ls.out b/libIRDB-transform/tests/false_positives/ls.out similarity index 100% rename from libtransform/tests/false_positives/ls.out rename to libIRDB-transform/tests/false_positives/ls.out diff --git a/libtransform/tests/false_positives/ls.shared.orig b/libIRDB-transform/tests/false_positives/ls.shared.orig similarity index 100% rename from libtransform/tests/false_positives/ls.shared.orig rename to libIRDB-transform/tests/false_positives/ls.shared.orig diff --git a/libtransform/tests/false_positives/ls.shared.orig.peasoup b/libIRDB-transform/tests/false_positives/ls.shared.orig.peasoup similarity index 100% rename from libtransform/tests/false_positives/ls.shared.orig.peasoup rename to libIRDB-transform/tests/false_positives/ls.shared.orig.peasoup diff --git a/libtransform/tests/idiom18.c b/libIRDB-transform/tests/idiom18.c similarity index 100% rename from libtransform/tests/idiom18.c rename to libIRDB-transform/tests/idiom18.c diff --git a/libtransform/tests/int16overflow.c b/libIRDB-transform/tests/int16overflow.c similarity index 100% rename from libtransform/tests/int16overflow.c rename to libIRDB-transform/tests/int16overflow.c diff --git a/libtransform/tests/int32overflow.c b/libIRDB-transform/tests/int32overflow.c similarity index 100% rename from libtransform/tests/int32overflow.c rename to libIRDB-transform/tests/int32overflow.c diff --git a/libtransform/tests/integer/addsuboverflow/Makefile b/libIRDB-transform/tests/integer/addsuboverflow/Makefile similarity index 100% rename from libtransform/tests/integer/addsuboverflow/Makefile rename to libIRDB-transform/tests/integer/addsuboverflow/Makefile diff --git a/libtransform/tests/integer/addsuboverflow/acrossfunctions/Makefile b/libIRDB-transform/tests/integer/addsuboverflow/acrossfunctions/Makefile similarity index 100% rename from libtransform/tests/integer/addsuboverflow/acrossfunctions/Makefile rename to libIRDB-transform/tests/integer/addsuboverflow/acrossfunctions/Makefile diff --git a/libtransform/tests/integer/addsuboverflow/acrossfunctions/addsub.ctmpl b/libIRDB-transform/tests/integer/addsuboverflow/acrossfunctions/addsub.ctmpl similarity index 100% rename from libtransform/tests/integer/addsuboverflow/acrossfunctions/addsub.ctmpl rename to libIRDB-transform/tests/integer/addsuboverflow/acrossfunctions/addsub.ctmpl diff --git a/libtransform/tests/integer/addsuboverflow/acrossfunctions/addsub.shtmpl b/libIRDB-transform/tests/integer/addsuboverflow/acrossfunctions/addsub.shtmpl similarity index 100% rename from libtransform/tests/integer/addsuboverflow/acrossfunctions/addsub.shtmpl rename to libIRDB-transform/tests/integer/addsuboverflow/acrossfunctions/addsub.shtmpl diff --git a/libtransform/tests/integer/addsuboverflow/acrossfunctions/generate_addsub_tests.sh b/libIRDB-transform/tests/integer/addsuboverflow/acrossfunctions/generate_addsub_tests.sh similarity index 100% rename from libtransform/tests/integer/addsuboverflow/acrossfunctions/generate_addsub_tests.sh rename to libIRDB-transform/tests/integer/addsuboverflow/acrossfunctions/generate_addsub_tests.sh diff --git a/libtransform/tests/integer/addsuboverflow/acrossfunctions/run_tests.sh b/libIRDB-transform/tests/integer/addsuboverflow/acrossfunctions/run_tests.sh similarity index 100% rename from libtransform/tests/integer/addsuboverflow/acrossfunctions/run_tests.sh rename to libIRDB-transform/tests/integer/addsuboverflow/acrossfunctions/run_tests.sh diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/Makefile b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/Makefile similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/Makefile rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/Makefile diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/addsub.ctmpl b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.ctmpl similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/addsub.ctmpl rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.ctmpl diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/addsub.int.int.-w.nobenchflag.test.sh b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.int.int.-w.nobenchflag.test.sh similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/addsub.int.int.-w.nobenchflag.test.sh rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.int.int.-w.nobenchflag.test.sh diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/addsub.int.int.c b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.int.int.c similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/addsub.int.int.c rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.int.int.c diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/addsub.int.unsigned+int.-w.nobenchflag.test.sh b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.int.unsigned+int.-w.nobenchflag.test.sh similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/addsub.int.unsigned+int.-w.nobenchflag.test.sh rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.int.unsigned+int.-w.nobenchflag.test.sh diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/addsub.int.unsigned+int.c b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.int.unsigned+int.c similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/addsub.int.unsigned+int.c rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.int.unsigned+int.c diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/addsub.shtmpl b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.shtmpl similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/addsub.shtmpl rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.shtmpl diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.int.-w.nobenchflag.test.sh b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.int.-w.nobenchflag.test.sh similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.int.-w.nobenchflag.test.sh rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.int.-w.nobenchflag.test.sh diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.int.c b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.int.c similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.int.c rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.int.c diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.unsigned+int.-w.nobenchflag.test.sh b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.unsigned+int.-w.nobenchflag.test.sh similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.unsigned+int.-w.nobenchflag.test.sh rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.unsigned+int.-w.nobenchflag.test.sh diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.unsigned+int.c b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.unsigned+int.c similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.unsigned+int.c rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/addsub.unsigned+int.unsigned+int.c diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/generate_addsub_tests.sh b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/generate_addsub_tests.sh similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/generate_addsub_tests.sh rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/generate_addsub_tests.sh diff --git a/libtransform/tests/integer/addsuboverflow/intraframe/run_tests.sh b/libIRDB-transform/tests/integer/addsuboverflow/intraframe/run_tests.sh similarity index 100% rename from libtransform/tests/integer/addsuboverflow/intraframe/run_tests.sh rename to libIRDB-transform/tests/integer/addsuboverflow/intraframe/run_tests.sh diff --git a/libtransform/tests/mitre/README b/libIRDB-transform/tests/mitre/README similarity index 100% rename from libtransform/tests/mitre/README rename to libIRDB-transform/tests/mitre/README diff --git a/libtransform/tests/mitre/TC_C_191_v304/README b/libIRDB-transform/tests/mitre/TC_C_191_v304/README similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/README rename to libIRDB-transform/tests/mitre/TC_C_191_v304/README diff --git a/libtransform/tests/mitre/TC_C_191_v304/Release/makefile b/libIRDB-transform/tests/mitre/TC_C_191_v304/Release/makefile similarity index 95% rename from libtransform/tests/mitre/TC_C_191_v304/Release/makefile rename to libIRDB-transform/tests/mitre/TC_C_191_v304/Release/makefile index c4301e0053f62e450a0c7de926bb8dd5f0023560..c823419d8f199849793a8b8dc2583625bf418479 100644 --- a/libtransform/tests/mitre/TC_C_191_v304/Release/makefile +++ b/libIRDB-transform/tests/mitre/TC_C_191_v304/Release/makefile @@ -1,44 +1,44 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include subdir.mk --include src/subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: TC_C_191_v304 - -# Tool invocations -TC_C_191_v304: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: MinGW C Linker' - $(SS_LNK) -o"TC_C_191_v304" $(OBJS) $(USER_OBJS) $(LIBS)$ $(SS_LDFLAGS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) TC_C_191_v304 - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include ../makefile.targets +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +-include ../makefile.init + +RM := rm -rf + +# All of the sources participating in the build are defined here +-include sources.mk +-include subdir.mk +-include src/subdir.mk +-include objects.mk + +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(strip $(C_DEPS)),) +-include $(C_DEPS) +endif +endif + +-include ../makefile.defs + +# Add inputs and outputs from these tool invocations to the build variables + +# All Target +all: TC_C_191_v304 + +# Tool invocations +TC_C_191_v304: $(OBJS) $(USER_OBJS) + @echo 'Building target: $@' + @echo 'Invoking: MinGW C Linker' + $(SS_LNK) -o"TC_C_191_v304" $(OBJS) $(USER_OBJS) $(LIBS)$ $(SS_LDFLAGS) + @echo 'Finished building target: $@' + @echo ' ' + +# Other Targets +clean: + -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) TC_C_191_v304 + -@echo ' ' + +.PHONY: all clean dependents +.SECONDARY: + +-include ../makefile.targets diff --git a/libtransform/tests/mitre/TC_C_191_v304/Release/objects.mk b/libIRDB-transform/tests/mitre/TC_C_191_v304/Release/objects.mk similarity index 96% rename from libtransform/tests/mitre/TC_C_191_v304/Release/objects.mk rename to libIRDB-transform/tests/mitre/TC_C_191_v304/Release/objects.mk index dc31e16c685929c0d9eb5bd448a36f54b1533d57..742c2da043f4f5d93c414dca3a725ab2204d9817 100644 --- a/libtransform/tests/mitre/TC_C_191_v304/Release/objects.mk +++ b/libIRDB-transform/tests/mitre/TC_C_191_v304/Release/objects.mk @@ -1,8 +1,8 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +USER_OBJS := + +LIBS := + diff --git a/libtransform/tests/mitre/TC_C_196_v459/Release/sources.mk b/libIRDB-transform/tests/mitre/TC_C_191_v304/Release/sources.mk similarity index 96% rename from libtransform/tests/mitre/TC_C_196_v459/Release/sources.mk rename to libIRDB-transform/tests/mitre/TC_C_191_v304/Release/sources.mk index 6975694ac9a45d363f1ed85997abb064dd982456..57cf3c3f15374c8cf5b5cc315ea217c4470e4dca 100644 --- a/libtransform/tests/mitre/TC_C_196_v459/Release/sources.mk +++ b/libIRDB-transform/tests/mitre/TC_C_191_v304/Release/sources.mk @@ -1,17 +1,17 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -O_SRCS := -C_SRCS := -S_UPPER_SRCS := -OBJ_SRCS := -ASM_SRCS := -OBJS := -C_DEPS := -EXECUTABLES := - -# Every subdirectory with source files must be described here +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +O_SRCS := +C_SRCS := +S_UPPER_SRCS := +OBJ_SRCS := +ASM_SRCS := +OBJS := +C_DEPS := +EXECUTABLES := + +# Every subdirectory with source files must be described here SUBDIRS := \ src \ - + diff --git a/libtransform/tests/mitre/TC_C_191_v304/Release/src/recaman.d b/libIRDB-transform/tests/mitre/TC_C_191_v304/Release/src/recaman.d similarity index 97% rename from libtransform/tests/mitre/TC_C_191_v304/Release/src/recaman.d rename to libIRDB-transform/tests/mitre/TC_C_191_v304/Release/src/recaman.d index 687de8509174eab24fa17b30f06896390dd3df28..d22d96f1b5c45d72a689d340f2b4d735b12af49a 100644 --- a/libtransform/tests/mitre/TC_C_191_v304/Release/src/recaman.d +++ b/libIRDB-transform/tests/mitre/TC_C_191_v304/Release/src/recaman.d @@ -1 +1 @@ -src/recaman.d src/recaman.o: ../src/recaman.c +src/recaman.d src/recaman.o: ../src/recaman.c diff --git a/libtransform/tests/mitre/TC_C_191_v304/Release/src/subdir.mk b/libIRDB-transform/tests/mitre/TC_C_191_v304/Release/src/subdir.mk similarity index 97% rename from libtransform/tests/mitre/TC_C_191_v304/Release/src/subdir.mk rename to libIRDB-transform/tests/mitre/TC_C_191_v304/Release/src/subdir.mk index 56c7f898214ea6696e4124662e2e8dd1d0b76a01..5381eac771fd3a73b2c973aaccfd3a112deb876b 100644 --- a/libtransform/tests/mitre/TC_C_191_v304/Release/src/subdir.mk +++ b/libIRDB-transform/tests/mitre/TC_C_191_v304/Release/src/subdir.mk @@ -1,24 +1,24 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +# Add inputs and outputs from these tool invocations to the build variables C_SRCS += \ -../src/recaman.c - +../src/recaman.c + OBJS += \ -./src/recaman.o - +./src/recaman.o + C_DEPS += \ -./src/recaman.d - - -# Each subdirectory must supply rules for building sources it contributes -src/%.o: ../src/%.c - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(SS_CC) -O0 -Wall $(SS_CFLAGS) $(SS_OS_SPECIFIC_CFLAGS) -c -fmessage-length=0 -std=c99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - +./src/recaman.d + + +# Each subdirectory must supply rules for building sources it contributes +src/%.o: ../src/%.c + @echo 'Building file: $<' + @echo 'Invoking: GCC C Compiler' + $(SS_CC) -O0 -Wall $(SS_CFLAGS) $(SS_OS_SPECIFIC_CFLAGS) -c -fmessage-length=0 -std=c99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" + @echo 'Finished building: $<' + @echo ' ' + + diff --git a/libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Bad1.xml b/libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Bad1.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Bad1.xml rename to libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Bad1.xml diff --git a/libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good1.xml b/libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good1.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good1.xml rename to libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good1.xml diff --git a/libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good2.xml b/libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good2.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good2.xml rename to libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good2.xml diff --git a/libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good3.xml b/libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good3.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good3.xml rename to libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good3.xml diff --git a/libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good4.xml b/libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good4.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good4.xml rename to libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good4.xml diff --git a/libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good5.xml b/libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good5.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good5.xml rename to libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-TC_C_191_304_Good5.xml diff --git a/libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-good.xml b/libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-good.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-good.xml rename to libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-good.xml diff --git a/libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-large input value.xml b/libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-large input value.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/io-specifications/io-large input value.xml rename to libIRDB-transform/tests/mitre/TC_C_191_v304/io-specifications/io-large input value.xml diff --git a/libtransform/tests/mitre/TC_C_191_v304/metaData.xml b/libIRDB-transform/tests/mitre/TC_C_191_v304/metaData.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/metaData.xml rename to libIRDB-transform/tests/mitre/TC_C_191_v304/metaData.xml diff --git a/libtransform/tests/mitre/TC_C_191_v304/src/Makefile b/libIRDB-transform/tests/mitre/TC_C_191_v304/src/Makefile similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/src/Makefile rename to libIRDB-transform/tests/mitre/TC_C_191_v304/src/Makefile diff --git a/libtransform/tests/mitre/TC_C_191_v304/src/out b/libIRDB-transform/tests/mitre/TC_C_191_v304/src/out similarity index 100% rename from libtransform/tests/mitre/TC_C_191_v304/src/out rename to libIRDB-transform/tests/mitre/TC_C_191_v304/src/out diff --git a/libtransform/tests/mitre/TC_C_191_v304/src/recaman.c b/libIRDB-transform/tests/mitre/TC_C_191_v304/src/recaman.c similarity index 96% rename from libtransform/tests/mitre/TC_C_191_v304/src/recaman.c rename to libIRDB-transform/tests/mitre/TC_C_191_v304/src/recaman.c index 95c710545dcdec2f62dafbd82e658f59a0fbec89..2db8bc266ab35e8bc7d78356525e615bad4cb4dd 100644 --- a/libtransform/tests/mitre/TC_C_191_v304/src/recaman.c +++ b/libIRDB-transform/tests/mitre/TC_C_191_v304/src/recaman.c @@ -1,190 +1,190 @@ -/******************************************* -** -** Copyright (C) 2011 The MITRE Corporation. ALL RIGHTS RESERVED -** -** Author: Mitchell Wills -** Date: 6/28/2011 -** -** Base Test Program -- recaman.c -** -** Variant Test Case Program -** -** -** The original base was altered so that when calculating a buffer index the -** number underflows causing the final buffer index to be negative -** -** STONESOUP Weakness Class: Number Handling -** CWE ID: CWE-191 -** Variant Spreadsheet Rev #: 2 -** Variant Spreadsheet ID: 304 -** -** Variant Features: -** Source Taint: PIPE -** Data Type: SIGNED_SHORT -** Control Flow: SEQUENCE -** Data Flow: BUFFER_ADDRESS_ARRAY_INDEX -** -** Initial Testing: (x means yes, - means no) -** Tested in MS Windows XP 32bit x -** Tested in MS Windows 7 64bit - -** Tested in Ubuntu10_10 Linux 32bit - -** Tested in Ubuntu10_10 Linux 64bit - -** -** Workflow: -** Created:6/28/2011 -** 1st Vett: <programmer> on <date> -** 2nd Vett: <peer> on <date> -** 3rd Vett: <teamleader> on <date> -** 4th Vett: Fortify Issues Fixed on <date> -** 5th Vett: Tested in Harness on <date> -** -** -** I/0 Pairs: -** Good: 1st Set: -** 2nd Set: -** 3rd Set: -** 4th Set: -** 5th Set: -** Bad: 1st Set: -*********************************************/ - -//Recaman's Sequence Generator -#include <stdio.h> -#include <stdlib.h> -#include <ctype.h> - -//Function prototypes -int mygeti (int *); -int recaman(int); -int inSequence(int, int *, int); - -//Securely read in the input number -//Buff[7] means that a maximum of 6 digits can be read -//Any input with a 6 digits in the beginning is valid -//e.g. 123456fffff is valid but ff123456 and 1234ff6234234 are not - -int main(void) -{ - printf("*************************************\n"); - printf("*** Recaman's Sequence Generator ***\n"); - printf("*************************************\n\n"); - - short value; - fputs("Enter a sequence number [ >= 0 ]: ", stdout); - fflush(stdout); - - fputs("A0", stdout); - fflush(stdout); - - char *end, buff [7]; - char* rBuff = fgets(buff, sizeof buff, stdin);//STONESOUP:INTERACTION_POINT //STONESOUP:feature-PIPE - if(!rBuff){//reached EOF - value = -1; - return 1; - } - fputs("A", stdout); - fflush(stdout); - value = (short) strtol(buff, &end, 10); - fflush(stdin); - if(!(!isspace(*buff) && end != buff && (*end == '\n' || *end == '\0'))) - return 1; - - fputs("B", stdout); - fflush(stdout); - - //-1 is the "magic" value that will quit out of the while loop - if (value == -1) { - return 1; - } - //Otherwise, send the value to the recaman function if its greater than zero - else if (value >= 0) { - fputs("C", stdout); - fflush(stdout); - signed short stuff[100];//STONESOUP:feature-SIGNED_SHORT - - short y = (short)(-(-32700-value))/(short)350;//STONESOUP:CROSSOVER_POINT - short x[2]={0, y}; - - *(stuff+x[1]) = value;//STONESOUP:TRIGGER_POINT //STONESOUP:feature-BUFFER_ADDRESS_ARRAY_INDEX - -// CLARK: if you uncomment the printf below, we will get a successful detection - printf("debug: value: %d %d\n", value, *(stuff+x[1])); // this causes the detection - - printf("%d\n\n", recaman(*(stuff+x[1]))); - } - else { - printf("Error: Please enter zero or a positive integer.\n\n"); - } - - return 0; -} - -//Calculate the actual sequence -//A(0) = 0. a(m) = a(m-1) - 1 if a(m) is positive and not already in the sequence, otherwise a(m) = a(m-1) + m. -//The first few numbers in the Recaman's Sequence is 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9. -int recaman(int sequenceNo) -{ - int *sequence = NULL; - int i; - int currentValue; - int outputValue = 0; - -printf("sequenceNo = %d\n", sequenceNo); - - //Create the dynamic array for storing the sequence - sequence = (int*) calloc((sequenceNo+1),sizeof(int)); - - //Check to make sure the calloc call succeeded - if (sequence == NULL) { - printf("ERROR: Calloc memory allocation failed\n"); - return -1; - } - - //Setup the sequence precondition - //a(0) = 0 - sequence[0] = 0; - - for (i = 1; i <= sequenceNo; i++) { - currentValue = (sequence[i-1] - i); - - //Do the > 0 check: - if(currentValue > 0) { - //Check if the value has already been seen - if (!inSequence(currentValue, sequence, sequenceNo)) { - //Add it to the sequence if not - sequence[i] = currentValue; - } - else { - //Otherwise, do the addition method and add it to the sequence - sequence[i] = (sequence[i-1] + i); - } - } - //If the value is <0 then do the addition method and add it to the sequence - else { - sequence[i] = (sequence[i-1] + i); - } - } - - //Set the output value - outputValue = sequence[sequenceNo]; - - //Free the dynamic array - free(sequence); - sequence = NULL; - - return outputValue; -} - -//See if the input value is already in the sequence -int inSequence(int value, int *seq, int size) -{ - int j; - - for (j=0; j > -size; j--) { - if (seq[-j] == value) { - return 1; - } - } - - return 0; -} +/******************************************* +** +** Copyright (C) 2011 The MITRE Corporation. ALL RIGHTS RESERVED +** +** Author: Mitchell Wills +** Date: 6/28/2011 +** +** Base Test Program -- recaman.c +** +** Variant Test Case Program +** +** +** The original base was altered so that when calculating a buffer index the +** number underflows causing the final buffer index to be negative +** +** STONESOUP Weakness Class: Number Handling +** CWE ID: CWE-191 +** Variant Spreadsheet Rev #: 2 +** Variant Spreadsheet ID: 304 +** +** Variant Features: +** Source Taint: PIPE +** Data Type: SIGNED_SHORT +** Control Flow: SEQUENCE +** Data Flow: BUFFER_ADDRESS_ARRAY_INDEX +** +** Initial Testing: (x means yes, - means no) +** Tested in MS Windows XP 32bit x +** Tested in MS Windows 7 64bit - +** Tested in Ubuntu10_10 Linux 32bit - +** Tested in Ubuntu10_10 Linux 64bit - +** +** Workflow: +** Created:6/28/2011 +** 1st Vett: <programmer> on <date> +** 2nd Vett: <peer> on <date> +** 3rd Vett: <teamleader> on <date> +** 4th Vett: Fortify Issues Fixed on <date> +** 5th Vett: Tested in Harness on <date> +** +** +** I/0 Pairs: +** Good: 1st Set: +** 2nd Set: +** 3rd Set: +** 4th Set: +** 5th Set: +** Bad: 1st Set: +*********************************************/ + +//Recaman's Sequence Generator +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> + +//Function prototypes +int mygeti (int *); +int recaman(int); +int inSequence(int, int *, int); + +//Securely read in the input number +//Buff[7] means that a maximum of 6 digits can be read +//Any input with a 6 digits in the beginning is valid +//e.g. 123456fffff is valid but ff123456 and 1234ff6234234 are not + +int main(void) +{ + printf("*************************************\n"); + printf("*** Recaman's Sequence Generator ***\n"); + printf("*************************************\n\n"); + + short value; + fputs("Enter a sequence number [ >= 0 ]: ", stdout); + fflush(stdout); + + fputs("A0", stdout); + fflush(stdout); + + char *end, buff [7]; + char* rBuff = fgets(buff, sizeof buff, stdin);//STONESOUP:INTERACTION_POINT //STONESOUP:feature-PIPE + if(!rBuff){//reached EOF + value = -1; + return 1; + } + fputs("A", stdout); + fflush(stdout); + value = (short) strtol(buff, &end, 10); + fflush(stdin); + if(!(!isspace(*buff) && end != buff && (*end == '\n' || *end == '\0'))) + return 1; + + fputs("B", stdout); + fflush(stdout); + + //-1 is the "magic" value that will quit out of the while loop + if (value == -1) { + return 1; + } + //Otherwise, send the value to the recaman function if its greater than zero + else if (value >= 0) { + fputs("C", stdout); + fflush(stdout); + signed short stuff[100];//STONESOUP:feature-SIGNED_SHORT + + short y = (short)(-(-32700-value))/(short)350;//STONESOUP:CROSSOVER_POINT + short x[2]={0, y}; + + *(stuff+x[1]) = value;//STONESOUP:TRIGGER_POINT //STONESOUP:feature-BUFFER_ADDRESS_ARRAY_INDEX + +// CLARK: if you uncomment the printf below, we will get a successful detection + printf("debug: value: %d %d\n", value, *(stuff+x[1])); // this causes the detection + + printf("%d\n\n", recaman(*(stuff+x[1]))); + } + else { + printf("Error: Please enter zero or a positive integer.\n\n"); + } + + return 0; +} + +//Calculate the actual sequence +//A(0) = 0. a(m) = a(m-1) - 1 if a(m) is positive and not already in the sequence, otherwise a(m) = a(m-1) + m. +//The first few numbers in the Recaman's Sequence is 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9. +int recaman(int sequenceNo) +{ + int *sequence = NULL; + int i; + int currentValue; + int outputValue = 0; + +printf("sequenceNo = %d\n", sequenceNo); + + //Create the dynamic array for storing the sequence + sequence = (int*) calloc((sequenceNo+1),sizeof(int)); + + //Check to make sure the calloc call succeeded + if (sequence == NULL) { + printf("ERROR: Calloc memory allocation failed\n"); + return -1; + } + + //Setup the sequence precondition + //a(0) = 0 + sequence[0] = 0; + + for (i = 1; i <= sequenceNo; i++) { + currentValue = (sequence[i-1] - i); + + //Do the > 0 check: + if(currentValue > 0) { + //Check if the value has already been seen + if (!inSequence(currentValue, sequence, sequenceNo)) { + //Add it to the sequence if not + sequence[i] = currentValue; + } + else { + //Otherwise, do the addition method and add it to the sequence + sequence[i] = (sequence[i-1] + i); + } + } + //If the value is <0 then do the addition method and add it to the sequence + else { + sequence[i] = (sequence[i-1] + i); + } + } + + //Set the output value + outputValue = sequence[sequenceNo]; + + //Free the dynamic array + free(sequence); + sequence = NULL; + + return outputValue; +} + +//See if the input value is already in the sequence +int inSequence(int value, int *seq, int size) +{ + int j; + + for (j=0; j > -size; j--) { + if (seq[-j] == value) { + return 1; + } + } + + return 0; +} diff --git a/libtransform/tests/mitre/TC_C_196_v459/README b/libIRDB-transform/tests/mitre/TC_C_196_v459/README similarity index 100% rename from libtransform/tests/mitre/TC_C_196_v459/README rename to libIRDB-transform/tests/mitre/TC_C_196_v459/README diff --git a/libtransform/tests/mitre/TC_C_196_v459/Release/makefile b/libIRDB-transform/tests/mitre/TC_C_196_v459/Release/makefile similarity index 95% rename from libtransform/tests/mitre/TC_C_196_v459/Release/makefile rename to libIRDB-transform/tests/mitre/TC_C_196_v459/Release/makefile index 31349eef48c01b09c0d0424ecd3d2a75f46bcf55..de71eb65e3928feafdf449541f65c18e2be032c7 100644 --- a/libtransform/tests/mitre/TC_C_196_v459/Release/makefile +++ b/libIRDB-transform/tests/mitre/TC_C_196_v459/Release/makefile @@ -1,44 +1,44 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include subdir.mk --include src/subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: TC_C_196_v459 - -# Tool invocations -TC_C_196_v459: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: MinGW C Linker' - $(SS_LNK) -o"TC_C_196_v459" $(OBJS) $(USER_OBJS) $(LIBS)$ $(SS_LDFLAGS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) TC_C_196_v459 - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include ../makefile.targets +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +-include ../makefile.init + +RM := rm -rf + +# All of the sources participating in the build are defined here +-include sources.mk +-include subdir.mk +-include src/subdir.mk +-include objects.mk + +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(strip $(C_DEPS)),) +-include $(C_DEPS) +endif +endif + +-include ../makefile.defs + +# Add inputs and outputs from these tool invocations to the build variables + +# All Target +all: TC_C_196_v459 + +# Tool invocations +TC_C_196_v459: $(OBJS) $(USER_OBJS) + @echo 'Building target: $@' + @echo 'Invoking: MinGW C Linker' + $(SS_LNK) -o"TC_C_196_v459" $(OBJS) $(USER_OBJS) $(LIBS)$ $(SS_LDFLAGS) + @echo 'Finished building target: $@' + @echo ' ' + +# Other Targets +clean: + -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) TC_C_196_v459 + -@echo ' ' + +.PHONY: all clean dependents +.SECONDARY: + +-include ../makefile.targets diff --git a/libtransform/tests/mitre/TC_C_196_v459/Release/objects.mk b/libIRDB-transform/tests/mitre/TC_C_196_v459/Release/objects.mk similarity index 96% rename from libtransform/tests/mitre/TC_C_196_v459/Release/objects.mk rename to libIRDB-transform/tests/mitre/TC_C_196_v459/Release/objects.mk index dc31e16c685929c0d9eb5bd448a36f54b1533d57..742c2da043f4f5d93c414dca3a725ab2204d9817 100644 --- a/libtransform/tests/mitre/TC_C_196_v459/Release/objects.mk +++ b/libIRDB-transform/tests/mitre/TC_C_196_v459/Release/objects.mk @@ -1,8 +1,8 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +USER_OBJS := + +LIBS := + diff --git a/libtransform/tests/mitre/TC_C_191_v304/Release/sources.mk b/libIRDB-transform/tests/mitre/TC_C_196_v459/Release/sources.mk similarity index 96% rename from libtransform/tests/mitre/TC_C_191_v304/Release/sources.mk rename to libIRDB-transform/tests/mitre/TC_C_196_v459/Release/sources.mk index 6975694ac9a45d363f1ed85997abb064dd982456..57cf3c3f15374c8cf5b5cc315ea217c4470e4dca 100644 --- a/libtransform/tests/mitre/TC_C_191_v304/Release/sources.mk +++ b/libIRDB-transform/tests/mitre/TC_C_196_v459/Release/sources.mk @@ -1,17 +1,17 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -O_SRCS := -C_SRCS := -S_UPPER_SRCS := -OBJ_SRCS := -ASM_SRCS := -OBJS := -C_DEPS := -EXECUTABLES := - -# Every subdirectory with source files must be described here +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +O_SRCS := +C_SRCS := +S_UPPER_SRCS := +OBJ_SRCS := +ASM_SRCS := +OBJS := +C_DEPS := +EXECUTABLES := + +# Every subdirectory with source files must be described here SUBDIRS := \ src \ - + diff --git a/libtransform/tests/mitre/TC_C_196_v459/Release/src/countlines.d b/libIRDB-transform/tests/mitre/TC_C_196_v459/Release/src/countlines.d similarity index 98% rename from libtransform/tests/mitre/TC_C_196_v459/Release/src/countlines.d rename to libIRDB-transform/tests/mitre/TC_C_196_v459/Release/src/countlines.d index ecb1a16785837aaee076f51258b333fddccb48ef..61403b4949f13819f660f5dc59e96b0b473ae4af 100644 --- a/libtransform/tests/mitre/TC_C_196_v459/Release/src/countlines.d +++ b/libIRDB-transform/tests/mitre/TC_C_196_v459/Release/src/countlines.d @@ -1 +1 @@ -src/countlines.d src/countlines.o: ../src/countlines.c +src/countlines.d src/countlines.o: ../src/countlines.c diff --git a/libtransform/tests/mitre/TC_C_196_v459/Release/src/subdir.mk b/libIRDB-transform/tests/mitre/TC_C_196_v459/Release/src/subdir.mk similarity index 97% rename from libtransform/tests/mitre/TC_C_196_v459/Release/src/subdir.mk rename to libIRDB-transform/tests/mitre/TC_C_196_v459/Release/src/subdir.mk index d4424adee0b96f6b3b081e77d7430fd1dd7fdbe7..bfc8b90c74dcea6411a467043834094db2d248c6 100644 --- a/libtransform/tests/mitre/TC_C_196_v459/Release/src/subdir.mk +++ b/libIRDB-transform/tests/mitre/TC_C_196_v459/Release/src/subdir.mk @@ -1,24 +1,24 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +# Add inputs and outputs from these tool invocations to the build variables C_SRCS += \ -../src/countlines.c - +../src/countlines.c + OBJS += \ -./src/countlines.o - +./src/countlines.o + C_DEPS += \ -./src/countlines.d - - -# Each subdirectory must supply rules for building sources it contributes -src/%.o: ../src/%.c - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(SS_CC) -O0 -Wall -c $(SS_CFLAGS) $(SS_SPECIFIC_CFLAGS) -fmessage-length=0 -std=c99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - +./src/countlines.d + + +# Each subdirectory must supply rules for building sources it contributes +src/%.o: ../src/%.c + @echo 'Building file: $<' + @echo 'Invoking: GCC C Compiler' + $(SS_CC) -O0 -Wall -c $(SS_CFLAGS) $(SS_SPECIFIC_CFLAGS) -fmessage-length=0 -std=c99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" + @echo 'Finished building: $<' + @echo ' ' + + diff --git a/libtransform/tests/mitre/TC_C_196_v459/io-specifications/io-Long File Name.xml b/libIRDB-transform/tests/mitre/TC_C_196_v459/io-specifications/io-Long File Name.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_196_v459/io-specifications/io-Long File Name.xml rename to libIRDB-transform/tests/mitre/TC_C_196_v459/io-specifications/io-Long File Name.xml diff --git a/libtransform/tests/mitre/TC_C_196_v459/io-specifications/io-good.xml b/libIRDB-transform/tests/mitre/TC_C_196_v459/io-specifications/io-good.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_196_v459/io-specifications/io-good.xml rename to libIRDB-transform/tests/mitre/TC_C_196_v459/io-specifications/io-good.xml diff --git a/libtransform/tests/mitre/TC_C_196_v459/metaData.xml b/libIRDB-transform/tests/mitre/TC_C_196_v459/metaData.xml similarity index 100% rename from libtransform/tests/mitre/TC_C_196_v459/metaData.xml rename to libIRDB-transform/tests/mitre/TC_C_196_v459/metaData.xml diff --git a/libtransform/tests/mitre/TC_C_196_v459/src/Makefile b/libIRDB-transform/tests/mitre/TC_C_196_v459/src/Makefile similarity index 100% rename from libtransform/tests/mitre/TC_C_196_v459/src/Makefile rename to libIRDB-transform/tests/mitre/TC_C_196_v459/src/Makefile diff --git a/libtransform/tests/mitre/TC_C_196_v459/src/countlines.c b/libIRDB-transform/tests/mitre/TC_C_196_v459/src/countlines.c similarity index 97% rename from libtransform/tests/mitre/TC_C_196_v459/src/countlines.c rename to libIRDB-transform/tests/mitre/TC_C_196_v459/src/countlines.c index 38f00ba7bed632061f82c8cabdb8d8f71017768d..cecacf59b0b81bae51597c1d37ed527163c690d9 100644 --- a/libtransform/tests/mitre/TC_C_196_v459/src/countlines.c +++ b/libIRDB-transform/tests/mitre/TC_C_196_v459/src/countlines.c @@ -1,305 +1,305 @@ -/******************************************* -** -** Copyright (C) 2011 The MITRE Corporation. ALL RIGHTS RESERVED -** -** Author: Mitchell Wills -** Date: 6/16/2011 -** -** Base Test Program -- countlines.c -** -** Variant Test Case Program -** -** This Base Test Program counts the number of lines of code in a Java Program -** ignoring whitespace and comment lines. It takes as input a single file that is -** located in the same directory as the executable. Note that technically this -** doesn't have to be a .java file and any file will work. This program just looks for -** comments that follow the Java language specification. -** -** Note that it is assumed that all lines of code are under 256 characters. If longer -** lines are encountered, then the counts will be incorrect. Also a /* sequence that -** appears within an escaped string (e.g. "A /* causes an error.") will lead to incorrect -** counts as the algorithim used will not recognize the escaped string and think this is -** the start of a multiline comment. -** -** The program has the following basic flow: -** -** - get filename -** - open file -** - read line -** - if it meets criteria increment counter -** - read next line -** - close file -** - output line count -** -** -** The original base was altered so that the loop counter used to check the file path for -** illegal characters is cast from a signed byte to an unsigned byte. When the file name -** is long the index becomes negative and negative memory is accessed and the program will -** go into an infinite loop (if not 0s exist in the 128 bytes before the buffer) or it will -** no validate all the characters so there is a possibility for path traversal. -** -** STONESOUP Weakness Class: Number Handling -** CWE ID: CWE-196 -** Variant Spreadsheet Rev #: 2 -** Variant Spreadsheet ID: 459 -** -** Variant Features: -** Source Taint: COMMAND_LINE -** Data Type: ARRAY -** Control Flow: LOOP_COMPLEXITY_TEST -** Data Flow: ADDRESS_AS_A_LINEAR_EXPRESSION -** -** Initial Testing: (x means yes, - means no) -** Tested in MS Windows XP 32bit x -** Tested in MS Windows 7 64bit - -** Tested in Ubuntu10_10 Linux 32bit - -** Tested in Ubuntu10_10 Linux 64bit - -** -** Workflow: -** Created:6/16/2011 -** 1st Vett: <programmer> on <date> -** 2nd Vett: <peer> on <date> -** 3rd Vett: <teamleader> on <date> -** 4th Vett: Fortify Issues Fixed on <date> -** 5th Vett: Tested in Harness on <date> -** -** -** I/0 Pairs: -** Good: 1st Set: -** 2nd Set: -** 3rd Set: -** 4th Set: -** 5th Set: -** Bad: 1st Set: -*********************************************/ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> - -#define DEBUG 0 - -int main (int argc, char *argv[]) -{ - FILE *fp; - - char filename[256];//STONESOUP:feature-ARRAY - char line[256]; - - char *line_pointer; - - int line_already_counted; - int multi_line_comment; - int total_lines; - int lines_of_code; - - - signed char getI(unsigned char i){ - return (signed char)i; - } - - unsigned char i; - - // An incorrect number of arguments were supplied. Let the user know the expected format of - // the command line. One user supplied argument is expected. Remember that the first argument - // is always the program name so we really need to check that 2 arguments exist. - - if (argc != 2) - { - printf("\nERROR: Usage: countlines <filename>\n"); - return(EXIT_FAILURE); - } - - // Get the input that was supplied on the command line. One argument should be there. This - // argument is the name of the .java file that is being counted. - // - // For the file name argument, this code will only grab the first 255 characters from the - // command line argument, placing a NULL terminator at the end. - - memset(filename, '\0', 256); - strncpy(filename, argv[1], 255);//STONESOUP:INTERACTION_POINT //STONESOUP:feature-COMMAND_LINE - filename[255] = '\0'; - - // Validate that the filename provided is just a filename and not a path to some other - // directory. We do this through a blacklist that excludes slashes (both forward and - // backward) and the double dot sequence. - // - // Note that we only loop from 0 to 255 since the last character should be a NULL - // and there is no need to double check this. In addition, this guards against any - // possible buffer overread when we check filename[i+1]. - - for (i=0;getI(i)<255;i++)//STONESOUP:CROSSOVER_POINT //STONESOUP:TRIGGER_POINT //STONESOUP:feature-LOOP_COMPLEXITY_TEST - { - printf("%d %c\n", (signed char)i, *(filename+sizeof(signed char)*(signed char)i) ); - if (*(filename+sizeof(char)*(signed char)i)=='\0') break; - - if (*(filename+sizeof(char)*(signed char)i)=='\\' /*|| filename[(signed char)*(i+1)]=='/'*/) - { - printf("\nERROR: Filename must not contain a slash character.\n"); - return(EXIT_FAILURE); - } - - if (*(filename+sizeof(char)*(signed char)i)==':') - { - printf("\nERROR: Filename must not contain a colon character.\n"); - return(EXIT_FAILURE); - } - - if (*(filename+sizeof(char)*(signed char)i)=='.' && *(filename+sizeof(char)*((signed char)i+1))=='.') //STONESOUP:feature-ADDRESS_AS_A_LINEAR_EXPRESSION - { - printf("\nERROR: Filename must not contain a double dot (e.g. '..') sequence.\n"); - return(EXIT_FAILURE); - } - } - // Open the file in readonly mode. - - fp = fopen(filename, "r"); - if (fp == NULL) - { - printf("\nERROR: Cannot open file.\n"); - return(EXIT_FAILURE); - } - - // After initializing variables, loop through each line of the file using fgets(). The function - // fgets(str, num, fp) reads up to num - 1 characters from the file stream fp and dumps them - // into str. fgets() will stop when it reaches the end of a line, in which case str will be - // terminated with a newline. If fgets() reaches num - 1 characters or encounters the EOF, - // str will be null-terminated. fgets() returns str on success, and NULL on an error. - - multi_line_comment = 0; - total_lines = 0; - lines_of_code = 0; - - memset(line, '\0', 256); - - while (fgets(line,256,fp) != NULL) - { - total_lines++; - - // We are reading a new line so we need to reset the line_already_counted flag since - // it obviously hasn't been counted yet. - - line_already_counted = 0; - - // Since fgets() may terminate a string with a newline ... we need to strip any trailing - // '\n' and replace it with a NULL character. - - if (line[strlen(line)-1] == '\n') line[strlen(line)-1] = '\0'; - - // Set the line_pointer to the first character of the line. - - line_pointer = line; - - // We are now ready to parse the line character by character. - - while (*line_pointer != '\0') - { - // If we are currently in a multi line scenario, then we need to check if we have hit - // an end tag. Otherwise we just advance the pointer and keep looping. - - if (multi_line_comment == 1) - { - if (*line_pointer == '*') - { - // Advance the line_pointer. We need to check for the NULL character - // and break if found. If we don't do this, then the next line_pointer++ - //call (before the start of the next iteration) will advance us out of bounds. - - line_pointer++; - if (*line_pointer == '\0') break; - - if (*line_pointer == '/') - { - // An end tag has been found! Reset the multi_line_comment. - // Note that we still need to advance the pointer and continue - // the loop. - - multi_line_comment = 0; - } - } - - line_pointer++; - continue; - } - - // If the current character is a whitespace, then skip it and continue the loop - // inorder to examine the next character. - - if (isspace(*line_pointer) != 0) - { - line_pointer++; - continue; - } - - // If the current character is a slash, then we need to look at the following - // character to see if the line is a Java comment. If we are looking at a Java - // comment line, then just break out of the loop without incrementing the - // line counter. - - if (*line_pointer == '/') - { - // Advance the line_pointer. We need to check for the NULL character - // and break if found. If we don't do this, then the next line_pointer++ - //call (before the start of the next iteration) will advance us out of bounds. - - line_pointer++; - if (*line_pointer == '\0') break; - - // If the next character is a slash as well, then a single line comment has - // been found. The rest of this line is not code, so break out of this loop. - - if (*line_pointer == '/') break; - - // If the next character is an asteric, then a multi-line comment has been - // found. We now need to skip every line until the end of the comment. To - // do this, we will turn on the multi_line_comment flag and continue - // processing this line (and any following line) looking for the closing tag. - //Note that the end of the comment may contain code on the rest of the - // line after the closing comment tag. - - if (*line_pointer == '*') - { - multi_line_comment = 1; - line_pointer++; - continue; - } - - // Note that if we reach here, a Java comment was NOT found, so we should - // fall through to the default processing and count the current line as a - // valid line of code. - } - - // A line ofJava code has been found! If the line has not already been counted, then - // increment the line counter. - - if (line_already_counted == 0) - { - if (DEBUG) printf("DEBUG: %s\n", line_pointer); - lines_of_code++; - line_already_counted = 1; - } - - // Move the line pointer to the next character in the line so that the next - // iteration of the current loop doesn't try to process the same character. - - line_pointer++; - } - } - - // We are done with the file so close it. - - if (fclose(fp)) - { - printf("\nERROR: File close error.\n"); - return(EXIT_FAILURE); - } - - // We have finished looking at each line in the file, and now have the line count. So print it!! - - if (DEBUG) printf("\nDEBUG: The file '%s' contains %d total lines, of which %d are code.\n\n", filename, total_lines, lines_of_code); - printf("\nRESULT: %d", lines_of_code); - return(EXIT_SUCCESS); -} - -/* End of file */ +/******************************************* +** +** Copyright (C) 2011 The MITRE Corporation. ALL RIGHTS RESERVED +** +** Author: Mitchell Wills +** Date: 6/16/2011 +** +** Base Test Program -- countlines.c +** +** Variant Test Case Program +** +** This Base Test Program counts the number of lines of code in a Java Program +** ignoring whitespace and comment lines. It takes as input a single file that is +** located in the same directory as the executable. Note that technically this +** doesn't have to be a .java file and any file will work. This program just looks for +** comments that follow the Java language specification. +** +** Note that it is assumed that all lines of code are under 256 characters. If longer +** lines are encountered, then the counts will be incorrect. Also a /* sequence that +** appears within an escaped string (e.g. "A /* causes an error.") will lead to incorrect +** counts as the algorithim used will not recognize the escaped string and think this is +** the start of a multiline comment. +** +** The program has the following basic flow: +** +** - get filename +** - open file +** - read line +** - if it meets criteria increment counter +** - read next line +** - close file +** - output line count +** +** +** The original base was altered so that the loop counter used to check the file path for +** illegal characters is cast from a signed byte to an unsigned byte. When the file name +** is long the index becomes negative and negative memory is accessed and the program will +** go into an infinite loop (if not 0s exist in the 128 bytes before the buffer) or it will +** no validate all the characters so there is a possibility for path traversal. +** +** STONESOUP Weakness Class: Number Handling +** CWE ID: CWE-196 +** Variant Spreadsheet Rev #: 2 +** Variant Spreadsheet ID: 459 +** +** Variant Features: +** Source Taint: COMMAND_LINE +** Data Type: ARRAY +** Control Flow: LOOP_COMPLEXITY_TEST +** Data Flow: ADDRESS_AS_A_LINEAR_EXPRESSION +** +** Initial Testing: (x means yes, - means no) +** Tested in MS Windows XP 32bit x +** Tested in MS Windows 7 64bit - +** Tested in Ubuntu10_10 Linux 32bit - +** Tested in Ubuntu10_10 Linux 64bit - +** +** Workflow: +** Created:6/16/2011 +** 1st Vett: <programmer> on <date> +** 2nd Vett: <peer> on <date> +** 3rd Vett: <teamleader> on <date> +** 4th Vett: Fortify Issues Fixed on <date> +** 5th Vett: Tested in Harness on <date> +** +** +** I/0 Pairs: +** Good: 1st Set: +** 2nd Set: +** 3rd Set: +** 4th Set: +** 5th Set: +** Bad: 1st Set: +*********************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> + +#define DEBUG 0 + +int main (int argc, char *argv[]) +{ + FILE *fp; + + char filename[256];//STONESOUP:feature-ARRAY + char line[256]; + + char *line_pointer; + + int line_already_counted; + int multi_line_comment; + int total_lines; + int lines_of_code; + + + signed char getI(unsigned char i){ + return (signed char)i; + } + + unsigned char i; + + // An incorrect number of arguments were supplied. Let the user know the expected format of + // the command line. One user supplied argument is expected. Remember that the first argument + // is always the program name so we really need to check that 2 arguments exist. + + if (argc != 2) + { + printf("\nERROR: Usage: countlines <filename>\n"); + return(EXIT_FAILURE); + } + + // Get the input that was supplied on the command line. One argument should be there. This + // argument is the name of the .java file that is being counted. + // + // For the file name argument, this code will only grab the first 255 characters from the + // command line argument, placing a NULL terminator at the end. + + memset(filename, '\0', 256); + strncpy(filename, argv[1], 255);//STONESOUP:INTERACTION_POINT //STONESOUP:feature-COMMAND_LINE + filename[255] = '\0'; + + // Validate that the filename provided is just a filename and not a path to some other + // directory. We do this through a blacklist that excludes slashes (both forward and + // backward) and the double dot sequence. + // + // Note that we only loop from 0 to 255 since the last character should be a NULL + // and there is no need to double check this. In addition, this guards against any + // possible buffer overread when we check filename[i+1]. + + for (i=0;getI(i)<255;i++)//STONESOUP:CROSSOVER_POINT //STONESOUP:TRIGGER_POINT //STONESOUP:feature-LOOP_COMPLEXITY_TEST + { + printf("%d %c\n", (signed char)i, *(filename+sizeof(signed char)*(signed char)i) ); + if (*(filename+sizeof(char)*(signed char)i)=='\0') break; + + if (*(filename+sizeof(char)*(signed char)i)=='\\' /*|| filename[(signed char)*(i+1)]=='/'*/) + { + printf("\nERROR: Filename must not contain a slash character.\n"); + return(EXIT_FAILURE); + } + + if (*(filename+sizeof(char)*(signed char)i)==':') + { + printf("\nERROR: Filename must not contain a colon character.\n"); + return(EXIT_FAILURE); + } + + if (*(filename+sizeof(char)*(signed char)i)=='.' && *(filename+sizeof(char)*((signed char)i+1))=='.') //STONESOUP:feature-ADDRESS_AS_A_LINEAR_EXPRESSION + { + printf("\nERROR: Filename must not contain a double dot (e.g. '..') sequence.\n"); + return(EXIT_FAILURE); + } + } + // Open the file in readonly mode. + + fp = fopen(filename, "r"); + if (fp == NULL) + { + printf("\nERROR: Cannot open file.\n"); + return(EXIT_FAILURE); + } + + // After initializing variables, loop through each line of the file using fgets(). The function + // fgets(str, num, fp) reads up to num - 1 characters from the file stream fp and dumps them + // into str. fgets() will stop when it reaches the end of a line, in which case str will be + // terminated with a newline. If fgets() reaches num - 1 characters or encounters the EOF, + // str will be null-terminated. fgets() returns str on success, and NULL on an error. + + multi_line_comment = 0; + total_lines = 0; + lines_of_code = 0; + + memset(line, '\0', 256); + + while (fgets(line,256,fp) != NULL) + { + total_lines++; + + // We are reading a new line so we need to reset the line_already_counted flag since + // it obviously hasn't been counted yet. + + line_already_counted = 0; + + // Since fgets() may terminate a string with a newline ... we need to strip any trailing + // '\n' and replace it with a NULL character. + + if (line[strlen(line)-1] == '\n') line[strlen(line)-1] = '\0'; + + // Set the line_pointer to the first character of the line. + + line_pointer = line; + + // We are now ready to parse the line character by character. + + while (*line_pointer != '\0') + { + // If we are currently in a multi line scenario, then we need to check if we have hit + // an end tag. Otherwise we just advance the pointer and keep looping. + + if (multi_line_comment == 1) + { + if (*line_pointer == '*') + { + // Advance the line_pointer. We need to check for the NULL character + // and break if found. If we don't do this, then the next line_pointer++ + //call (before the start of the next iteration) will advance us out of bounds. + + line_pointer++; + if (*line_pointer == '\0') break; + + if (*line_pointer == '/') + { + // An end tag has been found! Reset the multi_line_comment. + // Note that we still need to advance the pointer and continue + // the loop. + + multi_line_comment = 0; + } + } + + line_pointer++; + continue; + } + + // If the current character is a whitespace, then skip it and continue the loop + // inorder to examine the next character. + + if (isspace(*line_pointer) != 0) + { + line_pointer++; + continue; + } + + // If the current character is a slash, then we need to look at the following + // character to see if the line is a Java comment. If we are looking at a Java + // comment line, then just break out of the loop without incrementing the + // line counter. + + if (*line_pointer == '/') + { + // Advance the line_pointer. We need to check for the NULL character + // and break if found. If we don't do this, then the next line_pointer++ + //call (before the start of the next iteration) will advance us out of bounds. + + line_pointer++; + if (*line_pointer == '\0') break; + + // If the next character is a slash as well, then a single line comment has + // been found. The rest of this line is not code, so break out of this loop. + + if (*line_pointer == '/') break; + + // If the next character is an asteric, then a multi-line comment has been + // found. We now need to skip every line until the end of the comment. To + // do this, we will turn on the multi_line_comment flag and continue + // processing this line (and any following line) looking for the closing tag. + //Note that the end of the comment may contain code on the rest of the + // line after the closing comment tag. + + if (*line_pointer == '*') + { + multi_line_comment = 1; + line_pointer++; + continue; + } + + // Note that if we reach here, a Java comment was NOT found, so we should + // fall through to the default processing and count the current line as a + // valid line of code. + } + + // A line ofJava code has been found! If the line has not already been counted, then + // increment the line counter. + + if (line_already_counted == 0) + { + if (DEBUG) printf("DEBUG: %s\n", line_pointer); + lines_of_code++; + line_already_counted = 1; + } + + // Move the line pointer to the next character in the line so that the next + // iteration of the current loop doesn't try to process the same character. + + line_pointer++; + } + } + + // We are done with the file so close it. + + if (fclose(fp)) + { + printf("\nERROR: File close error.\n"); + return(EXIT_FAILURE); + } + + // We have finished looking at each line in the file, and now have the line count. So print it!! + + if (DEBUG) printf("\nDEBUG: The file '%s' contains %d total lines, of which %d are code.\n\n", filename, total_lines, lines_of_code); + printf("\nRESULT: %d", lines_of_code); + return(EXIT_SUCCESS); +} + +/* End of file */ diff --git a/libtransform/tests/mitre/TC_C_196_v459/testData/1.java b/libIRDB-transform/tests/mitre/TC_C_196_v459/testData/1.java similarity index 100% rename from libtransform/tests/mitre/TC_C_196_v459/testData/1.java rename to libIRDB-transform/tests/mitre/TC_C_196_v459/testData/1.java diff --git a/libtransform/tests/mitre/TC_C_196_v459/testData/2.java b/libIRDB-transform/tests/mitre/TC_C_196_v459/testData/2.java similarity index 100% rename from libtransform/tests/mitre/TC_C_196_v459/testData/2.java rename to libIRDB-transform/tests/mitre/TC_C_196_v459/testData/2.java diff --git a/libtransform/tests/mitre/TC_C_196_v459/testData/3.java b/libIRDB-transform/tests/mitre/TC_C_196_v459/testData/3.java similarity index 100% rename from libtransform/tests/mitre/TC_C_196_v459/testData/3.java rename to libIRDB-transform/tests/mitre/TC_C_196_v459/testData/3.java diff --git a/libtransform/tests/mitre/TC_C_196_v459/testData/4.java b/libIRDB-transform/tests/mitre/TC_C_196_v459/testData/4.java similarity index 100% rename from libtransform/tests/mitre/TC_C_196_v459/testData/4.java rename to libIRDB-transform/tests/mitre/TC_C_196_v459/testData/4.java diff --git a/libtransform/tests/mitre/TC_C_196_v459/testData/5.java b/libIRDB-transform/tests/mitre/TC_C_196_v459/testData/5.java similarity index 84% rename from libtransform/tests/mitre/TC_C_196_v459/testData/5.java rename to libIRDB-transform/tests/mitre/TC_C_196_v459/testData/5.java index 2fc9642d9982e414872236d31eb4bd1c98a30bd7..8d218b78fb0fd1be6f620cd2be7a371725e6684c 100644 --- a/libtransform/tests/mitre/TC_C_196_v459/testData/5.java +++ b/libIRDB-transform/tests/mitre/TC_C_196_v459/testData/5.java @@ -1,11 +1,11 @@ -//hi -asdsfd -/*hello - -test*/ - -asfdsadf -adsfsadf - - +//hi +asdsfd +/*hello + +test*/ + +asfdsadf +adsfsadf + + 345345 \ No newline at end of file diff --git a/libtransform/tests/mul.c b/libIRDB-transform/tests/mul.c similarity index 100% rename from libtransform/tests/mul.c rename to libIRDB-transform/tests/mul.c diff --git a/libtransform/tests/sample_meds_int.annot b/libIRDB-transform/tests/sample_meds_int.annot similarity index 100% rename from libtransform/tests/sample_meds_int.annot rename to libIRDB-transform/tests/sample_meds_int.annot diff --git a/libtransform/tests/signed_add.64.c b/libIRDB-transform/tests/signed_add.64.c similarity index 100% rename from libtransform/tests/signed_add.64.c rename to libIRDB-transform/tests/signed_add.64.c diff --git a/libtransform/tests/signed_mul.32.c b/libIRDB-transform/tests/signed_mul.32.c similarity index 100% rename from libtransform/tests/signed_mul.32.c rename to libIRDB-transform/tests/signed_mul.32.c diff --git a/libtransform/tests/signed_mul.64.c b/libIRDB-transform/tests/signed_mul.64.c similarity index 100% rename from libtransform/tests/signed_mul.64.c rename to libIRDB-transform/tests/signed_mul.64.c diff --git a/libtransform/tests/signedness.64.unsigned.c b/libIRDB-transform/tests/signedness.64.unsigned.c similarity index 100% rename from libtransform/tests/signedness.64.unsigned.c rename to libIRDB-transform/tests/signedness.64.unsigned.c diff --git a/libtransform/tests/simpletest.c b/libIRDB-transform/tests/simpletest.c similarity index 100% rename from libtransform/tests/simpletest.c rename to libIRDB-transform/tests/simpletest.c diff --git a/libtransform/tests/test.signed_add.64.sh b/libIRDB-transform/tests/test.signed_add.64.sh similarity index 100% rename from libtransform/tests/test.signed_add.64.sh rename to libIRDB-transform/tests/test.signed_add.64.sh diff --git a/libtransform/tests/test.signed_mul.32.sh b/libIRDB-transform/tests/test.signed_mul.32.sh similarity index 100% rename from libtransform/tests/test.signed_mul.32.sh rename to libIRDB-transform/tests/test.signed_mul.32.sh diff --git a/libtransform/tests/test.signed_mul.64.sh b/libIRDB-transform/tests/test.signed_mul.64.sh similarity index 100% rename from libtransform/tests/test.signed_mul.64.sh rename to libIRDB-transform/tests/test.signed_mul.64.sh diff --git a/libtransform/tests/test.trunc.32.16.signed.sh b/libIRDB-transform/tests/test.trunc.32.16.signed.sh similarity index 100% rename from libtransform/tests/test.trunc.32.16.signed.sh rename to libIRDB-transform/tests/test.trunc.32.16.signed.sh diff --git a/libtransform/tests/test.trunc.32.16.unsigned.sh b/libIRDB-transform/tests/test.trunc.32.16.unsigned.sh similarity index 100% rename from libtransform/tests/test.trunc.32.16.unsigned.sh rename to libIRDB-transform/tests/test.trunc.32.16.unsigned.sh diff --git a/libtransform/tests/test.trunc.32.8.signed.sh b/libIRDB-transform/tests/test.trunc.32.8.signed.sh similarity index 100% rename from libtransform/tests/test.trunc.32.8.signed.sh rename to libIRDB-transform/tests/test.trunc.32.8.signed.sh diff --git a/libtransform/tests/test.trunc.32.8.unsigned.sh b/libIRDB-transform/tests/test.trunc.32.8.unsigned.sh similarity index 100% rename from libtransform/tests/test.trunc.32.8.unsigned.sh rename to libIRDB-transform/tests/test.trunc.32.8.unsigned.sh diff --git a/libtransform/tests/test.trunc.64.16.signed.sh b/libIRDB-transform/tests/test.trunc.64.16.signed.sh similarity index 100% rename from libtransform/tests/test.trunc.64.16.signed.sh rename to libIRDB-transform/tests/test.trunc.64.16.signed.sh diff --git a/libtransform/tests/test.trunc.64.16.unknown.sh b/libIRDB-transform/tests/test.trunc.64.16.unknown.sh similarity index 100% rename from libtransform/tests/test.trunc.64.16.unknown.sh rename to libIRDB-transform/tests/test.trunc.64.16.unknown.sh diff --git a/libtransform/tests/test.trunc.64.16.unsigned.sh b/libIRDB-transform/tests/test.trunc.64.16.unsigned.sh similarity index 100% rename from libtransform/tests/test.trunc.64.16.unsigned.sh rename to libIRDB-transform/tests/test.trunc.64.16.unsigned.sh diff --git a/libtransform/tests/test.trunc.64.32.signed.sh b/libIRDB-transform/tests/test.trunc.64.32.signed.sh similarity index 100% rename from libtransform/tests/test.trunc.64.32.signed.sh rename to libIRDB-transform/tests/test.trunc.64.32.signed.sh diff --git a/libtransform/tests/test.trunc.64.32.unsigned.sh b/libIRDB-transform/tests/test.trunc.64.32.unsigned.sh similarity index 100% rename from libtransform/tests/test.trunc.64.32.unsigned.sh rename to libIRDB-transform/tests/test.trunc.64.32.unsigned.sh diff --git a/libtransform/tests/test.trunc.64.8.signed.sh b/libIRDB-transform/tests/test.trunc.64.8.signed.sh similarity index 100% rename from libtransform/tests/test.trunc.64.8.signed.sh rename to libIRDB-transform/tests/test.trunc.64.8.signed.sh diff --git a/libtransform/tests/test.trunc.64.8.unknown.sh b/libIRDB-transform/tests/test.trunc.64.8.unknown.sh similarity index 100% rename from libtransform/tests/test.trunc.64.8.unknown.sh rename to libIRDB-transform/tests/test.trunc.64.8.unknown.sh diff --git a/libtransform/tests/test.trunc.64.8.unsigned.sh b/libIRDB-transform/tests/test.trunc.64.8.unsigned.sh similarity index 100% rename from libtransform/tests/test.trunc.64.8.unsigned.sh rename to libIRDB-transform/tests/test.trunc.64.8.unsigned.sh diff --git a/libtransform/tests/test.unsigned_add.64.sh b/libIRDB-transform/tests/test.unsigned_add.64.sh similarity index 100% rename from libtransform/tests/test.unsigned_add.64.sh rename to libIRDB-transform/tests/test.unsigned_add.64.sh diff --git a/libtransform/tests/test.unsigned_mul.32.sh b/libIRDB-transform/tests/test.unsigned_mul.32.sh similarity index 100% rename from libtransform/tests/test.unsigned_mul.32.sh rename to libIRDB-transform/tests/test.unsigned_mul.32.sh diff --git a/libtransform/tests/test.unsigned_mul.64.sh b/libIRDB-transform/tests/test.unsigned_mul.64.sh similarity index 100% rename from libtransform/tests/test.unsigned_mul.64.sh rename to libIRDB-transform/tests/test.unsigned_mul.64.sh diff --git a/libtransform/tests/testall b/libIRDB-transform/tests/testall similarity index 100% rename from libtransform/tests/testall rename to libIRDB-transform/tests/testall diff --git a/libtransform/tests/trunc.16.8.c b/libIRDB-transform/tests/trunc.16.8.c similarity index 100% rename from libtransform/tests/trunc.16.8.c rename to libIRDB-transform/tests/trunc.16.8.c diff --git a/libtransform/tests/trunc.32.16.signed.c b/libIRDB-transform/tests/trunc.32.16.signed.c similarity index 100% rename from libtransform/tests/trunc.32.16.signed.c rename to libIRDB-transform/tests/trunc.32.16.signed.c diff --git a/libtransform/tests/trunc.32.16.unsigned.c b/libIRDB-transform/tests/trunc.32.16.unsigned.c similarity index 100% rename from libtransform/tests/trunc.32.16.unsigned.c rename to libIRDB-transform/tests/trunc.32.16.unsigned.c diff --git a/libtransform/tests/trunc.32.8.signed.c b/libIRDB-transform/tests/trunc.32.8.signed.c similarity index 100% rename from libtransform/tests/trunc.32.8.signed.c rename to libIRDB-transform/tests/trunc.32.8.signed.c diff --git a/libtransform/tests/trunc.32.8.unsigned.c b/libIRDB-transform/tests/trunc.32.8.unsigned.c similarity index 100% rename from libtransform/tests/trunc.32.8.unsigned.c rename to libIRDB-transform/tests/trunc.32.8.unsigned.c diff --git a/libtransform/tests/trunc.64.16.signed.c b/libIRDB-transform/tests/trunc.64.16.signed.c similarity index 100% rename from libtransform/tests/trunc.64.16.signed.c rename to libIRDB-transform/tests/trunc.64.16.signed.c diff --git a/libtransform/tests/trunc.64.16.unknown.c b/libIRDB-transform/tests/trunc.64.16.unknown.c similarity index 100% rename from libtransform/tests/trunc.64.16.unknown.c rename to libIRDB-transform/tests/trunc.64.16.unknown.c diff --git a/libtransform/tests/trunc.64.16.unsigned.c b/libIRDB-transform/tests/trunc.64.16.unsigned.c similarity index 100% rename from libtransform/tests/trunc.64.16.unsigned.c rename to libIRDB-transform/tests/trunc.64.16.unsigned.c diff --git a/libtransform/tests/trunc.64.32.signed.c b/libIRDB-transform/tests/trunc.64.32.signed.c similarity index 100% rename from libtransform/tests/trunc.64.32.signed.c rename to libIRDB-transform/tests/trunc.64.32.signed.c diff --git a/libtransform/tests/trunc.64.32.unsigned.c b/libIRDB-transform/tests/trunc.64.32.unsigned.c similarity index 100% rename from libtransform/tests/trunc.64.32.unsigned.c rename to libIRDB-transform/tests/trunc.64.32.unsigned.c diff --git a/libtransform/tests/trunc.64.8.signed.c b/libIRDB-transform/tests/trunc.64.8.signed.c similarity index 100% rename from libtransform/tests/trunc.64.8.signed.c rename to libIRDB-transform/tests/trunc.64.8.signed.c diff --git a/libtransform/tests/trunc.64.8.unknown.c b/libIRDB-transform/tests/trunc.64.8.unknown.c similarity index 100% rename from libtransform/tests/trunc.64.8.unknown.c rename to libIRDB-transform/tests/trunc.64.8.unknown.c diff --git a/libtransform/tests/trunc.64.8.unsigned.c b/libIRDB-transform/tests/trunc.64.8.unsigned.c similarity index 100% rename from libtransform/tests/trunc.64.8.unsigned.c rename to libIRDB-transform/tests/trunc.64.8.unsigned.c diff --git a/libtransform/tests/unsigned_add.64.c b/libIRDB-transform/tests/unsigned_add.64.c similarity index 100% rename from libtransform/tests/unsigned_add.64.c rename to libIRDB-transform/tests/unsigned_add.64.c diff --git a/libtransform/tests/unsigned_add.c b/libIRDB-transform/tests/unsigned_add.c similarity index 100% rename from libtransform/tests/unsigned_add.c rename to libIRDB-transform/tests/unsigned_add.c diff --git a/libtransform/tests/unsigned_mul.32.c b/libIRDB-transform/tests/unsigned_mul.32.c similarity index 100% rename from libtransform/tests/unsigned_mul.32.c rename to libIRDB-transform/tests/unsigned_mul.32.c diff --git a/libtransform/tests/unsigned_mul.64.c b/libIRDB-transform/tests/unsigned_mul.64.c similarity index 100% rename from libtransform/tests/unsigned_mul.64.c rename to libIRDB-transform/tests/unsigned_mul.64.c diff --git a/libIRDB/include/util/IBT_Provenance.hpp b/libIRDB-util/include/IBT_Provenance.hpp similarity index 100% rename from libIRDB/include/util/IBT_Provenance.hpp rename to libIRDB-util/include/IBT_Provenance.hpp diff --git a/libIRDB/include/util/Provenance.hpp b/libIRDB-util/include/Provenance.hpp similarity index 100% rename from libIRDB/include/util/Provenance.hpp rename to libIRDB-util/include/Provenance.hpp diff --git a/libIRDB/include/util/insn_preds.hpp b/libIRDB-util/include/insn_preds.hpp similarity index 100% rename from libIRDB/include/util/insn_preds.hpp rename to libIRDB-util/include/insn_preds.hpp diff --git a/libIRDB/include/libIRDB-util.hpp b/libIRDB-util/include/libIRDB-util.hpp similarity index 91% rename from libIRDB/include/libIRDB-util.hpp rename to libIRDB-util/include/libIRDB-util.hpp index 84d4e257b9f9610129dc18c8be5d4c128e8814f3..5b091d1165fab6cc1aa9edf3060a2a88e908c445 100644 --- a/libIRDB/include/libIRDB-util.hpp +++ b/libIRDB-util/include/libIRDB-util.hpp @@ -35,9 +35,9 @@ namespace libIRDB { -#include <util/insn_preds.hpp> -#include <util/IBT_Provenance.hpp> -#include <util/params.hpp> +#include <insn_preds.hpp> +#include <IBT_Provenance.hpp> +#include <params.hpp> }; diff --git a/libIRDB/include/util/params.hpp b/libIRDB-util/include/params.hpp similarity index 100% rename from libIRDB/include/util/params.hpp rename to libIRDB-util/include/params.hpp diff --git a/libIRDB/src/util/IBT_Provenance.cpp b/libIRDB-util/src/IBT_Provenance.cpp similarity index 100% rename from libIRDB/src/util/IBT_Provenance.cpp rename to libIRDB-util/src/IBT_Provenance.cpp diff --git a/libIRDB/src/util/Makefile b/libIRDB-util/src/Makefile similarity index 100% rename from libIRDB/src/util/Makefile rename to libIRDB-util/src/Makefile diff --git a/libIRDB/src/util/SConscript b/libIRDB-util/src/SConscript similarity index 86% rename from libIRDB/src/util/SConscript rename to libIRDB-util/src/SConscript index 6a872f20c8e9d7928be592aa9585e79a54fb596c..b57c532c186b2f609e50620c4dd156e9d720a6bc 100644 --- a/libIRDB/src/util/SConscript +++ b/libIRDB-util/src/SConscript @@ -14,7 +14,8 @@ files= ''' cpppath=''' $IRDB_SDK/include/ $SECURITY_TRANSFORMS_HOME/include/ - $SECURITY_TRANSFORMS_HOME/libIRDB/include/ + $SECURITY_TRANSFORMS_HOME/libIRDB-core/include/ + $SECURITY_TRANSFORMS_HOME/libIRDB-util/include/ ''' #myenv.Append(CCFLAGS=" -Wall -W -Wextra -Wconversion ") diff --git a/libIRDB/src/util/SConstruct b/libIRDB-util/src/SConstruct similarity index 100% rename from libIRDB/src/util/SConstruct rename to libIRDB-util/src/SConstruct diff --git a/libIRDB/src/util/insn_preds.cpp b/libIRDB-util/src/insn_preds.cpp similarity index 100% rename from libIRDB/src/util/insn_preds.cpp rename to libIRDB-util/src/insn_preds.cpp diff --git a/libIRDB/src/util/params.cpp b/libIRDB-util/src/params.cpp similarity index 100% rename from libIRDB/src/util/params.cpp rename to libIRDB-util/src/params.cpp diff --git a/libIRDB/LICENSE.txt b/libIRDB/LICENSE.txt deleted file mode 100644 index 312fba3fce32ba9e8a488ac58885ca41c59c2aa8..0000000000000000000000000000000000000000 --- a/libIRDB/LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -************************************************************************************* -* -* Unless otherwise specified, software artifacts in this directory and its -* subdirectories are subject to: -* -* GOVERNMENT PURPOSE RIGHTS -* -* The Government's rights to use, modify, reproduce, release, perform, display, or -* disclose this software are restricted by GOVERNMENT PURPOSE RIGHTS. -* -* Any reproduction of the software or portions thereof marked with this legend -* must also reproduce the markings. -* -************************************************************************************* diff --git a/libIRDB/Makefile.in b/libIRDB/Makefile.in deleted file mode 100644 index 2eda16e6fe37a49a9356cf509f1b755b6716aae0..0000000000000000000000000000000000000000 --- a/libIRDB/Makefile.in +++ /dev/null @@ -1,13 +0,0 @@ - -CC=@CC@ -CXX=@CXX@ - -all: - cd src;make CC="$(CC)" CXX="$(CXX)" - ./install_libs.sh - cd test;make CC="$(CC)" CXX="$(CXX)" - - -clean: - cd src;make clean - cd test;make clean diff --git a/libIRDB/SConscript b/libIRDB/SConscript deleted file mode 100644 index 4c1cbe85d0460f48d1a9e63d969b278e1d66baee..0000000000000000000000000000000000000000 --- a/libIRDB/SConscript +++ /dev/null @@ -1,10 +0,0 @@ -import os - -Import('env') - - -lib1=SConscript("src/SConscript") - - -ret=lib1 -Return('ret') diff --git a/libIRDB/SConstruct b/libIRDB/SConstruct deleted file mode 100644 index b5b7b78c5f88640c7e8877a9df76dc9191af7498..0000000000000000000000000000000000000000 --- a/libIRDB/SConstruct +++ /dev/null @@ -1,8 +0,0 @@ - - - -env=Environment() -Export('env') -lib=SConscript("SConscript") - -Return('lib') diff --git a/libIRDB/install_libs.sh b/libIRDB/install_libs.sh deleted file mode 100755 index 96de0964230d4707e30345074732d88da9f3908b..0000000000000000000000000000000000000000 --- a/libIRDB/install_libs.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -cd lib; -for i in *; -do - if test ! -f ../../lib/$i -o $i -nt ../../lib/$i ; then - echo Installing $i - cp $i ../../lib/; - fi -done - diff --git a/libIRDB/src/Makefile.in b/libIRDB/src/Makefile.in deleted file mode 100644 index bcf5ef6e803d87ebf6cde5111aee86982f75aca0..0000000000000000000000000000000000000000 --- a/libIRDB/src/Makefile.in +++ /dev/null @@ -1,11 +0,0 @@ - -CC=@CC@ -CXX=@CXX@ - -dirs=core cfg util syscall - -all: - for i in ${dirs}; do echo ${PWD}; cd $$i; make CC="$(CC)" CXX="$(CXX)" || exit 1; cd ..; done - -clean: - for i in ${dirs}; do echo ${PWD}; cd $$i; make clean || exit 1; cd ..; done diff --git a/libIRDB/src/SConscript b/libIRDB/src/SConscript deleted file mode 100644 index 439e5176c06481b34825a2eb2ddcb32f6f81ecd7..0000000000000000000000000000000000000000 --- a/libIRDB/src/SConscript +++ /dev/null @@ -1,17 +0,0 @@ -import os - -Import('env') - -tools=[] - -dirs=''' - cfg - core - syscall - util - ''' - -for i in Split(dirs): - tools=tools + SConscript(os.path.join(i,"SConscript")) - -Return('tools') diff --git a/libIRDB/src/SConstruct b/libIRDB/src/SConstruct deleted file mode 100644 index b5b7b78c5f88640c7e8877a9df76dc9191af7498..0000000000000000000000000000000000000000 --- a/libIRDB/src/SConstruct +++ /dev/null @@ -1,8 +0,0 @@ - - - -env=Environment() -Export('env') -lib=SConscript("SConscript") - -Return('lib') diff --git a/libtransform/tests/bin/ls_O3.exe b/libtransform/tests/bin/ls_O3.exe deleted file mode 100755 index cdbe0931c2b49ff1bcab208272a0508748ecfb2a..0000000000000000000000000000000000000000 Binary files a/libtransform/tests/bin/ls_O3.exe and /dev/null differ diff --git a/meds2pdb/SConscript b/meds2pdb/SConscript index 7c925ac4229bb95ffba4c888e0cb9d8828099690..ca7f560339534ff8749ed39cf64c61fe4aa62cff 100644 --- a/meds2pdb/SConscript +++ b/meds2pdb/SConscript @@ -9,10 +9,9 @@ myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME']) cpppath=''' $IRDB_SDK/include $SECURITY_TRANSFORMS_HOME/include + $SECURITY_TRANSFORMS_HOME/libIRDB-core/include $SECURITY_TRANSFORMS_HOME/libEXEIO/include - $SECURITY_TRANSFORMS_HOME/libIRDB/include $SECURITY_TRANSFORMS_HOME/libMEDSannotation/include - $SECURITY_TRANSFORMS_HOME/libtransform/include ''' files=Glob( Dir('.').srcnode().abspath+"/*.cpp") + Glob(Dir('.').srcnode().abspath+"/*.c") diff --git a/meds2pdb/elfreader.cpp b/meds2pdb/elfreader.cpp index 924dbdb04db67595b59548c0a6f3dbc7aeefde52..51f10cecea32d236fba283975abc44cf1b47f029 100644 --- a/meds2pdb/elfreader.cpp +++ b/meds2pdb/elfreader.cpp @@ -22,8 +22,8 @@ #include <string.h> #include <stdio.h> #include <irdb-core> -#include "elfreader.h" #include <libIRDB-core.hpp> +#include "elfreader.h" using namespace std; using namespace IRDB_SDK; diff --git a/thanos/SConscript b/thanos/SConscript index 408e042ba223e36478dd2c25e8404a5008bea9ef..ed7ad18ccbdec2248fb96d7f5fcef85375cac017 100644 --- a/thanos/SConscript +++ b/thanos/SConscript @@ -8,7 +8,7 @@ myenv.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME']) cpppath=''' $IRDB_SDK/include - $SECURITY_TRANSFORMS_HOME/libIRDB/include + $SECURITY_TRANSFORMS_HOME/libIRDB-core/include '''