mirror of
https://github.com/radareorg/radare2.git
synced 2024-10-07 02:23:58 +00:00
* Fix doc installation path
* Up config.mk version to 0.2b * Cleanup TODO * Initial implementation of r_cache (optimization for disassembler) * Add readme for r_sign (some randome notes and ideas)
This commit is contained in:
parent
0caaaaf82b
commit
3105b3f137
4
Makefile
4
Makefile
@ -8,8 +8,8 @@ clean:
|
||||
|
||||
install:
|
||||
mkdir -p ${DESTDIR}${PREFIX}
|
||||
mkdir -p ${DESTDIR}${PREFIX}/share/doc/radare
|
||||
for a in doc/* ; do cp $a ${DESTDIR}/${PREFIX}/share/doc/radare ; done
|
||||
mkdir -p ${DESTDIR}${PREFIX}/share/doc/radare2
|
||||
for a in doc/* ; do cp $a ${DESTDIR}/${PREFIX}/share/doc/radare2 ; done
|
||||
cd libr && make install PARENT=1 PREFIX=${DESTDIR}${PREFIX}
|
||||
|
||||
uninstall:
|
||||
|
33
libr/TODO
33
libr/TODO
@ -6,23 +6,6 @@
|
||||
|
||||
----------------------------------------[ todo
|
||||
|
||||
r_cache
|
||||
- register a hashtable of {int,char*}
|
||||
r_cache_validate(&cache, 0x800000, 0x8004000);
|
||||
char *str = r_cache_get(&cache, 0x8048000);
|
||||
if (str) { printf("%s\n", str); }
|
||||
... construct line ...
|
||||
r_cache_set(&cache, seek, constructedstring);
|
||||
- used by the disassebmler to not construct lines all the time
|
||||
|
||||
r_flagtree
|
||||
- r_flags should have a tree construction to access to them faster
|
||||
- btree? following pointers like bigger,smaller
|
||||
{ struct r_flag_t *bigger, *smaller; }
|
||||
- hooks r_flag_add to recalculate in r_flag_optimize(), bigger/smaller pointers
|
||||
- hooks r_flag_del to recalculate too.
|
||||
- the r_flag_get by string should have another construction with btree
|
||||
for the string of the name
|
||||
|
||||
|| search ||
|
||||
------------
|
||||
@ -31,9 +14,7 @@ r_flagtree
|
||||
|
||||
|| asm ||
|
||||
---------
|
||||
- Add support for more architectures
|
||||
- Add lua disassembler
|
||||
- Add java, dalvik, xtensa achiecture (mm cpu)
|
||||
- Add lua disassembler, dalvik, xtensa achiecture (mm cpu)
|
||||
- http://git.linux-xtensa.org/cgi-bin/git.cgi?p=buildroot/buildroot-xtensa;a=blob;f=toolchain/binutils/binutils-xtensa_dc232b.tgz;h=214164399158c540a3033e52b3bb9f65c55289af;hb=HEAD
|
||||
- Check if there are endianess issues
|
||||
|
||||
@ -43,7 +24,7 @@ r_flagtree
|
||||
|
||||
|| bin ||
|
||||
---------
|
||||
- Add support for PE64, mach0 and java class
|
||||
- Add mach0
|
||||
- Add dex format support (android)
|
||||
|
||||
|| cmd ||
|
||||
@ -74,6 +55,14 @@ r_flagtree
|
||||
- We probably need more methods
|
||||
- support to define relations between flags
|
||||
(flag hirearchies)
|
||||
r_flagtree
|
||||
- r_flags should have a tree construction to access to them faster
|
||||
- btree? following pointers like bigger,smaller
|
||||
{ struct r_flag_t *bigger, *smaller; }
|
||||
- hooks r_flag_add to recalculate in r_flag_optimize(), bigger/smaller pointers
|
||||
- hooks r_flag_del to recalculate too.
|
||||
- the r_flag_get by string should have another construction with btree
|
||||
for the string of the name
|
||||
|
||||
|| hash ||
|
||||
----------
|
||||
@ -82,7 +71,7 @@ r_flagtree
|
||||
|| diff ||
|
||||
----------
|
||||
- Need to fix the delta diffing algorithm
|
||||
- Reimplement delta diffing in C
|
||||
- Reimplement delta diffing in C (take the mercurial bdiff.c)
|
||||
|
||||
|| sign ||
|
||||
----------
|
||||
|
@ -2,6 +2,29 @@
|
||||
#define _INCLUDE_UTIL_R_
|
||||
|
||||
#include "r_types.h"
|
||||
#include "list.h"
|
||||
|
||||
/* r_cache */
|
||||
// TOTHINK: move into a separated library?
|
||||
struct r_cache_item_t {
|
||||
u64 addr;
|
||||
char *str;
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
struct r_cache_t {
|
||||
u64 from;
|
||||
u64 to;
|
||||
struct list_head items;
|
||||
};
|
||||
|
||||
void r_cache_init(struct r_cache_t *lang);
|
||||
struct r_cache_t *r_cache_new();
|
||||
void r_cache_free(struct r_cache_t *c);
|
||||
char *r_cache_get(struct r_cache_t *c, u64 addr);
|
||||
int r_cache_set(struct r_cache_t *c, u64 addr, char *str);
|
||||
int r_cache_validate(struct r_cache_t *c, u64 from, u64 to);
|
||||
int r_cache_invalidate(struct r_cache_t *c, u64 from, u64 to);
|
||||
|
||||
/* profiling */
|
||||
#include <sys/time.h>
|
||||
|
45
libr/sign/README
Normal file
45
libr/sign/README
Normal file
@ -0,0 +1,45 @@
|
||||
r_sign: signature api for radare2
|
||||
=================================
|
||||
|
||||
Plugins are used to implement data collectors for r_sign.
|
||||
|
||||
A data collector is a piece of code that feeds the r_sign
|
||||
database with information about symbols.
|
||||
|
||||
r_sign is configured to weight each attribute with some properties
|
||||
to be able to determine the semblance between a collector source
|
||||
information and the playground where r_sign tries to find valid
|
||||
duplicates of the information stored previously following the
|
||||
configured attributes and then we have output plugins to
|
||||
|
||||
Plugin types:
|
||||
=============
|
||||
collectors - collects initial signatures (libc, libm, ...) [ INPUT ]
|
||||
playground - find collected info using the configured attributes [ INPUT ]
|
||||
dumpers - dump the resulting information in ascii [ OUTPUT ]
|
||||
- dump signature
|
||||
- dump results of the signature analysis
|
||||
|
||||
Schematics
|
||||
-----------
|
||||
PLUGINS
|
||||
+-----------+
|
||||
| collector | (signature file, elf binary, radare database, ida...)
|
||||
+---.-------+
|
||||
|
|
||||
| +------------+
|
||||
| | playground | (plugins to find information on target file)
|
||||
| +------------+
|
||||
. . | . . . . .| . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
| | .
|
||||
| +--------+ . +----------------+
|
||||
`---->| r_sign |---->| signature file | output file (screen, disk)
|
||||
+--------+ . +----------------+
|
||||
.
|
||||
waka waka! .
|
||||
----,---- .
|
||||
_ LIB . OUTPUT
|
||||
(_< . . . . . . . . .
|
||||
|
||||
|
||||
--pancake
|
@ -1,5 +1,5 @@
|
||||
NAME=r_util
|
||||
OBJ=mem.o num.o str.o re.o hex.o file.o alloca.o float.o prof.o
|
||||
OBJ=mem.o num.o str.o re.o hex.o file.o alloca.o float.o prof.o cache.o
|
||||
|
||||
#CFLAGS+=-O2
|
||||
#CC=gcc-4.1.1
|
||||
|
69
libr/util/cache.c
Normal file
69
libr/util/cache.c
Normal file
@ -0,0 +1,69 @@
|
||||
#include <r_util.h>
|
||||
|
||||
void r_cache_init(struct r_cache_t *c)
|
||||
{
|
||||
INIT_LIST_HEAD(&c->items);
|
||||
}
|
||||
|
||||
struct r_cache_t *r_cache_new()
|
||||
{
|
||||
struct r_cache_t *a = MALLOC_STRUCT(struct r_cache_t);
|
||||
r_cache_init(a);
|
||||
return a;
|
||||
}
|
||||
|
||||
void r_cache_free(struct r_cache_t *a)
|
||||
{
|
||||
free(a);
|
||||
}
|
||||
|
||||
char *r_cache_get(struct r_cache_t *c, u64 addr)
|
||||
{
|
||||
struct list_head *pos;
|
||||
list_for_each_prev(pos, &c->items) {
|
||||
struct r_cache_item_t *h = list_entry(pos, struct r_cache_item_t, list);
|
||||
if (h->addr == addr)
|
||||
return h->str;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int r_cache_set(struct r_cache_t *c, u64 addr, char *str)
|
||||
{
|
||||
struct r_cache_item_t *a = MALLOC_STRUCT(struct r_cache_item_t);
|
||||
a->addr = addr;
|
||||
a->str = strdup(str);
|
||||
list_add_tail(&(a->list), &(c->items));
|
||||
return R_TRUE;
|
||||
}
|
||||
|
||||
int r_cache_validate(struct r_cache_t *c, u64 from, u64 to)
|
||||
{
|
||||
int ret = R_FALSE;
|
||||
struct list_head *pos, *n;
|
||||
|
||||
list_for_each_safe(pos, n, &c->items) {
|
||||
struct r_cache_item_t *h = list_entry(pos, struct r_cache_item_t, list);
|
||||
if (h->addr <from || h->addr > to) {
|
||||
free(h->str);
|
||||
list_del(&h->list);
|
||||
ret = R_TRUE;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int r_cache_invalidate(struct r_cache_t *c, u64 from, u64 to)
|
||||
{
|
||||
int ret = R_FALSE;
|
||||
struct list_head *pos, *n;
|
||||
list_for_each_safe(pos, n, &c->items) {
|
||||
struct r_cache_item_t *h = list_entry(pos, struct r_cache_item_t, list);
|
||||
if (h->addr >=from && h->addr <= to) {
|
||||
free(h->str);
|
||||
list_del(&h->list);
|
||||
ret = R_TRUE;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
Loading…
Reference in New Issue
Block a user