Git Product home page Git Product logo

lzjd's People

Contributors

edwardraff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lzjd's Issues

Depricated software: CMake & Boost

Modern CMake is upset with the minimum version being 2.8:

CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

Boost 1.74 has this warning:

In file included from /usr/include/boost/config/header_deprecated.hpp:18,
                 from /usr/include/boost/function_output_iterator.hpp:12,
                 from /home/rjzak/CLionProjects/MalwareDB/LZJD/src/LZJD.cpp:8:
/usr/include/boost/function_output_iterator.hpp:14:1: note: ‘#pragma message: This header is deprecated. Use <boost/iterator/function_output_iterator.hpp> instead.’
   14 | BOOST_HEADER_DEPRECATED("<boost/iterator/function_output_iterator.hpp>")

For reference, LZJD wants 1.50 or newer, Debian 12 (my system) has 1.74, the latest version is 1.82.

How to compile?

Hi, I read your papers and I found them really interesting. I'm eager to play with them, but I'm not a C++ developer and I'm not sure how I should compile this.

So, on my Ubuntu box, I installed cmake, libboost-dev, libboost-program-options-dev, libboost-system-dev and libboost-filesystem-dev. At this point cmake doesn't complain anymore. From the source directory I run "cmake .", and then "make", but I get the following error and the build halts:

[ 10%] Building CXX object CMakeFiles/lzjd.static.dir/LZJD.cpp.o
/home/della/pkg/LZJD/src/LZJD.cpp: In function ‘int32_t similarity(const std::vector<int>&, const std::vector<int>&)’:
/home/della/pkg/LZJD/src/LZJD.cpp:132:19: error: ‘round’ was not declared in this scope
     return (int) (round(100*sim));
                   ^~~~~
/home/della/pkg/LZJD/src/LZJD.cpp:132:19: note: suggested alternative: ‘rand’
     return (int) (round(100*sim));
                   ^~~~~
                   rand

Can you help me with understanding how to get a running binary? Thanks a lot!

Wrong results in the special case where the hashed string is not long enough to generate a hash of 1024 ints

Hello,

The implementation has a bug in the case where the strings are not long enough to generate the target hash full length.

The function:
std::vector<int32_t> getAllHashes(std::vector& bytes, uint64_t k)
stops generating the hast at the last character of the string.

The function:
std::vector<int32_t> digest(uint64_t k, std::vector& bytes)
then does a vector.resize up to the target hash size. This means padding the vector with zeros.

The set intersection function has a very strong initial assumption about the set being a real set and not a vector. If there is one single duplicate value in either of the input arrays the comparison of the hashes gives wrong results.

Here is my current solution to this problem. (Space padding the input string until the target hash size is reached using the same set insert mechanism as for the input string).

std::vector<int32_t> getAllHashes(std::vector& bytes, uint64_t k)
{
std::vector<int32_t> ints;

std::unordered_set<int32_t> x_set;
MurmurHash3 running_hash = MurmurHash3();

for(char b : bytes) 
{
    int32_t hash = running_hash.pushByte(b);

    if (x_set.insert(hash).second)
    {
        //was successfully added, so never seen it before. Put it in! 
        ints.push_back(hash);
        running_hash.reset();
    }
}

while (ints.size() < k) {
    int32_t hash = running_hash.pushByte(0x20);

    if (x_set.insert(hash).second)
    {
        //was successfully added, so never seen it before. Put it in! 
        ints.push_back(hash);
        running_hash.reset();
    }
}

return ints;

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.