~ubuntu-branches/ubuntu/saucy/radare/saucy

« back to all changes in this revision

Viewing changes to src/vm.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Reichel
  • Date: 2009-05-22 19:01:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090522190100-qqp4aja112976t5v
Tags: 20090522-1
* new hg checkout
 - added 'cX' command to compare like 'cc' does but using two side hexdiff dump format
 - specify pointer & data size in pm with %<size>
 - add graph.weight
 - fix 'c' command (missing radare_read(0))
 - added /P search command that searchs for proximity in bytelevel distance
 - added more 'ag' and 'gu' commands to readline autocompletion.
 - fix build of debugger for non-linux systems
 - fixed code analysis at startup
 - more work in graphs (graph.split)
 - fixups in x86 code analysis

Show diffs side-by-side

added added

removed removed

Lines of Context:
492
492
        for(;*str==' ';str=str+1);
493
493
        for(;*val==' ';val=val+1);
494
494
 
 
495
        /* STORE */
495
496
        if (*str=='[') {
496
497
                // USE MMU
497
498
                // [foo] = 33, [reg] = 33
557
558
                        }
558
559
                }
559
560
        } else {
 
561
        /* LOAD */
560
562
                // USE REG
561
563
                // reg = [foo] , reg = 33
562
564
                if (*val=='[') {
564
566
                        u8 data[8];
565
567
                        u64 off;
566
568
                        u32 _int32 = 0;
 
569
                        p = strchr(val+1,']');
 
570
                        if (p)
 
571
                                *p='\0';
567
572
                        p = strchr(val+1,':');
568
573
                        if (p) {
569
574
                                int size = atoi(val+1);
600
605
        char *ptr, *eq;
601
606
        char buf[128];
602
607
        int i, len;
 
608
        int op;
603
609
 
604
610
//      if (log)
605
611
        eprintf("   ; %s\n", str);
607
613
        len = strlen(str)+1;
608
614
        ptr = alloca(len);
609
615
        memcpy(ptr, str, len);
 
616
        for(i=0;ptr[i];i++) {
 
617
                if (ptr[i]==' ')
 
618
                        strbcpy(ptr+i, ptr+i+1);
 
619
        }
610
620
        
611
621
        eq = strchr(ptr, '=');
612
622
        if (eq) {
613
623
                eq[0]='\0';
614
 
                switch(eq[-1]) {
 
624
                op = eq[-1];
 
625
                switch(op) {
615
626
                case '+':
616
627
                case '-':
617
628
                case '*':
622
633
                case '|':
623
634
                case '<':
624
635
                case '>':
625
 
                        snprintf(buf, 127, "%s%c%s", ptr, eq[-1], eq+1);
 
636
                        eq[-1]='\0';
 
637
                        snprintf(buf, 127, "%s%c%s", ptr, op, eq+1); //eq[-1], eq+1);
 
638
                        for(i=0;ptr[i];i++) if (ptr[i]==' '){ptr[i]='\0';break;}
 
639
                        printf("BUF(%s)(%s)\n", ptr, buf);
626
640
                        vm_eval_eq(ptr, buf);
627
 
                        //printf("EQ(%s)(%s)\n", ptr, buf);
628
641
                        break;
629
642
                case ' ':
630
643
                        i=-1; do { eq[i--]='\0'; } while(eq[i]==' ');
748
761
        config_set("asm.pseudo", "true");
749
762
        config_set("asm.syntax", "intel");
750
763
        config_set("asm.profile", "simple");
 
764
        vm_reg_set(vm_cpu.pc, config.seek);
751
765
        while(n--) {
752
766
                pc = vm_reg_get(vm_cpu.pc);
753
767
        udis_init();