Commit Graph

72 Commits

Author SHA1 Message Date
Török Edvin
57f14280a7 Fix use-after-free on bytecode load/execution.
lsig->bc was referring to the bytecode directly (via a pointer),
but the bytecode struct changes place in memory (it is realloced on each .cbc
load). So use an index instead of the direct pointer.
2010-02-02 15:30:20 +02:00
Török Edvin
847d7fc1b8 2009->2010 2010-02-02 14:03:32 +02:00
Török Edvin
c1aff5ec76 fix loading from .cvd.
Chomp first line too, and look for \0 instead of \n.
2010-02-02 13:46:37 +02:00
Török Edvin
f6e8bb802a fix segfault on failed cbc load.
The bytecode struct might be only partially initialized. Account for that.
2010-02-02 13:42:33 +02:00
Tomasz Kojm
baf2e702e2 libclamav: provide information about lsig matches to bytecode (bb#1799) 2010-01-28 12:54:28 +01:00
Török Edvin
c0afc51729 Don't use C++ comments in C code. 2010-01-27 12:07:08 +02:00
Török Edvin
5297d09e9f fix distcheck warning. 2010-01-25 15:15:54 +02:00
Török Edvin
1a1876ceeb typo. 2010-01-22 17:19:11 +02:00
Török Edvin
a35cfe5137 print bytecode metadata. 2010-01-22 16:50:35 +02:00
Török Edvin
be43f951c6 BytecodeSecurity setting. 2010-01-22 16:50:35 +02:00
Török Edvin
2d45ef0616 Support for malloc in bytecode. Fix crash with mismatched api/flevel versions. 2010-01-20 20:04:01 +02:00
Török Edvin
b31f2e7a2d Fix loading of apicall8 (disasm).
must alloc room for numop+2,
must validate only first element of an array type (it doesn't have more!),
regenerate _api_decl.c using ifacegen.
2010-01-19 19:58:15 +02:00
Török Edvin
f4e3421592 Support PE hook bytecodes triggered by logical signature. 2010-01-19 16:41:26 +02:00
Török Edvin
0fa95ef231 filesize, and pe_rawaddr API. 2010-01-18 19:31:59 +02:00
Török Edvin
f6798708fd Fix some pointer dereferences, and sizeof.
There were some variables initialized with values from dereferenced pointers,
and the null check after the init.
Also sizeof must be applied to pointed to element.
2010-01-15 18:20:22 +02:00
Török Edvin
9463f9fd90 Stack protector support. 2009-12-18 14:17:50 +02:00
Török Edvin
688799d126 yc_bytecode is able to unpack a file now! 2009-12-17 17:40:35 +02:00
Török Edvin
3ff75dbf0c Add clambc to the win32 build. 2009-12-11 21:02:23 +02:00
Török Edvin
d0934caf99 Distcheck fixes. 2009-12-11 21:02:19 +02:00
Török Edvin
482e97dbb2 Support for bytecode lines >8k.
Size is specified on first line (which must be <8k).
2009-12-11 16:05:38 +02:00
Török Edvin
0a11015bf5 Refactor trace API, so that trace printing happens in clambc.
This will allow clambc to implement breakpoints, and watchpoints.
2009-12-09 17:05:05 +02:00
Török Edvin
65c740d7d8 Add support for tracing (if bytecode compiled with support).
TODO: global id 0 is now a null pointer, need to adjust rest of conversion code
accordingly.
2009-12-08 23:02:49 +02:00
Török Edvin
34da9ae405 change bytecode format to allow structs with more than 16 fields. 2009-12-04 16:45:48 +02:00
Török Edvin
74b0023374 Fix after merge: update to fmap API. 2009-12-03 11:37:38 +02:00
Török Edvin
3ae0a76d03 Support for scanning files created by bytecode. 2009-12-02 17:30:17 +02:00
Török Edvin
53bd5bb14d read optional debug metadata. 2009-11-30 15:22:20 +02:00
Török Edvin
322a0ea653 Fix bytecode load bugs. Make loading more robust: print error message instead of
crashing.
Able to load and dry-run yc_bytecode.o1.cbc now.
2009-11-26 17:29:59 +02:00
Török Edvin
a45e257772 Fix bugs when loading bytecode. 2009-11-26 17:29:45 +02:00
Török Edvin
ec41017bba WiP 2009-10-06 17:32:38 +03:00
Török Edvin
ab63657088 Add generic and PE hooks. 2009-10-02 17:33:11 +03:00
Török Edvin
9fac78c72e Update to latest bytecode format. 2009-10-02 10:26:47 +03:00
Török Edvin
88815fd801 Sync with compiler. 2009-09-30 13:41:02 +03:00
Török Edvin
d38d6dadef Logical signature hook for bytecode. 2009-09-22 11:04:33 +03:00
Török Edvin
df8af6d3ec Split out the ldb loader core into a helper, so that it can be used in the bytecode loader. 2009-09-21 20:28:15 +03:00
Török Edvin
52dd3a6bda Initial support for loading .cbc files from DB. 2009-09-21 20:10:33 +03:00
Török Edvin
dcee45cce2 Update to latest bytecode format. 2009-09-21 18:48:43 +03:00
Török Edvin
7189addbde WiP on debug APi. 2009-09-11 15:12:17 +03:00
Török Edvin
ec07792943 Support for constant global with global initializers. 2009-09-10 22:51:11 +03:00
Török Edvin
a1781898ec inputfile support 2009-09-08 22:25:33 +03:00
Török Edvin
2922746173 Fix make distcheck. 2009-09-07 19:29:50 +03:00
Török Edvin
4789b8a5a6 Add draft file API, doesn't work yet. 2009-09-04 17:29:13 +03:00
Török Edvin
479fa7135c Fix type checking. 2009-09-02 17:44:18 +03:00
Török Edvin
e32caecb83 Add APIcall support to JIT. 2009-09-02 15:32:59 +03:00
Török Edvin
c466339d01 Rename enum member to not clash with type names. 2009-08-28 18:41:50 +03:00
Török Edvin
85a25497bd really execute the JITed code. 2009-08-27 20:41:29 +03:00
Török Edvin
3b33bd6830 Minimal LLVM codegen. 2009-08-27 18:12:39 +03:00
Török Edvin
d1487222f7 Draft of libclamav <-> jit communication. 2009-08-25 19:06:32 +03:00
Török Edvin
7a14dc4ce9 bytecode: prepare for implementing gep. 2009-08-24 13:43:08 +03:00
Török Edvin
72617ba209 bytecode: Implement load/store. 2009-08-24 11:16:36 +03:00
Török Edvin
36fab4bd13 bytecode: fix memory leak shown by valgrind. 2009-08-20 17:09:25 +03:00