Created
November 5, 2012 18:11
-
-
Save rsky/4019375 to your computer and use it in GitHub Desktop.
よやさんのswfedに含まれるjpeg_segmentをDQT/DHTをダンプするように改造
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc -Wall -D__JPEG_SEGMENT_DEBUG__ -o jpeg_segment jpeg_segment.c bitstream.c | |
./jpeg_segment unlock_001.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- jpeg_segment.c.orig | |
+++ jpeg_segment.c | |
@@ -238,6 +238,14 @@ | |
printf("(%d) marker=%s(FF%02X): length=%lu\n", | |
i, marker_name?marker_name:"Unknown", | |
node->marker, node->data_len); | |
+ if (node->marker == 0xDB || node->marker == 0xC4) { // DQT or DHT | |
+ const unsigned char *data_cur = node->data_ref; | |
+ const unsigned char *data_end = node->data_ref + node->data_len; | |
+ while (data_cur < data_end) { | |
+ printf("%02x ", *data_cur++); | |
+ } | |
+ printf("\n"); | |
+ } | |
} | |
node = node->next; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(0) marker=SOI(FFD8): length=0 | |
(1) marker=APP0(FFE0): length=14 | |
(2) marker=DQT(FFDB): length=65 | |
00 (Pq1=0, Tq1=0) | |
04 03 03 03 03 03 04 03 03 04 06 04 03 04 06 07 | |
05 04 04 05 07 08 06 06 07 06 06 08 0a 08 09 09 | |
09 09 08 0a 0a 0c 0c 0c 0c 0c 0a 0c 0c 0d 0d 0c | |
0c 11 11 11 11 11 14 14 14 14 14 14 14 14 14 14 | |
(3) marker=DQT(FFDB): length=65 | |
01 (Pq1=0, Tq1=1) | |
04 05 05 08 07 08 0f 0a 0a 0f 14 0e 0e 0e 14 14 | |
14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 | |
14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 | |
14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 | |
(4) marker=SOF2(FFC2): length=15 | |
(5) marker=DHT(FFC4): length=27 | |
00 (Tc1=0, Th1=0) | |
00 00 07 01 01 01 00 00 00 00 00 00 00 00 00 00 | |
00 01 02 04 05 06 07 03 08 09 | |
(6) marker=SOS(FFDA): length=37586 | |
(7) marker=DHT(FFC4): length=27 | |
01 (Tc1=0, Th1=1) | |
00 02 02 03 01 01 01 00 00 00 00 00 00 00 00 00 | |
00 01 02 03 04 05 06 07 08 09 | |
(8) marker=SOS(FFDA): length=25178 | |
(9) marker=DHT(FFC4): length=26 | |
01 (Tc1=0, Th1=1) | |
00 02 03 01 01 01 01 00 00 00 00 00 00 00 00 00 | |
00 01 02 03 04 05 06 07 08 | |
(10) marker=SOS(FFDA): length=25039 | |
(11) marker=DHT(FFC4): length=61 | |
10 (Tc1=1, Th1=0) | |
00 01 04 02 02 01 02 04 05 04 02 02 01 03 00 0b | |
02 00 01 03 04 05 11 12 13 14 06 21 10 15 22 31 | |
16 20 23 32 34 24 33 35 41 25 30 42 51 40 07 52 | |
61 17 43 50 26 36 44 60 45 62 71 53 | |
(12) marker=SOS(FFDA): length=121575 | |
(13) marker=DHT(FFC4): length=80 | |
10 (Tc1=1, Th1=0) | |
00 01 03 01 04 05 08 07 05 06 05 02 05 04 00 07 | |
01 00 02 03 11 04 12 21 31 10 13 22 41 51 20 32 | |
52 61 71 91 92 b1 14 23 42 81 a1 c1 d1 05 30 33 | |
53 62 24 40 72 a2 b2 e1 34 43 82 93 f0 50 e2 15 | |
54 63 c2 d2 73 a3 b3 f1 60 83 25 44 74 70 35 | |
(14) marker=SOS(FFDA): length=123551 | |
(15) marker=DHT(FFC4): length=40 | |
10 (Tc1=1, Th1=0) | |
01 00 02 01 03 03 03 05 01 01 01 01 01 00 00 00 | |
01 00 11 21 31 41 51 10 61 71 81 91 f0 a1 b1 c1 | |
d1 f1 20 e1 30 40 50 | |
(16) marker=SOS(FFDA): length=137738 | |
(17) marker=DHT(FFC4): length=39 | |
10 (Tc1=1, Th1=0) | |
01 00 02 02 02 01 03 04 03 01 01 01 01 00 00 00 | |
01 00 11 21 31 41 51 61 71 81 91 10 a1 c1 f0 b1 | |
d1 f1 e1 20 30 40 | |
(18) marker=SOS(FFDA): length=190266 | |
(19) marker=DHT(FFC4): length=38 | |
11 (Tc1=1, Th1=1) | |
00 01 03 04 02 03 01 01 00 03 01 01 01 00 00 00 | |
01 02 03 11 00 04 05 12 10 13 06 14 20 15 30 07 | |
16 40 50 60 17 | |
(20) marker=SOS(FFDA): length=32347 | |
(21) marker=DHT(FFC4): length=75 | |
11 (Tc1=1, Th1=1) | |
00 01 03 01 06 03 04 07 05 06 04 05 03 04 01 05 | |
01 00 02 11 03 04 10 12 21 31 51 20 22 41 13 30 | |
61 71 05 23 32 52 81 91 b1 14 40 42 72 a1 24 50 | |
53 c1 d1 f0 33 62 92 e1 06 25 43 60 82 15 70 f1 | |
54 a2 b2 d2 80 55 63 90 93 e2 | |
(22) marker=SOS(FFDA): length=54999 | |
(23) marker=DHT(FFC4): length=38 | |
11 (Tc1=1, Th1=1) | |
00 01 03 04 02 03 01 01 01 01 01 01 01 01 00 00 | |
01 02 03 11 00 04 05 12 10 13 06 14 20 15 30 40 | |
16 07 50 17 60 | |
(24) marker=SOS(FFDA): length=32195 | |
(25) marker=DHT(FFC4): length=72 | |
11 (Tc1=1, Th1=1) | |
00 02 01 02 03 06 02 07 04 09 01 07 04 02 02 03 | |
00 01 02 03 11 10 12 21 04 20 22 31 41 51 61 71 | |
13 23 30 32 52 81 91 05 40 a1 b1 14 24 42 50 53 | |
62 72 c1 f0 92 06 33 43 60 82 d1 e1 25 a2 b2 f1 | |
15 63 44 54 70 34 80 | |
(26) marker=SOS(FFDA): length=50789 | |
(27) marker=EOI(FFD9): length=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment