#include <stdint.h>#include <emu/emu_list.h>

Go to the source code of this file.
| typedef bool(* emu_hashtable_cmp_cb)(void *a, void *b) |
| typedef void(* emu_hashtable_destructor)(void *data) |
| typedef uint32_t(* emu_hashtable_hash_cb)(void *key) |
| void emu_hashtable_bucket_free | ( | struct emu_hashtable_bucket * | ehb | ) |
References emu_hashtable_bucket::items.
Referenced by emu_hashtable_free().
| void emu_hashtable_bucket_item_add | ( | struct emu_hashtable_bucket * | ehb, | |
| struct emu_hashtable_bucket_item * | ehbi | |||
| ) |
| void emu_hashtable_bucket_item_free | ( | struct emu_hashtable_bucket_item * | ehbi | ) |
Referenced by emu_hashtable_free().
| struct emu_hashtable_bucket_item* emu_hashtable_bucket_item_new | ( | void * | key, | |
| void * | value | |||
| ) | [read] |
References emu_hashtable_bucket_item::item, emu_hashtable_item::key, and emu_hashtable_item::value.
Referenced by emu_hashtable_insert().
| struct emu_hashtable_bucket* emu_hashtable_bucket_new | ( | void | ) | [read] |
References emu_hashtable_bucket::items.
Referenced by emu_hashtable_insert().
| bool emu_hashtable_delete | ( | struct emu_hashtable * | eh, | |
| void * | key | |||
| ) |
delete a key/data pair from the hashtable
| eh | the hashtable | |
| key | the key to the key/data pair to remove |
References emu_hashtable::buckets, emu_hashtable::cmp, emu_hashtable::hash, emu_hashtable_bucket_item::item, emu_hashtable_bucket::items, emu_hashtable_item::key, emu_hashtable::key_destructor, emu_hashtable::size, emu_hashtable_item::value, and emu_hashtable::value_destructor.
| void emu_hashtable_free | ( | struct emu_hashtable * | eh | ) |
Free the hashtable, if the emu_hashtable_destructors key_/value_destructor within the emu_hashtable are set, freeing the hashtable will free the data too, if not, only the hashtable itself is free'd.
| eh | the hashtable |
References emu_hashtable::buckets, emu_hashtable_bucket_free(), emu_hashtable_bucket_item_free(), emu_hashtable_bucket_item::item, emu_hashtable_bucket::items, emu_hashtable_item::key, emu_hashtable::key_destructor, emu_hashtable::size, emu_hashtable_item::value, and emu_hashtable::value_destructor.
Referenced by emu_env_linux_free(), emu_env_w32_dll_free(), emu_shellcode_test(), and emu_track_and_source_free().

| struct emu_hashtable_item* emu_hashtable_insert | ( | struct emu_hashtable * | eh, | |
| void * | key, | |||
| void * | data | |||
| ) | [read] |
Insert a key/data pair into the hashtable
| eh | the hashtable | |
| key | the key | |
| data | the data |
References emu_hashtable::buckets, emu_hashtable_bucket_item_new(), emu_hashtable_bucket_new(), emu_hashtable_search(), emu_hashtable::hash, emu_hashtable_bucket_item::item, emu_hashtable_bucket::items, emu_hashtable::size, and emu_hashtable_item::value.
Referenced by emu_env_linux_new(), emu_env_w32_dll_exports_copy(), emu_shellcode_run_and_track(), and emu_source_instruction_graph_create().

| struct emu_hashtable* emu_hashtable_new | ( | uint32_t | size, | |
| emu_hashtable_hash_cb | hash, | |||
| emu_hashtable_cmp_cb | cmp | |||
| ) | [read] |
Create a bucket hashtable Due to the problems of double hashing when it comes to deleting elements we choose bucket hashtables. If used wrong, as slow als linked lists, if used right, as fast as a real (doublehash) hashtable.
| size | the size | |
| hash | pointer to the hash function | |
| cmp | pointer to the compare function |
References emu_hashtable::buckets, emu_hashtable::cmp, emu_hashtable::hash, and emu_hashtable::size.
Referenced by emu_env_linux_new(), emu_env_w32_dll_exports_copy(), emu_shellcode_test(), and emu_source_instruction_graph_create().
| bool emu_hashtable_ptr_cmp | ( | void * | a, | |
| void * | b | |||
| ) |
Referenced by emu_env_w32_dll_exports_copy(), emu_shellcode_test(), and emu_source_instruction_graph_create().
| uint32_t emu_hashtable_ptr_hash | ( | void * | data | ) |
Referenced by emu_env_w32_dll_exports_copy(), emu_shellcode_test(), and emu_source_instruction_graph_create().
| struct emu_hashtable_item* emu_hashtable_search | ( | struct emu_hashtable * | eh, | |
| void * | key | |||
| ) | [read] |
Search the hashtable for a key
| eh | the hashtable | |
| key | the key to look for |
References emu_hashtable::buckets, emu_hashtable::cmp, emu_hashtable::hash, emu_hashtable_bucket_item::item, emu_hashtable_bucket::items, emu_hashtable_item::key, and emu_hashtable::size.
Referenced by emu_env_linux_syscall_check(), emu_env_linux_syscall_hook(), emu_env_w32_eip_check(), emu_env_w32_export_hook(), emu_hashtable_insert(), emu_shellcode_run_and_track(), emu_source_instruction_graph_create(), and env_w32_hook_GetProcAddress().
| bool emu_hashtable_string_cmp | ( | void * | a, | |
| void * | b | |||
| ) |
Referenced by emu_env_linux_new(), and emu_env_w32_dll_exports_copy().
| uint32_t emu_hashtable_string_hash | ( | void * | key | ) |
string hashing function to avoid duplicate code algo is djb2 taken from http://www.cse.yorku.ca/~oz/hash.html
| data | the string to hash |
Referenced by emu_env_linux_new(), and emu_env_w32_dll_exports_copy().
| header_list_functions | ( | emu_hashtable_bucket_items | , | |
| emu_hashtable_bucket_item_root | , | |||
| emu_hashtable_bucket_item | , | |||
| link | ||||
| ) |
| header_list_typedefs | ( | emu_hashtable_bucket_item_root | , | |
| emu_hashtable_bucket_item | , | |||
| emu_hashtable_bucket_link | ||||
| ) |
1.6.1