Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

tools.cc File Reference

#include "tools.h"
#include "htdebug.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

Go to the source code of this file.

Defines

#define LN2   0.693147180559945309417232121458177

Functions

dword delinearize (dword d)
int compare_keys_int_delinear (Object *key_a, Object *key_b)
int compare_keys_uint_delinear (Object *key_a, Object *key_b)
int * random_permutation (int max)
double calc_entropy (byte *buf, int size)
int calc_entropy2 (byte *buf, int size)
int out_of_memory (int size)
void * smalloc (size_t size)
void * smalloc0 (size_t size)

Variables

int(* out_of_memory_func )(int size)=&out_of_memory


Define Documentation

#define LN2   0.693147180559945309417232121458177
 

Definition at line 73 of file tools.cc.

Referenced by calc_entropy().


Function Documentation

double calc_entropy byte *  buf,
int  size
 

Definition at line 75 of file tools.cc.

References buf, LN2, and size.

Referenced by ht_linear_func_entropy2().

int calc_entropy2 byte *  buf,
int  size
 

Definition at line 99 of file tools.cc.

References buf, byte, and size.

Referenced by ht_hex_viewer::handlemsg(), and ht_linear_func_entropy().

int compare_keys_int_delinear Object key_a,
Object key_b
 

Definition at line 34 of file tools.cc.

References delinearize(), and value.

int compare_keys_uint_delinear Object key_a,
Object key_b
 

Definition at line 42 of file tools.cc.

References delinearize(), UINT, and value.

dword delinearize dword  d  ) 
 

Definition at line 29 of file tools.cc.

References dword.

Referenced by compare_keys_file_delinear(), compare_keys_info_pos_delinear(), compare_keys_int_delinear(), compare_keys_uint_delinear(), AddressFlat32::compareDelinear(), AddressFlat64::compareDelinear(), AddressX86Flat32::compareDelinear(), AddressX86_1632::compareDelinear(), and AddressX86_1616::compareDelinear().

int out_of_memory int  size  ) 
 

Definition at line 148 of file tools.cc.

References OUT_OF_MEMORY_FAIL.

Referenced by done_app().

int* random_permutation int  max  ) 
 

Definition at line 50 of file tools.cc.

References NULL, and smalloc().

Referenced by MachoAnalyser::beginAnalysis(), NEAnalyser::beginAnalysis(), PEAnalyser::beginAnalysis(), XBEAnalyser::beginAnalysis(), and ElfAnalyser::initInsertSymbols().

void* smalloc size_t  size  ) 
 

Definition at line 157 of file tools.cc.

References malloc(), NULL, out_of_memory_func, OUT_OF_MEMORY_IGNORE, OUT_OF_MEMORY_RETRY, and size.

Referenced by ht_compressed_stream::flush_compressed(), ht_compressed_stream::flush_uncompressed(), ht_object_stream_bin::getBinary(), ht_object_stream_txt::getBinary(), ht_object_stream_txt::getString(), ht_aviewer::handlemsg(), ht_app::handlemsg(), ht_strdup(), ht_strndup(), ht_compressed_stream::init(), SymbolBox::init(), AnalyInfoline::init(), ht_object_stream_txt::putString(), SymbolBox::quickfindCompletition(), quote_string(), and random_permutation().

void* smalloc0 size_t  size  ) 
 

Definition at line 172 of file tools.cc.

References malloc(), NULL, out_of_memory_func, OUT_OF_MEMORY_IGNORE, OUT_OF_MEMORY_RETRY, and size.

Referenced by Analyser::newLocation(), and Analyser::newSymbol().


Variable Documentation

int(* out_of_memory_func)(int size)=&out_of_memory
 

Definition at line 155 of file tools.cc.

Referenced by done_app(), init_app(), smalloc(), and smalloc0().


Generated on Fri May 7 21:15:52 2004 by doxygen 1.3.5