Welcome to the Rockbox Technical Forums!
adfu_cmd_handler() read 32bit, check for 'USBC' 0x43425355 flag [0,1,2,3] read 12 bytes, store only last [4,5,6,7,8,9,10,11,12,13,14,15] check stored byte for CMD selector 0xB0, 0xCC or 0xCD B0 - force reset by entering infinte loop which catches watchdog reset CC - seems to be NOPdescription of CD: read byte, treate it as subcmd [16] strip top bit and compare with available subcmds 0x21, 0x13, 0x20, 0x10, 0x22, 0x23, 0x60 bit7 serves as transfer direction indicator 1 - usb IN transfer, 0 - usb OUT transfer0x20: read 7 bytes, discard [17,18,19,20,21,22,23] read 32bit, store in exec_address [24,25,26,27] execute code from exec_address (jalr) after exec return to adfus main()0x21: read 7 bytes, discard [17,18,19,20,21,22,23] read 32bit, store as jump address [24, 25, 26, 27] jalr to received address, the returned value in v0 is stored in cmd22_src_addr replay with all zeros packet0x22: read 3 bytes, discard [17,18,19] read 32bit, store as transfer len [20,21,22,23] transfer (IN) memory content as pointed in cmd22_src_addr+4, len reply with all zeros packet0x23: read 3 bytes, discard [17,18,19] read 32bit, store as transfer len [20,21,22,23] transfer (IN) memory content as pointed in cmd22_src_addr, len reply with all zeros packet0x13: read 3 bytes, discard [17,18,19] read 32bit, arg1 (address) [20,21,22,23] read 32bit, arg0 (len) [24,25,26,27] transfer 'len' bytes data in direction indicated in dir bit starting at 'address' reply with all zeros packetThis two do some more fancy stuff. Basically they do some transfers interleaved with calls to 0xbfc1e400 with 4 argumentswhere last is buffer address and first some sort of subcommand. At first glance this look like some crypt/scramble stuff withsome repetitive blocks of 0x20, 0x200 and 0x4000 bytes0x10:0x60:
Page created in 0.076 seconds with 14 queries.