@cybernet
First a huge thanks for all your work, especially the DS2000 keygen (which my DS2072 enjoyed) and now the DG4000 (I was lurking at a DG4062, this might help convince me even more).
Regarding cengen, as others already reported, it errors out with "invalid <CURRENT_MODEL> len" even with correct parameters.
This is due to a bug in strtoupper() that was also present in your initial DS2000 keygen. The following line has undefined behavior:
while ((*p++ = toupper(*p)));
So it might work or not, depending on the compiler/version/arch... It doesn't work with the compiler I use:
$ gcc --version
gcc (Debian 4.8.2-5) 4.8.2
It is easily fixed with:
while ((*p = toupper(*p))) p++;
I suggest you fix the strtoupper() implementation that you use in various pieces of code.
Anyway, very good job !