-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

pancake wrote:
>>tsearch line 142:
>>
>>        for(radare_read(0);!config.interrupted;i = radare_read(1)) {
>>                if (!i) break;
>>                binparse_reset_tlist ( t ) ;
>>                for(i=0;i<config.block_size;i++)
>>                        update_tlist(t, config.block[i], config.seek+i);
>>
>>                config.seek += config.block_size;
>>        }
>>        config.seek = tmp;
> 
> 
> this is not ok, config.seek is incremented inside radare_read(1);
>  // '1' means 'next block'.
> 

For me it did not work, if I printed it inside the loop it was always 0,
but I am sure it was because of the include problem. I will check it
now, have you made a commit ?

> 
>>and binparse.h :
>>
>>void binparse_reset_tlist (tokenizer *t );
>>
>>binparse.c :
>>
>>void binparse_reset_tlist (tokenizer *t )
>>{
>>        int i,j;
>>        for (i=0; i < t->nlists ; i ++ )
>>        {
>>                t->tls[i]->estat = 0;
>>        }
>>}
>>
>>

This reset is needed to set the state of the state based machines to
initial conditions after every block loop.


>>in callback I've added the size of the search:
>>static void radare_tsearch_callback(struct _tokenizer *t, int i,
>>unsigned long long where, unsigned long long size)
>>{
> 
> 
> this is not ok, the block size is size_t, btw changing the block
> size does not fixes anything, it just reduces the visibility of the
> bytes near the hit. It's useful.
> 

The point wasn't to fix anything, it was to have the flags result
correctly set to the size of the hit, not always 512.

> Try printf'g the values from the callback hit will fix this issue, btw
> i was able to reproduce the bug on qemu-arm. I've no gdb there, but
> printf debugging will be enought to allow me to fix this.
> 
> I think that passing more than one arg to a callback is not safe without
> using trampoline libraries or similar tricks. So I'll prefer to construct
> a single structure containing the arguments. This will fix the bug.
>


I passed more information just to test if the size did work and to give
an example of where the size of the hit was stored.


> Let me try! :)
> 
> --pancake
>

Great job!! I think it is getting some shape!


See you!


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFGF9PbHCkwMET/DRYRAkqdAKCjctkuxE/1KHk7MvLwJjFbNGvS3ACfWmFl
se6rUjG9rIIP8FJKOPAxAcw=
=VgO7
-----END PGP SIGNATURE-----
_______________________________________________
radare mailing list
[email protected]
https://lists.nopcode.org/mailman/listinfo/radare

Reply via email to