Distcheck fixes.

0.96
Török Edvin 16 years ago
parent 5b5e4e6ef0
commit d0934caf99
  1. 5
      clambc/bcrun.c
  2. 1
      libclamav/Makefile.am
  3. 63
      libclamav/Makefile.in
  4. 10
      libclamav/bytecode.c
  5. 1
      libclamav/bytecode.h
  6. 3
      libclamav/bytecode_api.c
  7. 4
      libclamav/bytecode_nojit.c
  8. 3
      libclamav/c++/Makefile.am
  9. 3
      libclamav/c++/Makefile.in
  10. 4
      libclamav/c++/bytecode2llvm.cpp
  11. 1
      libclamav/libclamav.map
  12. 2
      libclamav/pe.c

@ -130,10 +130,11 @@ int main(int argc, char *argv[])
exit(1);
}
if(optget(opts, "version")->enabled) {
char* argvx[] = {argv[0], "--version",NULL};
char versions[] = "--version";
char* argvx[] = {argv[0], versions,NULL};
printf("Clam AntiVirus Bytecode Testing Tool %s\n", get_version());
cl_init(CL_INIT_DEFAULT);
cli_bytecode_debug(2, argvx);
cli_bytecode_printversion();
optfree(opts);
exit(0);
}

@ -181,6 +181,7 @@ libclamav_la_SOURCES = \
pe_icons.h \
disasm.c \
disasm.h \
disasm-common.h \
disasmpriv.h \
upx.c \
upx.h \

@ -119,28 +119,29 @@ am__libclamav_la_SOURCES_DIST = clamav.h matcher-ac.c matcher-ac.h \
mbox.h message.c message.h table.c table.h text.c text.h \
ole2_extract.c ole2_extract.h vba_extract.c vba_extract.h \
cltypes.h msexpand.c msexpand.h pe.c pe.h pe_icons.c \
pe_icons.h disasm.c disasm.h disasmpriv.h upx.c upx.h \
htmlnorm.c htmlnorm.h chmunpack.c chmunpack.h rebuildpe.c \
rebuildpe.h petite.c petite.h wwunpack.c wwunpack.h unsp.c \
unsp.h aspack.c aspack.h packlibs.c packlibs.h fsg.c fsg.h \
mew.c mew.h upack.c upack.h line.c line.h untar.c untar.h \
unzip.c unzip.h inflate64.c inflate64.h inffixed64.h \
inflate64_priv.h special.c special.h binhex.c binhex.h \
is_tar.c is_tar.h tnef.c tnef.h autoit.c autoit.h unarj.c \
unarj.h nsis/bzlib.c nsis/bzlib_private.h nsis/nsis_bzlib.h \
nsis/nulsft.c nsis/nulsft.h nsis/infblock.c nsis/nsis_zconf.h \
nsis/nsis_zlib.h nsis/nsis_zutil.h pdf.c pdf.h spin.c spin.h \
yc.c yc.h elf.c elf.h execs.h sis.c sis.h uuencode.c \
uuencode.h phishcheck.c phishcheck.h phish_domaincheck_db.c \
phish_domaincheck_db.h phish_whitelist.c phish_whitelist.h \
iana_cctld.h iana_tld.h regex_list.c regex_list.h \
regex_suffix.c regex_suffix.h mspack.c mspack.h cab.c cab.h \
entconv.c entconv.h entitylist.h encoding_aliases.h hashtab.c \
hashtab.h dconf.c dconf.h 7z/LzmaDec.c 7z/LzmaDec.h 7z/Types.h \
lzma_iface.c lzma_iface.h 7z.c 7z.h 7z/7zFile.c 7z/7zFile.h \
7z/7zStream.c 7z/CpuArch.h 7z/7zCrc.c 7z/7zCrc.h 7z/7zBuf.c \
7z/7zBuf.h 7z/Bcj2.c 7z/Bcj2.h 7z/Bra.c 7z/Bra.h 7z/Bra86.c \
7z/BraIA64.c 7z/Archive/7z/7zIn.c 7z/Archive/7z/7zIn.h \
pe_icons.h disasm.c disasm.h disasm-common.h disasmpriv.h \
upx.c upx.h htmlnorm.c htmlnorm.h chmunpack.c chmunpack.h \
rebuildpe.c rebuildpe.h petite.c petite.h wwunpack.c \
wwunpack.h unsp.c unsp.h aspack.c aspack.h packlibs.c \
packlibs.h fsg.c fsg.h mew.c mew.h upack.c upack.h line.c \
line.h untar.c untar.h unzip.c unzip.h inflate64.c inflate64.h \
inffixed64.h inflate64_priv.h special.c special.h binhex.c \
binhex.h is_tar.c is_tar.h tnef.c tnef.h autoit.c autoit.h \
unarj.c unarj.h nsis/bzlib.c nsis/bzlib_private.h \
nsis/nsis_bzlib.h nsis/nulsft.c nsis/nulsft.h nsis/infblock.c \
nsis/nsis_zconf.h nsis/nsis_zlib.h nsis/nsis_zutil.h pdf.c \
pdf.h spin.c spin.h yc.c yc.h elf.c elf.h execs.h sis.c sis.h \
uuencode.c uuencode.h phishcheck.c phishcheck.h \
phish_domaincheck_db.c phish_domaincheck_db.h \
phish_whitelist.c phish_whitelist.h iana_cctld.h iana_tld.h \
regex_list.c regex_list.h regex_suffix.c regex_suffix.h \
mspack.c mspack.h cab.c cab.h entconv.c entconv.h entitylist.h \
encoding_aliases.h hashtab.c hashtab.h dconf.c dconf.h \
7z/LzmaDec.c 7z/LzmaDec.h 7z/Types.h lzma_iface.c lzma_iface.h \
7z.c 7z.h 7z/7zFile.c 7z/7zFile.h 7z/7zStream.c 7z/CpuArch.h \
7z/7zCrc.c 7z/7zCrc.h 7z/7zBuf.c 7z/7zBuf.h 7z/Bcj2.c \
7z/Bcj2.h 7z/Bra.c 7z/Bra.h 7z/Bra86.c 7z/BraIA64.c \
7z/Archive/7z/7zIn.c 7z/Archive/7z/7zIn.h \
7z/Archive/7z/7zDecode.c 7z/Archive/7z/7zDecode.h \
7z/Archive/7z/7zItem.c 7z/Archive/7z/7zItem.h \
7z/Archive/7z/7zHeader.c 7z/Archive/7z/7zHeader.h \
@ -614,15 +615,15 @@ libclamav_la_SOURCES = clamav.h matcher-ac.c matcher-ac.h matcher-bm.c \
rtf.c rtf.h blob.c blob.h mbox.c mbox.h message.c message.h \
table.c table.h text.c text.h ole2_extract.c ole2_extract.h \
vba_extract.c vba_extract.h cltypes.h msexpand.c msexpand.h \
pe.c pe.h pe_icons.c pe_icons.h disasm.c disasm.h disasmpriv.h \
upx.c upx.h htmlnorm.c htmlnorm.h chmunpack.c chmunpack.h \
rebuildpe.c rebuildpe.h petite.c petite.h wwunpack.c \
wwunpack.h unsp.c unsp.h aspack.c aspack.h packlibs.c \
packlibs.h fsg.c fsg.h mew.c mew.h upack.c upack.h line.c \
line.h untar.c untar.h unzip.c unzip.h inflate64.c inflate64.h \
inffixed64.h inflate64_priv.h special.c special.h binhex.c \
binhex.h is_tar.c is_tar.h tnef.c tnef.h autoit.c autoit.h \
unarj.c unarj.h nsis/bzlib.c nsis/bzlib_private.h \
pe.c pe.h pe_icons.c pe_icons.h disasm.c disasm.h \
disasm-common.h disasmpriv.h upx.c upx.h htmlnorm.c htmlnorm.h \
chmunpack.c chmunpack.h rebuildpe.c rebuildpe.h petite.c \
petite.h wwunpack.c wwunpack.h unsp.c unsp.h aspack.c aspack.h \
packlibs.c packlibs.h fsg.c fsg.h mew.c mew.h upack.c upack.h \
line.c line.h untar.c untar.h unzip.c unzip.h inflate64.c \
inflate64.h inffixed64.h inflate64_priv.h special.c special.h \
binhex.c binhex.h is_tar.c is_tar.h tnef.c tnef.h autoit.c \
autoit.h unarj.c unarj.h nsis/bzlib.c nsis/bzlib_private.h \
nsis/nsis_bzlib.h nsis/nulsft.c nsis/nulsft.h nsis/infblock.c \
nsis/nsis_zconf.h nsis/nsis_zlib.h nsis/nsis_zutil.h pdf.c \
pdf.h spin.c spin.h yc.c yc.h elf.c elf.h execs.h sis.c sis.h \

@ -30,6 +30,7 @@
#include "bytecode.h"
#include "bytecode_priv.h"
#include "readdb.h"
#include "scanners.h"
#include <string.h>
/* TODO: we should make sure lsigcnt is never NULL, and has at least as many
@ -82,7 +83,7 @@ int cli_bytecode_context_getresult_file(struct cli_bc_ctx *ctx, char **tempfilen
}
/* resets bytecode state, so you can run another bytecode with same ctx */
int cli_bytecode_context_reset(struct cli_bc_ctx *ctx)
static int cli_bytecode_context_reset(struct cli_bc_ctx *ctx)
{
free(ctx->opsizes);
free(ctx->values);
@ -94,7 +95,8 @@ int cli_bytecode_context_reset(struct cli_bc_ctx *ctx)
if (ctx->outfd != -1) {
cli_dbgmsg("Bytecode: nobody cared about FD %d, %s\n", ctx->outfd,
ctx->tempfile);
ftruncate(ctx->outfd, 0);
if (ftruncate(ctx->outfd, 0) == -1)
cli_dbgmsg("ftruncate failed\n");
close(ctx->outfd);
cli_unlink(ctx->tempfile);
free(ctx->tempfile);
@ -1579,7 +1581,6 @@ int cli_bytecode_done(struct cli_all_bc *allbc)
int cli_bytecode_context_setfile(struct cli_bc_ctx *ctx, fmap_t *map)
{
struct stat buf;
ctx->fmap = map;
ctx->file_size = map->len + map->offset;
return 0;
@ -1654,7 +1655,8 @@ int cli_bytecode_runhook(const struct cl_engine *engine, struct cli_bc_ctx *ctx,
cli_dbgmsg("***** Scanning unpacked file ******\n");
ret = cli_magic_scandesc(fd, cctx);
if (!cctx || !cctx->engine->keeptmp)
ftruncate(fd, 0);
if (ftruncate(fd, 0) == -1)
cli_dbgmsg("ftruncate failed\n");
close(fd);
if (!cctx || !cctx->engine->keeptmp) {
if (cli_unlink(tempfile))

@ -110,6 +110,7 @@ extern "C" {
int bytecode_init(void);
/* Bytecode internal debug API */
void cli_bytecode_debug(int argc, char **argv);
void cli_bytecode_printversion();
void cli_bytecode_debug_printsrc(const struct cli_bc_ctx *ctx);
typedef void (*bc_dbg_callback_trace)(struct cli_bc_ctx*, unsigned event);

@ -97,6 +97,7 @@ uint32_t cli_bcapi_setvirusname(struct cli_bc_ctx* ctx, const uint8_t *name, uin
uint32_t cli_bcapi_disasm_x86(struct cli_bc_ctx *ctx, struct DISASM_RESULT *res, uint32_t len)
{
//TODO: call disasm_x86_wrap, which outputs a MARIO struct
return -1;
}
/* TODO: field in ctx, id of last bytecode that called magicscandesc, reset
@ -129,7 +130,7 @@ int32_t cli_bcapi_write(struct cli_bc_ctx *ctx, uint8_t*data, int32_t len)
res = cli_writen(ctx->outfd, data, len);
if (res > 0) ctx->written += res;
if (res == -1)
cli_dbgmsg("Bytecode API: write failed: %s\n", errno);
cli_dbgmsg("Bytecode API: write failed: %d\n", errno);
return res;
}

@ -20,6 +20,7 @@
* MA 02110-1301, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include "cltypes.h"
#include "bytecode.h"
@ -69,4 +70,7 @@ int bytecode_init(void)
void cli_bytecode_debug_printsrc(const struct cli_bc_ctx *ctx) {
// Empty
}
void cli_bytecode_printversion() {
printf("LLVM not compiled in\n");
}
int have_clamjit=0;

@ -830,7 +830,8 @@ distclean-local:
rm -f llvm/mklib llvm/tools/Makefile llvm/tools/llvmc/llvm-config.in llvm/utils/Makefile
rm -f llvm/Makefile.common llvm/Makefile.config llvm/config.log llvm/unittests/Makefile
rm -f llvm/llvm.spec llvm/include/llvm/Config/AsmPrinters.def llvm/include/llvm/Config/config.h
rm -f llvm/include/llvm/Support/DataTypes.h llvm/include/llvm/Config/Targets.def
rm -f llvm/include/llvm/Config/Disassemblers.def
rm -f llvm/include/llvm/System/DataTypes.h llvm/include/llvm/Config/Targets.def
rm -f llvm/tools/llvmc/plugins/Base/Base.td llvm/tools/llvm-config/llvm-config.in
rm -f llvm/include/llvm/Config/AsmParsers.def

@ -6659,7 +6659,8 @@ distclean-local:
rm -f llvm/mklib llvm/tools/Makefile llvm/tools/llvmc/llvm-config.in llvm/utils/Makefile
rm -f llvm/Makefile.common llvm/Makefile.config llvm/config.log llvm/unittests/Makefile
rm -f llvm/llvm.spec llvm/include/llvm/Config/AsmPrinters.def llvm/include/llvm/Config/config.h
rm -f llvm/include/llvm/Support/DataTypes.h llvm/include/llvm/Config/Targets.def
rm -f llvm/include/llvm/Config/Disassemblers.def
rm -f llvm/include/llvm/System/DataTypes.h llvm/include/llvm/Config/Targets.def
rm -f llvm/tools/llvmc/plugins/Base/Base.td llvm/tools/llvm-config/llvm-config.in
rm -f llvm/include/llvm/Config/AsmParsers.def

@ -1290,3 +1290,7 @@ void cli_bytecode_debug_printsrc(const struct cli_bc_ctx *ctx)
}
int have_clamjit=1;
void cli_bytecode_printversion()
{
cl::PrintVersionMessage();
}

@ -168,6 +168,7 @@ CLAMAV_PRIVATE {
funmap;
cli_bytecode_context_set_trace;
cli_bytecode_debug_printsrc;
cli_bytecode_printversion;
local:
*;
};

@ -2214,7 +2214,7 @@ int cli_scanpe(cli_ctx *ctx, unsigned int *icongrps1, unsigned int *icongrps2)
pedata.exe_info.section = exe_sections;
pedata.exe_info.nsections = nsections;
pedata.exe_info.ep = ep;
pedata.exe_info.offset = offset;
pedata.exe_info.offset = 0;
pedata.file_hdr = &file_hdr;
pedata.opt32 = &pe_opt.opt32;
pedata.opt64 = &pe_opt.opt64;

Loading…
Cancel
Save