Giter Site home page Giter Site logo

usvfs's Introduction

usvfs

License Build status Coverity Scan Build Status

USVFS (short for User Space Virtual File System) aims to allow windows applications to create file or directory links that are visible to only a select set of processes. It does so by using api hooking to fool file access functions into discovering/opening files that are in fact somewhere else

Comparison to symbolic links

The following is based on the final goal for usvfs and doesn't necessary reflect the current development state.

Unlike symbolic file links provided by NTFS

  • links aren't visible to all applications but only to those the caller chooses
  • links disappear when the "session ends"
  • doesn't require write access to the link destination
  • doesn't require administrator rights (neither for installation nor for use)
  • links are filesystem independent so you can create links on fat32 drives, read-only media and network drives
  • can link multiple directories on top of a single destination (overlaying)
  • can also "virtually" unlink files, thus make them invisible to processes or replace existing files

There are of course drawbacks

  • will always impose a memory and cpu overhead though hopefully those will be marginal
  • becomes active only during the initialization phase of each process so it may not be active at the time dependent dlls are loaded
  • introduces a new source of bugs that can cause hard to diagnose problems in affected processes
  • may rub antivirus software the wrong way as the used techniques are similar to what some malware does.

Current state

usvfs is work in progress and should be considered in alpha state. It is a core component of Mod Organizer v2 https://github.com/TanninOne/modorganizer and thus receives serious real world testing

License

usvfs is currently licensed under the GPLv3 but this may change in the future.

Contributing

Contributions are very welcome but please notice that since I'm still undecided on licensing I have to ask all contributors to agree to future licensing changes.

usvfs's People

Contributors

lepresidente avatar tanninone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

usvfs's Issues

Doens't compile when using a 32bit compiler (MSVC 2015)

Fails to compile when trying to build the 32bit version

F:\Projects\modorganizer-umbrella\output_32\build\usvfs\usvfs\hookcontext.cpp(48): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1952): note: see declaration of '_snprintf'

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/move/detail/type_traits.hpp(761): error C2718: 'boost::container::basic_string<char,std::char_traits<char>,usvfs::shared::CharAllocatorT>': actual parameter with requested alignment of 8 won't be aligned

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/move/detail/type_traits.hpp(825): note: see reference to class template instantiation 'boost::move_detail::is_copy_constructible<T>' being compiled

        with

        [

            T=boost::container::basic_string<char,std::char_traits<char>,usvfs::shared::CharAllocatorT>

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/move/detail/meta_utils.hpp(357): note: see reference to class template instantiation 'boost::move_detail::is_trivially_copy_constructible<boost::container::basic_string<char,std::char_traits<char>,usvfs::shared::CharAllocatorT>>' being compiled

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/move/detail/meta_utils.hpp(375): note: see reference to class template instantiation 'boost::move_detail::and_impl<true,B,C,D>' being compiled

        with

        [

            B=boost::move_detail::is_trivially_copy_constructible<boost::container::basic_string<char,std::char_traits<char>,usvfs::shared::CharAllocatorT>>,

            C=boost::move_detail::true_,

            D=boost::move_detail::true_

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/detail/copy_move_algo.hpp(149): note: see reference to class template instantiation 'boost::move_detail::and_<boost::container::container_detail::are_contiguous_and_same<I,O>,boost::move_detail::is_trivially_copy_constructible<boost::container::basic_string<char,std::char_traits<char>,usvfs::shared::CharAllocatorT>>,boost::move_detail::true_,boost::move_detail::true_>' being compiled

        with

        [

            I=usvfs::shared::StringT *,

            O=usvfs::shared::StringT *

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/move/detail/meta_utils_core.hpp(68): note: see reference to class template instantiation 'boost::container::container_detail::is_memtransfer_copy_constructible<I,O>' being compiled

        with

        [

            I=usvfs::shared::StringT *,

            O=usvfs::shared::StringT *

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/detail/copy_move_algo.hpp(154): note: see reference to class template instantiation 'boost::move_detail::enable_if<boost::container::container_detail::is_memtransfer_copy_constructible<I,O>,R>' being compiled

        with

        [

            I=usvfs::shared::StringT *,

            O=usvfs::shared::StringT *,

            R=usvfs::shared::StringT *

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/vector.hpp(2947): note: see reference to class template instantiation 'boost::container::container_detail::enable_if_memtransfer_copy_constructible<T *,T *,T *>' being compiled

        with

        [

            T=usvfs::shared::StringT

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/vector.hpp(2802): note: see reference to function template instantiation 'void boost::container::vector<Value,Allocator>::priv_forward_range_insert_expand_forward<InsertionProxy>(T *const ,const unsigned int,InsertionProxy)' being compiled

        with

        [

            Value=usvfs::shared::StringT,

            Allocator=usvfs::StringAllocatorT,

            InsertionProxy=boost::container::container_detail::insert_move_proxy<usvfs::StringAllocatorT,usvfs::shared::StringT *>,

            T=usvfs::shared::StringT

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/vector.hpp(2802): note: see reference to function template instantiation 'void boost::container::vector<Value,Allocator>::priv_forward_range_insert_expand_forward<InsertionProxy>(T *const ,const unsigned int,InsertionProxy)' being compiled

        with

        [

            Value=usvfs::shared::StringT,

            Allocator=usvfs::StringAllocatorT,

            InsertionProxy=boost::container::container_detail::insert_move_proxy<usvfs::StringAllocatorT,usvfs::shared::StringT *>,

            T=usvfs::shared::StringT

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/vector.hpp(2610): note: see reference to function template instantiation 'boost::container::container_detail::vec_iterator<boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0>,false> boost::container::vector<Value,Allocator>::priv_forward_range_insert<boost::container::container_detail::insert_move_proxy<Allocator,T *>>(const boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0> &,const unsigned int,const InsertionProxy)' being compiled

        with

        [

            U=usvfs::shared::StringT,

            DifferenceType=int32_t,

            OffsetType=uint64_t,

            Value=usvfs::shared::StringT,

            Allocator=usvfs::StringAllocatorT,

            T=usvfs::shared::StringT,

            InsertionProxy=boost::container::container_detail::insert_move_proxy<usvfs::StringAllocatorT,usvfs::shared::StringT *>

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/vector.hpp(2609): note: see reference to function template instantiation 'boost::container::container_detail::vec_iterator<boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0>,false> boost::container::vector<Value,Allocator>::priv_forward_range_insert<boost::container::container_detail::insert_move_proxy<Allocator,T *>>(const boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0> &,const unsigned int,const InsertionProxy)' being compiled

        with

        [

            U=usvfs::shared::StringT,

            DifferenceType=int32_t,

            OffsetType=uint64_t,

            Value=usvfs::shared::StringT,

            Allocator=usvfs::StringAllocatorT,

            T=usvfs::shared::StringT,

            InsertionProxy=boost::container::container_detail::insert_move_proxy<usvfs::StringAllocatorT,usvfs::shared::StringT *>

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/vector.hpp(1864): note: see reference to function template instantiation 'boost::container::container_detail::vec_iterator<boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0>,false> boost::container::vector<Value,Allocator>::priv_insert<boost::container::basic_string<char,std::char_traits<char>,usvfs::shared::CharAllocatorT>>(const boost::container::container_detail::vec_iterator<boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0>,true> &,U &&)' being compiled

        with

        [

            U=usvfs::shared::StringT,

            DifferenceType=int32_t,

            OffsetType=uint64_t,

            Value=usvfs::shared::StringT,

            Allocator=usvfs::StringAllocatorT

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/vector.hpp(1864): note: see reference to function template instantiation 'boost::container::container_detail::vec_iterator<boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0>,false> boost::container::vector<Value,Allocator>::priv_insert<boost::container::basic_string<char,std::char_traits<char>,usvfs::shared::CharAllocatorT>>(const boost::container::container_detail::vec_iterator<boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0>,true> &,U &&)' being compiled

        with

        [

            U=usvfs::shared::StringT,

            DifferenceType=int32_t,

            OffsetType=uint64_t,

            Value=usvfs::shared::StringT,

            Allocator=usvfs::StringAllocatorT

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/vector.hpp(1864): note: while compiling class template member function 'boost::container::container_detail::vec_iterator<boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0>,false> boost::container::vector<Value,Allocator>::insert(boost::container::container_detail::vec_iterator<boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0>,true>,T &&)'

        with

        [

            U=usvfs::shared::StringT,

            DifferenceType=int32_t,

            OffsetType=uint64_t,

            Value=usvfs::shared::StringT,

            Allocator=usvfs::StringAllocatorT,

            T=usvfs::shared::StringT

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/detail/flat_tree.hpp(841): note: see reference to function template instantiation 'boost::container::container_detail::vec_iterator<boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0>,false> boost::container::vector<Value,Allocator>::insert(boost::container::container_detail::vec_iterator<boost::interprocess::offset_ptr<U,DifferenceType,OffsetType,0>,true>,T &&)' being compiled

        with

        [

            U=usvfs::shared::StringT,

            DifferenceType=int32_t,

            OffsetType=uint64_t,

            Value=usvfs::shared::StringT,

            Allocator=usvfs::StringAllocatorT,

            T=usvfs::shared::StringT

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/detail/flat_tree.hpp(173): note: see reference to class template instantiation 'boost::container::vector<Value,Allocator>' being compiled

        with

        [

            Value=usvfs::shared::StringT,

            Allocator=usvfs::StringAllocatorT

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/detail/flat_tree.hpp(176): note: see reference to class template instantiation 'boost::container::container_detail::flat_tree<Key,Key,boost::move_detail::identity<Key>,Compare,Allocator>::Data' being compiled

        with

        [

            Key=usvfs::shared::StringT,

            Compare=std::less<usvfs::shared::StringT>,

            Allocator=usvfs::StringAllocatorT

        ]

F:\Projects\modorganizer-umbrella\output_32\build\boost_1_60_0\boost/container/flat_set.hpp(74): note: see reference to class template instantiation 'boost::container::container_detail::flat_tree<Key,Key,boost::move_detail::identity<Key>,Compare,Allocator>' being compiled

        with

        [

            Key=usvfs::shared::StringT,

            Compare=std::less<usvfs::shared::StringT>,

            Allocator=usvfs::StringAllocatorT

        ]

f:\projects\modorganizer-umbrella\output_32\build\usvfs\usvfs\hookcontext.h(85): note: see reference to class template instantiation 'boost::container::flat_set<usvfs::shared::StringT,std::less<usvfs::shared::StringT>,usvfs::StringAllocatorT>' being compiled


Doesn't build with latest changes in asmjit

Build fails with the latest changes in asmjit's master branch

Last working commit: fb9f82cb61df36aa513d054e748dc6769045f33e

I have started working on it as you can see here "LePresidente@3005048"

which fixes the 64bit build, But the 32bit build fails with the following

ttrampolinepool.cpp
e:\mo2_32\build\asmjit\src\asmjit\./base/codebuilder.h(587) : warning C4510: 'asmjit::CBInstEx' : default constructor could not be generated
        e:\mo2_32\build\asmjit\src\asmjit\./base/codebuilder.h(584) : see declaration of 'asmjit::CBInstEx'
e:\mo2_32\build\asmjit\src\asmjit\./base/codebuilder.h(587) : warning C4610: struct 'asmjit::CBInstEx' can never be instantiated - user defined constructor required
E:\MO2_32\build\usvfs\thooklib\ttrampolinepool.cpp(163) : error C2065: 'Ptr' : undeclared identifier
E:\MO2_32\build\usvfs\thooklib\ttrampolinepool.cpp(163) : error C2143: syntax error : missing ')' before 'static_cast'
E:\MO2_32\build\usvfs\thooklib\ttrampolinepool.cpp(163) : error C2059: syntax error : ')'
E:\MO2_32\build\usvfs\thooklib\ttrampolinepool.cpp(172) : error C2065: 'Ptr' : undeclared identifier
E:\MO2_32\build\usvfs\thooklib\ttrampolinepool.cpp(172) : error C2143: syntax error : missing ')' before 'static_cast'
E:\MO2_32\build\usvfs\thooklib\ttrampolinepool.cpp(172) : error C2059: syntax error : ')'
E:\MO2_32\build\usvfs\thooklib\ttrampolinepool.cpp(178) : error C2065: 'Ptr' : undeclared identifier
E:\MO2_32\build\usvfs\thooklib\ttrampolinepool.cpp(178) : error C2143: syntax error : missing ')' before 'static_cast'
E:\MO2_32\build\usvfs\thooklib\ttrampolinepool.cpp(178) : error C2059: syntax error : ')'

Doesn't compile when using a 32bit compiler (MSVC 2013)

Reverted MSVC to 2013 hoping to get it to compile, though hit another memory allocation error. Not sure if this should be fixed in spdlog or usvfs though.

[ 75%] Building CXX object usvfs/CMakeFiles/usvfs_x86.dir/hooks/kernel32.cpp.obj

	cd D:\Build_32\build\usvfs\build\usvfs

	C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe  @C:\Users\MODORG~1\AppData\Local\Temp\nm8033.tmp

kernel32.cpp

Linking to lib file: libboost_date_time-vc120-mt-1_60.lib

Linking to lib file: libboost_filesystem-vc120-mt-1_60.lib

Linking to lib file: libboost_system-vc120-mt-1_60.lib

Linking to lib file: libboost_thread-vc120-mt-1_60.lib

Linking to lib file: libboost_chrono-vc120-mt-1_60.lib

this should be protected by a system-wide named mutex

D:\Build_32\build\usvfs\usvfs\hooks\kernel32.cpp(1088) : warning C4127: conditional expression is constant

d:\build_32\build\spdlog\include\spdlog\details\format.h(928) : error C2718: 'const usvfs::shared::StringT': actual parameter with __declspec(align('8')) won't be aligned

        d:\build_32\build\spdlog\include\spdlog\details\format.h(1717) : see reference to class template instantiation 'fmt::internal::IsConvertibleToInt<T>' being compiled

        with

        [

            T=usvfs::shared::StringT

        ]

        d:\build_32\build\spdlog\include\spdlog\details\format.h(1726) : see reference to function template instantiation 'void fmt::internal::store_args<Char,fmt::internal::Value,usvfs::shared::StringT,>(Arg *,const T &)' being compiled

        with

        [

            Char=char

,            Arg=fmt::internal::Value

,            T=usvfs::shared::StringT

        ]

        d:\build_32\build\spdlog\include\spdlog\details\format.h(2085) : see reference to function template instantiation 'fmt::ArgList fmt::internal::make_arg_list<Char,usvfs::shared::StringT>(fmt::internal::Value [],const usvfs::shared::StringT &)' being compiled

        with

        [

            Char=char

        ]

        d:\build_32\build\spdlog\include\spdlog\details\./line_logger.h(97) : see reference to function template instantiation 'void fmt::BasicWriter<char>::write<usvfs::shared::StringT>(fmt::BasicCStringRef<char>,const usvfs::shared::StringT &)' being compiled

        d:\build_32\build\spdlog\include\spdlog\details\./line_logger.h(97) : see reference to function template instantiation 'void fmt::BasicWriter<char>::write<usvfs::shared::StringT>(fmt::BasicCStringRef<char>,const usvfs::shared::StringT &)' being compiled

        d:\build_32\build\spdlog\include\spdlog\./details/logger_impl.h(81) : see reference to function template instantiation 'void spdlog::details::line_logger::write<usvfs::shared::StringT>(const char *,const usvfs::shared::StringT &)' being compiled

        d:\build_32\build\spdlog\include\spdlog\./details/logger_impl.h(117) : see reference to function template instantiation 'spdlog::details::line_logger spdlog::logger::_log_if_enabled<usvfs::shared::StringT>(spdlog::level::level_enum,const char *,const usvfs::shared::StringT &)' being compiled

        D:\Build_32\build\usvfs\shared\directory_tree.h(450) : see reference to function template instantiation 'spdlog::details::line_logger spdlog::logger::info<usvfs::shared::StringT>(const char *,const usvfs::shared::StringT &)' being compiled

        D:\Build_32\build\usvfs\shared\directory_tree.h(448) : while compiling class template member function 'void usvfs::shared::DirectoryTree<usvfs::RedirectionData>::removeFromTree(void)'

        D:\Build_32\build\usvfs\usvfs\hooks\kernel32.cpp(87) : see reference to function template instantiation 'void usvfs::shared::DirectoryTree<usvfs::RedirectionData>::removeFromTree(void)' being compiled

        D:\Build_32\build\usvfs\shared\directory_tree.h(627) : see reference to class template instantiation 'usvfs::shared::DirectoryTree<usvfs::RedirectionData>' being compiled

        d:\build_32\build\usvfs\usvfs\hooks\../hookcontext.h(215) : see reference to class template instantiation 'usvfs::shared::TreeContainer<usvfs::RedirectionTree>' being compiled

Change license to LGPLv3

I would like to relicense the User Space Virtual File System to be under the GNU Lesser General Public License version 3. This will make it possible for USVFS to be used by programs that are not GPL licensed.

This doesn’t affect Mod Organizer, because Mod Organizer is licensed under the GPLv3, because it uses USVFS, which itself is GPLv3 currently.

@TanninOne, @LePresidente if you agree with moving to this more free license, please write a comment confirming this.

Coverity Permission

Hi @TanninOne

Sorry looks like I chose the wrong permissions with coverity, so I can't upload the scan-log. Mind bumping me up a level to "Maintainer/Owner"

Regards

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.