126 (edited by ChunkLady 2015-12-15 12:20:08)

Re: DaVinci Junior cartridge reset

I didn't see you had already dumped something from the Nature 82 meter spool.

here goes:

Spool Info: Nature,82m remaining out of 100m, PLA
PAGE 08: 5A 50 5A 00  ZPZ.
PAGE 09: 00 35 35 36  .556
PAGE 10: A0 86 01 00  ��..
PAGE 11: A0 86 01 00  ��..
PAGE 14: 30 34 37 39  0479
PAGE 20: AB 41 01 00  �A..
PAGE 21: E3 53 33 54  �S3T
PAGE 22: 25 4D E1 CE  %M��
PAGE 23: BF BC 49 76  ��Iv

Spool Info (same as before) Nature, 80.364m remaining out of 100m, PLA
PAGE 08: 5A 50 5A 00  ZPZ.
PAGE 09: 00 35 35 36  .556
PAGE 10: A0 86 01 00  ��..
PAGE 11: A0 86 01 00  ��..
PAGE 14: 30 34 37 39  0479
PAGE 20: EC 39 01 00  �9..
PAGE 21: A4 2B 33 54  �+3T
PAGE 22: E4 45 E1 CE  �E��
PAGE 23: FE B4 49 76  ��Iv

Page 20-23 changed. Page 20 is the actual remaining length. Page 21-23 only changed the lower two bytes. Im just gonna postulate wildy here, that that probably means they are some kinda checksum-value, compiled from the above values.

Im just gonna lay out some calcs here that do not lead anywhere, but might get people on some kinda track I can't see atm:

First sample:
Page 10: 0x000186A0 =       100 000
Page 11: 0x000186A0 =       100 000
Page 20: 0x000141AB =        82 347
Page 21: 0x543353E3 = 1 412 649 955
Page 22: 0xCEE14D25 = 3 470 871 845
Page 23: 0x7649BCBF = 1 984 543 935

Second sample:
Page 10: 0x000186A0 =       100 000
Page 11: 0x000186A0 =       100 000
Page 20: 0x000139EC =        80 364
Page 21: 0x54332B4A = 1 412 639 562
Page 22: 0xCEE145E4 = 3 470 869 988
Page 23: 0x7649B4FE = 1 984 541 950

Difference from first sample to second sample: 
Page 10: 0
Page 11: 0
Page 20: - 1 983
Page 21: -10 393
Page 22: - 1 857
Page 23: - 1 985

Differences on Page 21-23 summed: -14 235

127

Re: DaVinci Junior cartridge reset

ChunkLady wrote:

I didn't see you had already dumped something from the Nature 82 meter spool.

(...)

didi you already try basics, like CRC?

128 (edited by ChunkLady 2015-12-15 12:47:30)

Re: DaVinci Junior cartridge reset

sztupy wrote:

didi you already try basics, like CRC?

I ran a variety of the numbers through an online CRC calculator just to check the lower bytes (as im not with my dev. tools atm) - and nothing seems to pop into mind. I tried CRC of the spool-length, big/little-endians, the lower bytes big/little-endians - no luck. 

However, its given (I think) that Page 21, 22 and 23 cannot -all- be CRC, as the upper 2 bytes does not change at all - its likely that we will see them change with a larger usage. The reason i never really suspected a CRC is that, the values change so little - Page 21 is in fact  0xE353 3354 in the first sample and  0xA42B 3354  in the second sample (note the 3354) - little change - indicating either only a 2byte CRC or a counter decreasing/a simple calculation.

Given page 21-23 are all lowered with usage (in this one sample), like page 20 is i would presume more samples would give a rough idea of what is happening.

129

Re: DaVinci Junior cartridge reset

ChunkLady wrote:
First sample:
Page 10: 0x000186A0 =       100 000
Page 11: 0x000186A0 =       100 000
Page 20: 0x000141AB =        82 347
Page 21: 0x543353E3 = 1 412 649 955
Page 22: 0xCEE14D25 = 3 470 871 845
Page 23: 0x7649BCBF = 1 984 543 935

Second sample:
Page 10: 0x000186A0 =       100 000
Page 11: 0x000186A0 =       100 000
Page 20: 0x000139EC =        80 364
Page 21: 0x54332B4A = 1 412 639 562
Page 22: 0xCEE145E4 = 3 470 869 988
Page 23: 0x7649B4FE = 1 984 541 950

Difference from first sample to second sample: 
Page 10: 0
Page 11: 0
Page 20: - 1 983
Page 21: -10 393
Page 22: - 1 857
Page 23: - 1 985

Differences on Page 21-23 summed: -14 235

Note, you transcribed page 21 wrong, it's 0x54332BA4 and not 0x54332B4A, not that it changes much (diff is 10303 instead of 10393)

130 (edited by ChunkLady 2015-12-15 13:26:56)

Re: DaVinci Junior cartridge reset

Yearh, unfortuanetly it does not change much - if only it was page23 i had transcribed 0x7649B501 as 0x7649B4FE :-) then we would have some kind of match.

If someone else would have a go at the CRC/rot/whatever regular basics that would be swell :-)

Also tried looking for some AND/XOR or RoL/RoR routines;

Page 10: 0x86A0 = 1000 0110 1010 0000
Page 20: 0x39EC = 0011 1001 1110 1100
Page 21: 0x2BA4 = 0010 1011 1010 0100
Page 22: 0x45E4 = 0100 0101 1110 0100
Page 23: 0xB4FE = 1011 0100 1111 1110

131

Re: DaVinci Junior cartridge reset

ChunkLady wrote:
crgpgh wrote:

OK it looks like you can't just write a new value to page 20. I tried writing the original value from page 10(11) and the printer complained the spool was unidentified.

No im thinking that page 21 or 14 holds the key to that one. But no matter what, you should be able to use 10 meters, then write back the entire old content to the NFC - and then be back where you started.

If possible, try using 1 (one) meter of the filament, and paste another dump of the NFC - that would give an idea of what changes with every use.

It would be neat if you tried the green unused one :-)

Yeah I am going to use a green roll to print the same part. I will also find or create a model that uses 1 meter.

I am also going to pay closer attention to the time. The two deltas (1857,1985) are close to time of the print in seconds.

Maybe the total seconds printed has to match up in some way to the remaining length.

132

Re: DaVinci Junior cartridge reset

Here is some photos from my teardown
there is hall sensor in the extruder motor that counts the filament.
If someone wants more photos, ill upload more

http://soliforum.com/i/?OVQCiNu.jpg
http://soliforum.com/i/?3IiIBkJ.jpg
http://soliforum.com/i/?2KKvsDX.jpg
http://soliforum.com/i/?5OIimVE.jpg

133

Re: DaVinci Junior cartridge reset

THA wrote:

Here is some photos from my teardown
there is hall sensor in the extruder motor that counts the filament.
If someone wants more photos, ill upload more

http://soliforum.com/i/?OVQCiNu.jpg
http://soliforum.com/i/?3IiIBkJ.jpg
http://soliforum.com/i/?2KKvsDX.jpg
http://soliforum.com/i/?5OIimVE.jpg


That's actually an optical sensor but it does not really matter as it serves the same purpose. For a Hall Sensor there would nee to be a magnet or two on the gear as a Hall sensor detects the passing of a magnetic field.

All they are doing is using a disk with clear notches to interrupt a beam in the optical switch.

Printing since 2009 and still love it!
Anycubic 4MAX best $225 ever invested.
Voxelabs Proxima SLA. 6 inch 2k Mono LCD.
Anycubic Predator, massive Delta machine. 450 x 370 print envelope.

134

Re: DaVinci Junior cartridge reset

Do they use same motherboard on all models?
There is connection for heated bed thermistor,lasers,cameras and more

http://soliforum.com/i/?5R7w0fh.jpg
http://soliforum.com/i/?Edlyv13.jpg

135

Re: DaVinci Junior cartridge reset

Can't you remove the sensor? I know it's lso on my Da VInci 1.0 and was wondering this.

136 (edited by ChunkLady 2015-12-15 22:25:23)

Re: DaVinci Junior cartridge reset

dedafmonteur wrote:

Can't you remove the sensor? I know it's lso on my Da VInci 1.0 and was wondering this.

Removing the sensor will probably have an negative effect on how the software checks its own ability to print; I could be overestimating their coding-skills, but, if you have a sensor that checks for movement, and you do not use this check for anything, you shouldn't be coding at all :-)

137

Re: DaVinci Junior cartridge reset

Or just run it past the sensor and see what happens. The filament chip is just a no-go but i can't believe there are no alternative ways to use other filament.

138

Re: DaVinci Junior cartridge reset

Hi guys. Just get in to forum. I find that every layer printed printer sending amount of used filament to chip. Firmware counting filament every command G code E adding them together and after printing layer sending to filament chip. If job canceled sending amount from cancel  point. Sorry for my English

139

Re: DaVinci Junior cartridge reset

Hi Everybody,

There is another optical sensor in the extruder head. Maybe each of them are computed in RFID?

Cheers

140

Re: DaVinci Junior cartridge reset

So if you unplug the power just before it's finished it won't count it?

141

Re: DaVinci Junior cartridge reset

dedafmonteur wrote:

So if you unplug the power just before it's finished it won't count it?

I guess it does it every G92 E0 request. I can try making a gcode where there is only one of those at the end, and check what happens if the job is cancelled mid build

142

Re: DaVinci Junior cartridge reset

sztupy wrote:
dedafmonteur wrote:

So if you unplug the power just before it's finished it won't count it?

I guess it does it every G92 E0 request. I can try making a gcode where there is only one of those at the end, and check what happens if the job is cancelled mid build

Well, i think it could work...

143

Re: DaVinci Junior cartridge reset

If u cancel job filament will be calculated, need turn of printer power. But make g-code big job. If code have 300000 lines each E value must be recalculated and changed.

144

Re: DaVinci Junior cartridge reset

I don't mean to derail progress so far, but I've been going about this in the opposite direction. I'm trying to find out how the 3W is generated - as well as how the NFC is written - from the side of XYZware.

I need somewhere to start so we don't duplicate progress. Simply removing functions that relate to filament counting and/or 3W generation will probably break the program when I attempt to recompile. However, if we study the logic of the application, we can probably duplicate this with our own software. Similar to XYZware Open Mod.

So far, I can confirm some things that have already been said in this thread:

CipherMode.ECB;
PaddingMode.PKCS7;

Base64 is still involved:

Convert.ToBase64String(inArray, 0, inArray.Length);

But curiously, this seems to change based on some attribute I haven't been able to link yet:

          if (str != "TagEJ256")
          {
            rijndaelManaged.Mode = CipherMode.CBC;
            rijndaelManaged.Padding = PaddingMode.PKCS7;
          }
          else
          {
            rijndaelManaged.Mode = CipherMode.ECB;
            rijndaelManaged.Padding = PaddingMode.None;

Funny enough, it also looks like they just doubled up their URL (instead of just once) in the key logic for this part:

byte[] rgbKey = !(str != "TagEJ256") ? Encoding.UTF8.GetBytes("@[email protected]") : Encoding.UTF8.GetBytes("@xyzprinting.com");

Again, a lot of this isn't new. Where should I be looking at to put the final pieces together?

145 (edited by sztupy 2015-12-16 21:51:11)

Re: DaVinci Junior cartridge reset

ptrav wrote:

I don't mean to derail progress so far, but I've been going about this in the opposite direction. I'm trying to find out how the 3W is generated - as well as how the NFC is written - from the side of XYZware.

I need somewhere to start so we don't duplicate progress. Simply removing functions that relate to filament counting and/or 3W generation will probably break the program when I attempt to recompile. However, if we study the logic of the application, we can probably duplicate this with our own software. Similar to XYZware Open Mod.

So far, I can confirm some things that have already been said in this thread:

CipherMode.ECB;
PaddingMode.PKCS7;

Base64 is still involved:

Convert.ToBase64String(inArray, 0, inArray.Length);

But curiously, this seems to change based on some attribute I haven't been able to link yet:

          if (str != "TagEJ256")
          {
            rijndaelManaged.Mode = CipherMode.CBC;
            rijndaelManaged.Padding = PaddingMode.PKCS7;
          }
          else
          {
            rijndaelManaged.Mode = CipherMode.ECB;
            rijndaelManaged.Padding = PaddingMode.None;

Funny enough, it also looks like they just doubled up their URL (instead of just once) in the key logic for this part:

byte[] rgbKey = !(str != "TagEJ256") ? Encoding.UTF8.GetBytes("@[email protected]") : Encoding.UTF8.GetBytes("@xyzprinting.com");

Again, a lot of this isn't new. Where should I be looking at to put the final pieces together?

Hi, I've already hacked the 3w format and made both an encoder and decoder (check previous page of this forum). I'll be ready with something useable this weekend for public consumption, you will be able to check it's source code to determine how it is done.

For the NFC part, that is done in ARM, which is harder to disassemble and figure out how it works. I'm not even sure whether anyone has a complete dump of a recent FW (but I would be interested if someone has)

146 (edited by ptrav 2015-12-17 00:07:00)

Re: DaVinci Junior cartridge reset

sztupy wrote:

Hi, I've already hacked the 3w format and made both an encoder and decoder (check previous page of this forum). I'll be ready with something useable this weekend for public consumption, you will be able to check it's source code to determine how it is done.

For the NFC part, that is done in ARM, which is harder to disassemble and figure out how it works. I'm not even sure whether anyone has a complete dump of a recent FW (but I would be interested if someone has)

I did see that! I was aware that you made the encoder/decoder and was validating what you found so far.

I still think it'd be particularly interesting to take all the DRM out of the XYZware app. That'd be a fun project & exercise just for the heck of it.

My ARM knowledge isn't quite there - so that's all yours. smile

As for the FW, did you check out some of the web calls in the code? There are a few in there that could lead somewhere. Also, I have to dig through my firewall, but I might be able to get a PCAP or at least the URL of the auto-update I had a few weeks back.

147

Re: DaVinci Junior cartridge reset

I'm not sure if/how it will effect code-resolutions but a couple of things I can confirm from playing with it physically:
(Sorry if this has been confirmed already, but it took me a couple of days to read through everything.)

It does write to the chip.  It is not a matter of the printer remembering the chip and having internal data saved regarding chips used.  I tested this by taking my chip from a spool with only 4m left and placing it into another printer that had not seen it.  The second printer displayed the same 4m remaining.

The printer also runs some sort of save/check on the chip at intervals that seem to be once per layer.  I took the spool out of the printer and started a print by simply holding the chip to the reader and removed it as soon as it displayed the beginning print info.  It threw an error and stopped having printed what appears to be only the first layer with the standard one pass in each diagonal.  It will take a more creative print to visually indicate to me when slices change so I can confirm that it runs this check after every slice with a second test stopping after a few more layers.

148

Re: DaVinci Junior cartridge reset

Just a thought; if the "remove some gcodes and the firmware do not write filament length to the NFC" works - then its surely just a matter of a firmware update from XYZware until that security hole is patched? I mean, they can get around that one pretty easily. Its not to be a downer, im just, well stating thoughts :-) Any thoughts on that ?

Workarounds for the "use the same NFC tag for multiple rolls" is gonna be a bit harder. They can't get around they shipped the NFC with that particular password. One way, is to detect "new" roll (entry password) and then set a new password rotating it ever now and then - changing the seed according to the public NFC information (which they change for every use). That means we do not just have to find one password, but a lot. Thats gonna be annoying.

Now, the obvious fix to that (for us), would just be to use a custom 0.5$ NFC tag with fresh filament info, for every self-made roll of filament. How they get around that one, would require some way of detecting if the NFC is real and official XYZware - that could be a tough on for them. Also, all it requires, is another cheap NFC, that they can't distinguish from the real thing, and boom - its game over.

149

Re: DaVinci Junior cartridge reset

ChunkLady wrote:

Just a thought; if the "remove some gcodes and the firmware do not write filament length to the NFC" works - then its surely just a matter of a firmware update from XYZware until that security hole is patched? I mean, they can get around that one pretty easily. Its not to be a downer, im just, well stating thoughts :-) Any thoughts on that ?

Workarounds for the "use the same NFC tag for multiple rolls" is gonna be a bit harder. They can't get around they shipped the NFC with that particular password. One way, is to detect "new" roll (entry password) and then set a new password rotating it ever now and then - changing the seed according to the public NFC information (which they change for every use). That means we do not just have to find one password, but a lot. Thats gonna be annoying.

Now, the obvious fix to that (for us), would just be to use a custom 0.5$ NFC tag with fresh filament info, for every self-made roll of filament. How they get around that one, would require some way of detecting if the NFC is real and official XYZware - that could be a tough on for them. Also, all it requires, is another cheap NFC, that they can't distinguish from the real thing, and boom - its game over.

And they also need to properly block firmware downgrades (and we need to figure out how to deploy a specific firmware version)

150 (edited by ChunkLady 2015-12-18 21:58:59)

Re: DaVinci Junior cartridge reset

I just got ten (10) pieces of NFC tags, hoping to find some time to make a quick test today :-)

EDIT: it seems my NFC writer is a bit strange. I am having problems writing to certain pages. However, i completely missed the point that the UUID can probably not be overwritten on this particular NFC i bought - I will have to reorder for the types that can mimic other NFC chips.