php-general Digest 27 Oct 2005 05:07:59 -0000 Issue 3760
Topics (messages 224684 through 224706):
Re: Decompress a zlib'd string in PHP
224684 by: Ben
224687 by: Graham Anderson
224688 by: Jochem Maas
224695 by: Jochem Maas
224697 by: Graham Anderson
224704 by: Richard Lynch
224706 by: Graham Anderson
Re: zipped files
224685 by: Richard Lynch
regex and global vars problem
224686 by: Jason Gerfen
224689 by: Jasper Bryant-Greene
224690 by: Jason Gerfen
224691 by: Jasper Bryant-Greene
224692 by: Jason Gerfen
224693 by: Jasper Bryant-Greene
224698 by: Jochem Maas
str_split() and errors?
224694 by: Jason Gerfen
224696 by: Ben
224699 by: James Richardson
224703 by: Richard Lynch
Windows XP installation confusion.
224700 by: Vizion
224702 by: Richard Lynch
Re: MySql connection error on win XP for script that works on Freebsd 5.3
224701 by: Vizion
Re: moving website from windows to linux hosting
224705 by: Oliver Grätz
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Graham Anderson said the following on 10/26/2005 09:07 AM:
I'm sure if I can decompress the string, then it will not be too hard
to do the rest :)
To decompress the string you'll want gzuncompress. More on zlib & php:
http://ca.php.net/manual/en/ref.zlib.php
The on-line manual is your friend :-).
- Ben
--- End Message ---
--- Begin Message ---
Just to show I am not a total leech, I did consult the manual before
I posted the question :)
The compressor in the file data says: dcomzlib
I tried the below with gzinflate and with gzuncompress.
Both give errors:
gzinflate(): data error
gzuncompress(): data error
The below is the copy/pasted hex of the compressed movie header in
the Quicktime Movie File
FYI ,I did not compress the string myself...it is compressed
automatically when a Quicktime movie is exported.
$compressed =
"DE789CB552BF6F133114F65D2852A50A7568E14041B2A00B120CB081549514860CA9545
15431743167E7CE8AED3B9D9D2B65E9D4FF0484F8079810EC8C0C8CFC2BE1D9E7FB91A4A
008C44B7CF67B7EFEDE67BF0FA1B59F32CB4A849090654A61465F2FD21B762014BE72234
0F6DFDA9CB3EC3F6D56F6FC92F520FEC1146402EB133371357B6DCD1AAD3D3B9BAD5E37B
09F07CEDD61D46898FB4C68D39EF0B8EE6CB8262927B0C092FEE6EE080D613C4EA928ECB
E4C4561D81B43F2FC914309822FD120CF05C32F218C0F1800E2215154303810BC935C8D2
171944857204A2050B19D39F3C4EE5BD0151FB62143810C115C0319B15991F9EEC90C042
71A3F27A64306EDD08A4C9F166CDC29B16141FCFA9336AF05CC2FB4D1B493B3EF082ED09
ABB42659BB6BF16B372AF264CB1D23E318AB471FDA811EA5EF4A1523C1F6FC616ECBDF57
B7B6D2CCEDAFCF007CCBB7146D9C2E3DDD38CA80E96B5ED098862F1616F4DA9B10CAF292
299EBE2C36A234CFE20D3D0E734323DFF3B99462223B4835567AF20DFE0FD8AF27DD2956
FC929F38A0188E0F3CD4A31C710CE96F4FBCCEB77ABACF41B7474FB5F75F8CDEB70BCA0C
3E302501B1F7EB668E55E818780B60CFDA55DC6FA4071490CCF14BADCB0BBCABF6AF336B
A549BBD6D98EF78795DB7F21A1D1DE27D124F92229BAAFA5E273EE3EE477D5A2068DE01A
10C9F7293E2112FD9912109C38785058E72314D64567266D17653809256F81BB139CB55A
6EC7A3D17E4CC01FF027425F9B1";
$string = pack("H*", $compressed);
$uncompressed = gzinflate($string);
//$uncompressed = gzuncompress($string);
echo $uncompressed;
?>
On Oct 26, 2005, at 10:20 AM, Jochem Maas wrote:
Graham Anderson wrote:
How do you decompress a zlib'd string located in a file with php ?
I need to dynamically write a password string into a movie file.....
It appears that in QuickTime movie API, all sprite variables/
values are zlib'd inside the movie file
So I need to:
find the string
decompress a zlib'd string inside a file.
change its value => password=new_password
recompress the new value
write the zlib'd string back to the file
I'm sure if I can decompress the string, then it will not be too
hard to do the rest :)
I'm sure if you spent 5 seconds searching the manual you would find
this page:
http://php.net/manual/en/function.gzuncompress.php
and this one:
http://php.net/manual/en/function.gzcompress.php
(HINT: I typed http://php.net/zlib into the address bar to find them)
'the rest' involves find your substring's beginning and ending
offset and then
using those values to 'splice' the new substring (aka password)
into the file/stream,
I can visualize how ot do it but have never actually needed to do
something like
that ... I would say the compress/decompress is the easier part
personally ...
buy hey as long as you get it working :-)
many thanks
back at ya, I learnt some stuff answering (hopefully) you question ;-)
g
--- End Message ---
--- Begin Message ---
Graham Anderson wrote:
How do you decompress a zlib'd string located in a file with php ?
I need to dynamically write a password string into a movie file.....
It appears that in QuickTime movie API, all sprite variables/values are
zlib'd inside the movie file
So I need to:
find the string
decompress a zlib'd string inside a file.
change its value => password=new_password
recompress the new value
write the zlib'd string back to the file
I'm sure if I can decompress the string, then it will not be too hard
to do the rest :)
I'm sure if you spent 5 seconds searching the manual you would find this page:
http://php.net/manual/en/function.gzuncompress.php
and this one:
http://php.net/manual/en/function.gzcompress.php
(HINT: I typed http://php.net/zlib into the address bar to find them)
'the rest' involves find your substring's beginning and ending offset and then
using those values to 'splice' the new substring (aka password) into the
file/stream,
I can visualize how ot do it but have never actually needed to do something like
that ... I would say the compress/decompress is the easier part personally ...
buy hey as long as you get it working :-)
many thanks
back at ya, I learnt some stuff answering (hopefully) you question ;-)
g
--- End Message ---
--- Begin Message ---
Graham Anderson wrote:
Just to show I am not a total leech, I did consult the manual before I
posted the question :)
ack.
The compressor in the file data says: dcomzlib
I tried the below with gzinflate and with gzuncompress.
Both give errors:
gzinflate(): data error
gzuncompress(): data error
The below is the copy/pasted hex of the compressed movie header in the
Quicktime Movie File
FYI ,I did not compress the string myself...it is compressed
automatically when a Quicktime movie is exported.
$compressed =
"DE789CB552BF6F133114F65D2852A50A7568E14041B2A00B120CB081549514860CA9545
15431743167E7CE8AED3B9D9D2B65E9D4FF0484F8079810EC8C0C8CFC2BE1D9E7FB91A4A
008C44B7CF67B7EFEDE67BF0FA1B59F32CB4A849090654A61465F2FD21B762014BE72234
0F6DFDA9CB3EC3F6D56F6FC92F520FEC1146402EB133371357B6DCD1AAD3D3B9BAD5E37B
09F07CEDD61D46898FB4C68D39EF0B8EE6CB8262927B0C092FEE6EE080D613C4EA928ECB
E4C4561D81B43F2FC914309822FD120CF05C32F218C0F1800E2215154303810BC935C8D2
171944857204A2050B19D39F3C4EE5BD0151FB62143810C115C0319B15991F9EEC90C042
71A3F27A64306EDD08A4C9F166CDC29B16141FCFA9336AF05CC2FB4D1B493B3EF082ED09
ABB42659BB6BF16B372AF264CB1D23E318AB471FDA811EA5EF4A1523C1F6FC616ECBDF57
B7B6D2CCEDAFCF007CCBB7146D9C2E3DDD38CA80E96B5ED098862F1616F4DA9B10CAF292
299EBE2C36A234CFE20D3D0E734323DFF3B99462223B4835567AF20DFE0FD8AF27DD2956
FC929F38A0188E0F3CD4A31C710CE96F4FBCCEB77ABACF41B7474FB5F75F8CDEB70BCA0C
3E302501B1F7EB668E55E818780B60CFDA55DC6FA4071490CCF14BADCB0BBCABF6AF336B
A549BBD6D98EF78795DB7F21A1D1DE27D124F92229BAAFA5E273EE3EE477D5A2068DE01A
10C9F7293E2112FD9912109C38785058E72314D64567266D17653809256F81BB139CB55A
6EC7A3D17E4CC01FF027425F9B1";
$string = pack("H*", $compressed);
ok I don't understand pack() very well at all, but why are you using it
here? as far as I can tell gzinflate()/gzuncompress() don't work on binary
strings. what happens is you don't use pack()?
$uncompressed = gzinflate($string);
//$uncompressed = gzuncompress($string);
echo $uncompressed;
?>
On Oct 26, 2005, at 10:20 AM, Jochem Maas wrote:
Graham Anderson wrote:
How do you decompress a zlib'd string located in a file with php ?
I need to dynamically write a password string into a movie file.....
It appears that in QuickTime movie API, all sprite variables/ values
are zlib'd inside the movie file
So I need to:
find the string
decompress a zlib'd string inside a file.
change its value => password=new_password
recompress the new value
write the zlib'd string back to the file
I'm sure if I can decompress the string, then it will not be too
hard to do the rest :)
I'm sure if you spent 5 seconds searching the manual you would find
this page:
http://php.net/manual/en/function.gzuncompress.php
and this one:
http://php.net/manual/en/function.gzcompress.php
(HINT: I typed http://php.net/zlib into the address bar to find them)
'the rest' involves find your substring's beginning and ending offset
and then
using those values to 'splice' the new substring (aka password) into
the file/stream,
I can visualize how ot do it but have never actually needed to do
something like
that ... I would say the compress/decompress is the easier part
personally ...
buy hey as long as you get it working :-)
many thanks
back at ya, I learnt some stuff answering (hopefully) you question ;-)
g
--- End Message ---
--- Begin Message ---
If I remove pack, I get the error:
gzuncompress(): data error
$uncompressed = gzuncompress($the_string);
echo $uncompressed;
in my hex editor, the movie header contains:
ftypqt qt Pmoov Hcmov dcomzlib 4cmvd
From the Quicktime Docs, 'dcomzlib' is supposed to be the
compression method for the below string:
fixúµRøo1ˆ](R•
[EMAIL PROTECTED]∞ÅTïÜ©TQT1t1gÁŒäÌ;ùù+eÈ‘ˇÑ¯òÏåå¸+·ŸÁ˚맆ƒK|ˆ{~˛figø°
...and so on
has anyone had experience with this ?
g
On Oct 26, 2005, at 12:15 PM, Jochem Maas wrote:
Graham Anderson wrote:
Just to show I am not a total leech, I did consult the manual
before I posted the question :)
ack.
The compressor in the file data says: dcomzlib
I tried the below with gzinflate and with gzuncompress.
Both give errors:
gzinflate(): data error
gzuncompress(): data error
The below is the copy/pasted hex of the compressed movie header
in the Quicktime Movie File
FYI ,I did not compress the string myself...it is compressed
automatically when a Quicktime movie is exported.
$compressed =
"DE789CB552BF6F133114F65D2852A50A7568E14041B2A00B120CB081549514860CA9
545
15431743167E7CE8AED3B9D9D2B65E9D4FF0484F8079810EC8C0C8CFC2BE1D9E7FB91
A4A
008C44B7CF67B7EFEDE67BF0FA1B59F32CB4A849090654A61465F2FD21B762014BE72
234
0F6DFDA9CB3EC3F6D56F6FC92F520FEC1146402EB133371357B6DCD1AAD3D3B9BAD5E
37B
09F07CEDD61D46898FB4C68D39EF0B8EE6CB8262927B0C092FEE6EE080D613C4EA928
ECB
E4C4561D81B43F2FC914309822FD120CF05C32F218C0F1800E2215154303810BC935C
8D2
171944857204A2050B19D39F3C4EE5BD0151FB62143810C115C0319B15991F9EEC90C
042
71A3F27A64306EDD08A4C9F166CDC29B16141FCFA9336AF05CC2FB4D1B493B3EF082E
D09
ABB42659BB6BF16B372AF264CB1D23E318AB471FDA811EA5EF4A1523C1F6FC616ECBD
F57
B7B6D2CCEDAFCF007CCBB7146D9C2E3DDD38CA80E96B5ED098862F1616F4DA9B10CAF
292
299EBE2C36A234CFE20D3D0E734323DFF3B99462223B4835567AF20DFE0FD8AF27DD2
956
FC929F38A0188E0F3CD4A31C710CE96F4FBCCEB77ABACF41B7474FB5F75F8CDEB70BC
A0C
3E302501B1F7EB668E55E818780B60CFDA55DC6FA4071490CCF14BADCB0BBCABF6AF3
36B
A549BBD6D98EF78795DB7F21A1D1DE27D124F92229BAAFA5E273EE3EE477D5A2068DE
01A
10C9F7293E2112FD9912109C38785058E72314D64567266D17653809256F81BB139CB
55A 6EC7A3D17E4CC01FF027425F9B1";
$string = pack("H*", $compressed);
ok I don't understand pack() very well at all, but why are you
using it
here? as far as I can tell gzinflate()/gzuncompress() don't work on
binary
strings. what happens is you don't use pack()?
$uncompressed = gzinflate($string);
//$uncompressed = gzuncompress($string);
echo $uncompressed;
?>
On Oct 26, 2005, at 10:20 AM, Jochem Maas wrote:
Graham Anderson wrote:
How do you decompress a zlib'd string located in a file with php ?
I need to dynamically write a password string into a movie
file.....
It appears that in QuickTime movie API, all sprite variables/
values are zlib'd inside the movie file
So I need to:
find the string
decompress a zlib'd string inside a file.
change its value => password=new_password
recompress the new value
write the zlib'd string back to the file
I'm sure if I can decompress the string, then it will not be
too hard to do the rest :)
I'm sure if you spent 5 seconds searching the manual you would
find this page:
http://php.net/manual/en/function.gzuncompress.php
and this one:
http://php.net/manual/en/function.gzcompress.php
(HINT: I typed http://php.net/zlib into the address bar to find
them)
'the rest' involves find your substring's beginning and ending
offset and then
using those values to 'splice' the new substring (aka password)
into the file/stream,
I can visualize how ot do it but have never actually needed to
do something like
that ... I would say the compress/decompress is the easier part
personally ...
buy hey as long as you get it working :-)
many thanks
back at ya, I learnt some stuff answering (hopefully) you
question ;-)
g
--- End Message ---
--- Begin Message ---
On Wed, October 26, 2005 12:34 pm, Graham Anderson wrote:
> The compressor in the file data says: dcomzlib
Okay, now we are getting somewhere.
dcomzlib is, most likely, not the same as zlib.
> I tried the below with gzinflate and with gzuncompress.
> Both give errors:
> gzinflate(): data error
> gzuncompress(): data error
And this pretty much clinches it, mostly, assuming you passed in the
right data.
"DE789CB552BF6F133114F65D2852A50A7568E14041B2A00B120CB081549514860CA9545
And this is just "data" with not much we can do to guess about its
format.
However, I surfed to http://info.com/dcomzlib and the very first link
(also the only one in English) was to:
http://sourceforge.net/mailarchive/forum.php?forum_id=9050&max_rows=25&style=nested&viewmonth=200205
where somebody pretty much tells you how to decompress this, I think.
(I didn't read the WHOLE thing, mind you)
S/He also raises the question of the legality of doing this, which you
may also wish to consider before proceeding.
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
Hi Richard :)
Looks like all he did was change a couple of atoms names...BEFORE
the compressed movie header stuff :(
All in all.... is all pretty basic stuff.
I am more interested in what comes AFTER dcomzlib.
Quicktime automatically decompressed the movie header when it plays a
file, so there has to be way to decompress it?
As far as legality, I am hacking my own files :)
Ultimately, I want to write a password variable into the Quicktime file
My hope is that all movie variables are also compressed with
dcomzlib...as they are no where to be found by looking at the hex :(
If I can find the variables, then I can rewrite them :)
I know several members of the Quicktime Engineering team, and no one
has made a peep.
But, they will not tell me the answer either ;)
Maybe they are waiting to sue me the moment I figure it out ;)
Here is a 'test' movie I created:
These two examples are the SAME file...One has a compressed movie
header. The other is uncompressed
So...one has dcomzlib, and one is not
Uncompressed Movie Header:
ftypqt qt fimoov lmvhd øÜ
bøÜ
[EMAIL PROTECTED]