-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move reverse to haystack[reverse] package
- Loading branch information
1 parent
2eccb6d
commit aaf7cc5
Showing
51 changed files
with
57 additions
and
10,731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
:mod:`haystack` -- a package to search known C or ctypes allocators in memory. | ||
============================================================================== | ||
.. module:: haystack | ||
:platform: Unix, Windows | ||
:synopsys: Search, reverse C/ctypes allocators from memory. | ||
.. moduleauthor:: Loic Jaquemet <loic.jaquemet+python [at] gmail.com> | ||
Available subpackages | ||
--------------------- | ||
gui | ||
An attempt to make a Qt4 GUI. | ||
reverse | ||
Framework to reverse engineer memory allocators | ||
""" | ||
|
||
__author__ = "Loic Jaquemet loic.jaquemet+python@gmail.com" | ||
|
||
__all__ = [ | ||
] | ||
|
||
# verify the version | ||
from pkg_resources import get_distribution, DistributionNotFound | ||
import os.path | ||
|
||
try: | ||
_dist = get_distribution('haystack') | ||
# Normalize case for Windows systems | ||
dist_loc = os.path.normcase(_dist.location) | ||
here = os.path.normcase(__file__) | ||
if not here.startswith(os.path.join(dist_loc, 'haystack')): | ||
# not installed, but there is another version that *is* | ||
raise DistributionNotFound | ||
except DistributionNotFound: | ||
__version__ = 'Please install this project with setup.py' | ||
else: | ||
__version__ = _dist.version | ||
|
||
# search API | ||
from haystack.search import api | ||
search_record = api.search_record | ||
output_to_string = api.output_to_string | ||
output_to_python = api.output_to_python | ||
|
||
try: | ||
import resource | ||
# augment our file limit capacity to max | ||
maxnofile = resource.getrlimit(resource.RLIMIT_NOFILE) | ||
# print 'maxnofile', maxnofile | ||
resource.setrlimit( | ||
resource.RLIMIT_NOFILE, | ||
(maxnofile[1], | ||
maxnofile[1])) | ||
# maxnofile_after = resource.getrlimit(resource.RLIMIT_NOFILE) | ||
# print 'maxnofile_after', maxnofile_after | ||
# travis-ci says | ||
# maxnofile (64000, 64000) | ||
# maxnofile_after (64000, 64000) | ||
except ImportError as e: | ||
pass | ||
|
||
|
||
# bad bad idea... | ||
MMAP_HACK_ACTIVE = True | ||
# do not load huge mmap | ||
MAX_MAPPING_SIZE_FOR_MMAP = 1024 * 1024 * 20 | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.