Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
974b8eeb
Unverified
Commit
974b8eeb
authored
5 years ago
by
isciurus
Committed by
Karl-Johan Karlsson
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Parsing XFS_DINODE_FMT_BTREE directories for v5 (tested on RHEL)
parent
91ddf980
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tsk/fs/tsk_xfs.h
+45
-0
45 additions, 0 deletions
tsk/fs/tsk_xfs.h
tsk/fs/xfs.c
+2
-1
2 additions, 1 deletion
tsk/fs/xfs.c
with
47 additions
and
1 deletion
tsk/fs/tsk_xfs.h
+
45
−
0
View file @
974b8eeb
...
@@ -265,8 +265,53 @@ typedef struct xfs_btree_lblock {
...
@@ -265,8 +265,53 @@ typedef struct xfs_btree_lblock {
uint16_t
bb_numrecs
;
uint16_t
bb_numrecs
;
uint64_t
bb_leftsib
;
uint64_t
bb_leftsib
;
uint64_t
bb_rightsib
;
uint64_t
bb_rightsib
;
/* version 5 filesystem fields start here */
uint64_t
bb_blkno
;
uint64_t
bb_lsn
;
xfs_uuid_t
bb_uuid
;
uint64_t
bb_owner
;
uint32_t
bb_crc
;
uint32_t
bb_pad
;
}
xfs_btree_lblock_t
;
}
xfs_btree_lblock_t
;
/* size of a long form block:
* uint32_t bb_magic;
* uint16_t bb_level;
* uint16_t bb_numrecs;
* uint64_t bb_leftsib;
* uint64_t bb_rightsib;
*/
#define XFS_BTREE_LBLOCK_LEN \
(sizeof(uint32_t) + sizeof(uint16_t) + sizeof(uint16_t) + \
sizeof(uint64_t) + sizeof(uint64_t))
/* sizes of CRC enabled long form blocks:
* uint32_t bb_magic;
* uint16_t bb_level;
* uint16_t bb_numrecs;
* uint64_t bb_leftsib;
* uint64_t bb_rightsib;
+
* uint64_t bb_blkno;
* uint64_t bb_lsn;
* xfs_uuid_t bb_uuid;
* uint64_t bb_owner;
* uint32_t bb_crc;
* uint32_t bb_pad;
*/
#define XFS_BTREE_LBLOCK_CRC_LEN \
(sizeof(uint32_t) + sizeof(uint16_t) + sizeof(uint16_t) + \
sizeof(uint64_t) + sizeof(uint64_t) + \
sizeof(uint64_t) + sizeof(uint64_t) + sizeof(xfs_uuid_t) + \
sizeof(uint64_t) + sizeof(uint32_t) + sizeof(uint32_t))
/*
* Long form block header size depends on a superblock flag
*/
#define XFS_LBLOCK_LEN(sb) \
(xfs_sb_version_hascrc(sb) ? \
XFS_BTREE_LBLOCK_CRC_LEN : XFS_BTREE_LBLOCK_LEN)
typedef
struct
xfs_bmbt_key
{
typedef
struct
xfs_bmbt_key
{
xfs_dfiloff_t
br_startoff
;
xfs_dfiloff_t
br_startoff
;
}
xfs_bmbt_key_t
,
xfs_bmdr_key_t
;
}
xfs_bmbt_key_t
,
xfs_bmdr_key_t
;
...
...
This diff is collapsed.
Click to expand it.
tsk/fs/xfs.c
+
2
−
1
View file @
974b8eeb
...
@@ -2268,6 +2268,7 @@ visit_btree_node(
...
@@ -2268,6 +2268,7 @@ visit_btree_node(
{
{
char
*
myname
=
"xfs_dir_open_meta"
;
char
*
myname
=
"xfs_dir_open_meta"
;
XFSFS_INFO
*
xfs
=
(
XFSFS_INFO
*
)
a_fs
;
XFSFS_INFO
*
xfs
=
(
XFSFS_INFO
*
)
a_fs
;
xfs_sb_t
*
sb
=
xfs
->
fs
;
// xfs_bmdr_block and xfs_bmbt_block_t share those two fields
// xfs_bmdr_block and xfs_bmbt_block_t share those two fields
uint16_t
bb_numrecs
=
0
;
uint16_t
bb_numrecs
=
0
;
...
@@ -2314,7 +2315,7 @@ visit_btree_node(
...
@@ -2314,7 +2315,7 @@ visit_btree_node(
return
TSK_ERR
;
return
TSK_ERR
;
}
}
len
=
header_offset
=
sizeof
(
xfs_bmbt_block_t
);
len
=
header_offset
=
XFS_LBLOCK_LEN
(
sb
);
cnt
=
tsk_fs_read
(
&
xfs
->
fs_info
,
cnt
=
tsk_fs_read
(
&
xfs
->
fs_info
,
cur_node_offset
,
cur_node_offset
,
(
char
*
)
cur_bmbt_block
,
(
char
*
)
cur_bmbt_block
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment