FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
wazuh/src/shared_modules/utils/byteArrayHelper.h at fuzzing · postech-compsec/wazuh · GitHub
postech-compsec
wazuh
Repository navigation
Code
Pull requests
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
wazuh
/
src
/
shared_modules
/
utils
/
byteArrayHelper.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (34 loc) · 1.05 KB
Breadcrumbs
wazuh
/
src
/
shared_modules
/
utils
/
byteArrayHelper.h
Copy path
File metadata and controls
41 lines (34 loc) · 1.05 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Wazuh shared modules utils
* Copyright (C) 2015, Wazuh Inc.
* March 15, 2021.
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
* License (version 2) as published by the FSF - Free Software
* Foundation.
*/
#
ifndef
_BYTE_ARRAY_HELPER_H
#
define
_BYTE_ARRAY_HELPER_H
#
include
<
string
>
#
pragma
GCC diagnostic push
#
pragma
GCC diagnostic ignored "-Wunused-function"
namespace
Utils
{
static
int32_t
toInt32BE
(
uint8_t
const
* bytes)
{
return
static_cast
<
int32_t
>(bytes[
3
]) |
static_cast
<
int32_t
>(bytes[
2
]) <<
8
|
static_cast
<
int32_t
>(bytes[
1
]) <<
16
|
static_cast
<
int32_t
>(bytes[
0
]) <<
24
;
}
static
int32_t
toInt32LE
(
uint8_t
const
* bytes)
{
return
static_cast
<
int32_t
>(bytes[
0
]) |
static_cast
<
int32_t
>(bytes[
1
]) <<
8
|
static_cast
<
int32_t
>(bytes[
2
]) <<
16
|
static_cast
<
int32_t
>(bytes[
3
]) <<
24
;
}
}
#
pragma
GCC diagnostic pop
#
endif
//
_BYTE_ARRAY_HELPER_H
Back
|
FazBrowse Home
|
New Git URL