Assured-Micropatching / CM2350-Emulator

CM2350 Emulator
Other
2 stars 2 forks source link

target.xml encoding error #7

Open sprout42 opened 1 year ago

sprout42 commented 1 year ago

It appears something in the length encoding when transferring the target.xml file is being miscalculated and generates a encoded response length 4092 > 4091, truncating warning:

2023-11-02 11:58:23,552:MIRE:vtrace.platforms.gdbstub: DATA: b'qXfer:features:read:target.xml:ffa,ffb'     CSUM: 0x76 (calculated: 0x76)[gdbstub.py:_recvServer:1982]
2023-11-02 11:58:23,552:WARNING:vtrace.platforms.gdbstub: qXfer fields:  [b'features', b'read', b'target.xml', b'ffa,ffb'][gdbstub.py:_serverQXfer:3299]
2023-11-02 11:58:23,552:DEBUG:vtrace.platforms.gdbstub: _serverQXfer(b'features:read:target.xml:ffa,ffb') => b'me="LPERU" regnum="78" />\n    <reg bitsize="32" name="CSRR0" regnum="79" />\n    <reg bitsize="32" name="CSRR1" regnum="80" />\n    <reg bitsize="32" name="DEAR" regnum="81" />\n    <reg bitsize="32" name="ESR" regnum="82" />\n    <reg bitsize="32" name="IVPR" regnum="83" />\n    <reg bitsize="32" name="TBL" regnum="84" />\n    <reg bitsize="32" name="TBU" regnum="85" />\n    <reg bitsize="32" name="PIR" regnum="86" />\n    <reg bitsize="32" name="PVR" regnum="87" />\n    <reg bitsize="32" name="DBSR" regnum="88" />\n    <reg bitsize="32" name="DBSRWR" regnum="89" />\n    <reg bitsize="32" name="EPCR" regnum="90" />\n    <reg bitsize="32" name="DBCR0" regnum="91" />\n    <reg bitsize="32" name="DBCR1" regnum="92" />\n    <reg bitsize="32" name="DBCR2" regnum="93" />\n    <reg bitsize="32" name="MSRP" regnum="94" />\n    <reg bitsize="32" name="IAC1" regnum="95" />\n    <reg bitsize="32" name="IAC2" regnum="96" />\n    <reg bitsize="32" name="IAC3" regnum="97" />\n    <reg bitsize="32" name="IAC4" regnum="98" />\n    <reg bitsize="32" name="DAC1" regnum="99" />\n    <reg bitsize="32" name="DAC2" regnum="100" />\n    <reg bitsize="32" name="DVC1" regnum="101" />\n    <reg bitsize="32" name="DVC2" regnum="102" />\n    <reg bitsize="32" name="TSR" regnum="103" />\n    <reg bitsize="32" name="LPIDR" regnum="104" />\n    <reg bitsize="32" name="TCR" regnum="105" />\n    <reg bitsize="32" name="IVOR0" regnum="106" />\n    <reg bitsize="32" name="IVOR1" regnum="107" />\n    <reg bitsize="32" name="IVOR2" regnum="108" />\n    <reg bitsize="32" name="IVOR3" regnum="109" />\n    <reg bitsize="32" name="IVOR4" regnum="110" />\n    <reg bitsize="32" name="IVOR5" regnum="111" />\n    <reg bitsize="32" name="IVOR6" regnum="112" />\n    <reg bitsize="32" name="IVOR7" regnum="113" />\n    <reg bitsize="32" name="IVOR8" regnum="114" />\n    <reg bitsize="32" name="IVOR9" regnum="115" />\n    <reg bitsize="32" name="IVOR10" regnum="116" />\n    <reg bitsize="32" name="IVOR11" regnum="117" />\n    <reg bitsize="32" name="IVOR12" regnum="118" />\n    <reg bitsize="32" name="IVOR13" regnum="119" />\n    <reg bitsize="32" name="IVOR14" regnum="120" />\n    <reg bitsize="32" name="IVOR15" regnum="121" />\n    <reg bitsize="32" name="IVOR38" regnum="122" />\n    <reg bitsize="32" name="IVOR39" regnum="123" />\n    <reg bitsize="32" name="IVOR40" regnum="124" />\n    <reg bitsize="32" name="IVOR41" regnum="125" />\n    <reg bitsize="32" name="IVOR42" regnum="126" />\n    <reg bitsize="32" name="TENSR" regnum="127" />\n    <reg bitsize="32" name="TENS" regnum="128" />\n    <reg bitsize="32" name="TENC" regnum="129" />\n    <reg bitsize="32" name="TIR" regnum="130" />\n    <reg bitsize="32" name="L1CFG0" regnum="131" />\n    <reg bitsize="32" name="L1CFG1" regnum="132" />\n    <reg bitsize="32" name="NPIDR5" regnum="133" />\n    <reg bitsize="32" name="L2CFG0" regnum="134" />\n    <reg bitsize="32" name="IVOR32" regnum="135" />\n    <reg bitsize="32" name="IVOR33" regnum="136" />\n    <reg bitsize="32" name="IVOR34" regnum="137" />\n    <reg bitsize="32" name="IVOR35" regnum="138" />\n    <reg bitsize="32" name="IVOR36" regnum="139" />\n    <reg bitsize="32" name="IVOR37" regnum="140" />\n    <reg bitsize="32" name="DBCR3" regnum="141" />\n    <reg bitsize="32" name="DBCNT" regnum="142" />\n    <reg bitsize="32" name="DBCR4" regnum="143" />\n    <reg bitsize="32" name="DBCR5" regnum="144" />\n    <reg bitsize="32" name="MCARU" regnum="145" />\n    <reg bitsize="32" name="MCSRR0" regnum="146" />\n    <reg bitsize="32" name="MCSRR1" regnum="147" />\n    <reg bitsize="32" name="MCSR" regnum="148" />\n    <reg bitsize="32" name="MCAR" regnum="149" />\n    <reg bitsize="32" name="DSRR0" regnum="150" />\n    <reg bitsize="32" name="DSRR1" regnum="151" />\n    <reg bitsize="32" name="DDAM" regnum="152" />\n    <reg bitsize="32" name="L1CSR2" regnum="153" />\n    <reg bitsize="32" name="L1CSR3" regnum="154" />\n    <reg bitsize="32" name="MAS0" regnum="155" />\n    <reg bitsize="32" name="MAS1" regnum="156" />\n    <reg bitsize="32" name="MAS2" regnum="157" />\n    <reg bitsize="32" name="MAS3" regnum="158" />\n    <reg bitsize="'[gdbstub.py:_serverQXfer:3321]
2023-11-02 11:58:23,552:ERROR:vtrace.platforms.gdbstub: encoded response length 4092 > 4091, truncating msg[gdbstub.py:_doServerResponse:2199]
sprout42 commented 9 months ago

it appears that the byte range requested is supposed to be inclusive but the vivisect GDB server is interpreting it as exclusive

2024-02-05 17:06:03,203:MIRE:vtrace.platforms.gdbstub: DATA: b'qXfer:features:read:target.xml:0,ffb'     CSUM: 0x79 (calculated: 0x79)[gdbstub.py:_recvServer:1982]
...
2024-02-05 17:06:03,205:MIRE:vtrace.platforms.gdbstub: DATA: b'qXfer:features:read:target.xml:ffa,ffb'     CSUM: 0x76 (calculated: 0x76)[gdbstub.py:_recvServer:1982]