MS Project 2010 - How to restore macros from (corrupt?) Global.MPT - vba

i was developing some VBA macro during a day - 500 lines of code. Code was placed into Global.mpt because i was going to reuse it across different project files.
At some moment i missed to increment cycle in the while cycle. When debugging this brought MS Project into endless non-responsive 100%-CPU-usage loop. I had to kill MS Project from task manager and after restarting it i see no VBA modules in Global.mpt. I see names of my variables and procedures in existing Global.MPT, but there is no plain code to restore manually.
When i try renaming Global.MPT into MyGlobal.MPT and opening it, MS Project shows 'Organizer' dialog suggesting to import content from MyGlobal.MPT to Global.MPT but 'Modules' tab shows empty list of like there is nothing to import.
Is there way to fix or export VBA content from the file? I do not want to loose day of works :(

For referrence - module named MyModule with following content
Sub HelloWorld()
MsgBox 'HelloWorld'
End Sub
Looks like following in the VBA stream
0012BA04 01 16 01 00 02 F0 00 00 00 BC 02 00 00 D4 00 00 |................|
0012BA14 00 B0 01 00 00 FF FF FF FF EA 02 00 00 8A 03 00 |................|
0012BA24 00 00 00 00 00 01 00 00 00 7D 0A CF 43 00 00 FF |.........}..C...|
0012BA34 FF 03 00 00 00 00 00 00 00 B6 00 FF FF 01 01 00 |................|
0012BA44 00 00 00 FF FF FF FF 00 00 00 00 FF FF 04 00 FF |................|
0012BA54 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
0012BA64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
0012BA74 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
0012BA84 00 00 00 00 00 00 00 10 00 00 00 03 00 00 00 05 |................|
0012BA94 00 00 00 07 00 00 00 FF FF FF FF FF FF FF FF 01 |................|
0012BAA4 01 08 00 00 00 FF FF FF FF 78 00 00 00 02 00 00 |.........x......|
0012BAB4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
0012BAC4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF |................|
0012BAD4 00 00 00 00 4D 45 00 00 FF FF FF FF FF FF 00 00 |....ME..........|
0012BAE4 00 00 FF FF 00 00 00 00 FF FF 01 01 00 00 00 00 |................|
0012BAF4 DF 00 FF FF 00 00 00 00 04 00 FF FF FF FF FF FF |................|
0012BB04 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
0012BB14 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
0012BB24 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
0012BB34 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
0012BB44 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
0012BB54 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
0012BB64 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
0012BB74 FF FF FF FF FF FF FF FF FF FF 28 00 00 00 00 00 |..........(.....|
0012BB84 36 0A FF FF FF FF 00 00 00 00 02 3C 08 00 FF FF |6..........<....|
0012BB94 00 00 00 00 02 3C 0C 00 FF FF 00 00 00 00 02 3C |.....<.........<|
0012BBA4 FF FF FF FF 00 00 FF FF 01 01 00 00 00 00 00 00 |................|
0012BBB4 01 00 00 00 FF FF FF FF 01 01 80 00 00 00 38 00 |..............8.|
0012BBC4 00 00 FF FF FF FF 02 83 1C 02 FF FF FF FF 08 00 |................|
0012BBD4 FF FF 30 00 00 00 00 00 FF FF FF FF FF FF 00 00 |..0.............|
0012BBE4 00 00 FF FF FF FF FF FF FF FF 00 00 00 00 1D 00 |................|
0012BBF4 00 00 25 00 00 00 0B 12 1E 02 FF FF FF FF 00 00 |..%.............|
0012BC04 00 60 00 00 00 00 FF FF FF FF FF FF FF FF 00 00 |.`..............|
0012BC14 00 00 00 00 00 00 FF FF FF FF 7C FF 00 00 FF FF |..........|.....|
0012BC24 FF FF FF FF FF FF FF FF FF FF 03 00 03 00 00 00 |................|
0012BC34 84 00 00 03 00 00 FF FF FF FF C0 01 00 00 01 00 |................|
0012BC44 01 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 |..............8.|
0012BC54 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
0012BC64 FF FF FF FF FF FF 38 00 00 00 FF FF FF FF FF FF |......8.........|
0012BC74 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
0012BC84 FF FF FF FF FF FF 08 00 00 00 00 00 00 00 01 00 |................|
0012BC94 00 00 08 00 04 00 FF FF FF FF 00 00 00 00 FF FF |................|
0012BCA4 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
0012BCB4 FF FF FF FF FF FF 02 00 00 00 00 00 E4 E7 C5 4E |...............N|
0012BCC4 0E 00 01 24 00 2A 00 5C 00 52 00 66 00 66 00 66 |...$.*.\.R.f.f.f|
0012BCD4 00 66 00 2A 00 30 00 3F 00 34 00 65 00 63 00 35 |.f.*.0.?.4.e.c.5|
0012BCE4 00 65 00 37 00 65 00 39 00 DF 00 00 00 00 00 00 |.e.7.e.9........|
0012BCF4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
0012BD04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
0012BD14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
0012BD24 00 00 00 00 00 00 FE CA 01 00 03 00 22 81 08 00 |............"...|
0012BD34 06 00 00 00 00 00 00 00 00 81 08 04 18 00 00 00 |................|
0012BD44 10 00 00 00 04 81 08 00 02 00 00 00 08 00 00 00 |................|
0012BD54 FF FF FF FF 01 01 30 00 00 00 96 04 38 00 00 00 |......0.....8...|
0012BD64 00 00 6F 00 FF FF 70 00 00 00 41 40 22 02 00 00 |..o...p...A#"...|
0012BD74 E0 00 0B 00 0B 00 48 65 6C 6C 6F 57 6F 72 6C 64 |......HelloWorld|
0012BD84 27 00 FF FF FF FF 50 00 00 00 FF FF FF FF 00 00 |'.....P.........|
0012BD94 01 52 B0 00 41 74 74 72 69 62 75 74 00 65 20 56 |.R..Attribut.e V|
0012BDA4 42 5F 4E 61 6D 00 65 20 3D 20 22 4D 79 4D 00 6F |B_Nam.e = "MyM.o|
0012BDB4 64 75 6C 65 22 0D 0A 00 53 75 62 20 48 65 6C 6C |dule"...Sub Hell|
0012BDC4 00 6F 57 6F 72 6C 64 28 29 08 0D 0A 20 00 00 4D |.oWorld()... ..M|
0012BDD4 73 67 42 10 6F 78 20 27 07 64 27 0D 0A 10 45 6E |sgB.ox '.d'...En|
0012BDE4 64 20 00 5C 0D 0A |d .\..|

Other solutions are to recover from backup. Open on another machine with Project or repair the User Profile. It may be corrupt. If you can log in with another username to the PC and try to open the file. Good luck,
OR:
1] Go t File --> Options --> Trust Center --> click on Trust Center Settings --> Select the option "Allow loading files with legacy or non-default file formats" and try opening the file.
2] Open a blank project and try inserting the problematic file and try opening it.

The easiest way is to simply change the file extension to MPP and open it as a project. The organizer will come up and ask you if you want to copy the MPP's macros and code into your new (blank) MPT file. Just slide them over and you're good as gold (you'll have to reset your references, but otherwise, ready to go)

Related

Needing help on CRC-8 reverse engineering

I have got the following messages:
|pref|data |cs|post|
|----|--------------------------------------|--|----|
|1002|00070080000000000000000000000000000000|87|10fe|
|1002|000700000c0000000000000000000000000000|19|10fe|
|1002|00070081000000000000000000000000000000|86|10fe|
|1002|00070001010000000000000000000000000000|15|10fe|
|1002|00070082000000000000000000000000000000|85|10fe|
|1002|00070005b00000000000000000000000000000|a0|10fe|
|1002|00070083000000000000000000000000000000|84|10fe|
|1002|000700b0140000000000000000000000000000|b1|10fe|
|1002|00070084000000000000000000000000000000|83|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|00070085000000000000000000000000000000|82|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|00070086000000000000000000000000000000|81|10fe|
|1002|00070000010000000000000000000000000000|14|10fe|
|1002|00070087000000000000000000000000000000|80|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|00070088000000000000000000000000000000|8f|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|00070089000000000000000000000000000000|8e|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|0007008a000000000000000000000000000000|8d|10fe|
|1002|00070000000000000000000000000000000000|15|10fe|
|1002|0007008b000000000000000000000000000000|8c|10fe|
|1002|000700979d0000000000000000000000000000|1f|10fe|
|1002|00050300000000000000000000000000000000|06|10fe|
|1002|000503044b0000000000000000000000000000|5b|10fe|
|1002|00ff000000ff01000000000000000000000002|11|10fe|
All number based 16 (hex)
pref always 1002 start of message
cs possible a 8-bit checksum
post always 10fe end of message
My question is "How to calculate the checksum?"
Mark takes me closely the solution.
I wrot a small test-code and let Marks algorithmus calculate a lot of message's checksum. Almost I gat 12h but sometimes 00h.
Can you figure out why?
#include <stdio.h>
const unsigned char data[172][20] = {
{0x01,0xf6,0x60,0x00,0x1e,0xb0,0x0f,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0xcb},
{0x00,0xff,0x00,0x51,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x40},
{0x01,0xf8,0x19,0xad,0x89,0x1d,0xd9,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x9d},
{0x01,0xf8,0x99,0xbd,0x85,0x81,0x01,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x25},
{0x01,0xf9,0x98,0x71,0x35,0x41,0x3f,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0xc7},
{0x01,0xfa,0x98,0x4c,0x01,0x71,0xc9,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x6b},
{0x01,0xfb,0x18,0x00,0x01,0x36,0xcb,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x83},
{0x01,0xf8,0x1b,0xad,0xf0,0x5c,0x57,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x49},
{0x01,0xf8,0x9b,0xbd,0x0c,0x3a,0x45,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x31},
{0x01,0xf9,0x1b,0xa6,0x38,0x42,0x27,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0xe5},
{0x01,0xf9,0x9a,0x71,0x3c,0x23,0xe7,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x76},
{0x01,0xfa,0x1b,0x94,0x00,0x82,0x63,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x68},
{0x01,0xfa,0x9a,0x4c,0x00,0x88,0xbb,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x83},
{0x01,0xfb,0x1a,0x00,0x00,0xcf,0xb9,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x6b},
{0x01,0xfb,0x9a,0x6c,0x00,0x1d,0xf5,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x79},
{0x01,0xf8,0x1d,0xac,0x4c,0xc2,0xb7,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x8c},
{0x01,0xf9,0x1d,0xa6,0x3c,0xe9,0x63,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x68},
{0x01,0xfa,0x1d,0x94,0x00,0xa1,0x6b,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x45},
{0x01,0xfa,0x9c,0x4c,0x00,0xab,0xb3,0x7f,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0xae},
{0x01,0xfb,0x9c,0x6c,0x00,0x3e,0xfd,0x7f,0x10,0x0a,0xd5,0x7f,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x34},
{0x01,0xf6,0x20,0x6c,0x00,0x38,0x43,0x1e,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x3c},
{0x00,0xff,0x00,0x53,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x42},
{0x01,0xf6,0x00,0x6c,0x00,0x7c,0x65,0x1e,0xd0,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x7e},
{0x01,0xe0,0x78,0x00,0x00,0x3c,0x61,0x2d,0xd0,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0x0a},
{0x00,0xff,0x00,0x53,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0xc2},
{0x00,0xff,0x00,0x53,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0xc2},
{0x01,0xa0,0x78,0x00,0x02,0x00,0x00,0xb3,0x7b,0x87,0x87,0x87,0x7b,0x22,0x00,0x00,0x00,0x00,0x00,0xdf},
{0x01,0x60,0xb8,0x00,0x00,0xc0,0x3c,0x1b,0xd0,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0xdd},
{0x01,0x60,0xb8,0x00,0x00,0xc1,0xb7,0x29,0x7f,0xc2,0xaf,0x7f,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0xd8},
{0x01,0xf0,0x20,0x00,0x00,0x20,0x80,0x00,0x00,0x11,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x4a},
{0x01,0xf2,0x00,0x00,0x00,0x41,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
{0x01,0xf0,0x20,0x00,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x3b},
{0x01,0xf2,0x00,0x00,0x00,0x21,0x80,0x00,0x00,0x11,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x69},
{0x01,0xf0,0x20,0x00,0x00,0x20,0x81,0x00,0x00,0x02,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x59},
{0x01,0xf2,0x00,0x00,0x00,0x41,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x19},
{0x01,0xf0,0x20,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x34},
{0x01,0xf2,0x00,0x00,0x00,0x21,0x8f,0x00,0x00,0x62,0xa2,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xb7},
{0x01,0xf0,0x20,0x1e,0x1e,0x20,0x81,0x00,0x00,0x03,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x58},
{0x01,0xf2,0x00,0x00,0x00,0x41,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x19},
{0x01,0xf0,0x20,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x34},
{0x01,0xf2,0x00,0x00,0x00,0x21,0x8f,0x00,0x00,0xf5,0x7c,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xfe},
{0x01,0xf0,0x20,0x1e,0x1e,0x20,0x81,0x00,0x00,0x08,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x53},
{0x01,0xf0,0x20,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x34},
{0x01,0xf2,0x00,0x00,0x00,0x21,0x8f,0x00,0x00,0x06,0x23,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x52},
{0x01,0xf0,0x20,0x1e,0x1e,0x20,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x5b},
{0x01,0xf2,0x00,0x00,0x00,0x41,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
{0x00,0xff,0x00,0x53,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x02,0x3e},
{0x01,0x60,0xb8,0x02,0x00,0x02,0x1c,0x19,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0xef},
{0x01,0x60,0xb8,0x02,0x00,0x03,0x97,0x2b,0x7f,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0x28},
{0x01,0xf2,0x00,0x02,0x00,0x42,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x19},
{0x01,0xf0,0x40,0x02,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x59},
{0x01,0xf2,0x00,0x02,0x00,0x22,0x80,0x00,0x00,0x12,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x6b},
{0x01,0xf0,0x40,0x02,0x00,0x20,0x81,0x00,0x00,0x06,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x3f},
{0x01,0xf2,0x00,0x02,0x00,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x02,0x00,0x22,0x8f,0x00,0x00,0x92,0xf2,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x16},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x02,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x38},
{0x01,0xf2,0x00,0x02,0x00,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x02,0x00,0x22,0x8f,0x00,0x00,0x3b,0xf7,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xba},
{0x01,0xf2,0x00,0x02,0x00,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x02,0x00,0x22,0x8f,0x00,0x00,0x06,0x23,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x53},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0a,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x31},
{0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
{0x01,0xf0,0x40,0x02,0x00,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x56},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0x55,0x35,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x14},
{0x01,0xf0,0x40,0x02,0x00,0x20,0x81,0x00,0x00,0x03,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x3b},
{0x01,0xf2,0x00,0x02,0x00,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8c,0x00,0x00,0x04,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x53},
{0x01,0xf2,0x00,0x02,0x00,0x22,0x8c,0x00,0x00,0xf6,0xff,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x7d},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x85,0x00,0x00,0x08,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x36},
{0x01,0xf2,0x00,0x02,0x00,0x42,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1c},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8c,0x00,0x00,0x04,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x53},
{0x01,0xf2,0x00,0x02,0x00,0x22,0x8c,0x00,0x00,0x07,0x04,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x76},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8c,0x00,0x00,0x01,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x56},
{0x01,0xf2,0x00,0x02,0x00,0x22,0x8c,0x00,0x00,0x02,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x77},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0a,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x31},
{0x01,0xf2,0x00,0x02,0x00,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x51},
{0x01,0xf2,0x00,0x02,0x00,0x22,0x8a,0x00,0x00,0x20,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x53},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0b,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x30},
{0x00,0xff,0x00,0x53,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0x3c},
{0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0xa7,0xce,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1d},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x51},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x19,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x22},
{0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0xaf,0xac,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x77},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0c,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x37},
{0x00,0xff,0x00,0x53,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0x3c},
{0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0xba,0xa5,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x6b},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x51},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8a,0x00,0x00,0x20,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x51},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0d,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x36},
{0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0x05,0x28,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x59},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x13,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x28},
{0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0xee,0xd8,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x42},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x0e,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x35},
{0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0x0f,0xe1,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x9a},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x14,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x2f},
{0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0x81,0x3b,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xce},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x81,0x00,0x00,0x11,0x00,0x01,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x2a},
{0x01,0xf2,0x00,0x1e,0x1e,0x42,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x54},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x8f,0x00,0x00,0xbc,0xa9,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x61},
{0x01,0xf0,0x40,0x1e,0x1e,0x20,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x3b},
{0x01,0xf2,0x00,0x1e,0x1e,0x42,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1b},
{0x01,0xf0,0x40,0x1e,0x1e,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x9b},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x40,0x00,0x00,0x00,0x00,0x7f,0xff,0x38,0x00,0x00,0x00,0x00,0x00,0x3b},
{0x01,0xf2,0x00,0x1e,0x1e,0x22,0x50,0x00,0x00,0x7f,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xd4},
{0x01,0x60,0xb8,0x00,0x00,0xc0,0x3c,0x1b,0x02,0x19,0xc1,0x7f,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0xa8},
{0x01,0xa1,0x98,0x00,0x00,0x00,0x00,0x62,0x9b,0x2f,0xe9,0x7f,0x7b,0x22,0x00,0x00,0x00,0x00,0x00,0x33},
{0x01,0xe1,0x98,0x00,0x08,0x97,0x33,0x14,0x00,0x0f,0x59,0x07,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0xab},
{0x01,0xe0,0x78,0x00,0x00,0x3c,0x61,0x2d,0x9b,0x2f,0xe9,0x7f,0x7b,0x21,0x00,0x00,0x00,0x00,0x00,0x83},
{0x00,0xff,0x00,0x53,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x00,0x02,0x3c},
{0x00,0x04,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06},
{0x01,0x60,0xb8,0x02,0x00,0x03,0x97,0x2b,0x3c,0x03,0x16,0xb3,0xd1,0x21,0x00,0x00,0x00,0x00,0x00,0x1c},
{0x01,0x60,0xb8,0x00,0x00,0xc1,0xb7,0x29,0x7f,0x87,0x87,0x87,0x7b,0x21,0x00,0x00,0x00,0x00,0x00,0x36},
{0x01,0xa0,0x78,0x00,0x02,0x00,0x00,0xb3,0x7b,0x87,0x87,0x87,0x7b,0x22,0x00,0x00,0x00,0x00,0x00,0xdf},
{0x00,0xff,0x00,0x01,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x02,0x6c},
{0x00,0x04,0x03,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05},
{0x01,0xa1,0x98,0x00,0x00,0x00,0x00,0x62,0x9b,0x87,0x87,0x87,0x7b,0x22,0x00,0x00,0x00,0x00,0x00,0x0d},
{0x01,0xf1,0xe0,0x00,0x00,0x20,0x80,0x00,0x00,0x1f,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xa7},
{0x01,0xf2,0x00,0x00,0x00,0x4f,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x16},
{0x01,0xf1,0xe0,0x00,0x00,0x20,0x81,0x00,0x00,0x03,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xba},
{0x01,0xf2,0x00,0x02,0x00,0x4f,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x15},
{0x01,0xe1,0x38,0x1e,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4},
{0x01,0xf1,0xe0,0x00,0x00,0x40,0x89,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xd1},
{0x01,0xf2,0x00,0x1e,0x02,0x2f,0x89,0x00,0x00,0x01,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x62},
{0x01,0xf1,0xe0,0x00,0x00,0x20,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xbc},
{0x01,0xf2,0x00,0x1e,0x1e,0x4f,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x12},
{0x01,0xf1,0xe0,0x00,0x00,0x40,0x86,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xde},
{0x01,0xf2,0x00,0x1e,0x02,0x2f,0x86,0x00,0x00,0x0d,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x61},
{0x01,0xf1,0xe0,0x00,0x00,0x20,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xbd},
{0x00,0xff,0x00,0x01,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0x6e},
{0x01,0xf2,0x00,0x02,0x02,0x4f,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x13},
{0x01,0xf1,0xe0,0x00,0x00,0x50,0x8c,0x00,0x00,0x0d,0x00,0x00,0x40,0x08,0x00,0x00,0x00,0x00,0x00,0x89},
{0x01,0xf2,0x00,0x1e,0x02,0x0f,0x8c,0x00,0x00,0x0d,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x4b},
{0x01,0xf2,0x1c,0x00,0x02,0xf6,0xff,0x01,0x00,0x01,0x07,0xf2,0xff,0x38,0x00,0x00,0x00,0x00,0x00,0xc4},
{0x01,0xf2,0x1e,0x00,0x04,0x07,0x04,0x00,0x00,0x02,0x1b,0x1d,0x00,0x35,0x00,0x00,0x00,0x00,0x00,0xc9},
{0x01,0xf1,0xfe,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a},
{0x01,0xf2,0x00,0x00,0x04,0x8f,0x8c,0x00,0x00,0xe8,0x2c,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1a},
{0x01,0xf1,0xe0,0x00,0x00,0x80,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x14},
{0x01,0xf1,0xe0,0x00,0x00,0x40,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xd2},
{0x01,0xf2,0x00,0x02,0x02,0x2f,0x8a,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x7c},
{0x01,0xf1,0xe0,0x00,0x00,0x40,0x8b,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xd3},
{0x01,0xf2,0x00,0x00,0x04,0x2f,0x8b,0x00,0x00,0x75,0x4d,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x41},
{0x01,0xf1,0xe0,0x00,0x00,0x20,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xb8},
{0x01,0xf2,0x00,0x02,0x02,0x4f,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x16},
{0x01,0xf1,0xe0,0x00,0x00,0x40,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x10},
{0x01,0xf2,0x00,0x02,0x02,0x2f,0x48,0x00,0x00,0x03,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0xbd},
{0x00,0x04,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06},
{0x00,0xff,0x00,0x01,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x02,0x6d},
{0x01,0x60,0xd8,0x02,0x02,0x03,0x01,0x01,0xa5,0x25,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x00,0x0b},
{0x01,0xa1,0x98,0x00,0x00,0x00,0x00,0x62,0x9b,0x87,0x7f,0x87,0x7b,0x22,0x00,0x00,0x00,0x00,0x00,0xf5},
{0x01,0x60,0xb8,0x02,0x00,0x02,0x1c,0x19,0x9b,0x87,0x7f,0x87,0x7b,0x21,0x00,0x00,0x00,0x00,0x00,0x70},
{0x01,0x60,0xd8,0x02,0x02,0x02,0x01,0x01,0x45,0x0d,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x00,0xc2},
{0x01,0x60,0xd8,0x02,0x02,0x05,0x01,0x01,0x78,0x83,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x00,0x76},
{0x01,0xa0,0x78,0x00,0x02,0x00,0x00,0xb3,0x7b,0x83,0x00,0x00,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0xa0}
};
int main(int argc, char **argv)
{
puts("Mark Adler has said ...");
for(int row=0;row<172;row++)
{
const unsigned char *prow = data[row];
unsigned char s = 0;
for(int col=0;col<20;col++)
{
s ^= prow[col];
printf("%02x ",prow[col]);
}
printf(" ==> %02x\n",s);
}
return 0;
}
results in
[juergen#nadhh ~]$ ./xor12
Mark Adler has said ...
01 f6 60 00 1e b0 0f 7f 10 0a d5 7f 00 20 00 00 00 00 00 cb ==> 12
00 ff 00 53 02 00 01 00 00 00 00 00 00 03 80 00 00 00 02 3c ==> 12
00 04 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 ==> 00
01 60 b8 02 00 03 97 2b 3c 03 16 b3 d1 21 00 00 00 00 00 1c ==> 12
01 60 b8 00 00 c1 b7 29 7f 87 87 87 7b 21 00 00 00 00 00 36 ==> 12
01 a0 78 00 02 00 00 b3 7b 87 87 87 7b 22 00 00 00 00 00 df ==> 12
00 ff 00 01 02 00 01 00 00 00 00 00 00 01 80 00 00 00 02 6c ==> 12
00 04 03 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ==> 00
01 a1 98 00 00 00 00 62 9b 87 87 87 7b 22 00 00 00 00 00 0d ==> 12
01 f1 e0 00 00 20 80 00 00 1f 00 00 00 08 00 00 00 00 00 a7 ==> 00
01 f2 00 00 00 4f 80 00 00 00 00 00 00 38 00 00 00 00 00 16 ==> 12
01 f1 e0 00 00 20 81 00 00 03 00 00 00 08 00 00 00 00 00 ba ==> 00
01 f2 00 02 00 4f 81 00 00 00 00 00 00 38 00 00 00 00 00 15 ==> 12
01 e1 38 1e 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c4 ==> 00
01 f1 e0 00 00 40 89 00 00 00 00 00 00 08 00 00 00 00 00 d1 ==> 00
01 f2 00 1e 02 2f 89 00 00 01 00 00 00 38 00 00 00 00 00 62 ==> 12
01 f1 e0 00 00 20 84 00 00 00 00 00 00 08 00 00 00 00 00 bc ==> 00
01 f2 00 1e 1e 4f 84 00 00 00 00 00 00 38 00 00 00 00 00 12 ==> 12
01 f1 e0 00 00 40 86 00 00 00 00 00 00 08 00 00 00 00 00 de ==> 00
01 f2 00 1e 02 2f 86 00 00 0d 00 00 00 38 00 00 00 00 00 61 ==> 12
01 f1 e0 00 00 20 85 00 00 00 00 00 00 08 00 00 00 00 00 bd ==> 00
00 ff 00 01 02 00 02 00 00 00 00 00 00 00 80 00 00 00 02 6e ==> 12
01 f2 00 02 02 4f 85 00 00 00 00 00 00 38 00 00 00 00 00 13 ==> 12
01 f1 e0 00 00 50 8c 00 00 0d 00 00 40 08 00 00 00 00 00 89 ==> 00
01 f2 00 1e 02 0f 8c 00 00 0d 00 00 00 38 00 00 00 00 00 4b ==> 12
01 f2 1c 00 02 f6 ff 01 00 01 07 f2 ff 38 00 00 00 00 00 c4 ==> 12
01 f2 1e 00 04 07 04 00 00 02 1b 1d 00 35 00 00 00 00 00 c9 ==> 12
01 f1 fe 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0a ==> 00
01 f2 00 00 04 8f 8c 00 00 e8 2c 00 00 38 00 00 00 00 00 1a ==> 12
01 f1 e0 00 00 80 8c 00 00 00 00 00 00 08 00 00 00 00 00 14 ==> 00
01 f1 e0 00 00 40 8a 00 00 00 00 00 00 08 00 00 00 00 00 d2 ==> 00
01 f2 00 02 02 2f 8a 00 00 00 00 00 00 38 00 00 00 00 00 7c ==> 12
01 f1 e0 00 00 40 8b 00 00 00 00 00 00 08 00 00 00 00 00 d3 ==> 00
01 f2 00 00 04 2f 8b 00 00 75 4d 00 00 38 00 00 00 00 00 41 ==> 12
01 f1 e0 00 00 20 80 00 00 00 00 00 00 08 00 00 00 00 00 b8 ==> 00
01 f2 00 02 02 4f 80 00 00 00 00 00 00 38 00 00 00 00 00 16 ==> 12
01 f1 e0 00 00 40 48 00 00 00 00 00 00 08 00 00 00 00 00 10 ==> 00
01 f2 00 02 02 2f 48 00 00 03 00 00 00 38 00 00 00 00 00 bd ==> 12
00 04 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 ==> 00
00 ff 00 01 02 00 01 00 00 00 00 00 00 00 80 00 00 00 02 6d ==> 12
01 60 d8 02 02 03 01 01 a5 25 00 00 00 23 00 00 00 00 00 0b ==> 12
01 a1 98 00 00 00 00 62 9b 87 7f 87 7b 22 00 00 00 00 00 f5 ==> 12
01 60 b8 02 00 02 1c 19 9b 87 7f 87 7b 21 00 00 00 00 00 70 ==> 12
01 60 d8 02 02 02 01 01 45 0d 00 00 00 23 00 00 00 00 00 c2 ==> 12
01 60 d8 02 02 05 01 01 78 83 00 00 00 23 00 00 00 00 00 76 ==> 12
01 a0 78 00 02 00 00 b3 7b 83 00 00 00 22 00 00 00 00 00 a0 ==> 12
[juergen#nadhh ~]$
It is not a CRC-8.
Each "cs" value is the exclusive-or of all of the "data" values, or that exclusive-or'ed with 0x12. In your list, the exclusive-or of each row is 0, 0x12 alternating, except for the last row. I don't see anything obvious in the data that might indicate whether it should be 0 or 0x12.

SPI doesn’t work on Jetson Nano 2GB. How to use SPI on Jetson Nano?

SPI doesn’t want to work on my Jetson Nano.
In my devices from terminal I have this:
val#val-desktop:~$ ls /dev/spi*
/dev/spidev0.0 /dev/spidev0.1 /dev/spidev1.0 /dev/spidev1.1
And this:
val#val-desktop:~$ lsmod | grep spi
spidev 13282 0
When I’m connecting MISO and MOSI pins(19 and 21 pins according to this picture ) and testing SPI with this code I have this:
val#val-desktop:~/spi_test$ ./spi_test -v -D /dev/spidev0.0
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 kHz)
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |…#…|
RX | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |…|
No response. I was trying all 0.0 0.1 1.0 1.1 variants.
What am I doing wrong?

Reference key not useable when authenticating to MIFARE Classic card

I'm trying to authenticate to a MIFARE Classic card using PC/SC based APDU. I'm using a SCL3711 reader and the key A 00 00 00 00 00 03.
>> FF 82 00 60 06 00 00 00 00 00 03
<< 90 00
>> FF 86 00 00 05 01 00 08 60 00
<< 69 84
(Check error : referenced data invalidated)
I'm sure the data stored in the corresponding sector trailer is ok, as using a native reader I'm able to read/write the value. Actually this is the way I was able to restore the key once this happened.
When using other keys like FF FF FF FF FF FF, or 01 02 03 04 05 06, or whatever "normal", everything is working as expected.
a) With valid key FF FF FF FF FF FF
>> FF 82 00 60 06 FF FF FF FF FF FF
<< 90 00
>> FF 86 00 00 05 01 00 08 60 00
<< 90 00
b) With invalid key 01 02 03 04 05 06
>> FF 82 00 60 06 01 02 03 04 05 06
<< 90 00
>> FF 86 00 00 05 01 00 08 60 00
<< 69 82
I have gone through the PC/SC specs (Part 3) and haven't found any place where they include any reference to valid or invalid keys. It is the first time I'm not able to use a key.
Any idea why this is happening?

How can I check INITIALIZE UPDATE and EXTERNAL AUTHENTICATE correctness?

I sent 80 50 00 00 08 00 00 00 00 00 00 00 00 [INITILIZE UPDATE Command] via opensc-tool to my java card and received 00 00 11 60 01 00 8A 79 0A F9 FF 02 00 11 79 11 36 5D 71 00 A5 A5 EC 63 BB DC 05 CC [Init Response] as its response from the card.
As you see:
In the command,I send 00 00 00 00 00 00 00 00 as Host Challenge, And in the response :
00 00 11 60 01 00 8A 79 0A F9 = Key diversification data
FF 02 = Key information
00 11 79 11 36 5D 71 00 = Card challenge
A5 A5 EC 63 BB DC 05 CC = Card cryptogram
Now I want to check myself,if the card cryptogram is OK or not. How I can do it? for example I encrypt 00 00 00 00 00 00 00 00 in this site under a 3DES cryptography algorithm [with keys of my card = 4041...4F], but the output is not equal with card cryptogram that I wrote above. Why?
And the next question is, if I want to send EXTERNAL AUTHENTICATION command to the card, what is its data field (after the above INITILIZE UPDATE)?
Update:
This is GPJ output :
C:\Users\ghasemi\Desktop\gpj-20120310>GPJ
C:\Users\ghasemi\Desktop\gpj-20120310>java -jar gpj.jar
Found terminals: [PC/SC terminal ACS CCID USB Reader 0]
Found card in terminal: ACS CCID USB Reader 0
ATR: 3B 68 00 00 00 73 C8 40 12 00 90 00
.
.
.
DEBUG: Command APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
DEBUG: Response APDU: 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65 01 FF 90 00
Successfully selected Security Domain OP201a A0 00 00 00 03 00 00 00
DEBUG: Command APDU: 80 50 00 00 08 7F 41 A9 E7 19 37 83 FA
DEBUG: Response APDU: 00 00 11 60 01 00 8A 79 0A F9 FF 02 00 1B 9B 95 B9 5E 5E BC BA 51 34 84 D9 C1 B9 6E 90 00
DEBUG: Command APDU: 84 82 00 00 10 13 3B 4E C5 2C 9E D8 24 50 71 83 3A 78 AE 75 23
DEBUG: Response APDU: 90 00
DEBUG: Command APDU: 84 82 00 00 08 13 3B 4E C5 2C 9E D8 24
DEBUG: Response APDU: 90 00
C:\Users\ghasemi\Desktop\gpj-20120310>
So :
Host_Challenge :: 7F41A9E7193783FA
Diversification_Data :: 0000116001008A790AF9
Key_Information :: FF02
Sequence_Counter :: 001B
Card_Challenge :: 9B95B95E5EBC
Card_Cryptogram :: BA513484D9C1B96E
Host_Cryptogram[16,24] = 13 3B 4E C5 2C 9E D8 24
Now,lets make our Host_Cryptogram Manually :
Derivation_data=derivation_const_ENC|sequence_counter|0000 0000 0000 0000 0000 0000
Derivation_Data = 0182001B000000000000000000000000
k_ENC :: 404142434445464748494A4B4C4D4E4F
IV = 00 00 00 00 00 00 00 00
S_ENC = encrypt(TDES_CBC, K_ENC, IV, derivation_data)
So :
I used http://tripledes.online-domain-tools.com/ and its output for above values was :
S_ENC = 448b0a5967ca246d058703ff0c694f15
And :
Padding_DES = 80 00 00 00 00 00 00 00
Host_auth_data = sequence_counter | card_challenge | host_challenge | padding_DES
IV = Card_Cryptogram :: BA513484D9C1B96E
host_cryptogram = encrypt(TDES_CBC, S_ENC, IV, host_auth_data)
So :
Host_Authentication_Data : 001B9B95B95E5EBC7F41A9E7193783FA8000000000000000
Again, I used http://tripledes.online-domain-tools.com/
and :
Host_Cryptogram : 3587b531db71ac52392493c08cff189ce7b9061029c63b62
So :
Host_Cryptogram[16,24] = e7b9061029c63b62
Why these two way [manually and GPJ output] give us two host cryptogram?
From the INITIALIZE UPDATE command you send, you get
host_challenge = 00 00 00 00 00 00 00 00
In response to the INITIALIZE UPDATE command, you get
diversification_data = 00 00 11 60 01 00 8A 79 0A F9
key_information = FF 02
sequence_counter = 00 11
card_challenge = 79 11 36 5D 71 00
card_cryptogram = A5 A5 EC 63 BB DC 05 CC
The key information indicates SCP02 (02). The key diversification data may be used to derive the card-specific K_ENC. Lets assume we have a K_ENC like this
K_ENC = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
We can then derive the session encryption key like this
derivation_const_ENC = 01 82
derivation_data = derivation_const_ENC | sequence_counter | 00 00 00 00 00 00 00 00 00 00 00 00
IV = 00 00 00 00 00 00 00 00
S_ENC = encrypt(TDES_CBC, K_ENC, IV, derivation_data)
Next, we can assemble the authentication data used to calculate the host cryptogram:
padding_DES = 80 00 00 00 00 00 00 00
host_auth_data = sequence_counter | card_challenge | host_challenge | padding_DES
Then we can use the session encryption key to encrypt the authentication data:
IV = 00 00 00 00 00 00 00 00
host_cryptogram = encrypt(TDES_CBC, S_ENC, IV, host_auth_data)
The last 8 bytes of the encrypted authentication data are the actual host cryptogram that we would send to the card:
EXTERNAL_AUTHENTICATE_data = host_cryptogram[16, 24]
Now we can assemble the EXTERNAL AUTHENTICATE command:
EXTERNAL_AUTHENTICATE = 84 82 03 00 08 | EXTERNAL_AUTHENTICATE_data
We can then calculate the S_MAC key (analoguous to getting the S_ENC above) and the MAC over that command and append it to the command data to get the full EXTERNAL AUTHENTICATE command that can be sent to the card:
EXTERNAL_AUTHENTICATE = 84 82 03 00 10 | EXTERNAL_AUTHENTICATE_data | MAC
Update
Using http://tripledes.online-domain-tools.com/ to reproduce the results of GPJ
Your K_ENC is 404142434445464748494A4B4C4D4E4F. The online tools does not properly support 2-key-3DES, so you have to convert the key into its 3-key form first:
K_ENC = 404142434445464748494A4B4C4D4E4F4041424344454647
Use this key and a zero IV to encrypt the derivation data (0182001B000000000000000000000000). You get
S_ENC = fb063cc2e17b979b10e22f82110234b4
In 3-key notation, this is
S_ENC = fb063cc2e17b979b10e22f82110234b4fb063cc2e17b979b
Use this key and a zero IV to encrypt the host authentication data (001b9b95b95e5ebc7f41a9e7193783fa8000000000000000):
HOST_CRYPTOGRAM = 773e790c91acce3167d99f92c60e2afd133b4ec52c9ed824

Calculate time duration using awk [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How to calculate time duration by using awk for the following file:
02 0F 00 80 C9 CD AB 00 00 48 CF 00 00 00 00 00 00 6B E7 01 07 1A 16 1B 36 00 with Timestamp2014-03-12 18:46:59.986000
02 0F 00 80 CA CD AB 00 00 48 CF 00 00 00 00 00 00 6B E7 01 07 1A 14 DB 39 00 with Timestamp2014-03-12 18:47:02.446279
02 13 23 C8 B0 CD AB 00 00 FF FF E2 75 AC 21 4E 83 00 00 01 83 6C E7 01 11 1A 36 DD 39 00 with Timestamp2014-03-12 18:47:02.455278
02 03 12 00 B0 6B E7 01 03 1A FF FF FF FF with Timestamp2014-03-12 18:47:02.457279
02 17 00 80 CB CD AB 00 00 48 CF 00 10 E2 75 AC 21 4E 83 00 00 00 00 00 00 6B E6 01 07 1A 10 9B 3D 00 with Timestamp2014-03-12 18:47:06.196279
02 10 63 C8 B1 CD AB 00 00 E2 75 AC 21 4E 83 00 00 04 6A E6 01 0F 1A 14 9D 3D 00 with Timestamp2014-03-12 18:47:06.205278
02 03 12 00 B1 6C E6 01 03 1A FF FF FF FF with Timestamp2014-03-12 18:47:06.206279
In other words, last line timestamp value minus first line timestamp values.
Is this what you want (using GNU awk for mktime())?
$ cat tst.awk
sub(/.*Timestamp/,"") {
split($0,t,/[-:. ]/)
time[++nr] = mktime(t[1]" "t[2]" "t[3]" "t[4]" "t[5]" "t[6]) "." t[7]
}
END { print time[nr] - time[1] }
$ awk -f tst.awk file
6.22028
Thanks a lot #Ed Morton; it is not working with this example:
Number of saved packets= 373
Protocol: IEEE 802.15.4
Packet #0 :02 0F 00 80 C9 CD AB 00 00 48 CF 00 00 00 00 00 00 6B E7 01 07 1A 16 1B 36 00 with Timestamp2014-03-12 18:46:59.986000
###################################################################################
Packet #1 :02 0F 00 80 CA CD AB 00 00 48 CF 00 00 00 00 00 00 6B E7 01 07 1A 14 DB 39 00 with Timestamp2014-03-12 18:47:02.446279
###################################################################################
Packet #2 :02 13 23 C8 B0 CD AB 00 00 FF FF E2 75 AC 21 4E 83 00 00 01 83 6C E7 01 11 1A 36 DD 39 00 with Timestamp2014-03-12 18:47:02.455278
###################################################################################
Packet #3 :02 03 12 00 B0 6B E7 01 03 1A FF FF FF FF with Timestamp2014-03-12 18:47:02.457279
###################################################################################
Packet #4 :02 17 00 80 CB CD AB 00 00 48 CF 00 10 E2 75 AC 21 4E 83 00 00 00 00 00 00 6B E6 01 07 1A 10 9B 3D 00 with Timestamp2014-03-12 18:47:06.196279
###################################################################################
Packet #5 :02 10 63 C8 B1 CD AB 00 00 E2 75 AC 21 4E 83 00 00 04 6A E6 01 0F 1A 14 9D 3D 00 with Timestamp2014-03-12 18:47:06.205278
###################################################################################
Packet #6 :02 03 12 00 B1 6C E6 01 03 1A FF FF FF FF with Timestamp2014-03-12 18:47:06.206279