Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
#1 | Link |
|
Registered User
Join Date: Dec 2001
Posts: 73
|
Don't buy this software
Don't buy this software dvdcloner 2 it's dvdshrink here's to these gangsters http://www.dvd--copy.net
__________________
TJ |
|
|
|
|
|
#2 | Link |
|
- DVDRB User -
Join Date: Oct 2001
Location: Brussels - Belgium
Posts: 430
|
Yes, ****** bad, it's really DVDShrink 3.05 Beta. You can see it when you push cancel while scanning the disc. The DVDShrink analysis window appears and then the main window.
It's well camoufled.
__________________
- CaN - Last edited by mrbass; 9th February 2004 at 02:02. |
|
|
|
|
|
#3 | Link |
|
Registered User
Join Date: Apr 2003
Posts: 176
|
I'm curious - but I don't want to install it, God knows what other stuff it will install as well.
I wonder if they managed to decrypt DVD Shrink and modify the executable, or are running it unmodified but in a hidden window, and sending it fake mouse click events...? |
|
|
|
|
|
#5 | Link |
|
Registered User
Join Date: Apr 2003
Posts: 176
|
Are there any programmers out there, who know how to prevent this kind of thing from within an application?
I suppose checking AfxGetMainWnd()->IsWindowVisible() would suffice? If you get a mouse click, and the window is invisible, something has to be wrong ;-) |
|
|
|
|
|
#6 | Link |
|
Moderator
![]() Join Date: Oct 2001
Location: England
Posts: 3,260
|
Also check that the window position is within the window view (i.e. so it can be seen on the desktop) and not obscured by a larger window. Also check Window Title/Caption names (so they can't rename them). And then, if you can, encrypt and compress your app.
That should do it (Hopefully)Take Care, -Nic |
|
|
|
|
|
#7 | Link |
|
Registered User
Join Date: Apr 2003
Location: Bedfordshire, UK
Posts: 39
|
Check out the "version history"
Did you see the "version history" page?
http://www.dvd--copy.net/release.html These guys just really take the cake! A whole page of versions that tells you absolutely nothing. As far a protection goes you can try http://www.aspack.com/ |
|
|
|
|
|
#8 | Link |
|
Moderator
![]() Join Date: Oct 2001
Location: England
Posts: 3,260
|
aspack and asprotect are good, but so well known that their are tutorials everywhere for them....dvdshrink, if he has the time, should look at the fravia messageboard and see which protections people have trouble hacking...
-Nic |
|
|
|
|
|
#9 | Link |
|
Registered User
Join Date: Apr 2003
Posts: 176
|
> Also check that the window position is within
> the window view (i.e. so it can be seen on the > desktop) and not obscured by a larger window Good point, thanks for the tip. DVD Shrink is already encrypted and compressed, although I don't suppose there is any encryption software out there that would put off a determined hacker for long. I'm not aware that it's been hacked yet though. It's a strange world, that one should need to protect a free software. Nic, good luck with Rejig! Will the GNU licence be enough to protect it? |
|
|
|
|
|
#10 | Link |
|
Moderator
![]() Join Date: Oct 2001
Location: England
Posts: 3,260
|
he he, I had a little go at decrypting dvdshrink, (I try on all things I realise that are protected). Looks like it's been compressed with UPX and then changed. I just dumped it with LordPE, never got round to fixing the OEP/IAT though. Ill try and tell you how hard it is
(shame the old mod chainsaw isn't around, he'd probably crack it in a sec)Thanks for the good luck I'll need it.lol...Don't have too much time. For the new unreleased version I'm sure im writing the SCRs a bit weirdly, but it seems to work. I love dvdshrink's interface, very well written.GPL will protect it until it gets good enough to be ripped off. And then it'll probably be sold as something else Oh well.If you do actually work at ahead, say hi to Menno and Ivan for me ![]() Cheers, -Nic |
|
|
|
|
|
#11 | Link |
|
Registered User
Join Date: Apr 2003
Posts: 176
|
Nic, I'd love to know if you can hack DVD Shrink, but of course, don't publish how you did it on the forum ;-)
Naturally I checked out the Rejig source, and you're doing a great job getting all those modules working together. It's a big project! And yes, when it's finished, it will surely become the basis of many commercial implementations (in same manner as MSSG reference source for mpeg-2 video). Let me know if you need help with anything. I'd like to contribute. |
|
|
|
|
|
#12 | Link |
|
Moderator
![]() Join Date: Oct 2001
Location: England
Posts: 3,260
|
Thanks loads dvdshrink
I may well just have to do that. Currently dvdauthor is a bit particular about what video you feed it. i.e. the PTS values can't reset, nor can the SCR values. So in the new version I have to correct the all the PTSs and SCR values. It seems to work ok. But might need to should you for help.I'll see what I can do with dvdshrink...did you make the protection yourself. When ever I've released stuff that I dont want people looking into I just used UPX and then hex edited bad values into the UPX header. Stops the average prying eyes but isn't secure..... I'll keep you posted ![]() -Nic ps Damn them for making PTS and SCR 33 bit variables hey? Would have made life so much easier if they had been 32 bit..... ![]() edit: grrr, I think the OEP is 0x10cc and after rebuilding the IAT table and setting that OEP. It should work, but doesn't. I must be forgetting something. But seeing I've got this far, and I dont know what im doing, someone with better skills probably could unpack it easily. Last edited by Nic; 11th February 2004 at 14:29. |
|
|
|
|
|
#13 | Link |
|
Registered User
Join Date: Apr 2003
Posts: 176
|
I attached the code used by DVD Shrink for reading/writing SCR, PTS and DTS, also a generic pack header structure.
Code:
//////////////////////////////////////////////////////////////////////////
// DVD Shrink
// the following should be in header file
typedef unsigned int uint32;
typedef unsigned short uint16;
typedef unsigned char uchar;
typedef unsigned __int64 uint64;
//
// data structure for first 36 bytes of a pack
//
// PTS, DTS and PES_EXT are optional fields. So actual size of pack
// header may be as small as 23 bytes, followed by stuffing and
// pack data. If PTS exists, DTS is optional. If no PTS, then DTS
// is not allowed.
//
// system header - 14 bytes (mandatory)
// PES header - 9 bytes (mandatory)
// PTS - 5 bytes (if pts_dts_flag & 2)
// DTS - 5 bytes (if pts_dts_flag & 1)
// PES_EXTN - 3 bytes (if pes_ext_flag)
// stuffing - N bytes (stuffing_size, 0 - 7 bytes)
typedef struct {
// 14 bytes
uint32 system_code; // PACK start code
uchar scr_base_5 : 2; // scr_base (bits 28 - 29)
uchar marker1 : 1;
uchar scr_base_6 : 2; // scr_base (bits 31 - 30)
uchar scr_base_7 : 1; // scr_base (bit 32)
uchar bits_01 : 2;
uchar scr_base_4; // scr_base (bits 20 - 27)
uchar scr_base_2 : 2; // scr_base (bits 13 - 14)
uchar marker2 : 1;
uchar scr_base_3 : 5; // scr_base (bits 15 - 19)
uchar scr_base_1; // scr_base (bits 5 - 12)
uchar scr_extn_1 : 2; // scr_extension (bits 7 - 8)
uchar marker3 : 1;
uchar scr_base_0 : 5; // scr_base (bits 0 - 4)
uchar marker4 : 1;
uchar scr_extn_0 : 7; // scr_extension (bits 0 - 6)
uchar mux_rate_2; // mux_rate (bits 14 - 21)
uchar mux_rate_1; // mux_rate (bits 6 - 13)
uchar marker6 : 1;
uchar marker5 : 1;
uchar mux_rate_0 : 6; // mux_rate (bits 0 - 5)
uchar stuffing_size : 3; // stuffing size
uchar reserved : 5;
// 6 bytes
uint32 stream_code; // stream code
uint16 pack_len; // PES pack length
// 1 byte
uchar original_copy : 1; // original or copy flag
uchar copyright : 1; // copyright flag
uchar data_alignment : 1; // data alignment indicator
uchar pes_priority : 1; // PES priority
uchar pes_scrambling : 2; // PES scrambling control
uchar res10 : 2; // reserved = 10b
// 1 byte
uchar pes_ext_flag : 1; // PES ext exists flag
uchar pes_crc_flag : 1; // PES CRC exists flag
uchar addn_copy_info : 1; // additional copy info flag
uchar dsm_trick_flag : 1; // DSM trick mode flag
uchar es_rate_flag : 1; // ES rate exists flag
uchar escr_flag : 1; // ESCR exists flag
uchar pts_dts_flag : 2; // PTS/DTS exists flag
// 1 byte
uchar pes_header_len; // PES header data length
// 5 byte PTS (optional)
uchar marker7 : 1; // marker bit
uchar pts5 : 3; // PTS bits 30-32
uchar res0011 : 4; // reserved = 0011b
uchar pts4; // PTS bits 22-29
uchar marker8 : 1; // marker bit
uchar pts3 : 7; // PTS bits 15-21
uchar pts2; // PTS bits 07-14
uchar marker9 : 1; // marker bit
uchar pts1 : 7; // PTS bits 00-06
// 5 byte DTS (optional)
uchar marker10 : 1; // marker bit
uchar dts5 : 3; // DTS bits 30-32
uchar res0012 : 4; // reserved = 0011b
uchar dts4; // DTS bits 22-29
uchar marker11 : 1; // marker bit
uchar dts3 : 7; // DTS bits 15-21
uchar dts2; // DTS bits 07-14
uchar marker12 : 1; // marker bit
uchar dts1 : 7; // DTS bits 00-06
// 1 byte PES_EXT
uchar pes_ext_flag_2 : 1; // 0
uchar res11 : 3; // 0x07
uchar p_std_buf_flag : 1; // 1
uchar p_pscf : 1; // 0
uchar pack_hdr_field : 1; // 0
uchar private_data : 1; // 0
// 2 byte PES_EXT
uchar p_std_buf_sz1 : 5; // P_STD buffer size
uchar p_std_bufscale : 1; // 1
uchar bits2_01 : 2; // 01b
uchar p_std_buf_sz2 : 8; // P_STD buffer size
} PackHeader;
//
// functions defined in this module
//
uint64 read_scr(const PackHeader * ppack);
void write_scr(uint64 nSCR, PackHeader * ppack);
bool pts_exists(const PackHeader * ppack);
bool dts_exists(const PackHeader * ppack);
uint64 read_pts(const PackHeader * ppack);
void write_pts(uint64 nPTS, PackHeader * ppack);
uint64 read_dts(const PackHeader * ppack);
void write_dts(uint64 nDTS, PackHeader * ppack);
//////////////////////////////////////////////////////////////////////////
// implementation
// read 64-bit SCR from a pack
uint64 read_scr(const PackHeader * ppack)
{
ASSERT(ppack);
ASSERT(ppack->system_code == 0xba010000);
// scr_base
uint64 scr_base = ((uint64) ppack->scr_base_7 << 32) +
((uint64) ppack->scr_base_6 << 30) +
((uint64) ppack->scr_base_5 << 28) +
((uint64) ppack->scr_base_4 << 20) +
((uint64) ppack->scr_base_3 << 15) +
((uint64) ppack->scr_base_2 << 13) +
((uint64) ppack->scr_base_1 << 5) +
((uint64) ppack->scr_base_0 << 0);
// scr_extn
uint64 scr_extn = ((uint64) ppack->scr_extn_1 << 7) +
((uint64) ppack->scr_extn_0 << 0);
// SCR
return scr_extn + (scr_base * 300);
}
// write 64-bit SCR to a pack
void write_scr(uint64 nSCR, PackHeader * ppack)
{
ASSERT(ppack);
ASSERT(ppack->system_code == 0xba010000);
// write base and extn
const uint64 scr_base = nSCR / 300;
const uint64 scr_extn = nSCR % 300;
ppack->scr_base_5 = (uchar)(0x03 & (scr_base >> 28));
ppack->scr_base_6 = (uchar)(0x03 & (scr_base >> 30));
ppack->scr_base_7 = (uchar)(0x01 & (scr_base >> 32));
ppack->scr_base_4 = (uchar)(0xff & (scr_base >> 20));
ppack->scr_base_2 = (uchar)(0x03 & (scr_base >> 13));
ppack->scr_base_3 = (uchar)(0x1f & (scr_base >> 15));
ppack->scr_base_1 = (uchar)(0xff & (scr_base >> 5));
ppack->scr_extn_1 = (uchar)(0x03 & (scr_extn >> 7));
ppack->scr_base_0 = (uchar)(0x1f & (scr_base >> 0));
ppack->scr_extn_0 = (uchar)(0x7f & (scr_extn >> 0));
}
// check if the PTS exists in a pack
bool pts_exists(const PackHeader * ppack)
{
ASSERT(ppack);
ASSERT(ppack->system_code == 0xba010000);
return (ppack->pts_dts_flag & 2) != 0;
}
// check if the DTS exists in a pack
bool dts_exists(const PackHeader * ppack)
{
ASSERT(ppack);
ASSERT(ppack->system_code == 0xba010000);
return (ppack->pts_dts_flag & 1) != 0;
}
// read 64-bit PTS from a pack
// PTS is only 33 bits, and since DVD packs never use the MSB, could be
// optimized to return 32-bit unsigned
uint64 read_pts(const PackHeader * ppack)
{
ASSERT(ppack);
ASSERT(ppack->system_code == 0xba010000);
// check PTS exists
if (ppack->pts_dts_flag & 2)
{
return ((uint64) ppack->pts5 << 30) +
((uint64) ppack->pts4 << 22) +
((uint64) ppack->pts3 << 15) +
((uint64) ppack->pts2 << 7 ) +
((uint64) ppack->pts1);
}
// return invalid PTS if none exists
else
{
return (uint64) -1;
}
}
// write 64-bit PTS to a pack
void write_pts(uint64 nPTS, PackHeader * ppack)
{
ASSERT(ppack);
ASSERT(ppack->system_code == 0xba010000);
// set the PTS exists flag
ppack->pts_dts_flag |= 2;
// set the PTS
ppack->pts1 = (uchar)((nPTS ) & 0x7f);
ppack->pts2 = (uchar)((nPTS >> 7) & 0xff);
ppack->pts3 = (uchar)((nPTS >> 15) & 0x7f);
ppack->pts4 = (uchar)((nPTS >> 22) & 0xff);
ppack->pts5 = (uchar)((nPTS >> 30) & 0x07);
}
// read 64-bit DTS from a pack
// DTS is only 33 bits, and since DVD packs never use the MSB, could be
// optimized to return 32-bit unsigned
uint64 read_dts(const PackHeader * ppack)
{
ASSERT(ppack);
ASSERT(ppack->system_code == 0xba010000);
// check DTS exists
if (ppack->pts_dts_flag & 1)
{
return ((uint64) ppack->dts5 << 30) +
((uint64) ppack->dts4 << 22) +
((uint64) ppack->dts3 << 15) +
((uint64) ppack->dts2 << 7 ) +
((uint64) ppack->dts1);
}
// return invalid DTS if none exists
else
{
return (uint64) -1;
}
}
// write 64-bit DTS to a pack
void write_dts(uint64 nDTS, PackHeader * ppack)
{
ASSERT(ppack);
ASSERT(ppack->system_code == 0xba010000);
// set the DTS exists flag
ppack->pts_dts_flag |= 1;
// set the DTS
ppack->dts1 = (uchar)((nDTS ) & 0x7f);
ppack->dts2 = (uchar)((nDTS >> 7) & 0xff);
ppack->dts3 = (uchar)((nDTS >> 15) & 0x7f);
ppack->dts4 = (uchar)((nDTS >> 22) & 0xff);
ppack->dts5 = (uchar)((nDTS >> 30) & 0x07);
}
//////////////////////////////////////////////////////////////////////////
// end of file
|
|
|
|
|
|
#14 | Link |
|
Moderator
![]() Join Date: Oct 2001
Location: England
Posts: 3,260
|
Thanks! Already got very similar code to that. But may use yours because yours is neater. My problem is laying out the SCRs correctly. I read a bunch of video packs in. Then write out less when their compressed and try to spread the SCR values evenly.
i.e. Read 12 blocks 1st block's SCR = 10 last block's SCR = 10000 going to write 10 blocks (the compressed 12 blocks) so Scr_Inc = (10000-10)/(12-1); and SCR = 10; Then I write out the blocks: Block 1 = SCR Block 2 = SCR + Scr_Inc Block 3 = SCR + Scr_Inc + Scr_Inc If that makes any sense Seems to work ok...but you don't get many blocks going up by the standard 146.086 value...As for dvdshrink, think my OEP is wrong. I think if I find the right one use ollydbg ill be able to unpack it (but at work at minute, so can't) -Nic |
|
|
|
|
|
#15 | Link |
|
Moderator
![]() Join Date: Oct 2001
Posts: 3,398
|
getting off topic, but...
The increment in scr should always be around 146.085 (IfoEdit notation, it is actually 85/300 or .283+) to 146.260 for the NAV pack and video. This reflects the maximum bitrate of 10.08Mbs. (2048 bytes *8 bits/byte *90000 ticks/second /10080000 bits/second = 146.2857) Then the SCR jumps ahead during the audio and subpictures. Very important to get the video into the buffer as fast as possible. edit: 146.086 is the highest that can be sustained (represents 146.2867). I've seen 146.085, but the next 2 packs were 146.086, for a total of 438.257 over three packs (average of 146.2856, still a little too fast). I assume further down there were some more adjustments to keep it right on the edge (I didn't write them all down), but it seems like a lot of work just to nudge such a small increase in speed. Last edited by mpucoder; 11th February 2004 at 17:30. |
|
|
|
|
|
#16 | Link |
|
Moderator
![]() Join Date: Oct 2001
Location: England
Posts: 3,260
|
So how can someone approach my problem without re-writing all the PTSs to keep inline with the SCR values only being increased by a maximum of 146.xxx ?
I know DVDShrink does this without modifying the PTSs. DVDShrink seems to suddenly jump its SCR values up a little and then carry on with the rougly 146.xxx increase. I haven't currently worked out how. I haven't found a DVD player yet that didn't like my approach (and I've tried it on about 10). Infact when I completely screwed up the SCR values (they got way ahead of the relevant PTS values), only one DVD Player minded and that was only when seeking. However, I would like to do it "properly". Any suggestions ? -Nic |
|
|
|
|
|
#17 | Link |
|
Moderator
![]() Join Date: Oct 2001
Posts: 3,398
|
I don't see any problem, really. The DTS and PTS values should not change, as the time to decode and present do not change. And if you are reducing the video data, maintaining 10.08 into the buffer will not result in buffer overflow.
Perhaps you are looking at this as a streaming mpeg rather than a DVD. In a DVD the SCR is NOT the system clock, instead it is used to control the rate that data is read and buffered. In other words, the read process compares the SCR to the players master clock to determine when to put another sector into the buffer (oversimplified, since there are 16 sectors in one ECB) |
|
|
|
|
|
#18 | Link |
|
Moderator
![]() Join Date: Oct 2001
Location: England
Posts: 3,260
|
You are right, I was thinking about it like a System Clock. My bad misconception. So if my SCR increments by slightly more than 146 it shouldn't cause a problem?
Weirdly though, originally I just started the SCR at 0 and then incremented by 146.xx with every pack header, but this caused a problem when seeking to chapters or fastforwarding through the file ? Why would that be if it isn't used as the system clock? I think what I've got now is ok, but if you've got any insight it will be real helpful ![]() Thanks, -Nic |
|
|
|
|
|
#19 | Link |
|
Moderator
![]() Join Date: Oct 2001
Posts: 3,398
|
As for jumps, they occur in three places.
1) between video and audio/subpicture - after stuffing all the video in the reading relaxes a bit. The SCR of the first audio should not be changed, though, since this has been back calculated from the DTS and PTS of the streams to allow anough time to load the buffer (prior to the first DTS). 2) within audio/subpicture streams - they have much lower bitrates, and greater delay in decoding, so stuffing the buffer at max speed isn't needed. 3) between VOBU's - although this is usually small, since the audio/subpictures can be used to distribute the time. For good random access each VOBU should have enough lead time (usually 4 to 7 frames) for reading and decoding. The hard rule is the last pack of the first presented (not decoded) picture has to be read in time for it and all preceeding pictures to be delivered to the decoder, and decoded. For a lot of GOPs that means 3 pictures (2 B and the I). |
|
|
|
|
|
#20 | Link |
|
Moderator
![]() Join Date: Oct 2001
Posts: 3,398
|
The SCR isn't used as the system clock, but it still represents the same time, and exhibits the same relationships with DTS and PTS as an mpeg stream. It's just that the tail wags the dog in a DVD. When a random seek occurs the players clock gets set to the first SCR encountered, reading begins at the rate indicated by SCR increments, and data gets delivered to the decoders according to the newly set clock and DTS, and then the show starts when PTS agrees with the player clock.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|