Clang-format touchup

This commit is contained in:
Micah Snyder 2024-01-09 19:41:17 -05:00 committed by Micah Snyder
parent 0e5d3f97f1
commit 1e5ddefcee
29 changed files with 178 additions and 177 deletions

View file

@ -212,7 +212,7 @@ struct client_parallel_data {
unsigned int id;
const char *file;
struct SCANID *next;
} * ids;
} *ids;
};
/* Sends a proper scan request to clamd and parses its replies

View file

@ -37,7 +37,7 @@
#include "scanners.h"
#include "dconf.h"
//#define DEBUG_APM_PARSE
// #define DEBUG_APM_PARSE
#ifdef DEBUG_APM_PARSE
#define apm_parsemsg(...) cli_dbgmsg(__VA_ARGS__)

View file

@ -286,17 +286,17 @@ static always_inline struct stack_entry *pop_stack(struct stack *stack,
*(uint8_t *)&values[p] = x
#define WRITE16(p, x) \
CHECK_GT(func->numBytes, p + 1); \
CHECK_EQ((p) & 1, 0); \
CHECK_EQ((p)&1, 0); \
TRACE_W(x, p, 16); \
*(uint16_t *)&values[p] = x
#define WRITE32(p, x) \
CHECK_GT(func->numBytes, p + 3); \
CHECK_EQ((p) & 3, 0); \
CHECK_EQ((p)&3, 0); \
TRACE_W(x, p, 32); \
*(uint32_t *)&values[p] = x
#define WRITE64(p, x) \
CHECK_GT(func->numBytes, p + 7); \
CHECK_EQ((p) & 7, 0); \
CHECK_EQ((p)&7, 0); \
TRACE_W(x, p, 64); \
*(uint64_t *)&values[p] = x
#define WRITEP(x, p) \
@ -348,8 +348,8 @@ static always_inline struct stack_entry *pop_stack(struct stack *stack,
}
#define READPOP(x, p, asize) \
{ \
if ((p) & 0x40000000) { \
unsigned ptr__ = (p) & 0xbfffffff; \
if ((p)&0x40000000) { \
unsigned ptr__ = (p)&0xbfffffff; \
CHECK_GT(func->numBytes, ptr__); \
TRACE_PTR(ptr__, asize); \
x = (void *)&values[ptr__]; \
@ -364,17 +364,17 @@ static always_inline struct stack_entry *pop_stack(struct stack *stack,
TRACE_R(x)
#define READOLD16(x, p) \
CHECK_GT(func->numBytes, p + 1); \
CHECK_EQ((p) & 1, 0); \
CHECK_EQ((p)&1, 0); \
x = *(uint16_t *)&old_values[p]; \
TRACE_R(x)
#define READOLD32(x, p) \
CHECK_GT(func->numBytes, p + 3); \
CHECK_EQ((p) & 3, 0); \
CHECK_EQ((p)&3, 0); \
x = *(uint32_t *)&old_values[p]; \
TRACE_R(x)
#define READOLD64(x, p) \
CHECK_GT(func->numBytes, p + 7); \
CHECK_EQ((p) & 7, 0); \
CHECK_EQ((p)&7, 0); \
x = *(uint64_t *)&old_values[p]; \
TRACE_R(x)

View file

@ -106,7 +106,7 @@ void LLVMInitializePowerPCAsmPrinter();
#include "llvm/IR/Dominators.h"
//#define TIMING
// #define TIMING
#undef TIMING
#include "llvm/Config/llvm-config.h"

View file

@ -57,7 +57,7 @@
typedef struct {
enum encodings encoding;
size_t size;
} * iconv_t;
}* iconv_t;
#endif
static unsigned char tohex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};

View file

@ -41,8 +41,8 @@
#include "scanners.h"
#include "dconf.h"
//#define DEBUG_GPT_PARSE
//#define DEBUG_GPT_PRINT
// #define DEBUG_GPT_PARSE
// #define DEBUG_GPT_PRINT
#ifdef DEBUG_GPT_PARSE
#define gpt_parsemsg(...) cli_dbgmsg(__VA_ARGS__)

View file

@ -358,7 +358,7 @@ struct IS_CABSTUFF {
unsigned int cabno;
off_t off;
size_t sz;
} * cabs;
} *cabs;
off_t hdr;
size_t hdrsz;
unsigned int cabcnt;

View file

@ -67,7 +67,7 @@ typedef struct scanner {
size_t lastpos;
enum tokenizer_state state;
enum tokenizer_state last_state;
} * yyscan_t;
} *yyscan_t;
static int yylex(YYSTYPE *lvalp, yyscan_t);
static void yy_scan_bytes(const char *, size_t, yyscan_t scanner);

View file

@ -162,7 +162,7 @@ typedef enum {
* Slows things down a lot and only catches unencoded copies
* of EICAR within bounces, which don't matter
*/
//#define SCAN_UNENCODED_BOUNCES
// #define SCAN_UNENCODED_BOUNCES
typedef struct mbox_ctx {
const char *dir;

View file

@ -38,8 +38,8 @@
#include "scanners.h"
#include "dconf.h"
//#define DEBUG_MBR_PARSE
//#define DEBUG_EBR_PARSE
// #define DEBUG_MBR_PARSE
// #define DEBUG_EBR_PARSE
#ifdef DEBUG_MBR_PARSE
#define mbr_parsemsg(...) cli_dbgmsg(__VA_ARGS__)

View file

@ -593,16 +593,16 @@ extern LIBCLAMAV_EXPORT int have_rar;
/* based on macros from A. Melnikoff */
#define cbswap16(v) (((v & 0xff) << 8) | (((v) >> 8) & 0xff))
#define cbswap32(v) ((((v) & 0x000000ff) << 24) | (((v) & 0x0000ff00) << 8) | \
(((v) & 0x00ff0000) >> 8) | (((v) & 0xff000000) >> 24))
#define cbswap64(v) ((((v) & 0x00000000000000ffULL) << 56) | \
(((v) & 0x000000000000ff00ULL) << 40) | \
(((v) & 0x0000000000ff0000ULL) << 24) | \
(((v) & 0x00000000ff000000ULL) << 8) | \
(((v) & 0x000000ff00000000ULL) >> 8) | \
(((v) & 0x0000ff0000000000ULL) >> 24) | \
(((v) & 0x00ff000000000000ULL) >> 40) | \
(((v) & 0xff00000000000000ULL) >> 56))
#define cbswap32(v) ((((v)&0x000000ff) << 24) | (((v)&0x0000ff00) << 8) | \
(((v)&0x00ff0000) >> 8) | (((v)&0xff000000) >> 24))
#define cbswap64(v) ((((v)&0x00000000000000ffULL) << 56) | \
(((v)&0x000000000000ff00ULL) << 40) | \
(((v)&0x0000000000ff0000ULL) << 24) | \
(((v)&0x00000000ff000000ULL) << 8) | \
(((v)&0x000000ff00000000ULL) >> 8) | \
(((v)&0x0000ff0000000000ULL) >> 24) | \
(((v)&0x00ff000000000000ULL) >> 40) | \
(((v)&0xff00000000000000ULL) >> 56))
#ifndef HAVE_ATTRIB_PACKED
#define __attribute__(x)
@ -828,8 +828,8 @@ size_t cli_recursion_stack_get_size(cli_ctx *ctx, int index);
/* used by: spin, yc (C) aCaB */
#define __SHIFTBITS(a) (sizeof(a) << 3)
#define __SHIFTMASK(a) (__SHIFTBITS(a) - 1)
#define CLI_ROL(a, b) a = (a << ((b) & __SHIFTMASK(a))) | (a >> ((__SHIFTBITS(a) - (b)) & __SHIFTMASK(a)))
#define CLI_ROR(a, b) a = (a >> ((b) & __SHIFTMASK(a))) | (a << ((__SHIFTBITS(a) - (b)) & __SHIFTMASK(a)))
#define CLI_ROL(a, b) a = (a << ((b)&__SHIFTMASK(a))) | (a >> ((__SHIFTBITS(a) - (b)) & __SHIFTMASK(a)))
#define CLI_ROR(a, b) a = (a >> ((b)&__SHIFTMASK(a))) | (a << ((__SHIFTBITS(a) - (b)) & __SHIFTMASK(a)))
/* Implementation independent sign-extended signed right shift */
#ifdef HAVE_SAR

View file

@ -3032,7 +3032,8 @@ static void check_user_password(struct pdf_struct *pdf, int R, const char *O,
case 3:
case 4: {
unsigned char *d;
size_t sz = 68 + pdf->fileIDlen + (R >= 4 && !EM ? 4 : 0); d = calloc(1, sz);
size_t sz = 68 + pdf->fileIDlen + (R >= 4 && !EM ? 4 : 0);
d = calloc(1, sz);
if (!(d))
goto done;

View file

@ -268,7 +268,7 @@ static char *pdf_decrypt_string(struct pdf_struct *pdf, struct pdf_obj *obj, con
bin_length = *length / 2;
// Convert the hex string to binary
CLI_MAX_CALLOC(decoded_bin, 1, bin_length);
CLI_MAX_CALLOC_OR_GOTO_DONE(decoded_bin, 1, bin_length);
hex2str_ret = cli_hex2str_to(hex, decoded_bin, *length);
if (hex2str_ret != 0) {

View file

@ -188,7 +188,7 @@ int cli_groupiconscan(struct ICON_ENV *icon_env, uint32_t rva)
uint16_t depth;
uint32_t sz;
uint16_t id;
} * dir;
} *dir;
raddr = cli_rawaddr(cli_readint32(grp), peinfo->sections, peinfo->nsections, (unsigned int *)(&err), map->len, peinfo->hdr_size);
cli_dbgmsg("cli_scanicon: icon group @%x\n", raddr);

View file

@ -27,6 +27,6 @@
#include <stdio.h>
#include "clamav-types.h"
int sf_base64decode(uint8_t*, size_t, uint8_t*, size_t, size_t*);
int sf_base64decode(uint8_t *, size_t, uint8_t *, size_t, size_t *);
#endif

View file

@ -66,7 +66,7 @@ typedef struct __attribute__((packed)) {
} lb_addr;
typedef struct __attribute__((packed)) {
uint32_t length; //4/14.14.1.1
uint32_t length; // 4/14.14.1.1
/*30 least significant bits are length in bytes.
*
* 2 most significant bits are described in figure 4/42
@ -77,7 +77,7 @@ typedef struct __attribute__((packed)) {
* 3 the extent is the next extent of allocation descriptors.
* */
lb_addr extentLocation; //logical block number. (CAN be zero)
lb_addr extentLocation; // logical block number. (CAN be zero)
uint8_t implementationUse[6];
@ -155,8 +155,8 @@ typedef struct __attribute__((packed)) {
uint16_t partitionReferenceNumber;
} LBAddr;
//https://www.ecma-international.org/wp-content/uploads/ECMA-167_3rd_edition_june_1997.pdf
//section 4/23
// https://www.ecma-international.org/wp-content/uploads/ECMA-167_3rd_edition_june_1997.pdf
// section 4/23
typedef struct __attribute__((packed)) {
uint32_t priorRecordedNumberOfDirectEntries;
uint16_t strategyType;
@ -284,7 +284,7 @@ typedef struct __attribute__((packed)) {
uint64_t infoLength;
uint64_t objectSize; //different
uint64_t objectSize; // different
uint64_t logicalBlocksRecorded;
@ -292,17 +292,17 @@ typedef struct __attribute__((packed)) {
timestamp modificationDateTime;
timestamp creationDateTime; //different
timestamp creationDateTime; // different
timestamp attributeDateTime;
uint32_t checkpoint;
uint32_t reserved; //different
uint32_t reserved; // different
long_ad extendedAttrICB;
long_ad streamDirectoryICB; //different
long_ad streamDirectoryICB; // different
regid implementationId;
@ -462,7 +462,7 @@ typedef struct __attribute__((packed)) {
charspec descriptorCharSet;
uint8_t logicalVolumeIdentifier[128]; //TODO: handle dstring
uint8_t logicalVolumeIdentifier[128]; // TODO: handle dstring
uint32_t logicalBlockSize;
@ -480,7 +480,7 @@ typedef struct __attribute__((packed)) {
ext_ad integritySequenceExtent;
uint8_t partitionMaps[1]; //actual length of mapTableLength above;
uint8_t partitionMaps[1]; // actual length of mapTableLength above;
} LogicalVolumeDescriptor;

View file

@ -470,7 +470,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
id = le16_to_host(val16);
data_offset += sizeof(uint16_t);
@ -479,7 +479,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
@ -497,7 +497,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
uint32_t sys_kind = le32_to_host(val32);
data_offset += sizeof(uint32_t);
CLI_WRITEN("REM PROJECTSYSKIND: ", 20);
@ -534,7 +534,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
uint32_t lcid = le32_to_host(val32);
char buf[64];
data_offset += size;
@ -552,7 +552,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
uint32_t lcid_invoke = le32_to_host(val32);
char buf[64];
data_offset += sizeof(uint32_t);
@ -570,7 +570,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
codepage = le16_to_host(val16);
char buf[64];
data_offset += sizeof(uint16_t);
@ -640,7 +640,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
id = le16_to_host(val16);
if (id != 0x003d) {
cli_warnmsg("vba_readdir_new: PROJECTHELPFILEPATH is not followed by PROJECTHELPFILEPATH2\n");
@ -655,7 +655,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
uint32_t size2;
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size2 = le32_to_host(val32);
data_offset += sizeof(uint32_t);
@ -692,7 +692,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
uint32_t context = le32_to_host(val32);
char buf[64];
data_offset += size;
@ -710,7 +710,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
uint32_t libflags = le32_to_host(val32);
char buf[64];
data_offset += sizeof(uint32_t);
@ -729,7 +729,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
uint32_t major = le32_to_host(val32);
data_offset += size;
@ -738,7 +738,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
uint16_t minor = le16_to_host(val16);
data_offset += sizeof(uint16_t);
char buf[64];
@ -756,7 +756,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
uint16_t modules = le16_to_host(val16);
data_offset += sizeof(uint16_t);
char buf[64];
@ -774,7 +774,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
ret = CL_EREAD;
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
uint16_t cookie = le16_to_host(val16);
data_offset += sizeof(uint16_t);
char buf[64];
@ -808,7 +808,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
if ((id = le16_to_host(val16)) != 0x0047) {
cli_dbgmsg("cli_vba_readdir_new: Expected MODULENAMEUNICODE (0x47) record, but got 0x%04x\n", id);
ret = CL_EREAD;
@ -816,7 +816,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
}
data_offset += sizeof(uint16_t);
CLI_WRITEN("\nREM MODULENAMEUNICODE: ", 24);
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
@ -859,7 +859,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
if ((id = le16_to_host(val16)) != 0x001a) {
cli_dbgmsg("cli_vba_readdir_new: Expected MODULESTREAMNAME (0x1a) record, but got 0x%04x\n", id);
ret = CL_EREAD;
@ -867,7 +867,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
}
data_offset += sizeof(uint16_t);
CLI_WRITEN("\nREM MODULESTREAMNAME: ", 23);
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
@ -894,7 +894,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
if ((id = le16_to_host(val16)) != 0x0032) {
cli_dbgmsg("cli_vba_readdir_new: Expected MODULESTREAMNAMEUNICODE (0x32) record, but got 0x%04x\n", id);
ret = CL_EREAD;
@ -902,7 +902,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
}
data_offset += sizeof(uint16_t);
CLI_WRITEN("\nREM MODULESTREAMNAMEUNICODE: ", 30);
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
uint32_t module_stream_name_size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
@ -946,7 +946,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
if ((id = le16_to_host(val16)) != 0x001c) {
cli_dbgmsg("cli_vba_readdir_new: Expected MODULEDOCSTRING (0x1c) record, but got 0x%04x\n", id);
ret = CL_EREAD;
@ -954,7 +954,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
}
data_offset += sizeof(uint16_t);
CLI_WRITEN("\nREM MODULEDOCSTRING: ", 22);
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
@ -981,7 +981,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
if ((id = le16_to_host(val16)) != 0x0048) {
cli_dbgmsg("cli_vba_readdir_new: Expected MODULEDOCSTRINGUNICODE (0x32) record, but got 0x%04x\n", id);
ret = CL_EREAD;
@ -989,7 +989,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
}
data_offset += sizeof(uint16_t);
CLI_WRITEN("\nREM MODULEDOCSTRINGUNICODE: ", 29);
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
@ -1032,14 +1032,14 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
if ((id = le16_to_host(val16)) != 0x0031) {
cli_dbgmsg("cli_vba_readdir_new: Expected MODULEOFFSET (0x31) record, but got 0x%04x\n", id);
ret = CL_EREAD;
goto done;
}
data_offset += sizeof(uint16_t);
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
if (size != sizeof(uint32_t)) {
@ -1054,7 +1054,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
uint32_t module_offset = le32_to_host(val32);
data_offset += size;
char buffer[64];
@ -1071,7 +1071,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
if ((id = le16_to_host(val16)) != 0x001e) {
cli_dbgmsg("cli_vba_readdir_new: Expected MODULEHELPCONTEXT (0x1e) record, but got 0x%04x\n", id);
ret = CL_EREAD;
@ -1079,7 +1079,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
}
data_offset += sizeof(uint16_t);
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
if (size != sizeof(uint32_t)) {
@ -1094,7 +1094,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
uint32_t help_context = le32_to_host(val32);
data_offset += size;
buffer_size = snprintf(buffer, sizeof(buffer), "\nREM MODULEHELPCONTEXT: 0x%08x", help_context);
@ -1110,14 +1110,14 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
if ((id = le16_to_host(val16)) != 0x002c) {
cli_dbgmsg("cli_vba_readdir_new: Expected MODULECOOKIE (0x2c) record, but got 0x%04x\n", id);
ret = CL_EREAD;
goto done;
}
data_offset += sizeof(uint16_t);
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
if (size != sizeof(uint16_t)) {
@ -1132,7 +1132,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
uint16_t cookie = le16_to_host(val16);
data_offset += size;
buffer_size = snprintf(buffer, sizeof(buffer), "\nREM MODULECOOKIE: 0x%04x", cookie);
@ -1147,7 +1147,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
id = le16_to_host(val16);
if (id != 0x0021 && id != 0x0022) {
cli_dbgmsg("cli_vba_readdir_new: Expected MODULETYPE (0x21/0x22) record, but got 0x%04x\n", id);
@ -1155,7 +1155,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
data_offset += sizeof(uint16_t);
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
if (size != 0) {
@ -1176,7 +1176,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
id = le16_to_host(val16);
data_offset += sizeof(uint16_t);
@ -1187,7 +1187,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
if (size != 0) {
@ -1203,7 +1203,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
id = le16_to_host(val16);
data_offset += sizeof(uint16_t);
}
@ -1216,7 +1216,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
if (size != 0) {
@ -1232,7 +1232,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val16, &data[data_offset], sizeof (uint16_t));
memcpy(&val16, &data[data_offset], sizeof(uint16_t));
id = le16_to_host(val16);
data_offset += sizeof(uint16_t);
}
@ -1250,7 +1250,7 @@ cl_error_t cli_vba_readdir_new(cli_ctx *ctx, const char *dir, struct uniq *U, co
goto done;
}
memcpy(&val32, &data[data_offset], sizeof (uint32_t));
memcpy(&val32, &data[data_offset], sizeof(uint32_t));
size = le32_to_host(val32);
data_offset += sizeof(uint32_t);
if (size != 0) {
@ -2021,7 +2021,7 @@ word_read_macro_entry(int fd, macro_info_t *macro_info)
uint32_t len __attribute__((packed));
uint32_t state __attribute__((packed));
uint32_t offset __attribute__((packed));
} * m;
} *m;
const struct macro *n;
#ifdef HAVE_PRAGMA_PACK
#pragma pack()

View file

@ -22,11 +22,11 @@
#include <errno.h>
#include <Windows.h>
//#include "clamav.h"
//#include "others.h"
// #include "clamav.h"
// #include "others.h"
#include "dirent.h"
#include "w32_stat.h"
//#include "misc.h"
// #include "misc.h"
DIR *opendir(const char *name)
{

View file

@ -19,7 +19,7 @@
#define strncasecmp _strnicmp
#ifndef _LIBC
//# include <config.h>
// # include <config.h>
#endif
#include <time.h>
@ -31,7 +31,7 @@
#endif
#include <limits.h>
#include <string.h>
//#include <stdbool.h>
// #include <stdbool.h>
#ifdef _LIBC
#include "../locale/localeinfo.h"