* Implement @:blocksize syntax for commands

* Some reordering of the TODO
This commit is contained in:
pancake 2010-08-10 12:34:10 +02:00
parent c101235102
commit 8a3c845627
5 changed files with 61 additions and 41 deletions

61
TODO
View File

@ -6,16 +6,33 @@
<{include libr/TODO}>
Questions:
----------
* Meld r_meta inside r_anal?
* How to search for an opcode like CALL+REG? or MOV+CONST, ...
- r_anal_match(anal, aop CALL | REG) ?
- Implememnted in a command like /a..
* imports from PE doesnt works with /a because there's an indirect call
* Load symbol information from libraries (only the ones imported by rabin2?)
- only in runtime when eip is in library code?
* Implement 'av' command we need it (really?) how about to eval with ?
* filter search results..? cc 8080 @@ hit* .. check for values that has changed.
* code analysis with r_parse // isnt this already done? nibble?
- generate by just parsing the opcode
- RAnalAopArg { int size; int delta; int type; }
- r_anal_aop_arg_set (); r_anal_aop_arg_get (); r_anal_aop_arg_binmask ();
* rasign2 : must be done, write manpage (isn't r2 enought?)
* rabin2 can now extract fat mach-o with rabin -x, is it worth native support for fat bins? nibble: NO pancake: ??
* Deprecate CF and use af+ instead? (pancake: yes)
0.6 RELEASE
===========
* Is necesary to prefix all OSX symbols with section name?
name=__symbol_stub4:_uname .. imho no!
* Implement fcn_from_string anal/fcn.c
- define function signature command: (afs? CF?)
> afs int foo(int var, char* str) @ fun.main
- How to define function variables? CFv? CFa for args?
* Support indirect references on /a and similars.. (e search.refptr) .. or /A?
* Implement /A : search AES
* Implement case-insensitive search (e search.casematters ?) any better name? Use /i?
* Implement /. to search using a file .. isnt zignatures about this?
* Implement /p to search for patterns
* Implement search and replace /s
* Cx/CX are not displayed in disasm as they should.. (C! must die)
Build system:
-------------
@ -27,13 +44,14 @@ Build system:
TODO edu
--------
* Implement more get_main()
* fix visual cursor byte selection (support +,- for blocks)
* typedef all function pointers, like in r_bp
TODO nibble
-----------
* Fix PLT bounds detection
* Cx/CX are not displayed in disasm as they should.. (C! must die)
* Implement /A : search AES
* Implement case-insensitive search (e search.casematters ?) any better name? Use /i?
* Implement /. to search using a file .. isnt zignatures about this?
* Implement /p to search for patterns
* Implement search and replace /s
TODO pancake
------------
@ -57,7 +75,6 @@ unassigned TODO pointz
* Realign flags when using project in debug mode
* Test r_lib^w32/osx support
* Implement r_sys_setenv stuff from r1 in core/file.c:33 (!!?)
* Implement more get_main() (NOOB)
* FileDescriptors: dd -- copy from !fd in r1
* r_bin->relocs // RList of relocations
@ -74,24 +91,6 @@ unassigned TODO pointz
2nd level:
- basic block level diffing (output in graph mode)
Questions:
----------
* How to search for an opcode like CALL+REG? or MOV+CONST, ...
- r_anal_match(anal, aop CALL | REG) ?
- Implememnted in a command like /a..
* imports from PE doesnt works with /a because there's an indirect call
* Load symbol information from libraries (only the ones imported by rabin2?)
- only in runtime when eip is in library code?
* Implement 'av' command we need it (really?) how about to eval with ?
* filter search results..? cc 8080 @@ hit* .. check for values that has changed.
* code analysis with r_parse // isnt this already done? nibble?
- generate by just parsing the opcode
- RAnalAopArg { int size; int delta; int type; }
- r_anal_aop_arg_set (); r_anal_aop_arg_get (); r_anal_aop_arg_binmask ();
* rasign2 : must be done, write manpage (isn't r2 enought?)
* rabin2 can now extract fat mach-o with rabin -x, is it worth native support for fat bins? nibble: NO pancake: ??
* Deprecate CF and use af+ instead?
Bindings
========
* generate accessors automatically from valaswig

View File

@ -40,3 +40,4 @@
----------
- Reimplement or fix the delta diffing in C
- first we need to do it for ired..
- take a look on the fossil diff.c ?

View File

@ -1,3 +1,6 @@
NOTE: Most of the information in this document is not matching with reality.
Take it as random ideas, proposals and so on
Code analysis module
====================
* Opcodes that will be executed depending on cond?

View File

@ -137,7 +137,6 @@ R_API int r_anal_fcn_add(RAnal *anal, ut64 addr, ut64 size, const char *name, in
R_API int r_anal_fcn_del(RAnal *anal, ut64 addr) {
RAnalFcn *fcni;
RListIter *iter;
if (addr == 0) {
r_list_free (anal->fcns);
if (!(anal->fcns = r_anal_fcn_list_new ()))
@ -189,8 +188,8 @@ R_API char *r_anal_fcn_to_string(RAnal *a, RAnalFcn* fs) {
if (ret) sign = r_str_newf ("%s %s (", ret->name, fs->name);
else sign = r_str_newf ("void %s (", fs->name);
for (i=0;;i++) {
arg = r_anal_fcn_get_var (fs, i, R_ANAL_VAR_IN);
if (!arg) break;
if (!(arg = r_anal_fcn_get_var (fs, i, R_ANAL_VAR_IN)))
break;
if (arg->array>1) {
if (i) sign = r_str_concatf (sign, ", %s %s[%d]", arg->vartype, arg->name, arg->array);
else sign = r_str_concatf (sign, "%s %s[%d]", arg->vartype, arg->name, arg->array);
@ -199,6 +198,12 @@ R_API char *r_anal_fcn_to_string(RAnal *a, RAnalFcn* fs) {
else sign = r_str_concatf (sign, "%s %s", arg->vartype, arg->name);
}
}
sign = r_str_concatf (sign, ");");
return sign;
return (sign = r_str_concatf (sign, ");"));
}
R_API void r_anal_fcn_from_string(RAnal *a, RAnalFcn *f, const char *str) {
/* TODO : implement parser */
//r_list_destroy (fs->vars);
//set: fs->vars = r_list_new ();
//set: fs->name
}

View File

@ -2749,7 +2749,7 @@ static int r_core_cmd_subst(RCore *core, char *cmd) {
char buf[1024];
int ret;
printf ("> "); fflush (stdout);
fgets(buf, 1023, stdin); // XXX use r_line ??
fgets (buf, sizeof (buf)-1, stdin); // XXX use r_line ??
if (feof (stdin))
break;
buf[strlen (buf)-1]='\0';
@ -2815,19 +2815,31 @@ static int r_core_cmd_subst(RCore *core, char *cmd) {
/* seek commands */
ptr = strchr (cmd, '@');
if (ptr) {
ptr[0]='\0';
ut64 tmpoff = core->offset;
ut64 tmpoff, tmpbsz;
char *ptr2 = strchr (ptr+1, ':');
*ptr = '\0';
tmpoff = core->offset;
tmpbsz = core->blocksize;
if (ptr2) {
*ptr2 = '\0';
r_core_block_size (core, r_num_math (core->num, ptr2+1));
}
if (ptr[1]=='@') {
// TODO: remove temporally seek (should be done by cmd_foreach)
ret = r_core_cmd_foreach (core, cmd, ptr+2);
//ret = -1; /* do not run out-of-foreach cmd */
} else {
if (r_core_seek (core, r_num_math (core->num, ptr+1), 1))
if (!ptr[1] || r_core_seek (core, r_num_math (core->num, ptr+1), 1))
ret = r_cmd_call (core->cmd, r_str_trim_head (cmd));
else ret = 0;
}
if (ptr2) {
*ptr2 = ':';
r_core_block_size (core, tmpbsz);
}
r_core_seek (core, tmpoff, 1);
ptr[0] = '@';
*ptr = '@';
return ret;
}