HollowsHunter
Scans all running processes. Recognizes and dumps a variety of potentially malicious implants (replaced/implanted PEs, shellcodes, hooks, in-memory patches).
Loading...
Searching...
No Matches
util
custom_buffer.h
Go to the documentation of this file.
1
#pragma once
2
#include <windows.h>
3
4
namespace
util
{
5
6
struct
AutoBuffer
7
{
8
AutoBuffer
() :
buf
(nullptr),
max_size
(0),
buf_size
(0) { }
9
10
~AutoBuffer
() {
11
if
(
buf
) {
12
::free(
buf
);
13
buf
=
nullptr
;
14
}
15
max_size
= 0;
16
buf_size
= 0;
17
}
18
19
BYTE*
alloc
(
size_t
_buf_size)
20
{
21
if
(_buf_size >
max_size
) {
22
BYTE* allocated = (BYTE*)::realloc((
void
*)
buf
, _buf_size);
23
if
(!allocated) {
24
return
nullptr
;
25
}
26
buf
= allocated;
27
max_size
= _buf_size;
28
}
29
buf_size
= _buf_size;
30
::memset(
buf
, 0,
max_size
);
31
return
buf
;
32
}
33
34
BYTE*
buf
;
35
size_t
max_size
;
36
size_t
buf_size
;
37
};
38
39
};
//namespace util
40
util
Definition
etw_settings.cpp:14
util::AutoBuffer::buf_size
size_t buf_size
Definition
custom_buffer.h:36
util::AutoBuffer::AutoBuffer
AutoBuffer()
Definition
custom_buffer.h:8
util::AutoBuffer::~AutoBuffer
~AutoBuffer()
Definition
custom_buffer.h:10
util::AutoBuffer::alloc
BYTE * alloc(size_t _buf_size)
Definition
custom_buffer.h:19
util::AutoBuffer::max_size
size_t max_size
Definition
custom_buffer.h:35
util::AutoBuffer::buf
BYTE * buf
Definition
custom_buffer.h:34
Generated by
1.13.2