View Issue Details

IDProjectCategoryView StatusLast Update
0000410fileGeneralpublic2022-12-26 19:21
Reporterpandrew Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.43 
Summary0000410: add support for bitcoin-core blk.dat, rev.dat, also .ldb files
DescriptionDetect magic bytes and display basic data from the first header.

For the LevelDB table data files, just detect the 64-bit magic number, no further processing.

File attached and on github:

https://github.com/pandrewhk/andrew/blob/master/magic/bitcoin
Tagsmagic

Activities

pandrew

2022-12-18 10:19

reporter  

bitcoin (669 bytes)   
# Bitcoin block files
0	lelong		0xD9B4BEF9	Bitcoin
>(4.l+40)	lelong	0xD9B4BEF9	reverse block
>>4	lelong		x		\b, size %u
# normal block below
>0	default		x		block
>>4	lelong		x		\b, size %u
>>8	lelong&0xE0000000	0x20000000
>>>8	lelong		x		\b, BIP9 0x%x
>>8	lelong&0xE0000000	!0x20000000
>>>8	lelong		x		\b, version 0x%x
>>76	ledate	x	\b, %s UTC
# VarInt counter
>>88	ubyte	<0xfd	\b, txcount %u
>>88	ubyte	0xfd
>>>89	leshort	x	\b, txcount %u
>>88	ubyte	0xfe
>>>89	lelong	x	\b, txcount %u
>>88	ubyte	0xff
>>>89	lequad	x	\b, txcount %llu
!:ext	dat
# option to find more blocks in the file
#>>(4.l+8)	indirect	x	; 

# LevelDB
-8	lequad	0xdb4775248b80fb57	LevelDB table data
bitcoin (669 bytes)   

christos

2022-12-26 19:21

manager   ~0003877

Added, thanks

Issue History

Date Modified Username Field Change
2022-12-18 10:19 pandrew New Issue
2022-12-18 10:19 pandrew File Added: bitcoin
2022-12-22 10:00 pandrew Tag Attached: magic
2022-12-26 19:21 christos Assigned To => christos
2022-12-26 19:21 christos Status new => assigned
2022-12-26 19:21 christos Status assigned => resolved
2022-12-26 19:21 christos Resolution open => fixed
2022-12-26 19:21 christos Note Added: 0003877