i have a corrupted Lightroom catalog file(.lrcat) which is a SQL database, which i usually repair by creating an SQL file using these commands:
echo .dump | sqlite3 CorruptedFile.lrcat > Temp.sql
From the SQL file i then rebuild the lrcat file with this command:
sqlite3 -init Temp.sql New.lrcat
In this case it loads the resources from the SQL file and after a while i get this message:
Error: incomplete SQL: ■P
Since I am not a programmer, but a somewhat nerdy photographer I am stuck at this point. Any hints would be greatly appreciated.
Thanks,
Holger
000000: FF FE 50 00 52 00 41 00 47 00 4D 00 41 00 20 00 ..P.R.A.G.M.A. .
000010: 66 00 6F 00 72 00 65 00 69 00 67 00 6E 00 5F 00 f.o.r.e.i.g.n._.
000020: 6B 00 65 00 79 00 73 00 3D 00 4F 00 46 00 46 00 k.e.y.s.=.O.F.F.
000030: 3B 00 0D 00 0A 00 42 00 45 00 47 00 49 00 4E 00 ;.....B.E.G.I.N.
000040: 20 00 54 00 52 00 41 00 4E 00 53 00 41 00 43 00 .T.R.A.N.S.A.C.
000050: 54 00 49 00 4F 00 4E 00 3B 00 0D 00 0A 00 43 00 T.I.O.N.;.....C.
000060: 52 00 45 00 41 00 54 00 45 00 20 00 54 00 41 00 R.E.A.T.E. .T.A.
...
This is not a plain text file; it is encoded in UTF-16.
This might happen if you have modified the file in a misconfigured editor, or used PowerShell instead of cmd.exe.
Related
I'm trying to decode a hex string to a datetime format from a BLE custom UUID. I don't have any information except the decoded value and datetime, that's why I put similar examples in milliseconds and minutes. It will be complicated to see the value of another year.
If you look closely, you will notice there are only 2 values repeated twice in each row (bold and italic). First starts with 0x01 (maybe a flag) and then 2 bytes and second 2 bytes too.
Similar minutes:
01 8E 6C 00 00 8E 6C 00 00 62 25 62 25 00 00 00 00 00 00 00 - 1669024172,5141 (Nov 21 2022 09:49:32,5387632)
01 9C 6C 00 00 9C 6C 00 00 62 49 62 49 00 00 00 00 00 00 00 - 1669024172,68598 (Nov 21 2022 09:49:32,7638451)
01 fd 6c 00 00 fd 6c 00 00 64 0f 64 0f 00 00 00 00 00 00 00 - 1669024174,23293 (Nov 21 2022 09:49:34,3170414)
01 0d 6d 00 00 0d 6d 00 00 6e 2f 6e 2f 00 00 00 00 00 00 00 - 1669024174,5767 (Nov 21 2022 09:49:34,5414078)
01 f0 6d 00 00 f0 6d 00 00 62 21 62 21 00 00 00 00 00 00 00 - 1669024178,01436 (Nov 21 2022 09:49:38,0746688)
01 00 6e 00 00 00 6e 00 00 67 81 67 81 00 00 00 00 00 00 00 - 1669024178,35812 (Nov 21 2022 09:49:38,2775026)
Similar milliseconds:
01 16 1d 00 00 16 1d 00 00 4d f4 4d f4 00 00 00 00 00 00 00 - 1669023854,70251 (Nov 21 2022 09:44:14,7728813)
01 1e 6e 00 00 1e 6e 00 00 67 c5 67 c5 00 00 00 00 00 00 00 - 1669024178,70189 (Nov 21 2022 09:49:38,7714679)
01 e2 6d 00 00 e2 6d 00 00 62 4d 62 4d 00 00 00 00 00 00 00 - 1669024177,84247 (2022-11-21 10:49:37,8263242)
01 5f dd 06 00 5f dd 06 00 cb 46 cb 46 00 00 00 00 00 00 00 - 1669110577,66758 (2022-11-22 10:49:37,8231004)
01 00 6e 00 00 00 6e 00 00 67 81 67 81 00 00 00 00 00 00 00 - 1669024178,35812 (2022-11-21 10:49:38,2775026)
01 7c dd 06 00 7c dd 06 00 c8 0c c8 0c 00 00 00 00 00 00 00 - 1669024178 (2022-11-22 10:49:38,2722736)
It's looks like:
It's not decoded in the unix epoch (JAN 1 1970)
The first value is increasing (0xXX6C, 0xXX6E, 0xXX6E), so maybe it's the int part.
I tried to decode like year, minutes, seconds but it seems it isn't.
Sometimes first value is bigger than 2 bytes (3 bytes):
01 DE 61 04 00 DE 61 04 00 4A C1 4A C1 00 00 00 00 00 00 00 - 1669104436 (Nov 22 2022 09:07:16,1902042)
I tried this solutions:
https://stackoverflow.com/questions/1389046/what-is-the-specification-of-hexadecimal-date-format-in-sql-server Error: System.ArgumentOutOfRangeException (trying one of my hex)
http://erbhavi.blogspot.com/search/label/Converting%20DateTime%20to%20Hex%20in%20C%23 DateTime yourDateTime = new DateTime( ticks1970 + gmt * 10000000L ); //Error CS0019: Operator '*' can't apply to types 'string' y 'long'
I'll update the question if I find more info.
I am struggling to get Windows to load the default WinUSB driver for my device. Please note that I am looking for a solution that is using BOS descriptor (and not the old 0xEE string index).
The device enumerates and Windows tells me that it is installing the device, but the WinUSB driver is not loaded. I have tried everything that I can think of, but still I can't get Windows to load the driver. I even uninstall the device and delete the USB flags in the registry whenever I re-try, but to no avail. Is there anyone who can help me to get this to work?
I don't want WebUSB capabilities or anything additional. This is a non-composite device.
This is my BOS descriptor (as sent over USB):
05 0F 21 00 01 1C 10 05 00 DF 60 DD D8 89
45 C7 4C 9C D2 65 9D 9E 64 8A 9F 00 00 03
06 B2 00 01 00
And this my BOS descriptor set:
0A 00 00 00 00 00 03 06 B2 00 08 00 01 00 ..............
00 00 A8 00 08 00 02 00 00 00 A0 00 14 00 ..............
03 00 57 49 4E 55 53 42 00 00 00 00 00 00 ..WINUSB......
00 00 00 00 84 00 04 00 07 00 2A 00 44 00 ..........*.D.
65 00 76 00 69 00 63 00 65 00 49 00 6E 00 e.v.i.c.e.I.n.
74 00 65 00 72 00 66 00 61 00 63 00 65 00 t.e.r.f.a.c.e.
47 00 55 00 49 00 44 00 73 00 00 00 50 00 G.U.I.D.s...P.
7B 00 46 00 37 00 32 00 46 00 45 00 30 00 {.F.7.2.F.E.0.
44 00 34 00 2D 00 43 00 42 00 43 00 42 00 D.4.-.C.B.C.B.
2D 00 34 00 30 00 37 00 44 00 2D 00 38 00 -.4.0.7.D.-.8.
38 00 31 00 34 00 2D 00 39 00 45 00 44 00 8.1.4.-.9.E.D.
36 00 37 00 33 00 44 00 30 00 44 00 44 00 6.7.3.D.0.D.D.
36 00 42 00 7D 00 00 00 00 00 6.B.}.....
The layout is:
typedef struct _SMSOS20DescriptorSet
{
SDeviceDescSetHeader sDescriptorSetHeader;
SConfigurationSubsetHeader sConfSubsetHeader;
SFunctionSubsetHeader sFuncSubsetHeader;
SDeviceCompatibleIdDescriptor sCompIdDescriptor;
SDeviceRegDescDeviceInterfaceGUID sRegistryDescDevInterfaceGuid;
} SMSOS20DescriptorSet;
I have follewed these guides and doc:
https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/automatic-installation-of-winusb#winusb-device-installation-by-using-the-in-box-winusbinf
MS_OS_2_0_desc.docx
https://thewindowsupdate.com/2018/10/12/how-to-install-winusb-sys-without-a-custom-inf/
https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/winusb-installation#automatic-installation-of--winusb-without-an-inf-file
UPDATE:
when you have a non-composite device that only has a single a configuration, then you are not use any subset headers (neither 'Configuration subset header' nor 'Function subset header'). So, the correct layout in this case is:
typedef struct _SMSOS20DescriptorSet
{
SDeviceDescSetHeader sDescriptorSetHeader;
SDeviceCompatibleIdDescriptor sCompIdDescriptor;
SDeviceRegDescDeviceInterfaceGUID sRegistryDescDevInterfaceGuid;
} SMSOS20DescriptorSet;
UPDATE: when you have a non-composite device that only has a single a configuration, then you are not use any subset headers (neither 'Configuration subset header' nor 'Function subset header'). So, the correct layout in this case is:
typedef struct _SMSOS20DescriptorSet
{
SDeviceDescSetHeader sDescriptorSetHeader;
SDeviceCompatibleIdDescriptor sCompIdDescriptor;
SDeviceRegDescDeviceInterfaceGUID sRegistryDescDevInterfaceGuid;
} SMSOS20DescriptorSet;
I'm trying to recover vault storage from MetaMask for Firefox on a broken Mac, but only have file system access so can't follow the usual recovery steps here.
I've also tried copying the extension storage to a fresh install, but MetaMask won't launch.
On another computer, I've followed the usual recovery method linked to get a known-good export, which looks something like:
{
...
"KeyringController": {
"vault": "{\"data\":\"wLLUOXsS8u82TEDMjT1UNNtpANP2Eu6VfqbhHFTI3s+xKomLCXxnRtoPKlOlUDBPM7sOtIr8qoJofBqREfO9pN50vaEt3jw9sqUOk7Xdi0GHLpndlJvTmkI15aGk6udWc5MX/CW+F1KfJZbW7VpSMrrQPpfjULidxBLDfKac/wF9gF8pY4w1s9puVEgCgXAHYsX9bbR68vqMDLZmpr6NG5QCkFg0clLx6d6tddmMEg11hv+CrGI=\",\"iv\":\"8zjDMB77cQa1HX1B0gs+pQ==\",\"salt\":\"8VHAOfYllhPFs7zTgCr1PuZm7a4v8IFhoeqa2+7ZThQ=\"}"
},
...
}
I've found the idb folder for the extension under ~/Library/Application Support/Firefox/Profiles/profileid/storage/default/extensionid, and dumped the main blob to file. Searching through this, I was able to find the vault part of the configuration:
0000ac70 72 69 6e 67 4e 5f 01 25 60 1e 40 14 2c 76 61 75 |ringN_.%`.#.,vau|
0000ac80 6c 74 00 00 00 55 01 00 00 0e d0 50 f4 02 02 7b |lt...U.....P...{|
0000ac90 00 22 00 64 00 61 00 74 00 61 00 22 00 3a 00 22 |.".d.a.t.a.".:."|
0000aca0 00 77 00 4c 00 4c 00 55 00 4f 00 58 00 73 00 53 |.w.L.L.U.O.X.s.S|
0000acb0 00 38 00 75 00 38 00 32 00 54 00 45 00 44 00 4d |.8.u.8.2.T.E.D.M|
0000acc0 00 6a 00 54 00 31 00 55 00 4e 00 4e 00 74 00 70 |.j.T.1.U.N.N.t.p|
0000acd0 00 41 00 4e 00 50 00 32 00 45 00 75 00 36 00 56 |.A.N.P.2.E.u.6.V|
0000ace0 00 66 00 71 00 62 00 68 00 48 00 46 00 54 00 49 |.f.q.b.h.H.F.T.I|
0000acf0 00 33 00 73 00 2b 00 78 00 4b 00 6f 00 6d 00 4c |.3.s.+.x.K.o.m.L|
0000ad00 00 43 00 58 00 78 00 6e 00 52 00 74 00 6f 00 50 |.C.X.x.n.R.t.o.P|
0000ad10 00 4b 00 6c 00 4f 00 6c 00 55 00 44 00 42 00 50 |.K.l.O.l.U.D.B.P|
0000ad20 00 4d 00 37 00 73 00 4f 00 74 00 49 00 72 00 38 |.M.7.s.O.t.I.r.8|
0000ad30 00 71 00 6f 00 4a 00 6f 00 66 00 42 00 71 00 52 |.q.o.J.o.f.B.q.R|
0000ad40 00 45 00 66 00 4f 00 39 00 70 00 4e 00 35 00 30 |.E.f.O.9.p.N.5.0|
0000ad50 00 76 00 61 00 45 00 74 00 33 00 6a 00 77 00 39 |.v.a.E.t.3.j.w.9|
0000ad60 00 73 00 71 00 55 00 4f 00 6b 00 37 00 58 00 64 |.s.q.U.O.k.7.X.d|
0000ad70 00 69 00 30 00 47 00 48 00 4c 00 70 00 6e 00 64 |.i.0.G.H.L.p.n.d|
0000ad80 00 6c 00 4a 00 76 00 54 00 6d 00 6b 00 49 00 31 |.l.J.v.T.m.k.I.1|
0000ad90 00 35 00 61 00 47 00 6b 00 36 00 75 00 64 00 57 |.5.a.G.k.6.u.d.W|
0000ada0 00 63 00 35 00 4d 00 58 00 2f 00 43 00 57 00 2b |.c.5.M.X./.C.W.+|
0000adb0 00 46 00 31 00 4b 00 66 00 4a 00 5a 00 62 00 57 |.F.1.K.f.J.Z.b.W|
0000adc0 00 37 00 56 00 70 00 53 00 4d 00 72 00 72 00 51 |.7.V.p.S.M.r.r.Q|
0000add0 00 50 00 70 00 66 00 6a 00 55 00 4c 00 69 00 64 |.P.p.f.j.U.L.i.d|
0000ade0 00 78 00 42 00 4c 00 44 00 66 00 4b 00 61 00 63 |.x.B.L.D.f.K.a.c|
0000adf0 00 2f 00 77 00 46 00 39 00 67 00 46 00 38 00 70 |./.w.F.9.g.F.8.p|
0000ae00 00 59 00 34 00 77 00 31 00 73 00 39 00 70 00 75 |.Y.4.w.1.s.9.p.u|
0000ae10 00 56 00 45 00 67 00 43 00 67 00 58 00 41 00 48 |.V.E.g.C.g.X.A.H|
0000ae20 00 59 00 73 00 58 00 39 00 62 00 62 00 52 00 36 |.Y.s.X.9.b.b.R.6|
0000ae30 00 38 00 76 00 71 00 4d 00 44 00 4c 00 5a 00 6d |.8.v.q.M.D.L.Z.m|
0000ae40 00 70 00 72 00 36 00 4e 00 47 00 35 00 51 00 43 |.p.r.6.N.G.5.Q.C|
0000ae50 00 6b 00 46 00 67 00 30 00 63 00 6c 00 4c 00 78 |.k.F.g.0.c.l.L.x|
0000ae60 00 36 00 64 00 36 00 74 00 64 00 64 00 6d 00 4d |.6.d.6.t.d.d.m.M|
0000ae70 00 45 00 67 00 31 00 31 00 68 00 76 00 2b 00 43 |.E.g.1.1.h.v.+.C|
0000ae80 00 72 00 47 00 49 00 3d 00 22 00 2c 00 22 00 69 |.r.G.I.=.".,.".i|
0000ae90 00 76 2d f8 10 38 00 7a 00 6a 25 e2 c8 42 00 37 |.v-..8.z.j%..B.7|
0000aea0 00 37 00 63 00 51 00 61 00 31 00 48 00 58 00 31 |.7.c.Q.a.1.H.X.1|
0000aeb0 00 42 00 30 00 67 00 73 00 2b 00 70 00 51 00 3d |.B.0.g.s.+.p.Q.=|
0000aec0 00 3d 00 22 00 2c 00 22 00 73 00 61 00 6c 00 74 |.=.".,.".s.a.l.t|
0000aed0 15 44 f0 52 56 00 48 00 41 00 4f 00 66 00 59 00 |.D.RV.H.A.O.f.Y.|
0000aee0 6c 00 6c 00 68 00 50 00 46 00 73 00 37 00 7a 00 |l.l.h.P.F.s.7.z.|
0000aef0 54 00 67 00 43 00 72 00 31 00 50 00 75 00 5a 00 |T.g.C.r.1.P.u.Z.|
0000af00 6d 00 37 00 61 00 34 00 76 00 38 00 49 00 46 00 |m.7.a.4.v.8.I.F.|
0000af10 68 00 6f 00 65 00 71 00 61 00 32 00 2b 00 37 00 |h.o.e.q.a.2.+.7.|
0000af20 5a 00 54 00 68 00 51 05 6c 04 7d 00 19 01 61 70 |Z.T.h.Q.l.}...ap|
Reconstructing it, I was almost able to get the correct data but a few characters are incorrect:
data (extract): wLLUOXsS8u82TEDMjT1UNNtpANP2Eu6VfqbhHFTI3s+xKomLCXxnRtoPKlOlUDBPM7sOtIr8qoJofBqREfO9pN50vaEt3jw9sqUOk7Xdi0GHLpndlJvTmkI15aGk6udWc5MX/CW+F1KfJZbW7VpSMrrQPpfjULidxBLDfKac/wF9gF8pY4w1s9puVEgCgXAHYsX9bbR68vqMDLZmpr6NG5QCkFg0clLx6d6tddmMEg11hv+CrGI=
data (correct): wLLUOXsS8u82TEDMjT1UNNtpANP2Eu6VfqbhHFTI3s+xKomLCXxnRtoPKlOlUDBPM7sOtIr8qoJofBqREfO9pN50vaEt3jw9sqUOk7Xdi0GHLpndlJvTmkI15aGk6udWc5MX/CW+F1KfJZbW7VpSMrrQPpfjULidxBLDfKac/wF9gF8pY4w1s9puVEgCgXAHYsX9bbR68vqMDLZmpr6NG5QCkFg0clLx6d6tddmMEg11hv+CrGI=\
iv (extract): 8zj%B77cQa1HX1B0gs+pQ==
iv (correct): 8zjDMB77cQa1HX1B0gs+pQ==
salt (extract): DRVHAOfYllhPFs7zTgCr1PuZm7a4v8IFhoeqa2+7ZThQl
salt (correct): 8VHAOfYllhPFs7zTgCr1PuZm7a4v8IFhoeqa2+7ZThQ=\
Comparing the two IVs in hex, you can see how close they are but one nibble is missing, and one is incorrect:
correct: 38 7a 6a 44 4d 42 37 37 63 51 61 31 48 58 31 42 30 67 73 2b 70 51 3d 3d
extract: 38 7a 6a 25 42 37 37 63 51 61 31 48 58 31 42 30 67 73 2b 70 51 3d 3d
For the salt, the correct one is offset by one nibble and missing a couple:
correct: 38 56 48 41 4f 66 59 6c 6c 68 50 46 73 37 7a 54 67 43 72 31 50 75 5a 6d 37 61 34 76 38 49 46 68 6f 65 71 61 32 2b 37 5a 54 68 51 3d 5c
original: 44 52 56 48 41 4f 66 59 6c 6c 68 50 46 73 37 7a 54 67 43 72 31 50 75 5a 6d 37 61 34 76 38 49 46 68 6f 65 71 61 32 2b 37 5a 54 68 51 6c
Obviously the wallet above is now burned and won't be used, but any advice on how to repeat this for the recovered wallet would be really helpful.
I wrote a program for parsing SQLite file, i can parse all data from b-tree pages to record, column & values but i need to parse schema of tables, i found something like database schema stored in page 1 (root page) and i can see it with Hex Editor, and i found structure of sqlite_master, i read it exact as explain in http://sqlite.org/fileformat2.html
I want to know how can i found the first byte of sqlite_master table in db file, how can i detect starting byte of schema? is there anything related in SQLite DB Header?
Edit 1 (more info):
For example:
i opened sqlite db with hex editor, (if you check my page size is 4096 bytes and i marked page header in image):
i marked root page header that start with 05 means the page is an interior table b-tree page and please check B-tree Page Header Format (http://sqlite.org/fileformat2.html) and its have 5 cells that you can see it with this cell pointers array: 0FFB, 0FF6, 0FF1, 0FEC, 0FE7 (that start after ending header) and all cells have 5 bytes and start from 0FE7 then the schema that you can see it in picture ( in text part ) start from 232~240 and i check other dbs and schema in different place...
Edit 2:
You can download Example File from https://www.dropbox.com/s/lanky02kneyb74w/31bb7ba8914766d4ba40d6dfb6113c8b614be442
Edit 3:
In my file you can see
$ hexdump -C 31bb7ba8914766d4ba40d6dfb6113c8b614be442
00000000 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 |SQLite format 3.|
00000010 10 00 02 02 00 40 20 20 00 00 00 02 00 00 00 3f |.....# .......?|
00000020 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 04 |...........G....|
00000030 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
00000060 00 2d e2 25 05 00 00 00 05 0f e7 00 00 00 00 3d |.-.%...........=|
00000070 0f fb 0f f6 0f f1 0f ec 0f e7 08 7f 07 9d 08 3c |...............<|
00000080 07 01 06 22 05 92 04 fe 03 fc 04 c1 03 4d 02 b8 |...".........M..|
00000090 02 0a 02 75 01 32 01 c7 00 e9 00 e9 00 00 00 00 |...u.2..........|
000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000000e0 00 00 00 00 00 00 00 00 00 47 18 06 17 5b 35 01 |.........G...[5.|
000000f0 00 69 6e 64 65 78 73 71 6c 69 74 65 5f 61 75 74 |.indexsqlite_aut|
00000100 6f 69 6e 64 65 78 5f 41 42 4d 75 6c 74 69 56 61 |oindex_ABMultiVa|
00000110 6c 75 65 45 6e 74 72 79 4b 65 79 5f 31 41 42 4d |lueEntryKey_1ABM|
00000120 75 6c 74 69 56 61 6c 75 65 45 6e 74 72 79 4b 65 |ultiValueEntryKe|
Page Header ( offset 64)
05 <- interior table b-tree page
0000 <- Byte offset into the page of the first freeblock
0005 <- Number of cells on this page
0FE7 <- Offset to the first byte of the cell content area
00 <- Number of fragmented free bytes
0000003D (61) <- The right-most pointer
Cell Array Pointers & Cell Contents:
(Table Interior Cell Format)
Cell Pointer| Page number of left child | Rowid
------------|---------------------------|-------
0FFB | 0000001A (26) | 15
0FF6 | 0000001C (28) | 2D
0FF1 | 00000031 (49) | 3C
0FEC | 00000039 (57) | 48
0FE7 | 0000003C (60) | 4C <- equal to (Offset to the first byte of the cell content area) in page header
I realize your question was asked over a year ago and you probably resolved it, but I would like to submit an answer in case anyone else has this same question. I was in the same situation as you, Mehdi. I wanted to read a SQLite database file, and was looking for the master table / schema. It appeared to be in page 1, but the header was not pointing to it. There were two reasons for my confusion.
(1) There was a lot of "dead" data in my SQLite database file that was not being used. I believe as the database was created and grew, the location of the actual active data moved, and the old location was not overwritten with zeros. Doing a search for some of the "CREATE TABLE" statements found multiple results in different locations of the file. I later determined the actual schema was split up and located on pages 18, 10, and 8 (which the page 1 interior table pointed to). I would have detected this earlier, if not for reason #2.
(2) I had miscalculated the byte position of the page number, which confused me. Where p = page #, and s = page size, I thought it was [p * s] .... but actually it's [(p-1) * s] (except for page 1 which starts at byte 100). In other words, I thought the page numbering started at zero instead of 1.
As an additional note, I believe the http://sqlite.org/fileformat2.html page is missing some vital info. Specifically, it doesn't explain where the "root page" number is in the schema table (it's in field 4). I couldn't find this information on the sqlite.org page.
The documentation you linked to says in section 2.6:
Page 1 of a database file is the root page of a table b-tree that holds a special table named "sqlite_master"
and in section 1.5:
A b-tree page is divided into regions in the following order:
The 100-byte database file header (found on page 1 only)
The 8 or 12 byte b-tree page header …
For example, with this database:
$ sqlite3 test.db "create table hello(world);"
$ hexdump -C test.db
00000000 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 |SQLite format 3.|
00000010 04 00 01 01 00 40 20 20 00 00 00 01 00 00 00 02 |.....# ........|
00000020 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 |................|
00000060 00 2d e6 03 0d 00 00 00 01 03 cf 00 03 cf 00 00 |.-æ.......Ï..Ï..|
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000003c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2f |.............../|
000003d0 01 06 17 17 17 01 3f 74 61 62 6c 65 68 65 6c 6c |......?tablehell|
000003e0 6f 68 65 6c 6c 6f 02 43 52 45 41 54 45 20 54 41 |ohello.CREATE TA|
000003f0 42 4c 45 20 68 65 6c 6c 6f 28 77 6f 72 6c 64 29 |BLE hello(world)|
00000400 0d 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 |................|
00000410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... the page header at offset 0x64 has these values:
0d: page is a leaf table b-tree page
0000: freeblock offset
0001: number of cells
03cf: offset of cell content
00: fragmented free bytes
03cf: first cell pointer
And at offset 3cf, you have a standard table b-tree leaf cell, containing the only row of the sqlite_master table:
sqlite> select * from sqlite_master;
type name tbl_name rootpage sql
---------- ---------- ---------- ---------- -------------------------
table hello hello 2 CREATE TABLE hello(world)
I have a very long running task I need to take from my website and put into a web service however every time I try call the web service I get this error message The request failed with HTTP status 401: Unauthorized.
I assumed this could just be an issue with the credentials as I have seen something similar when sending emails so I did this:
Dim wsCustomer As New blueprintdev.RosterEmailService()
Dim basicAuthenticationInfo As New System.Net.NetworkCredential("user", "pass")
wsCustomer.UseDefaultCredentials = False
wsCustomer.PreAuthenticate = True
wsCustomer.Credentials = basicAuthenticationInfo
txtTestResult.Text = wsCustomer.Test()
This still gives me the same issue.
Also tried this using default credentials and that still does not help.
Now I have no idea how to properly do this, and so I have mostly worked off tutorials etc, can anyone tell me what im doing wrong here?
Thanks
Additional notes: the project im working on is one I inherited when I joined the company and cant be built in visual studio so breakpointing through the code is not an option for me without massively hacking the project and removing a lot of code.
Update: Running fiddler shows me 3 entries, when I look at the auth tab i see:
No Proxy-Authenticate Header is present.
WWW-Authenticate Header (Negotiate) appears to be a Kerberos reply:
A1 15 30 13 A0 03 0A 01 03 A1 0C 06 0A 2B 06 01 ¡.0. ....¡...+..
04 01 82 37 02 02 0A ..7...
Then
No Proxy-Authenticate Header is present.
WWW-Authenticate Header (Negotiate) appears to be a Kerberos reply:
A1 81 E2 30 81 DF A0 03 0A 01 01 A2 81 D7 04 81 ¡â0ß ....¢×.
D4 4E 54 4C 4D 53 53 50 00 02 00 00 00 0E 00 0E ÔNTLMSSP........
00 38 00 00 00 15 82 89 E2 C1 20 C3 44 5E 99 21 .8....âÁ ÃD^!
A0 00 00 00 00 00 00 00 00 8E 00 8E 00 46 00 00 ..........F..
00 06 01 B1 1D 00 00 00 0F 41 00 43 00 41 00 44 ...±.....A.C.A.D
00 45 00 4D 00 59 00 02 00 0E 00 41 00 43 00 41 .E.M.Y.....A.C.A
00 44 00 45 00 4D 00 59 00 01 00 06 00 44 00 45 .D.E.M.Y.....D.E
00 56 00 04 00 1A 00 6C 00 6F 00 63 00 61 00 6C .V.....l.o.c.a.l
00 2E 00 41 00 63 00 61 00 64 00 65 00 6D 00 79 ...A.c.a.d.e.m.y
00 03 00 22 00 44 00 45 00 56 00 2E 00 6C 00 6F ...".D.E.V...l.o
00 63 00 61 00 6C 00 2E 00 41 00 63 00 61 00 64 .c.a.l...A.c.a.d
00 65 00 6D 00 79 00 05 00 1A 00 6C 00 6F 00 63 .e.m.y.....l.o.c
00 61 00 6C 00 2E 00 41 00 63 00 61 00 64 00 65 .a.l...A.c.a.d.e
00 6D 00 79 00 07 00 08 00 2E 76 48 74 53 21 CD .m.y......vHtS!Í
01 00 00 00 00
.....
And finally this one highlighted in red
No Proxy-Authenticate Header is present.
No WWW-Authenticate Header is present.
Does this mean the authentication data is being lost somewhere between client and server? or that I am not passing anything to begin with?
If you can access the service through a browser I suggest passing in your username including domain as the credentials.
The username would look something like this: DOMAIN\USER
I've had a similar problem and the username and password had to be explicitly added.
ie.
wsCustomer.username = "something"
wsCustomer.password = "something else"
I guess you're already doing that with:
Dim basicAuthenticationInfo As New System.Net.NetworkCredential("user", "pass")
but maybe worth a try