I've been working on the head-0.8.4 branch (ale!) adding some
nice stuff... something that will probably finish on a libreadline
replacement. It's an unnecesary dependency and should die.

First, a little note...i have fixed radare to work better with serial consoles.
Now it's possible to log a radare session using tee:

 $ radare /bin/ls | tee ls.log

ATM I have partially replaced the history stuff. The libreadline looks
not very nice and it's hardly connected to the input stuff. So it is
the first piece to be wrapped.

Now you can access to the history commands and run them using a shell-like
syntax:

!h  -> show history commands of the current session
!l  -> list labels and offset into history string
!~  -> remove all labels and session history
!#  -> # is a number from 0 to infinite-1 that means to run the command number 
'#'

The history code has been used to manage comment commands. Yeah that's new
stuff. A comment command (cocos for the friends) are defined as:

 ;label:
 :x 20
 s +0x40
 ;loop 3 label

The previous code looks pretty selfexplanatory, but i will explain:

 The comments are now used to define code to be executed by radare, in the
 history format way. This is a bit limitated at the moment, so, you cannot
 actually load external scripts or share local/global variables, but here
 is the way.

Commands implemented are:

 ;break   - stops a loop
 ;foo:    - all strings starting with ';' and ending with ':' are understood as 
labels
 ;loop <times> <label> - repeates a goto N times
 ;goto <label>    - jumps to the label and executes until break or EOH
 ;hdump <file>   - dumps history to a file
 ;hload <file>   - load history from a file (replace current one)

Help is available via ;? command.

You can type !+ or !- to enable or disable command execution. this can be used
to inline scripts with copypasta. but you cant interpret more than one time the
same, because the label implementation. But I will fix that too.

As you see.. this is something like an internal scripting. This can be joined
with

I have used ioctl to get the columns of the terminal, and automatically
resize the view. In visual mode the print dump is autoadapted from an
alarm(), some code cleanup has been done and more print commands accept
colors (+40%! :D) I will happily accept ideas for colorization and so. 

Look at the latest two commits fmi:

  http://news.nopcode.org/miau/pvc.cgi?prj=radare

0: f12ca246
author: [EMAIL PROTECTED]
date: 20070820-23:43:29

* Yay: Now we have ;goto and ;loop  commands to move around history.
  This looks like a turing machine ;)
* config.h has changed. make clean is recommended to avoid segfaults
* Labels are now defined with ';:' for example:
* Add '!+' and '!-' commands to enable/disable execution (history.c)

  > ;show-var:

* Add label_get and label_show functions. this is all done from history.c
  so they can be static.
* Add '!l' command to list all labels
* Loop break (;break)
* TODO: conditionals for jumps

1: 2ffa5757
author: [EMAIL PROTECTED]
date: 20070820-22:33:09

* Fix the %COLUMNS weirdness. Use winsize structures.
  On visual mode an alarm is scheduled to automatically resize
  the terminal providing a better look and feel
* Make HEXB fit better on %COLUMNS
* Autodetect when radare is working with non terminal output (serial console)
  This is useful when you want to log a radare session easily.

  $ radare /bin/ls | tee log.file

  This way %COLUMNS are forced to be 80 at startup. You can redefine this
  by hand if you want :)
* Split the drawing part from the input code. This way I can throw it from the 
alarm
* Add history.c with lot of hiztory_ functions. This is a wrapper for the 
libreadline
  one, allowing you to emulate the history functionality in a better way without
  the need of libreadline.
* This is dupped info, so in the future I plan to completely replace 
libreadline,
  or at least provide a minimalistic version if you want to link against 
libreadline,
  this will be good for the BSD family that uses libedit or so
* Hijack '!h' command to show the history list
* Reorder all print modes for nicer readibility (still shitty)
* Colorize the rest of print modes. Maybe I should test it more and define new 
color
  palettes.


  --pancake
_______________________________________________
radare mailing list
[email protected]
https://lists.nopcode.org/mailman/listinfo/radare

Reply via email to