BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
Util.h File Reference
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <QtCore>
#include "win_hdrs/win_types.h"

Go to the source code of this file.

Namespaces

namespace  Logger
 
namespace  pe_util
 

Macros

#define DEFAULT_BUFSIZE   0xFF
 
#define IS_PRINTABLE(c)
 
#define IS_ENDLINE(c)
 
#define DBG_LVL   0
 
#define TRACE()
 
#define LOG(msg)
 

Enumerations

enum  Logger::dbg_level { Logger::D_ERROR = 0 , Logger::D_WARNING , Logger::D_INFO , Logger::D_LVL_COUNT }
 

Functions

bool Logger::append (dbg_level lvl, const char *format,...)
 
bool pe_util::isPrintable (char c)
 
bool pe_util::isStrLonger (const char *inp, size_t maxLen)
 
bool pe_util::hasNonPrintable (const char *ptr, size_t maxInp)
 
size_t pe_util::getAsciiLen (const char *ptr, size_t maxCount, bool acceptNotTerminated=false)
 
size_t pe_util::getAsciiLenW (const WORD *ptr, size_t maxCount, bool acceptNotTerminated=false)
 
size_t pe_util::noWhiteCount (char *buf, size_t bufSize)
 
size_t pe_util::noWhiteCount (std::string)
 
bool pe_util::validateFuncName (const char *fPtr, size_t bufSize)
 
size_t pe_util::forwarderNameLen (const char *ptr, size_t max_len)
 
void pe_util::hexdump (BYTE *buf, size_t bufSize, size_t pad)
 
size_t pe_util::unitsCount (uint64_t value, uint64_t unit, bool roundup=true)
 
uint64_t pe_util::roundup (uint64_t value, uint64_t unit)
 
bool pe_util::isSpaceClear (void *ptr, uint64_t size)
 
bool pe_util::isHexChar (char c)
 
bool pe_util::endsWith (std::string string, std::string endStr)
 

Macro Definition Documentation

◆ DBG_LVL

#define DBG_LVL   0

Definition at line 18 of file Util.h.

◆ DEFAULT_BUFSIZE

#define DEFAULT_BUFSIZE   0xFF

Definition at line 10 of file Util.h.

◆ IS_ENDLINE

#define IS_ENDLINE ( c)
Value:
(c == 0x0A || c == 0xD)

Definition at line 12 of file Util.h.

◆ IS_PRINTABLE

#define IS_PRINTABLE ( c)
Value:
(c >= 0x20 && c < 0x7f)

Definition at line 11 of file Util.h.

◆ LOG

#define LOG ( msg)
Value:
if (DBG_LVL) printf("%s: %s\n", __FUNCTION__,msg);
#define DBG_LVL
Definition Util.h:18

Definition at line 22 of file Util.h.

◆ TRACE

#define TRACE ( )
Value:
if (DBG_LVL) printf(">%s line: %d [%s]\n", __FUNCTION__, __LINE__, __FILE__);

Definition at line 21 of file Util.h.