Commit graph

42 commits

Author SHA1 Message Date
Török Edvin
1dae00ebf4 bytecode: add icon match API. 2010-08-02 18:21:24 +03:00
Török Edvin
dc200c6b19 Add bytecode API for pdf. 2010-08-02 18:21:24 +03:00
Török Edvin
9f1715ccea Add new bytecode APIs to access the environment.
check_platform(...) is an API that can be used to:
 - blacklist JIT/bytecode on just a very specific platform (not recommended)
 - mask (with 0xf/0xff) some fields, and keep just the flags that uniquely
 identify the system where a bug occurs (for example linux + ppc32).
 - it returns a bool so you can do further checks if needed.

The bytecode also has access to all the information collected from the
environment, so it can make more detailed decisions (based on CPU, presence of
SELinux/PaX, etc.).
You can't introduce new detections via bytecode, but you can write new
conditions using existing ones.

The previously added builtin bytecode moved all the JIT disable logic to
bytecode for easy updating.
2010-07-29 14:06:59 +03:00
Török Edvin
d5ffa2acff Introduce BC_STARTUP bytecode (bb #2101, #2078).
This bytecode will be run in interpreter mode on startup:
it can disable the JIT, or disable all further bytecodes.
There will be a builtin copy of it that is loaded if
no BC_STARTUP bytecodes were loaded (like filetypes_int.h and daily.ftm).
Only one BC_STARTUP bytecode is accepted, so as soon as bytecode.cvd will
contain one, it won't be overridable!

This bytecode will replace all the JIT checks (CPU, selinux, pax) etc.,
and allows to disable the JIT on just specific OS/arch/compiler/etc.
combinations. There are too many combinations to have a dconf flag for each.

Also fix the bytecode dconf so that the individual JIT_* flags actually work
(previously we could disable the entire JIT, or none at all).

Also introduce preliminary support for bytecode test mode (we already have
auto, jit and interpreter mode, introducing another mode here is easiest).
The test mode doesn't actually compare the outputs yet, but it does fail if
the JIT is disabled / falls back to interpreter.
2010-07-29 13:48:18 +03:00
Török Edvin
da91503d8e Properly round ilog/iexp/... 2010-05-14 10:41:42 +03:00
Török Edvin
7ebca3d717 Fix interpreter on new bytecode API tests. 2010-05-13 22:44:41 +03:00
Török Edvin
7a7365efe9 0.96.1 new APIs (cli_map etc.) 2010-05-12 23:51:20 +03:00
Török Edvin
8f5cead087 Fix bytecode_api.h
It helps if I actually run make before committing.
2010-05-07 11:09:17 +03:00
Török Edvin
4ed8c2349b Restore the fix in clamav-0.96-19-ge4a0f2c.
It got lost when running sync_clamav in the bytecode compiler.
Fixed the script now.
2010-05-07 11:01:51 +03:00
Török Edvin
1c4683acd1 add match_offsets support. 2010-05-07 10:53:18 +03:00
Török Edvin
3735fda134 min/max functionality level support. 2010-04-26 19:37:04 +03:00
Török Edvin
e4a0f2c94f fix compiler warnings (bb #1872, bb #1934, bb #1935) 2010-04-13 16:19:47 +03:00
Török Edvin
b00a7cc8f8 jsnorm api. 2010-03-31 10:53:11 +03:00
Török Edvin
02068643c1 Print location of runtime error. 2010-03-22 14:58:58 +02:00
Török Edvin
7b33a3661d More API fixes. 2010-03-22 11:18:28 +02:00
Török Edvin
6ad39a4099 zlib/buffer apis. 2010-03-22 11:18:28 +02:00
Török Edvin
75e18b29c2 minimalistic zlib api. 2010-03-22 11:18:28 +02:00
Török Edvin
f6471bc9d6 More APIs. 2010-03-22 11:18:28 +02:00
Török Edvin
d9fbce26fc More API additions for PDF. 2010-03-22 11:18:28 +02:00
Török Edvin
b56bea54d3 New API for buffer fill. 2010-03-22 11:18:28 +02:00
Török Edvin
236fb13647 New pointer handling rules. 2010-02-15 17:32:40 +02:00
Török Edvin
847d7fc1b8 2009->2010 2010-02-02 14:03:32 +02:00
Török Edvin
4395bb9acf bytecode ptrdiff32 opcode. 2010-01-21 16:49:22 +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
565e677f95 file_find, file_byteat bytecode APIs. 2010-01-20 17:16:45 +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
688799d126 yc_bytecode is able to unpack a file now! 2009-12-17 17:40:35 +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
75acf165c7 Sync headers with clamav bytecode compiler. 2009-11-27 16:54:24 +02:00
Török Edvin
b8656613c0 Doxygenize API headers. 2009-11-26 17:29:58 +02:00
Török Edvin
250d92c533 Sync with compiler. 2009-11-06 16:34:46 +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
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
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
4789b8a5a6 Add draft file API, doesn't work yet. 2009-09-04 17:29:13 +03:00
Török Edvin
d0af4afea4 ctx param to APIs 2009-09-04 16:24:52 +03:00
Török Edvin
1a486dca3b Add hidden ctx param to APIcalls. 2009-09-04 12:09:17 +03:00
Török Edvin
cf0cd429e9 Implement API calls from bytecode. 2009-08-20 16:33:58 +03:00