# Path: haystack/search/api.py
# class HaystackError(Exception):
# def search_record(memory_handler, record_type, search_constraints=None, extended_search=False):
# def search_record_hint(memory_handler, record_type, hint, search_constraints=None, extended_search=False):
# def output_to_string(memory_handler, results):
# def output_to_python(memory_handler, results):
# def output_to_json(memory_handler, results):
# def output_to_pickle(memory_handler, results):
# def load_record(memory_handler, struct_type, memory_address, load_constraints=None):
# def validate_record(memory_handler, instance, record_constraints=None, max_depth=10):
# 
# Path: haystack/search/searcher.py
# class RecordSearcher(object):
# class RecordLoader(RecordSearcher):
# class AnyOffsetRecordSearcher(RecordSearcher):
#     def __init__(self, memory_handler, my_constraints=None, target_mappings=None, update_cb=None):
#     def search(self, struct_type, max_res=10, max_depth=10):
#     def _search_in(self, mem_map, struct_type, nb=10, depth=99):
#     def _load_at(self, mem_map, address, struct_type, depth=99):
#     def load(self, struct_type, memory_address):
#     def __init__(self, memory_handler, my_constraints=None, target_mappings=None, update_cb=None):
#     def _search_in(self, mem_map, struct_type, nb=10, depth=99, align=None):
# 
# Path: haystack/mappings/folder.py
# MMAP_HACK_ACTIVE = True
# MAX_MAPPING_SIZE_FOR_MMAP = 1024 * 1024 * 20
# class LazyLoadingException(Exception):
# class MemoryDumpLoader(interfaces.IMemoryLoader):
# class ProcessMemoryDumpLoader(MemoryDumpLoader):
# class LazyProcessMemoryDumpLoader(ProcessMemoryDumpLoader):
# class VeryLazyProcessMemoryDumpLoader(LazyProcessMemoryDumpLoader):
# class FolderLoader(interfaces.IMemoryLoader):
#     def __init__(self, filename):
#     def __init__(self, dumpname, bits=None, os_name=None):
#     def make_memory_handler(self):
#     def _is_valid(self):
#     def _load_mappings(self):
#     def _is_valid(self):
#     def _test_dir(self):
#     def _protected_open_file(self, mmap_fname, mmap_pathname):
#     def _load_mappings(self):
#     def _load_metadata(self):
#     def _load_memory_mappings(self):
#     def __init__(self, dumpname, maps_to_load=None, bits=None, os_name=None):
#     def _protected_open_file(self, mmap_fname, mmap_pathname):
#     def _load_memory_mappings(self):
# def load(dumpname, bits=None, os_name=None):
#     def __init__(self, opts):
#     def make_memory_handler(self):


import logging
import unittest
from haystack.search import api
from haystack.search import searcher
from haystack.mappings import folder
#!/usr/bin/env python
# -*- coding: utf-8 -*-




class TestApiWin32Dump(unittest.TestCase):
    """
    test if the API works for windows
    """

    memdumpname = 'test/dumps/putty/putty.1.dump'
    #modulename = "test/src/putty.py"

    def setUp(self):
        self.classname = 'haystack.allocators.win32.win7heap.HEAP'
        self.known_heaps = [(0x00390000, 8956), (0x00540000, 868),
                            (0x00580000, 111933), (0x005c0000, 1704080),
                            (0x01ef0000, 604), (0x02010000, 61348),
                            (0x02080000, 474949), (0x021f0000, 18762),
                            (0x03360000, 604), (0x04030000, 632),
                            (0x04110000, 1334), (0x041c0000, 644),
                            # from free stuf
                            (0x0061a000, 1200),
                            ]

# Path: haystack/search/api.py
# class HaystackError(Exception):
# def search_record(memory_handler, record_type, search_constraints=None, extended_search=False):
# def search_record_hint(memory_handler, record_type, hint, search_constraints=None, extended_search=False):
# def output_to_string(memory_handler, results):
# def output_to_python(memory_handler, results):
# def output_to_json(memory_handler, results):
# def output_to_pickle(memory_handler, results):
# def load_record(memory_handler, struct_type, memory_address, load_constraints=None):
# def validate_record(memory_handler, instance, record_constraints=None, max_depth=10):
# 
# Path: haystack/search/searcher.py
# class RecordSearcher(object):
# class RecordLoader(RecordSearcher):
# class AnyOffsetRecordSearcher(RecordSearcher):
#     def __init__(self, memory_handler, my_constraints=None, target_mappings=None, update_cb=None):
#     def search(self, struct_type, max_res=10, max_depth=10):
#     def _search_in(self, mem_map, struct_type, nb=10, depth=99):
#     def _load_at(self, mem_map, address, struct_type, depth=99):
#     def load(self, struct_type, memory_address):
#     def __init__(self, memory_handler, my_constraints=None, target_mappings=None, update_cb=None):
#     def _search_in(self, mem_map, struct_type, nb=10, depth=99, align=None):
# 
# Path: haystack/mappings/folder.py
# MMAP_HACK_ACTIVE = True
# MAX_MAPPING_SIZE_FOR_MMAP = 1024 * 1024 * 20
# class LazyLoadingException(Exception):
# class MemoryDumpLoader(interfaces.IMemoryLoader):
# class ProcessMemoryDumpLoader(MemoryDumpLoader):
# class LazyProcessMemoryDumpLoader(ProcessMemoryDumpLoader):
# class VeryLazyProcessMemoryDumpLoader(LazyProcessMemoryDumpLoader):
# class FolderLoader(interfaces.IMemoryLoader):
#     def __init__(self, filename):
#     def __init__(self, dumpname, bits=None, os_name=None):
#     def make_memory_handler(self):
#     def _is_valid(self):
#     def _load_mappings(self):
#     def _is_valid(self):
#     def _test_dir(self):
#     def _protected_open_file(self, mmap_fname, mmap_pathname):
#     def _load_mappings(self):
#     def _load_metadata(self):
#     def _load_memory_mappings(self):
#     def __init__(self, dumpname, maps_to_load=None, bits=None, os_name=None):
#     def _protected_open_file(self, mmap_fname, mmap_pathname):
#     def _load_memory_mappings(self):
# def load(dumpname, bits=None, os_name=None):
#     def __init__(self, opts):
#     def make_memory_handler(self):


# Path: test/haystack/search/test_searcher.py
import logging
import unittest
from haystack.search import api
from haystack.search import searcher
from haystack.mappings import folder

#!/usr/bin/env python
# -*- coding: utf-8 -*-




class TestApiWin32Dump(unittest.TestCase):
    """
    test if the API works for windows
    """

    memdumpname = 'test/dumps/putty/putty.1.dump'
    #modulename = "test/src/putty.py"

    def setUp(self):
        self.classname = 'haystack.allocators.win32.win7heap.HEAP'
        self.known_heaps = [(0x00390000, 8956), (0x00540000, 868),
                            (0x00580000, 111933), (0x005c0000, 1704080),
                            (0x01ef0000, 604), (0x02010000, 61348),
                            (0x02080000, 474949), (0x021f0000, 18762),
                            (0x03360000, 604), (0x04030000, 632),
                            (0x04110000, 1334), (0x041c0000, 644),
                            # from free stuf
                            (0x0061a000, 1200),
                            ]

        self.memory_handler = folder.load(self.memdumpname)