Here’s my latest openbinder.c file (use with the other changes in my previous post).
openbinder.c
Much more sensible output this time. I was right to be suspicious about all the nulls - it turned out I was only transferring the first byte of the data. But still no strings yet… next is to decode the replies from the kernel, then to read the kernel module source a little more closely to work out if we can decode any of the stuff in ‘buffer’. Plus, of course, to keep working on it to see if I’ve made any other daft mistakes :-)
Example output:
22:34:57.044758 ioctl(7, BINDER_WRITE_READ, {write_size=56,write_consumed=56,write_buffer=0×153f8,read_size=256, read_consumed=8,read_buffer=0×152e8,write_data= [bcINCREFS(target=0×00000015)bcACQUIRE(target=0×00000015) bcREPLY({cookie=0×00014130,code=0×00000000,flags=0×00000000,priority=80,data_size=12, offsets_size=0,data={buffer=0×00015970,offsets=0×00000000, *buffer=[0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0×00,0×00,0×00,0×00,…………]}})], read_data={…}) = 0
22:34:57.867208 ioctl(7, BINDER_WRITE_READ, {write_size=40,write_consumed=40,write_buffer=0×153f8,read_size=256,read_consumed=8, read_buffer=0×152e8,write_data=[bcREPLY({cookie=0×00014130,code=0×00000000, flags=0×00000000,priority=80,data_size=24,offsets_size=4,data={buffer=0×00015e18, offsets=0×00014130,*buffer= [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0×85,0×2a,0×68,0×73,0×08,0×00,0×00,0×00,0×0e,0×00,0×00,0×00,0×04,0xfe,0×4f,0×10, ………*hs……….O.]}})],read_data={…}) = 0
So far the only decent string I’ve seen in any of the buffers is /dev/input/event0… which might give another clue about where to head next.