content
stringlengths
4
1.04M
lang
stringclasses
358 values
score
int64
0
5
repo_name
stringlengths
5
114
repo_path
stringlengths
4
229
repo_licenses
listlengths
1
8
# Produces a GraphViz Dot file from the data in the contributors.json file. # Documentation for this syntax at https://stedolan.github.io/jq/manual to_entries | map(select( (.value.groups | index("Angular")) or (.value.groups | index("Collaborators")))) | map(.value |= { name: .name, lead: (.lead // .mentor // ""), fillcolor: (if .groups | index("Collaborators") then "aquamarine" else "beige" end), }) | map( "\(.key|tojson) [ label=\(.value.name|tojson) fillcolor=\(.value.fillcolor|tojson) style=filled ] ", (if .value.lead != "" then "\(.key|tojson) -> \(.value.lead|tojson)" else "" end) ) []
JSONiq
3
coreyscherbing/angular
aio/scripts/contributors/org_chart.jq
[ "MIT" ]
# ============================================================= # This script is written to generate structured multi-block # grid for a nozzle profile with respect to grid guideline. #============================================================== # written by Pay Dehpanah # last update: Sep 2021 #============================================================== proc Nozzle_Mesh {} { global nx_node ny_node nozzUpperCurve nozzLowerCurve nozzTeCurve nozzLowerCurve_sp global NZZ_BLTK NZZ_ROT_STEP Sponge_iGR Sponge_oGR FWH_slp FWH_GR FWH_GRP res_lev global nozz_upfront_con FWH_R D_blkright D_blkleft cae_solver global domBCs blkBCs upvar 1 grg NZZ_IN_GR upvar 1 dsg NZZ_DS upvar 1 chord_sg NZZ_IN_SPC upvar 1 GRD_TYP grid_type # collecting boundaries as it builds array set domBCs [] array set blkBCs [] #-------------------------------------------------- # Create FarField set nozzFar [pw::Application begin Create] set nozzFarPts [pw::SegmentSpline create] $nozzFarPts setSlope Free $nozzFarPts addPoint [list 0 20 0] $nozzFarPts addPoint [list 50 40 0] $nozzFarPts setSlopeOut 1 {33.948334619740201 -0.021626272409800862 0} $nozzFarPts setSlopeIn 2 {-30.2782087944274 0.45412873257959774 0} set nozzFarCurve [pw::Curve create] $nozzFarCurve addSegment $nozzFarPts $nozzFar end # -------------------------------------------------- pw::Application setCAESolver $cae_solver 3 #-------------------------------------------------- set nzz_inn_con [pw::Connector createOnDatabase -parametricConnectors Aligned [list $nozzLowerCurve]] #-------------------------------------------------- $nzz_inn_con setDimensionFromSpacing $NZZ_IN_SPC set nzz_inn_edg [pw::Edge createFromConnectors [list $nzz_inn_con]] set nzz_inn_BLdom [pw::DomainStructured create] $nzz_inn_BLdom addEdge $nzz_inn_edg set nzz_inn_extr [pw::Application begin ExtrusionSolver [list $nzz_inn_BLdom]] $nzz_inn_BLdom setExtrusionBoundaryCondition Begin ConstantX $nzz_inn_BLdom setExtrusionBoundaryCondition End ConstantX $nzz_inn_BLdom setExtrusionSolverAttribute SpacingGrowthFactor $NZZ_IN_GR $nzz_inn_BLdom setExtrusionSolverAttribute NormalInitialStepSize $NZZ_DS $nzz_inn_BLdom setExtrusionSolverAttribute StopAtHeight $NZZ_BLTK $nzz_inn_extr run 75 $nzz_inn_extr end #------------------------------------------------- set nzz_inn_surf [pw::Surface create] $nzz_inn_surf revolve -angle 360 $nozzLowerCurve {0 0 0} {1 0 0} set nzz_BLface [pw::FaceStructured createFromDomains [list $nzz_inn_BLdom]] set nzz_BLblk [pw::BlockStructured create] $nzz_BLblk addFace $nzz_BLface set nzz_BLblk_extr [pw::Application begin ExtrusionSolver [list $nzz_BLblk]] $nzz_BLblk setExtrusionSolverAttribute Mode Rotate $nzz_BLblk setExtrusionSolverAttribute RotateAxisStart {0 0 0} $nzz_BLblk setExtrusionSolverAttribute RotateAxisEnd [pwu::Vector3 add {0 0 0} {1 0 0}] $nzz_BLblk setExtrusionSolverAttribute RotateAngle 360 $nzz_BLblk_extr run $NZZ_ROT_STEP $nzz_BLblk_extr end set nzz_BLblk_sp [$nzz_BLblk split -K [list [expr ($NZZ_ROT_STEP/2)+1]]] set nzz_BLblk_rcon1 [[[[lindex $nzz_BLblk_sp 0] getFace 4] getEdge 2] getConnector 1] set nzz_BLblk_rcon2 [[[[lindex $nzz_BLblk_sp 0] getFace 2] getEdge 4] getConnector 1] set nzz_BLblk_lcon1 [[[[lindex $nzz_BLblk_sp 1] getFace 4] getEdge 2] getConnector 1] set nzz_BLblk_lcon2 [[[[lindex $nzz_BLblk_sp 1] getFace 2] getEdge 4] getConnector 1] #collecting BC | Nozzle lappend domBCs(0) [[[lindex $nzz_BLblk_sp 0] getFace 3] getDomain 1] lappend blkBCs(0) [lindex $nzz_BLblk_sp 0] lappend domBCs(0) [[[lindex $nzz_BLblk_sp 1] getFace 3] getDomain 1] lappend blkBCs(0) [lindex $nzz_BLblk_sp 1] #collecting BC | Inlet lappend domBCs(1) [[[lindex $nzz_BLblk_sp 0] getFace 4] getDomain 1] lappend blkBCs(1) [lindex $nzz_BLblk_sp 0] lappend domBCs(1) [[[lindex $nzz_BLblk_sp 1] getFace 4] getDomain 1] lappend blkBCs(1) [lindex $nzz_BLblk_sp 1] # DOM AT INLET #------------------------------------------------------------------------------------- set spmiddim1 [expr int(floor([$nzz_BLblk_rcon1 getDimension]/4))+3] set nzz_BLblk_rcon1_sp1 [$nzz_BLblk_rcon1 split -I [list $spmiddim1]] set spmiddim2 [expr [[lindex $nzz_BLblk_rcon1_sp1 1] getDimension] - $spmiddim1 + 1] set nzz_BLblk_rcon1_sp2 [[lindex $nzz_BLblk_rcon1_sp1 1] split -I [list $spmiddim2]] set nzz_BLblk_lcon1_sp [$nzz_BLblk_lcon1 split -I [list $spmiddim1 [expr $spmiddim1 + $spmiddim2 -1]]] set nzz_in_dom_edg1 [pw::Edge create] $nzz_in_dom_edg1 addConnector [lindex $nzz_BLblk_rcon1_sp1 0] $nzz_in_dom_edg1 addConnector [lindex $nzz_BLblk_lcon1_sp 2] set nzz_in_dom_edg2 [pw::Edge create] $nzz_in_dom_edg2 addConnector [lindex $nzz_BLblk_lcon1_sp 1] set nzz_in_dom_edg3 [pw::Edge create] $nzz_in_dom_edg3 addConnector [lindex $nzz_BLblk_lcon1_sp 0] $nzz_in_dom_edg3 addConnector [lindex $nzz_BLblk_rcon1_sp2 1] set nzz_in_dom_edg4 [pw::Edge create] $nzz_in_dom_edg4 addConnector [lindex $nzz_BLblk_rcon1_sp2 0] set nzz_in_dom [pw::DomainStructured create] $nzz_in_dom addEdge $nzz_in_dom_edg1 $nzz_in_dom addEdge $nzz_in_dom_edg2 $nzz_in_dom addEdge $nzz_in_dom_edg3 $nzz_in_dom addEdge $nzz_in_dom_edg4 set nzz_in_dom_slv [pw::Application begin EllipticSolver [list $nzz_in_dom]] $nzz_in_dom_slv run $NZZ_ROT_STEP $nzz_in_dom_slv end # DOM AT OUTLET #------------------------------------------------------------------------------------- set nzz_BLblk_rcon2_sp [$nzz_BLblk_rcon2 split -I [list $spmiddim1 [expr $spmiddim1 + $spmiddim2 -1]]] set nzz_BLblk_lcon2_sp [$nzz_BLblk_lcon2 split -I [list $spmiddim1 [expr $spmiddim1 + $spmiddim2 -1]]] set nzz_out_dom_edg1 [pw::Edge create] $nzz_out_dom_edg1 addConnector [lindex $nzz_BLblk_rcon2_sp 0] $nzz_out_dom_edg1 addConnector [lindex $nzz_BLblk_lcon2_sp 2] set nzz_out_dom_edg2 [pw::Edge create] $nzz_out_dom_edg2 addConnector [lindex $nzz_BLblk_lcon2_sp 1] set nzz_out_dom_edg3 [pw::Edge create] $nzz_out_dom_edg3 addConnector [lindex $nzz_BLblk_lcon2_sp 0] $nzz_out_dom_edg3 addConnector [lindex $nzz_BLblk_rcon2_sp 2] set nzz_out_dom_edg4 [pw::Edge create] $nzz_out_dom_edg4 addConnector [lindex $nzz_BLblk_rcon2_sp 1] set nzz_out_dom [pw::DomainStructured create] $nzz_out_dom addEdge $nzz_out_dom_edg1 $nzz_out_dom addEdge $nzz_out_dom_edg2 $nzz_out_dom addEdge $nzz_out_dom_edg3 $nzz_out_dom addEdge $nzz_out_dom_edg4 set nzz_out_dom_slv [pw::Application begin EllipticSolver [list $nzz_out_dom]] $nzz_out_dom_slv run $NZZ_ROT_STEP $nzz_out_dom_slv end # NOZZLE BLOCK # ----------------------------------------------------------------------------------- set inn_nzz_domr [[[lindex $nzz_BLblk_sp 0] getFace 5] getDomain 1] set inn_nzz_doml [[[lindex $nzz_BLblk_sp 1] getFace 5] getDomain 1] set inn_nzz_domrf [[[lindex $nzz_BLblk_sp 0] getFace 2] getDomain 1] set inn_nzz_domlf [[[lindex $nzz_BLblk_sp 1] getFace 2] getDomain 1] set inn_nzz_tck1 [[[[lindex $nzz_BLblk_sp 1] getFace 6] getEdge 4] getConnector 1] set inn_nzz_tck2 [[[[lindex $nzz_BLblk_sp 1] getFace 1] getEdge 4] getConnector 1] set nzz_BLtck [$inn_nzz_tck1 getDimension] set inn_nzz_domr_sp [$inn_nzz_domr split -J [list $spmiddim1 [expr $spmiddim1 + $spmiddim2 -1]]] set inn_nzz_doml_sp [$inn_nzz_doml split -J [list $spmiddim1 [expr $spmiddim1 + $spmiddim2 -1]]] set inn_nzz_blk [pw::BlockStructured createFromDomains [list [lindex $inn_nzz_domr_sp 0]\ [lindex $inn_nzz_domr_sp 1]\ [lindex $inn_nzz_domr_sp 2]\ [lindex $inn_nzz_doml_sp 0]\ [lindex $inn_nzz_doml_sp 1]\ [lindex $inn_nzz_doml_sp 2]\ $nzz_in_dom $nzz_out_dom]] #collecting BC | inlet lappend domBCs(1) [[$inn_nzz_blk getFace 3] getDomain 1] lappend blkBCs(1) $inn_nzz_blk # ----------------------------------------- NOZZLE UP --------------------------------- # examine edge length set nzz_bl_front_con [[[[lindex $nzz_BLblk_sp 0] getFace 1] getEdge 4] getConnector 1] set front_edg_exm [pw::Examine create ConnectorEdgeLength] $front_edg_exm addEntity $nzz_bl_front_con $front_edg_exm examine set front_edg_value [$front_edg_exm getValue $nzz_bl_front_con 1] set nzz_outt_surf [pw::Surface create] $nzz_outt_surf revolve -angle 360 $nozzUpperCurve {0 0 0} {1 0 0} set nzz_outt_con [pw::Connector createOnDatabase -parametricConnectors Aligned [list $nozzUpperCurve]] set nzz_far_con [pw::Connector createOnDatabase -parametricConnectors Aligned [list $nozzFarCurve]] # front connector set nozzUpFront_seg [pw::SegmentSpline create] $nozzUpFront_seg setSlope Free $nozzUpFront_seg addPoint [[$nzz_outt_con getNode End] getXYZ] $nozzUpFront_seg addPoint [[$nzz_far_con getNode Begin] getXYZ] set nozz_upfront_con [pw::Connector create] $nozz_upfront_con addSegment $nozzUpFront_seg # top connector set nozzUpTop_seg [pw::SegmentSpline create] $nozzUpTop_seg setSlope Free $nozzUpTop_seg addPoint [list [lindex $nx_node 0] 20 0] $nozzUpTop_seg addPoint [[$nzz_far_con getNode Begin] getXYZ] set nozz_uptop_con [pw::Connector create] $nozz_uptop_con addSegment $nozzUpTop_seg # back connector set nozzUpBck_seg [pw::SegmentSpline create] $nozzUpBck_seg setSlope Free $nozzUpBck_seg addPoint [list [lindex $nx_node 0] 20 0] $nozzUpBck_seg addPoint [[$nzz_outt_con getNode Begin] getXYZ] set nozz_upback_con [pw::Connector create] $nozz_upback_con addSegment $nozzUpBck_seg # Dimension $nzz_outt_con setDimension [expr int([$nzz_inn_con getDimension]/5)] $nozz_uptop_con setDimension [$nzz_outt_con getDimension] $nozz_upback_con setDimensionFromSpacing [$nzz_outt_con getAverageSpacing] [$nozz_upback_con getDistribution 1] setEndSpacing $front_edg_value $nozz_upback_con addBreakPoint -Y 6 pw::Connector swapDistribution Growth [list [list $nozz_upback_con 2]] [$nozz_upback_con getDistribution 2] setEndMode HeightAndRate [$nozz_upback_con getDistribution 2] setEndHeight 6 [$nozz_upback_con getDistribution 2] setEndRate $Sponge_iGR $nozz_upback_con setSubConnectorDimensionFromDistribution 2 #examine set nozzupbackdisexm [pw::Examine create ConnectorEdgeLength] $nozzupbackdisexm addEntity $nozz_upback_con $nozzupbackdisexm examine set nozzupbackdisexm_value [$nozzupbackdisexm getValue $nozz_upback_con \ [expr [$nozz_upback_con getSubConnectorDimension 1]]] [$nozz_upback_con getDistribution 1] setEndSpacing $nozzupbackdisexm_value pw::Connector swapDistribution Growth [list [list $nozz_upback_con 1]] [$nozz_upback_con getDistribution 1] setEndMode HeightAndRate [$nozz_upback_con getDistribution 1] setEndHeight 15 [$nozz_upback_con getDistribution 1] setEndRate $Sponge_oGR $nozz_upback_con setSubConnectorDimensionFromDistribution 1 [$nozz_upfront_con getDistribution 1] setBeginSpacing $front_edg_value $nozz_upfront_con setDimension [$nozz_upback_con getDimension] set nozzupfrontdis [pw::DistributionGeneral create \ [list [list $nozz_upback_con 1] [list $nozz_upback_con 2]]] $nozzupfrontdis setBeginSpacing 0 $nozzupfrontdis setEndSpacing 0 $nozzupfrontdis setVariable [[$nozz_upfront_con getDistribution 1] getVariable] $nozz_upfront_con setDistribution 1 $nozzupfrontdis [$nozz_upfront_con getDistribution 1] reverse set nzz_outt_dom [pw::DomainStructured createFromConnectors [list $nzz_outt_con\ $nozz_uptop_con\ $nozz_upfront_con\ $nozz_upback_con]] #revolve set nzz_outface [pw::FaceStructured createFromDomains [list $nzz_outt_dom]] set nzz_outblk [pw::BlockStructured create] $nzz_outblk addFace $nzz_outface set nzz_outblk_extr [pw::Application begin ExtrusionSolver [list $nzz_outblk]] $nzz_outblk setExtrusionSolverAttribute Mode Rotate $nzz_outblk setExtrusionSolverAttribute RotateAxisStart {0 0 0} $nzz_outblk setExtrusionSolverAttribute RotateAxisEnd [pwu::Vector3 add {0 0 0} {1 0 0}] $nzz_outblk setExtrusionSolverAttribute RotateAngle 360 $nzz_outblk_extr run $NZZ_ROT_STEP $nzz_outblk_extr end pw::Entity project -type ClosestPoint -interior [[$nzz_outblk getFace 3] getDomain 1] set nzz_outblk_sp [$nzz_outblk split -K [expr ($NZZ_ROT_STEP/2)+1]] set nzz_outblk_rcon [[[[lindex $nzz_outblk_sp 0] getFace 4] getEdge 4] getConnector 1] set nzz_outblk_lcon [[[[lindex $nzz_outblk_sp 1] getFace 4] getEdge 4] getConnector 1] set nzz_outblk_rbcon [[[[lindex $nzz_outblk_sp 0] getFace 4] getEdge 3] getConnector 1] set nzz_innblk_rcon [[[[lindex $nzz_BLblk_sp 0] getFace 2] getEdge 2] getConnector 1] set nzz_innblk_lcon [[[[lindex $nzz_BLblk_sp 1] getFace 2] getEdge 2] getConnector 1] #collecting BC | Nozzle lappend domBCs(0) [[[lindex $nzz_outblk_sp 0] getFace 3] getDomain 1] lappend blkBCs(0) [lindex $nzz_outblk_sp 0] #collecting BC | far1 lappend domBCs(2) [[[lindex $nzz_outblk_sp 0] getFace 2] getDomain 1] lappend blkBCs(2) [lindex $nzz_outblk_sp 0] #collecting BC | far2 lappend domBCs(3) [[[lindex $nzz_outblk_sp 0] getFace 5] getDomain 1] lappend blkBCs(3) [lindex $nzz_outblk_sp 0] #collecting BC | Nozzle lappend domBCs(0) [[[lindex $nzz_outblk_sp 1] getFace 3] getDomain 1] lappend blkBCs(0) [lindex $nzz_outblk_sp 1] #collecting BC | far1 lappend domBCs(2) [[[lindex $nzz_outblk_sp 1] getFace 2] getDomain 1] lappend blkBCs(2) [lindex $nzz_outblk_sp 1] #collecting BC | far2 lappend domBCs(3) [[[lindex $nzz_outblk_sp 1] getFace 5] getDomain 1] lappend blkBCs(3) [lindex $nzz_outblk_sp 1] # edge connector top set edgtop_seg [pw::SegmentSpline create] $edgtop_seg setSlope Free $edgtop_seg addPoint [[$nzz_outblk_rcon getNode Begin] getXYZ] $edgtop_seg addPoint [[$nzz_innblk_rcon getNode Begin] getXYZ] set edgtop_con [pw::Connector create] $edgtop_con addSegment $edgtop_seg $edgtop_con setDimensionFromSpacing $front_edg_value # edge connector bottom set edgbot_seg [pw::SegmentSpline create] $edgbot_seg setSlope Free $edgbot_seg addPoint [[$nzz_outblk_rcon getNode End] getXYZ] $edgbot_seg addPoint [[$nzz_innblk_rcon getNode End] getXYZ] set edgbot_con [pw::Connector create] $edgbot_con addSegment $edgbot_seg $edgbot_con setDimension [$edgtop_con getDimension] set nzz_tck_top [pw::DomainStructured createFromConnectors [list $edgbot_con\ $edgtop_con\ $nzz_outblk_rcon\ $nzz_innblk_rcon]] set nzz_tck_bot [pw::DomainStructured createFromConnectors [list $edgbot_con\ $edgtop_con\ $nzz_outblk_lcon\ $nzz_innblk_lcon]] set D_R [expr 0.5+$FWH_slp*30] #30D STATION set D_seg [pw::SegmentCircle create] $D_seg addPoint [list 30 $D_R 0] $D_seg addPoint {30 0 0} $D_seg setEndAngle 360 {1 0 0} set D_con [pw::Connector create] $D_con addSegment $D_seg $D_con setDimension [expr $NZZ_ROT_STEP+1] set D_con_sp [$D_con split [$D_con getParameter -arc 0.5]] set D_inn_edg [pw::Edge createFromConnectors [list [lindex $D_con_sp 0] [lindex $D_con_sp 1]]] set D_inn_BLdom [pw::DomainStructured create] $D_inn_BLdom addEdge $D_inn_edg set D_inn_extr [pw::Application begin ExtrusionSolver [list $D_inn_BLdom]] $D_inn_BLdom setExtrusionSolverAttribute NormalMarchingMode Plane $D_inn_BLdom setExtrusionSolverAttribute NormalMarchingVector {1 -0 -0} $D_inn_BLdom setExtrusionSolverAttribute SpacingGrowthFactor $NZZ_IN_GR $D_inn_BLdom setExtrusionSolverAttribute NormalInitialStepSize $NZZ_DS $D_inn_extr run [expr $nzz_BLtck-1] $D_inn_extr end set D_inncon [[$D_inn_BLdom getEdge 3] getConnector 1] set D_inncon_sp [$D_inncon split -I [expr int($NZZ_ROT_STEP/2)+1]] set D_inncon_spspr [[lindex $D_inncon_sp 0] split -I [list $spmiddim1 [expr $spmiddim1 + $spmiddim2 -1]]] set D_inncon_spspl [[lindex $D_inncon_sp 1] split -I [list $spmiddim1 [expr $spmiddim1 + $spmiddim2 -1]]] set D_inn_BLdom_sp [$D_inn_BLdom split -I [expr int($NZZ_ROT_STEP/2)+1]] set D_tck1 [[[lindex $D_inn_BLdom_sp 0] getEdge 2] getConnector 1] set D_tck2 [[[lindex $D_inn_BLdom_sp 0] getEdge 4] getConnector 1] set D_edg1 [pw::Edge create] $D_edg1 addConnector [lindex $D_inncon_spspr 2] $D_edg1 addConnector [lindex $D_inncon_spspl 0] set D_edg2 [pw::Edge create] $D_edg2 addConnector [lindex $D_inncon_spspl 1] set D_edg3 [pw::Edge create] $D_edg3 addConnector [lindex $D_inncon_spspl 2] $D_edg3 addConnector [lindex $D_inncon_spspr 0] set D_edg4 [pw::Edge create] $D_edg4 addConnector [lindex $D_inncon_spspr 1] set D_inn_dom [pw::DomainStructured create] $D_inn_dom addEdge $D_edg1 $D_inn_dom addEdge $D_edg2 $D_inn_dom addEdge $D_edg3 $D_inn_dom addEdge $D_edg4 set D_inn_dom_slv [pw::Application begin EllipticSolver [list $D_inn_dom]] $D_inn_dom_slv run $NZZ_ROT_STEP $D_inn_dom_slv end set D_inn_dom_sp [$D_inn_dom split -I [[lindex $D_inncon_spspl 0] getDimension]] set nzz_out_dom_sp [$nzz_out_dom split -I [[lindex $D_inncon_spspl 0] getDimension]] set nzz_out_dom_midcon [[[lindex $nzz_out_dom_sp 0] getEdge 2] getConnector 1] set D_inn_midcon [[[lindex $D_inn_dom_sp 1] getEdge 4] getConnector 1] set FWH_curve_seg [pw::SegmentSpline create] $FWH_curve_seg addPoint [list [lindex $nx_node 192] [lindex $ny_node 192] 0] $FWH_curve_seg addPoint [[[lindex $D_con_sp 0] getNode Begin] getXYZ] $FWH_curve_seg setSlope Free $FWH_curve_seg setSlopeOut 1 {0.23220261589167601 0.00056916422991104554 0} $FWH_curve_seg setSlopeIn 2 {-9.9607251797528988 0.00036843829710797582 0} set FWH_curve_con1 [pw::Connector create] $FWH_curve_con1 addSegment $FWH_curve_seg $FWH_curve_con1 setDimensionFromSpacing [$nzz_outt_con getAverageSpacing] [$FWH_curve_con1 getDistribution 1] setBeginSpacing [$nzz_inn_con getAverageSpacing] $FWH_curve_con1 addBreakPoint -X 5 pw::Connector swapDistribution Growth [list [list $FWH_curve_con1 1]] [$FWH_curve_con1 getDistribution 1] setBeginMode HeightAndRate [$FWH_curve_con1 getDistribution 1] setBeginHeight 5 [$FWH_curve_con1 getDistribution 1] setBeginRate $FWH_GR $FWH_curve_con1 setSubConnectorDimensionFromDistribution 1 #examine set fwhdisexm [pw::Examine create ConnectorEdgeLength] $fwhdisexm addEntity $FWH_curve_con1 $fwhdisexm examine set fwhdisexm_value [$fwhdisexm getValue $FWH_curve_con1 \ [expr [$FWH_curve_con1 getSubConnectorDimension 1]-1]] [$FWH_curve_con1 getDistribution 2] setBeginSpacing $fwhdisexm_value pw::Connector swapDistribution Growth [list [list $FWH_curve_con1 2]] [$FWH_curve_con1 getDistribution 2] setBeginMode HeightAndRate [$FWH_curve_con1 getDistribution 2] setBeginHeight 5 [$FWH_curve_con1 getDistribution 2] setBeginRate [expr ($FWH_GR-1)*($FWH_GRP/100)+$FWH_GR] $FWH_curve_con1 setSubConnectorDimensionFromDistribution 2 set trns_vec [pwu::Vector3 subtract [list [lindex $nx_node 191] [lindex $ny_node 192] 0] \ [[$inn_nzz_tck1 getNode End] getXYZ]] set FWH_curve_con2 \ [$FWH_curve_con1 createPeriodic -rotate [list 0 0 0] "1 0 0" 180] set D_midom [pw::DomainStructured createFromConnectors [list $FWH_curve_con1\ $inn_nzz_tck1 $nzz_out_dom_midcon $inn_nzz_tck2\ $FWH_curve_con2 $D_tck1 $D_inn_midcon $D_tck2]] set D_midom_sp [$D_midom split -I [list [$D_tck1 getDimension] \ [expr [$D_inn_midcon getDimension]+[$D_tck1 getDimension]-1]]] set D_middom_conu [[[lindex $D_midom_sp 1] getEdge 4] getConnector 1] set D_middom_conb [[[lindex $D_midom_sp 1] getEdge 2] getConnector 1] set D_sider1 [pw::DomainStructured createFromConnectors [list $FWH_curve_con1 \ $nzz_innblk_rcon \ [lindex $D_con_sp 0]\ $FWH_curve_con2 ]] set D_sider2 [pw::DomainStructured createFromConnectors [list $D_middom_conu \ [lindex $nzz_BLblk_rcon2_sp 0]\ [lindex $nzz_BLblk_rcon2_sp 1]\ [lindex $nzz_BLblk_rcon2_sp 2]\ $D_middom_conb\ [lindex $D_inncon_spspl 0]\ [lindex $D_inncon_spspl 1]\ [lindex $D_inncon_spspl 2]]] set D_sider2_sp [$D_sider2 split -I [list $spmiddim1 [expr $spmiddim1 + $spmiddim2 -1]]] set D_sidel1 [pw::DomainStructured createFromConnectors [list $FWH_curve_con1 \ $nzz_innblk_lcon \ [lindex $D_con_sp 1]\ $FWH_curve_con2 ]] set D_sidel2 [pw::DomainStructured createFromConnectors [list $D_middom_conu \ [lindex $nzz_BLblk_lcon2_sp 0]\ [lindex $nzz_BLblk_lcon2_sp 1]\ [lindex $nzz_BLblk_lcon2_sp 2]\ $D_middom_conb\ [lindex $D_inncon_spspr 0]\ [lindex $D_inncon_spspr 1]\ [lindex $D_inncon_spspr 2]]] set D_sidel2_sp [$D_sidel2 split -I [list $spmiddim1 [expr $spmiddim1 + $spmiddim2 -1]]] set D_blk1 [pw::BlockStructured createFromDomains [list [lindex $D_sider2_sp 0] \ [lindex $D_sider2_sp 1]\ [lindex $D_sider2_sp 2]\ [lindex $D_midom_sp 1]\ [lindex $D_inn_dom_sp 1]\ [lindex $nzz_out_dom_sp 0]]] set D_blk2 [pw::BlockStructured createFromDomains [list $D_sider1 [lindex $D_sider2_sp 0] \ [lindex $D_sider2_sp 1] \ [lindex $D_sider2_sp 2] \ [lindex $D_inn_BLdom_sp 0]\ [lindex $D_midom_sp 0] \ [lindex $D_midom_sp 2]\ $inn_nzz_domrf]] set D_blk3 [pw::BlockStructured createFromDomains [list [lindex $D_sidel2_sp 0] \ [lindex $D_sidel2_sp 1]\ [lindex $D_sidel2_sp 2]\ [lindex $D_midom_sp 1]\ [lindex $D_inn_dom_sp 0]\ [lindex $nzz_out_dom_sp 1]]] set D_blk4 [pw::BlockStructured createFromDomains [list $D_sidel1 [lindex $D_sidel2_sp 0] \ [lindex $D_sidel2_sp 1] \ [lindex $D_sidel2_sp 2] \ [lindex $D_inn_BLdom_sp 1]\ [lindex $D_midom_sp 0] \ [lindex $D_midom_sp 2]\ $inn_nzz_domlf]] #outer block set nzz_far_con_sp [$nzz_far_con split [$nzz_far_con getParameter -X 30]] [lindex $nzz_far_con_sp 0] setDimension [$FWH_curve_con1 getDimension] [lindex $nzz_far_con_sp 0] setDistribution 1 [[$FWH_curve_con1 getDistribution 1] copy] set D_front_seg [pw::SegmentSpline create] $D_front_seg addPoint [[$FWH_curve_con1 getNode End] getXYZ] $D_front_seg addPoint [[[lindex $nzz_far_con_sp 0] getNode End] getXYZ] set D_frontcon [pw::Connector create] $D_frontcon addSegment $D_front_seg $D_frontcon setDimension [expr [$nozz_upfront_con getDimension]+[$edgtop_con getDimension]-1] $D_frontcon setDistribution 1 [[$nozz_upfront_con getDistribution 1] copy] set D_side [pw::DomainStructured createFromConnectors [list $FWH_curve_con1 \ $D_frontcon \ [lindex $nzz_far_con_sp 0]\ $nozz_upfront_con\ $edgtop_con]] #revolve set far_edg [pw::Edge createFromConnectors [list [lindex $nzz_far_con_sp 0]]] set far_dom [pw::DomainStructured create] $far_dom addEdge $far_edg set far_extr [pw::Application begin ExtrusionSolver [list $far_dom]] $far_dom setExtrusionSolverAttribute Mode Rotate $far_dom setExtrusionSolverAttribute RotateAxisStart {0 0 0} $far_dom setExtrusionSolverAttribute RotateAxisEnd [pwu::Vector3 add {0 0 0} {1 0 0}] $far_dom setExtrusionSolverAttribute RotateAngle 360 $far_extr run $NZZ_ROT_STEP $far_extr end set far_dom_sp [$far_dom split -J [expr int($NZZ_ROT_STEP/2)+1]] set D_frontb_seg [pw::SegmentSpline create] $D_frontb_seg addPoint [[$FWH_curve_con2 getNode End] getXYZ] $D_frontb_seg addPoint [[[[[lindex $far_dom_sp 0] getEdge 2] getConnector 1] getNode End] getXYZ] set D_frontconb [pw::Connector create] $D_frontconb addSegment $D_frontb_seg $D_frontconb setDimension [$D_frontcon getDimension] $D_frontconb setDistribution 1 [[$D_frontcon getDistribution 1] copy] set D_sideb [pw::DomainStructured createFromConnectors [list $FWH_curve_con2 \ $edgbot_con\ $nzz_outblk_rbcon\ [[[lindex $far_dom_sp 0] getEdge 3] getConnector 1]\ $D_frontconb]] set D_sider [pw::DomainStructured createFromConnectors [list [lindex $D_con_sp 0] \ $D_frontcon\ [[[lindex $far_dom_sp 0] getEdge 2] getConnector 1]\ $D_frontconb]] set D_sidel [pw::DomainStructured createFromConnectors [list [lindex $D_con_sp 1] \ $D_frontcon\ [[[lindex $far_dom_sp 1] getEdge 2] getConnector 1]\ $D_frontconb]] set D_blkright [pw::BlockStructured createFromDomains \ [list $D_sider $D_side $D_sider1 $D_sideb $nzz_tck_top\ [[[lindex $nzz_outblk_sp 0] getFace 4] getDomain 1] [lindex $far_dom_sp 0]]] set D_blkleft [pw::BlockStructured createFromDomains \ [list $D_sidel $D_side $D_sidel1 $D_sideb $nzz_tck_bot\ [[[lindex $nzz_outblk_sp 1] getFace 4] getDomain 1] [lindex $far_dom_sp 1]]] #collecting BC | far2 lappend domBCs(3) [[$D_blkright getFace 4] getDomain 1] lappend blkBCs(3) $D_blkright #collecting BC | nozzle lappend domBCs(0) [[$D_blkright getFace 2] getDomain 2] lappend blkBCs(0) $D_blkright #collecting BC | far2 lappend domBCs(3) [[$D_blkleft getFace 4] getDomain 1] lappend blkBCs(3) $D_blkleft #collecting BC | nozzle lappend domBCs(0) [[$D_blkleft getFace 2] getDomain 2] lappend blkBCs(0) $D_blkleft # THIRD PART #----------------------------------------------------------------------------- # examine edge length set corejet_edg_exm [pw::Examine create ConnectorEdgeLength] $corejet_edg_exm addEntity [lindex $nzz_far_con_sp 0] $corejet_edg_exm examine set corejet_edg_value [$corejet_edg_exm getValue [lindex $nzz_far_con_sp 0] \ [expr [[lindex $nzz_far_con_sp 0] getDimension]-1]] set corejet_face [pw::FaceStructured createFromDomains [list [lindex $D_inn_BLdom_sp 0] \ [lindex $D_inn_BLdom_sp 1]\ [lindex $D_inn_dom_sp 0]\ [lindex $D_inn_dom_sp 1]]] set corejet_blk1 [pw::BlockStructured create] set corejet_blk2 [pw::BlockStructured create] $corejet_blk1 addFace [lindex $corejet_face 0] $corejet_blk2 addFace [lindex $corejet_face 1] set corejet_extr [pw::Application begin ExtrusionSolver [list $corejet_blk1 $corejet_blk2]] $corejet_blk1 setExtrusionSolverAttribute Mode Translate $corejet_blk1 setExtrusionSolverAttribute TranslateDirection {1 0 0} $corejet_blk1 setExtrusionSolverAttribute TranslateDistance 20 $corejet_blk2 setExtrusionSolverAttribute Mode Translate $corejet_blk2 setExtrusionSolverAttribute TranslateDirection {1 0 0} $corejet_blk2 setExtrusionSolverAttribute TranslateDistance 20 $corejet_extr run [expr int(floor(20/$corejet_edg_value))] $corejet_extr end #collecting BC | far3 lappend domBCs(4) [[$corejet_blk1 getFace 6] getDomain 1] lappend blkBCs(4) $corejet_blk1 #collecting BC | far3 lappend domBCs(4) [[$corejet_blk2 getFace 6] getDomain 1] lappend blkBCs(4) $corejet_blk2 set DD_front_seg [pw::SegmentSpline create] $DD_front_seg addPoint [[[lindex $nzz_far_con_sp 1] getNode End] getXYZ] $DD_front_seg addPoint \ [[[[[[$corejet_blk1 getFace 3] getDomain 1] getEdge 2] getConnector 1] getNode End] getXYZ] set DD_front_con [pw::Connector create] $DD_front_con addSegment $DD_front_seg [lindex $nzz_far_con_sp 1] setDimension [expr int(floor(20/$corejet_edg_value))+1] $DD_front_con setDimension [$D_frontcon getDimension] $DD_front_con setDistribution 1 [[$D_frontcon getDistribution 1] copy] [$DD_front_con getDistribution 1] reverse set DD_side [pw::DomainStructured createFromConnectors [list [lindex $nzz_far_con_sp 1] \ $D_frontcon \ [[[[$corejet_blk1 getFace 3] getDomain 1] getEdge 2] getConnector 1]\ $DD_front_con]] #revolve set DDface [pw::FaceStructured createFromDomains [list $DD_side]] set DD_outblk [pw::BlockStructured create] $DD_outblk addFace $DDface set DD_outblk_extr [pw::Application begin ExtrusionSolver [list $DD_outblk]] $DD_outblk setExtrusionSolverAttribute Mode Rotate $DD_outblk setExtrusionSolverAttribute RotateAxisStart {0 0 0} $DD_outblk setExtrusionSolverAttribute RotateAxisEnd [pwu::Vector3 add {0 0 0} {1 0 0}] $DD_outblk setExtrusionSolverAttribute RotateAngle 360 $DD_outblk_extr run $NZZ_ROT_STEP $DD_outblk_extr end set DD_outblk_sp [$DD_outblk split -K [expr int(floor($NZZ_ROT_STEP/2))+1]] #collecting BC | far2 lappend domBCs(3) [[[lindex $DD_outblk_sp 0] getFace 3] getDomain 1] lappend blkBCs(3) [lindex $DD_outblk_sp 0] #collecting BC | far3 lappend domBCs(4) [[[lindex $DD_outblk_sp 0] getFace 2] getDomain 1] lappend blkBCs(4) [lindex $DD_outblk_sp 0] #collecting BC | far2 lappend domBCs(3) [[[lindex $DD_outblk_sp 1] getFace 3] getDomain 1] lappend blkBCs(3) [lindex $DD_outblk_sp 1] #collecting BC | far3 lappend domBCs(4) [[[lindex $DD_outblk_sp 1] getFace 2] getDomain 1] lappend blkBCs(4) [lindex $DD_outblk_sp 1] set dashes [string repeat - 70] puts "MULTI-BLOCK GRID WITHOUT FWH MARKER/INTERFACE GENERATED FOR LEVEL $res_lev." set blk [pw::Grid getAll -type pw::Block] return $blk }
Glyph
4
pdpdhp/nozzlemesher
nozz_mesh.glf
[ "BSD-3-Clause" ]
# all sub postcircumfix {;} candidates here please proto sub postcircumfix:<{; }>($, $, *%) is nodal {*} multi sub postcircumfix:<{; }>(\SELF, @indices) { my \target = nqp::create(IterationBuffer); my int $dims = @indices.elems; # reifies my $indices := nqp::getattr(@indices,List,'$!reified'); sub MD-HASH-SLICE-ONE-POSITION(\SELF, \idx, int $dim --> Nil) { my int $next-dim = $dim + 1; if nqp::istype(idx, Iterable) && nqp::not_i(nqp::iscont(idx)) { MD-HASH-SLICE-ONE-POSITION(SELF, $_, $dim) for idx; } elsif $next-dim < $dims { if nqp::istype(idx,Whatever) { MD-HASH-SLICE-ONE-POSITION(SELF.AT-KEY($_), nqp::atpos($indices,$next-dim), $next-dim) for SELF.keys; } else { MD-HASH-SLICE-ONE-POSITION(SELF.AT-KEY(idx), nqp::atpos($indices,$next-dim), $next-dim); } } # $next-dim == $dims elsif nqp::istype(idx,Whatever) { nqp::push(target, SELF.AT-KEY($_)) for SELF.keys; } else { nqp::push(target, SELF.AT-KEY(idx)); } } MD-HASH-SLICE-ONE-POSITION(SELF, nqp::atpos($indices,0), 0); target.List } multi sub postcircumfix:<{; }>(\SELF, @indices, :$exists!) { sub recurse-at-key(\SELF, \indices) { my \idx := indices[0]; my \exists := SELF.EXISTS-KEY(idx); nqp::if( nqp::istype(idx, Iterable), idx.map({ |recurse-at-key(SELF, ($_, |indices.skip.cache)) }).List, nqp::if( nqp::iseq_I(indices.elems, 1), exists, nqp::if( exists, recurse-at-key(SELF{idx}, indices.skip.cache), nqp::stmts( (my \times := indices.map({ .elems }).reduce(&[*])), nqp::if( nqp::iseq_I(times, 1), False, (False xx times).List ) ).head ) ) ); } recurse-at-key(SELF, @indices) } # vim: expandtab shiftwidth=4
Perl6
4
raydiak/rakudo
src/core.c/hash_multislice.pm6
[ "Artistic-2.0" ]
/* * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.actuate.metrics.r2dbc; import io.micrometer.core.instrument.Gauge; import io.micrometer.core.instrument.Gauge.Builder; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; import io.micrometer.core.instrument.binder.MeterBinder; import io.r2dbc.pool.ConnectionPool; import io.r2dbc.pool.PoolMetrics; /** * A {@link MeterBinder} for a {@link ConnectionPool}. * * @author Tadaya Tsuyukubo * @author Stephane Nicoll * @since 2.3.0 */ public class ConnectionPoolMetrics implements MeterBinder { private static final String CONNECTIONS = "connections"; private final ConnectionPool pool; private final Iterable<Tag> tags; public ConnectionPoolMetrics(ConnectionPool pool, String name, Iterable<Tag> tags) { this.pool = pool; this.tags = Tags.concat(tags, "name", name); } @Override public void bindTo(MeterRegistry registry) { this.pool.getMetrics().ifPresent((poolMetrics) -> { bindConnectionPoolMetric(registry, Gauge.builder(metricKey("acquired"), poolMetrics, PoolMetrics::acquiredSize) .description("Size of successfully acquired connections which are in active use.")); bindConnectionPoolMetric(registry, Gauge.builder(metricKey("allocated"), poolMetrics, PoolMetrics::allocatedSize) .description("Size of allocated connections in the pool which are in active use or idle.")); bindConnectionPoolMetric(registry, Gauge.builder(metricKey("idle"), poolMetrics, PoolMetrics::idleSize) .description("Size of idle connections in the pool.")); bindConnectionPoolMetric(registry, Gauge.builder(metricKey("pending"), poolMetrics, PoolMetrics::pendingAcquireSize).description( "Size of pending to acquire connections from the underlying connection factory.")); bindConnectionPoolMetric(registry, Gauge.builder(metricKey("max.allocated"), poolMetrics, PoolMetrics::getMaxAllocatedSize) .description("Maximum size of allocated connections that this pool allows.")); bindConnectionPoolMetric(registry, Gauge.builder(metricKey("max.pending"), poolMetrics, PoolMetrics::getMaxPendingAcquireSize) .description( "Maximum size of pending state to acquire connections that this pool allows.")); }); } private void bindConnectionPoolMetric(MeterRegistry registry, Builder<?> builder) { builder.tags(this.tags).baseUnit(CONNECTIONS).register(registry); } private static String metricKey(String name) { return "r2dbc.pool." + name; } }
Java
5
techAi007/spring-boot
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/r2dbc/ConnectionPoolMetrics.java
[ "Apache-2.0" ]
<% form_tag url_for(:action => 'forgot_password') do %> What is the email address for your account?<br /> <%= text_field_tag :email, "", :size => 30 %><br /> <%= submit_tag 'Request Password' %> <% end %>
RHTML
4
andypohl/kent
src/hg/encode/hgEncodeSubmit/app/views/account/forgot_password.rhtml
[ "MIT" ]
module Graphics.UI.FLTK.LowLevel.HorFillSlider ( -- *Hierarchy -- -- $hierarchy ) where -- $hierarchy -- @ -- "Graphics.UI.FLTK.LowLevel.Base.Widget" -- | -- v -- "Graphics.UI.FLTK.LowLevel.Base.Valuator" -- | -- v -- "Graphics.UI.FLTK.LowLevel.Base.Slider" -- | -- v -- "Graphics.UI.FLTK.LowLevel.Base.HorFillSlider" -- | -- v -- "Graphics.UI.FLTK.LowLevel.HorFillSlider" -- @
C2hs Haskell
3
ericu/fltkhs
src/Graphics/UI/FLTK/LowLevel/HorFillSlider.chs
[ "MIT" ]
[develop] script_dir=$base/lib/@(project_name) [install] install_scripts=$base/lib/@(project_name)
EmberScript
2
bergercookie/ros2cli
ros2pkg/ros2pkg/resource/ament_python/setup.cfg.em
[ "Apache-2.0" ]
= nginx_substitutions_filter = _Note: this module is not distributed with the Nginx source. Installation instructions can be found [#Installation below]._ == Description == `nginx_substitutions_filter` is a filter module which can do both regular expression and fixed string substitutions on response bodies. This module is quite different from the Nginx's native Substitution Module. It scans the output chains buffer and matches string line by line, just like Apache's [http://httpd.apache.org/docs/trunk/mod/mod_substitute.html mod_substitute]. == Example == {{{ location / { subs_filter_types text/html text/css text/xml; subs_filter st(\d*).example.com $1.example.com ir; subs_filter a.example.com s.example.com; subs_filter http://$host https://$host; } }}} == Directives == * [#subs_filter_types subs_filter_types] * [#subs_filter subs_filter] === subs_filter_types === `syntax:` _subs_filter_types mime-type `[`mime-types`]` _ `default:` _subs_filter_types text/html_ `context:` _http, server, location_ _subs_filter_types_ is used to specify which content types should be checked for _subs_filter_, in addition to *text/html*. The default is only _text/html_. This module just works with plain text. If the response is compressed, it can't uncompress the response and will ignore this response. This module can be compatible with gzip filter module. But it will not work with proxy compressed response. You can disable the compressed response like this: proxy_set_header Accept-Encoding ""; === subs_filter === `syntax:` _subs_filter source_str destination_str `[`gior`]` _ `default:` _none_ `context:` _http, server, location_ _subs_filter_ allows replacing source string(regular expression or fixed) in the nginx response with destination string. The variables in matching text is only avaiable under fixed string mode, which means the matching text could not contain variables if it is a regular expression. Substitution text may contain variables. More than one substitution rules per location is supported. The meaning of the third flags are: * _g_ (default): Replace all the match strings. * _i_: Perform a case-insensitive match. * _o_: Just replace the first one. * _r_: The pattern is treated as a regular expression, default is fixed string. === subs_filter_bypass === `syntax:` _subs_filter_bypass $variable1 ..._ `default:` _none_ `context:` _http, server, location_ You can sepcify several variables with this directive. If at least one of the variable is not empty and is not equal to '0', this substitution filter will be disabled. == Installation == To install, get the source with subversion: {{{ git clone git://github.com/yaoweibin/ngx_http_substitutions_filter_module.git }}} and then compile nginx with the following option: {{{ ./configure --add-module=/path/to/ngx_http_substitutions_filter_module }}} == Known issue == * Can't substitute the response header. == CHANGES == Changes with nginx_substitutions_filter 0.6.4 2014-02-15 * Now non-200 response will work * added the subs_filter_bypass directive Changes with nginx_substitutions_filter 0.6.2 2012-08-26 * fixed a bug of buffer overlap * fixed a bug with last zero buffer Changes with nginx_substitutions_filter 0.6.0 2012-06-30 * refactor this module Changes with nginx_substitutions_filter 0.5.2 2010-08-11 * do many optimizing for this module * fix a bug of buffer overlap * fix a segment fault bug when output chain return NGX_AGAIN. * fix a bug about last buffer with no linefeed. This may cause segment fault. Thanks for Josef Fröhle Changes with nginx_substitutions_filter 0.5 2010-04-15 * refactor the source structure, create branches of dev * fix a bug of small chunk of buffers causing lose content * fix the bug of last_buf and the nginx's compatibility above 0.8.25 * fix a bug with unwanted capture config error in fix string substitution * add feature of regex captures Changes with nginx_substitutions_filter 0.4 2009-12-23 * fix many bugs Changes with nginx_substitutions_filter 0.3 2009-02-04 * Initial public release == Reporting a bug == Questions/patches may be directed to Weibin Yao, yaoweibin@gmail.com. == Copyright & License == This module is licensed under the BSD license. Copyright (C) 2014 by Weibin Yao <yaoweibin@gmail.com>. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MediaWiki
4
steamboatid/nginx
debian/modules/http-subs-filter/doc/README.google_code_home_page.wiki
[ "BSD-2-Clause" ]
CREATE TABLE `tb_lqvkbeqhuw` ( `col_gseshvltxd` tinytext CHARACTER SET latin1, `col_otuwjnlrtt` decimal, UNIQUE INDEX `col_otuwjnlrtt` (`col_otuwjnlrtt`), UNIQUE `col_gseshvltxd` (`col_gseshvltxd`(26)) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; RENAME TABLE `tb_lqvkbeqhuw` TO `tb_mqghelxirz`; ALTER TABLE `tb_mqghelxirz` ADD COLUMN (`col_gwwjlquinc` mediumint NOT NULL, `col_ibdwyzxgxi` varchar(134)); ALTER TABLE `tb_mqghelxirz` ADD COLUMN (`col_hidvbhcjfu` set('enum_or_set_0','enum_or_set_1','enum_or_set_2') CHARACTER SET utf8mb4, `col_gubjakxnpz` char); ALTER TABLE `tb_mqghelxirz` ADD COLUMN (`col_hawbrmwxzw` blob(1199961922), `col_kgokeficzq` set('enum_or_set_0','enum_or_set_1','enum_or_set_2') DEFAULT 'enum_or_set_0'); ALTER TABLE `tb_mqghelxirz` ADD (`col_dplffwllbx` char(146) CHARACTER SET utf8, `col_rikplgqsve` tinyint(146) zerofill NULL); ALTER TABLE `tb_mqghelxirz` ADD `col_ukmsekjycj` tinyblob; ALTER TABLE `tb_mqghelxirz` ADD COLUMN `col_ixaybtquqz` smallint(215) unsigned DEFAULT '1' FIRST; ALTER TABLE `tb_mqghelxirz` ADD COLUMN (`col_zonuplyzdz` tinyblob, `col_snvmotcqtx` mediumtext); ALTER TABLE `tb_mqghelxirz` CHARACTER SET = utf8mb4; ALTER TABLE `tb_mqghelxirz` ADD CONSTRAINT symb_hewywavzus PRIMARY KEY (`col_gwwjlquinc`); ALTER TABLE `tb_mqghelxirz` ADD UNIQUE `col_gwwjlquinc`(`col_gwwjlquinc`,`col_gubjakxnpz`); ALTER TABLE `tb_mqghelxirz` ALTER `col_rikplgqsve` SET DEFAULT NULL; ALTER TABLE `tb_mqghelxirz` CHANGE COLUMN `col_dplffwllbx` `col_xltpnadrcs` bigint zerofill NOT NULL; ALTER TABLE `tb_mqghelxirz` CHANGE `col_hidvbhcjfu` `col_vtkwyvoqkp` varbinary(121) NULL; ALTER TABLE `tb_mqghelxirz` DROP INDEX `col_gseshvltxd`; ALTER TABLE `tb_mqghelxirz` DROP KEY `col_gwwjlquinc`;
SQL
3
yuanweikang2020/canal
parse/src/test/resources/ddl/alter/test_41.sql
[ "Apache-2.0" ]
functions { real model_log_dens( int[] deaths_slice, int start, int end, //pars vector logit_p_avg, // data int[] casesM ) { int n; real lpmf; int N_slice; lpmf = 0.0; N_slice = end - start + 1; for(n_slice in 1:N_slice) { n = n_slice + start - 1; lpmf += binomial_logit_lpmf(deaths_slice[n] | casesM[n], logit_p_avg[n]); } return( lpmf ); } } data { int<lower=0> N; // number of observations int<lower=0> M; // number of studies int deaths[N]; // number of deaths int casesM[N]; // numnber of cases, midpoint estimate vector<lower=0>[N] age_study; // age midpoints } transformed data { real delta = 1e-9; int<lower=0> N_predict=21; vector<lower=0>[N_predict] age_predict; int age_predict_study_idx[N]; for(i in 1:N_predict) { age_predict[i] = 100/(N_predict-1)*(i-1); } for(i in 1:N) { for(j in 2:N_predict) { if(age_predict[j-1]<=age_study[i] && age_study[i]<age_predict[j]) { age_predict_study_idx[i] = j-1; } } } print(age_predict_study_idx); } parameters { real alpha; real beta; real<lower=0> obs_rnde_sd; vector[N] obs_rnde; real<lower=0> gp_len_sc; real<lower=0> gp_msd; vector[N_predict] eta_f; } transformed parameters { vector[N] logit_p_avg; vector[N_predict] gp_age_predict; { matrix[N_predict, N_predict] K = cov_exp_quad(to_array_1d(age_predict), gp_msd, gp_len_sc); // diagonal elements for (n in 1:N_predict) K[n, n] = K[n, n] + delta; gp_age_predict = cholesky_decompose(K) * eta_f; logit_p_avg = alpha + gp_age_predict[age_predict_study_idx] + beta * age_study + obs_rnde; } } model { target += normal_lpdf( alpha | 0, 20); target += normal_lpdf( beta | 0, 1); target += cauchy_lpdf( obs_rnde_sd | 0, 1); target += normal_lpdf( obs_rnde | 0, obs_rnde_sd); target += normal_lpdf( gp_msd | 0, 2); //target += inv_gamma_lpdf( gp_len_sc | 16, 700); // qinvgamma(c(.01,.99), 16, 700) = 26.17519 85.56298 target += inv_gamma_lpdf( gp_len_sc | 11, 400); // qinvgamma(c(.01,.99), 11, 400) = [1] 19.85636 83.83554 target += normal_lpdf( eta_f | 0, 1); //log lkl rstan version target += model_log_dens(deaths, 1, N, //log lkl cmdstan version //target += reduce_sum(model_log_dens, deaths, 1, // pars logit_p_avg, // data casesM ); } generated quantities { vector<lower=0, upper=1>[N_predict] p_predict; int pred_deaths[N_predict]; p_predict = inv_logit( alpha + gp_age_predict + beta * age_predict ); pred_deaths = binomial_rng(rep_array(10000000, N_predict), p_predict); }
Stan
5
viniciuszendron/covid19model
covid19AgeModel/inst/ifr-by-age/base_age_prior_ifr_200820b3_cmdstanv.stan
[ "MIT" ]
Rebol [ Title: "Clean" Author: "Christopher Ross-Gill" Date: 18-Apr-2018 File: %clean.red Version: 0.1.2 Purpose: "Converts errant CP-1252 codepoints within a UTF-8 binary" Rights: http://opensource.org/licenses/Apache-2.0 Type: module Name: rgchris.clean Exports: [clean] History: [ 18-Apr-2018 0.1.2 "Ren-C Version" 14-Aug-2013 0.1.1 "Working Version" ] ] clean: use [ codepoints ascii utf-b utf-2 utf-3 utf-4 here cleaner ][ codepoints: make map! [ ; CP-1252 specific range 128 #{E282AC} 130 #{E2809A} 131 #{C692} 132 #{E2809E} 133 #{E280A6} 134 #{E280A0} 135 #{E280A1} 136 #{CB86} 137 #{E280B0} 138 #{C5A0} 139 #{E280B9} 140 #{C592} 142 #{C5BD} 145 #{E28098} 146 #{E28099} 147 #{E2809C} 148 #{E2809D} 149 #{E280A2} 150 #{E28093} 151 #{E28094} 152 #{CB9C} 153 #{E284A2} 154 #{C5A1} 155 #{E280BA} 156 #{C593} 158 #{C5BE} ] ascii: charset [ 0 - 127] utf-b: charset [128 - 191] utf-2: charset [194 - 223] utf-3: charset [224 - 239] utf-4: charset [240 - 244] here: _ cleaner: [ ascii ; simplistic representation of UTF-8 | utf-2 utf-b | utf-3 2 utf-b | utf-4 3 utf-b | change here: skip ( case [ did select codepoints here/1 [codepoints/(here/1)] here/1 > 191 [reduce [195 here/1 and+ 191]] here/1 > 158 [reduce [194 here/1]] ] else [[239 191 189]] ) ] clean: func [ "Converts errant CP-1252 codepoints within a UTF-8 binary" string [binary!] "Binary to convert" ][ parse string [any cleaner] to string! string ] ]
Rebol
5
hostilefork/rgchris-scripts
ren-c/clean.reb
[ "Apache-2.0" ]
var foo1 = "a/".replace(/.[/]/, ""); var foo2 = "a//".replace(/.[//]/g, ""); var foo3 = "a/".replace(/.[/no sleep /till/]/, "bugfix");
TypeScript
2
nilamjadhav/TypeScript
tests/cases/compiler/regExpWithSlashInCharClass.ts
[ "Apache-2.0" ]
--TEST-- Fixed bug #69756 (Fatal error: Nesting level too deep - recursive dependency? with ===). --FILE-- <?php $arr = range(1, 2); foreach($arr as &$item ) { var_dump($arr === array(1, 2)); } ?> --EXPECT-- bool(true) bool(true)
PHP
3
thiagooak/php-src
Zend/tests/bug69756.phpt
[ "PHP-3.01" ]
// FLAGS: -d3 // OUTPUT: \[debug\] Run time error 27: "General error \(unknown or unspecific error\)" // OUTPUT: \[debug\] AMX backtrace: // OUTPUT: \[debug\] #0 00000344 in end \(\) at .*args\.pwn:86 // OUTPUT: \[debug\] #1 0000032c in f8 \(UknownTag:n=999\) at .*args\.pwn:82 // OUTPUT: \[debug\] #2 000002fc in f7 \(e\[struct:1\]=@00003f70\) at .*args\.pwn:77 // OUTPUT: \[debug\] #3 000002a8 in f6 \(aa\[3\]\[4\]=@00003f84\) at .*args\.pwn:72 // OUTPUT: \[debug\] #4 00000240 in f5 \(a\[3\]=@00003fd0 ""\) at .*args\.pwn:62 // OUTPUT: \[debug\] #5 000001c4 in f4 \(s\[\]=@00000018 "hi there"\) at .*args\.pwn:52 // OUTPUT: \[debug\] #6 00000168 in f3 \(Float:f=1\.50000\) at .*args\.pwn:46 // OUTPUT: \[debug\] #7 00000104 in f2 \(bool:b1=true, bool:b2=false\) at .*args\.pwn:41 // OUTPUT: \[debug\] #8 000000cc in f1 \(x=123\) at .*args\.pwn:36 // OUTPUT: \[debug\] #9 00000094 in begin \(\) at .*args\.pwn:31 // OUTPUT: \[debug\] #10 00000064 in public test \(\) at .*args\.pwn:27 // OUTPUT: \[debug\] #11 native CallLocalFunction \(\) in plugin-runner(\.exe)? // OUTPUT: \[debug\] #12 00000038 in main \(\) at .*args\.pwn:23 #include "test" forward test(); main() { CallLocalFunction("test", ""); } public test() { begin(); } begin() { f1(123); } f1(x) { f2(true, false); return x; } f2(bool:b1, bool:b2) { f3(1.5); return b1 && b2; } f3(Float:f) { f4("hi there"); return _:f; } f4(s[]) { new a[] = {3, 2, 1}; f5(a); return s[0]; } f5(a[3]) { new aa[][] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; f6(aa); return a[0]; } enum struct { abc }; f6(aa[3][4]) { new e[struct] = { 0xdeadbeef }; f7(e); return aa[0][0]; } f7(e[struct]) { f8(UknownTag:999); return e[abc]; } f8(UknownTag:n) { end(); return _:n; } end() { #emit halt 27 }
PAWN
3
SL-RP/samp-plugin-crashdetect
tests/args.pwn
[ "BSD-2-Clause" ]
package org.zstack.core.aspect; import org.zstack.utils.Utils; import org.zstack.utils.logging.CLogger; import org.springframework.beans.factory.annotation.Autowired; import org.zstack.core.encrypt.EncryptRSA; public aspect EncryptAspect { private static final CLogger logger = Utils.getLogger(EncryptAspect.class); @Autowired private EncryptRSA rsa; void around(String param) : args(param) && execution(@org.zstack.header.core.encrypt.ENCRYPT * *(..)){ if(param.length() > 0){ try{ param = rsa.encrypt1(param); }catch(Exception e){ logger.debug(String.format("encrypt aspectj is error...")); logger.debug(e.getMessage()); e.printStackTrace(); } proceed(param); } } }
AspectJ
3
qianfei11/zstack
core/src/main/java/org/zstack/core/aspect/EncryptAspect.aj
[ "Apache-2.0" ]
// deno-lint-ignore-file export function retb() { return "b"; }
JavaScript
1
Preta-Crowz/deno
cli/tests/esm_imports_b.js
[ "MIT" ]
"""Support for Fibaro switches.""" from __future__ import annotations from homeassistant.components.switch import ENTITY_ID_FORMAT, SwitchEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import FIBARO_DEVICES, FibaroDevice from .const import DOMAIN async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback, ) -> None: """Set up the Fibaro switches.""" async_add_entities( [ FibaroSwitch(device) for device in hass.data[DOMAIN][entry.entry_id][FIBARO_DEVICES][ Platform.SWITCH ] ], True, ) class FibaroSwitch(FibaroDevice, SwitchEntity): """Representation of a Fibaro Switch.""" def __init__(self, fibaro_device): """Initialize the Fibaro device.""" self._state = False super().__init__(fibaro_device) self.entity_id = ENTITY_ID_FORMAT.format(self.ha_id) def turn_on(self, **kwargs): """Turn device on.""" self.call_turn_on() self._state = True def turn_off(self, **kwargs): """Turn device off.""" self.call_turn_off() self._state = False @property def is_on(self): """Return true if device is on.""" return self._state def update(self): """Update device state.""" self._state = self.current_binary_state
Python
4
liangleslie/core
homeassistant/components/fibaro/switch.py
[ "Apache-2.0" ]
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Utility functions for TPU.""" import contextlib from tensorflow.python.distribute import packed_distributed_variable as packed from tensorflow.python.eager import context from tensorflow.python.framework import ops from tensorflow.python.tpu import tpu def enclosing_tpu_context(): """Returns the TPUReplicateContext, which exists inside a tpu.rewrite().""" return enclosing_tpu_context_and_graph()[0] def enclosing_tpu_context_and_graph(): """Returns the TPUReplicateContext which exists inside a tpu.rewrite(), and its associated graph.""" graph = ops.get_default_graph() while graph is not None: ctx = graph._get_control_flow_context() # pylint: disable=protected-access while ctx is not None: if isinstance(ctx, tpu.TPUReplicateContext): return ctx, graph ctx = ctx.outer_context # This may be a FuncGraph due to defuns or v2 control flow. We need to # find the original graph with the XLAControlFlowContext. graph = getattr(graph, "outer_graph", None) return None, None @contextlib.contextmanager def outside_or_skip_tpu_context(): """Returns a context manager that skips current enclosing context if there is any.""" ctx, graph = enclosing_tpu_context_and_graph() if ctx is None: yield else: saved_context = graph._get_control_flow_context() # pylint: disable=protected-access graph._set_control_flow_context(ctx.outer_context) # pylint: disable=protected-access yield graph._set_control_flow_context(saved_context) # pylint: disable=protected-access @contextlib.contextmanager def _maybe_enter_graph(tensor): # Note: might have an eager tensor but not be executing eagerly when # building functions. if (context.executing_eagerly() or isinstance(tensor, ops.EagerTensor) or ops.has_default_graph()): yield else: with tensor.graph.as_default(): yield @contextlib.contextmanager def _maybe_on_device(var): # Add a device scope for packed variables. if isinstance(var, packed.PackedVarAndDevice): with ops.device(var.device): yield else: yield def make_raw_assign_fn(raw_assign_fn, use_handle=True): """Wrap `raw_assign_fn` with the proper graph context and device scope. Args: raw_assign_fn: the function to be wrapped. use_handle: if True, the `raw_assign_fn` will be applied to the handle of a variable; otherwise it will be applied to the variable itself. Returns: The wrapped function. """ def assign_fn(var, value, use_locking=False, name=None, read_value=True): del use_locking # Unused. handle = var.handle if use_handle else var with _maybe_enter_graph(handle), _maybe_on_device(var): op = raw_assign_fn( handle, ops.convert_to_tensor(value, dtype=var.dtype), name=name) with ops.control_dependencies([op]): if read_value: return var._read_variable_op() if use_handle else var.read_value() # pylint: disable=protected-access else: return op return assign_fn def make_raw_scatter_xxx_fn(raw_scatter_xxx_fn): """Wrap `raw_scatter_xxx_fn` so that it can be called w/ and w/o packed handle.""" def scatter_xxx_fn(var, sparse_delta, use_locking=False, name=None): # pylint: disable=missing-docstring del use_locking # Unused. handle = var.handle with _maybe_enter_graph(handle), _maybe_on_device(var): op = raw_scatter_xxx_fn( handle, sparse_delta.indices, ops.convert_to_tensor(sparse_delta.values, var.dtype), name=name) with ops.control_dependencies([op]): return var._read_variable_op() # pylint: disable=protected-access return scatter_xxx_fn
Python
4
EricRemmerswaal/tensorflow
tensorflow/python/distribute/tpu_util.py
[ "Apache-2.0" ]
/** * Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. * * This file provided by Facebook is for non-commercial testing and evaluation * purposes only. Facebook reserves all rights not expressly granted. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ body { margin: 0; padding: 0; font-family: sans-serif; } #root{ position: fixed; height: 100vh; width: 100%; }
CSS
3
raihan71/draft-js
examples/draft-0-10-0/playground/src/index.css
[ "MIT" ]
{} :users $ {} |root $ {} (:id |root) (:name |root) (:nickname |root) (:avatar nil) (:theme :star-trail) :ir $ {} (:package |app) :root $ {} (:ns |main) (:def |main!) :files $ {} |app.comp.page-members $ {} :ns $ {} (:type :expr) (:by |S1lNv50FW) (:at 1550076412760) (:id |ytgdqU0an) :data $ {} |T $ {} (:type :leaf) (:text |ns) (:id |HyWduBt42qW) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |app.comp.page-members) (:id |B1zOOSKN39W) (:by |root) (:at 1504777353661) |r $ {} (:type :expr) (:id |SJgtdStV39Z) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |:require) (:id |SJ-F_rYVn5W) (:by |root) (:at 1504777353661) |j $ {} (:type :expr) (:id |HJMKOSt43q-) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |[]) (:id |HJQKdrYNh9-) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |clojure.string) (:id |S1VF_rFVh5Z) (:by |root) (:at 1504777353661) |r $ {} (:type :leaf) (:text |:as) (:id |r1HF_SK43c-) (:by |root) (:at 1504777353661) |v $ {} (:type :leaf) (:text |string) (:id |SkLKurKE25Z) (:by |root) (:at 1504777353661) |r $ {} (:type :expr) (:id |S1vY_HYE2cZ) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |[]) (:id |SkOFdrYN25W) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |hsl.core) (:id |SktFdHtV29b) (:by |root) (:at 1504777353661) |r $ {} (:type :leaf) (:text |:refer) (:id |BycYOSFVnqW) (:by |root) (:at 1504777353661) |v $ {} (:type :expr) (:id |S1oYOHYNh5Z) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |[]) (:id |H13YOSKE3qZ) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |hsl) (:id |HJTK_rYN29Z) (:by |root) (:at 1504777353661) |v $ {} (:type :expr) (:id |BkAKuHFVh9-) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |[]) (:id |rkkqOSKVnqZ) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |respo-ui.core) (:id |S1gcdBKEhq-) (:by |root) (:at 1504777353661) |r $ {} (:type :leaf) (:text |:as) (:id |S1WqdHY42qW) (:by |root) (:at 1504777353661) |v $ {} (:type :leaf) (:text |ui) (:id |HkGcOBtN3cZ) (:by |root) (:at 1504777353661) |y $ {} (:type :expr) (:id |HkRCrER6-) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |[]) (:id |r1IOdSKV29W) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |respo.core) (:id |SywOOSYE2cb) (:by |root) (:at 1504777353661) |r $ {} (:type :leaf) (:text |:refer) (:id |Hk__uBtEhcW) (:by |root) (:at 1504777353661) |v $ {} (:type :expr) (:id |SyFddHYE39W) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |[]) (:id |rJqOOSK4hcW) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |defcomp) (:id |SJs_OSY435b) (:by |root) (:at 1504777353661) |r $ {} (:type :leaf) (:text |<>) (:id |r1h_OBKNncW) (:by |root) (:at 1504777353661) |t $ {} (:type :leaf) (:text |list->) (:id |SkeLXDDlbf) (:by |root) (:at 1512236830915) |v $ {} (:type :leaf) (:text |span) (:id |ry6uuBY4h9Z) (:by |root) (:at 1504777353661) |x $ {} (:type :leaf) (:text |div) (:id |S1AuOrYEncZ) (:by |root) (:at 1504777353661) |y $ {} (:type :leaf) (:text |a) (:id |r11t_HK435Z) (:by |root) (:at 1504777353661) |yT $ {} (:type :expr) (:id |S1ksOSKEn9-) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |[]) (:id |rkei_SFV39W) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |respo.comp.space) (:id |rJbsdBFEncZ) (:by |root) (:at 1504777353661) |r $ {} (:type :leaf) (:text |:refer) (:id |BJzjOBYNh9W) (:by |root) (:at 1504777353661) |v $ {} (:type :expr) (:id |HJ7iuHtN3qb) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |[]) (:id |HkEsOrFV39b) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |=<) (:id |r1BouSYV39Z) (:by |root) (:at 1504777353661) |yj $ {} (:type :expr) (:by |S1lNv50FW) (:at 1550076422286) (:id |RWcAq7jGbe) :data $ {} |T $ {} (:type :leaf) (:by |S1lNv50FW) (:at 1550076422664) (:text |[]) (:id |aauVImKdc) |j $ {} (:type :leaf) (:by |S1lNv50FW) (:at 1550076423285) (:text "|\"url-parse") (:id |oSXAyVtQXl) |r $ {} (:type :leaf) (:by |S1lNv50FW) (:at 1550076423983) (:text |:as) (:id |Ph_pMR_iX) |v $ {} (:type :leaf) (:by |S1lNv50FW) (:at 1550076428729) (:text |url-parse) (:id |FPv0anxaXD) :defs $ {} |comp-page-members $ {} (:type :expr) (:id |SkPj_HY43cZ) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |defcomp) (:id |r1_oOSY43c-) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |comp-page-members) (:id |SktiOrtN2q-) (:by |root) (:at 1504777353661) |r $ {} (:type :expr) (:id |S19idBYN29Z) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |router-data) (:id |rJosuHFN25b) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |session-id) (:id |BJnjOHKV39Z) (:by |root) (:at 1504777353661) |v $ {} (:type :expr) (:id |S1aoOBFN25W) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |div) (:id |ByAjdrYV2qW) (:by |root) (:at 1504777353661) |j $ {} (:type :expr) (:id |SyJnOSFEn5W) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |{}) (:id |ByenOHFNh9Z) (:by |root) (:at 1504777353661) |j $ {} (:type :expr) (:id |r1-3_BFN25Z) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |:style) (:id |rJznuSKEhcZ) (:by |root) (:at 1504777353661) |j $ {} (:type :expr) (:id |SyQn_StEn5W) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |merge) (:id |Sy42OBtEnqW) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |ui/flex) (:id |HJSnOSKN2qZ) (:by |root) (:at 1504777353661) |r $ {} (:type :leaf) (:text |style-members) (:id |BkL3_HFN3qZ) (:by |root) (:at 1504777353661) |style-bookmark $ {} (:type :expr) (:id |SketBt429Z) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |def) (:id |rkZYBKV39-) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |style-bookmark) (:id |ByGYBK4h5Z) (:by |root) (:at 1504777353661) |r $ {} (:type :expr) (:id |BJmtrFN35W) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |{}) (:id |HyVYHKNhc-) (:by |root) (:at 1504777353661) |j $ {} (:type :expr) (:id |rkHtHKNn5W) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |:font-family) (:id |BJItBtVnq-) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text ||Menlo,monospace) (:id |SJwtBFN35-) (:by |root) (:at 1504777353661) |r $ {} (:type :expr) (:id |H1dFrF439W) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |:min-width) (:id |rJFFStE2qZ) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |200) (:id |S1cFBY42cW) (:by |root) (:at 1504777353661) |v $ {} (:type :expr) (:id |HysKrF43qZ) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |:display) (:id |Sk3tBtEh9W) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |:inline-block) (:id |H1TFBFN29-) (:by |root) (:at 1504777353661) |style-row $ {} (:type :expr) (:id |H1hWFSYN3cb) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |def) (:id |SJpWKrKEn9W) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |style-row) (:id |BkAWFHFV25-) (:by |root) (:at 1504777353661) |r $ {} (:type :expr) (:id |BJJzKSFVh9-) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |{}) (:id |ByeztHYEncZ) (:by |root) (:at 1504777353661) |j $ {} (:type :expr) (:id |B1-GYBtEhqb) (:by nil) (:at 1504777353661) :data $ {} |T $ {} (:type :leaf) (:text |:cursor) (:id |SkzMtSKN39Z) (:by |root) (:at 1504777353661) |j $ {} (:type :leaf) (:text |:pointer) (:id |HJmGtHtVn9-) (:by |root) (:at 1504777353661) :proc $ {} (:type :expr) (:id |S1Li_rF4n9Z) (:by nil) (:at 1504777353661) (:data $ {})
Cirru
2
Cardsareus/linguist
samples/Cirru/calcit.cirru
[ "MIT" ]
% Default to the notebook output style % Inherit from the specified cell style. \documentclass{article} \usepackage{graphicx} % Used to insert images \usepackage{adjustbox} % Used to constrain images to a maximum size \usepackage{color} % Allow colors to be defined \usepackage{enumerate} % Needed for markdown enumerations to work \usepackage{geometry} % Used to adjust the document margins \usepackage{amsmath} % Equations \usepackage{amssymb} % Equations \usepackage{eurosym} % defines \euro \usepackage[mathletters]{ucs} % Extended unicode (utf-8) support \usepackage[utf8x]{inputenc} % Allow utf-8 characters in the tex document \usepackage{fancyvrb} % verbatim replacement that allows latex \usepackage{grffile} % extends the file name processing of package graphics % to support a larger range % The hyperref package gives us a pdf with properly built % internal navigation ('pdf bookmarks' for the table of contents, % internal cross-reference links, web links for URLs, etc.) \usepackage{hyperref} \usepackage{longtable} % longtable support required by pandoc >1.10 \usepackage{booktabs} % table support for pandoc > 1.12.2 \usepackage{color} \usepackage{soul} \usepackage[framemethod=tikz]{mdframed} \definecolor{orange}{cmyk}{0,0.4,0.8,0.2} \definecolor{darkorange}{rgb}{.71,0.21,0.01} \definecolor{darkgreen}{rgb}{.12,.54,.11} \definecolor{myteal}{rgb}{.26, .44, .56} \definecolor{gray}{gray}{0.45} \definecolor{lightgray}{gray}{.95} \definecolor{mediumgray}{gray}{.8} \definecolor{inputbackground}{rgb}{.95, .95, .85} \definecolor{outputbackground}{rgb}{.95, .95, .95} \definecolor{traceback}{rgb}{1, .95, .95} % ansi colors \definecolor{red}{rgb}{.6,0,0} \definecolor{green}{rgb}{0,.65,0} \definecolor{brown}{rgb}{0.6,0.6,0} \definecolor{blue}{rgb}{0,.145,.698} \definecolor{purple}{rgb}{.698,.145,.698} \definecolor{cyan}{rgb}{0,.698,.698} \definecolor{lightgray}{gray}{0.5} % bright ansi colors \definecolor{darkgray}{gray}{0.25} \definecolor{lightred}{rgb}{1.0,0.39,0.28} \definecolor{lightgreen}{rgb}{0.48,0.99,0.0} \definecolor{lightblue}{rgb}{0.53,0.81,0.92} \definecolor{lightpurple}{rgb}{0.87,0.63,0.87} \definecolor{lightcyan}{rgb}{0.5,1.0,0.83} % commands and environments needed by pandoc snippets % extracted from the output of `pandoc -s` \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} % Add ',fontsize=\small' for more characters per line \newenvironment{Shaded}{}{} \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}} \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} \newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}} \newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}} \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}} \newcommand{\RegionMarkerTok}[1]{{#1}} \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} \newcommand{\NormalTok}[1]{{#1}} % Define a nice break command that doesn't care if a line doesn't already % exist. \def\br{\hspace*{\fill} \\* } % Math Jax compatability definitions \def\gt{>} \def\lt{<} % Document parameters \title{export\_highlights} \author{} % Pygments definitions \makeatletter \def\PY@reset{\let\PY@it=\relax \let\PY@bf=\relax% \let\PY@ul=\relax \let\PY@tc=\relax% \let\PY@bc=\relax \let\PY@ff=\relax} \def\PY@tok#1{\csname PY@tok@#1\endcsname} \def\PY@toks#1+{\ifx\relax#1\empty\else% \PY@tok{#1}\expandafter\PY@toks\fi} \def\PY@do#1{\PY@bc{\PY@tc{\PY@ul{% \PY@it{\PY@bf{\PY@ff{#1}}}}}}} \def\PY#1#2{\PY@reset\PY@toks#1+\relax+\PY@do{#2}} \expandafter\def\csname PY@tok@gp\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} \expandafter\def\csname PY@tok@no\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}} \expandafter\def\csname PY@tok@il\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} \expandafter\def\csname PY@tok@sx\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} \expandafter\def\csname PY@tok@kt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}} \expandafter\def\csname PY@tok@mo\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} \expandafter\def\csname PY@tok@sh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} \expandafter\def\csname PY@tok@bp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} \expandafter\def\csname PY@tok@gd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}} \expandafter\def\csname PY@tok@sb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} \expandafter\def\csname PY@tok@err\endcsname{\def\PY@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}} \expandafter\def\csname PY@tok@nd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}} \expandafter\def\csname PY@tok@gr\endcsname{\def\PY@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}} \expandafter\def\csname PY@tok@kd\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} \expandafter\def\csname PY@tok@s\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} \expandafter\def\csname PY@tok@cs\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}} \expandafter\def\csname PY@tok@sd\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} \expandafter\def\csname PY@tok@ss\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} \expandafter\def\csname PY@tok@nn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} \expandafter\def\csname PY@tok@w\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}} \expandafter\def\csname PY@tok@kn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} \expandafter\def\csname PY@tok@sc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} \expandafter\def\csname PY@tok@s1\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} \expandafter\def\csname PY@tok@ge\endcsname{\let\PY@it=\textit} \expandafter\def\csname PY@tok@cp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.74,0.48,0.00}{##1}}} \expandafter\def\csname PY@tok@gh\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} \expandafter\def\csname PY@tok@gi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}} \expandafter\def\csname PY@tok@vc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} \expandafter\def\csname PY@tok@si\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}} \expandafter\def\csname PY@tok@ow\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}} \expandafter\def\csname PY@tok@vg\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} \expandafter\def\csname PY@tok@sr\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}} \expandafter\def\csname PY@tok@cm\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}} \expandafter\def\csname PY@tok@c\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}} \expandafter\def\csname PY@tok@mi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} \expandafter\def\csname PY@tok@kc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} \expandafter\def\csname PY@tok@ne\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.82,0.25,0.23}{##1}}} \expandafter\def\csname PY@tok@nf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} \expandafter\def\csname PY@tok@go\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}} \expandafter\def\csname PY@tok@m\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} \expandafter\def\csname PY@tok@mh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} \expandafter\def\csname PY@tok@nc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} \expandafter\def\csname PY@tok@mb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} \expandafter\def\csname PY@tok@se\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.13}{##1}}} \expandafter\def\csname PY@tok@gt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}} \expandafter\def\csname PY@tok@nv\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} \expandafter\def\csname PY@tok@c1\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}} \expandafter\def\csname PY@tok@kp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} \expandafter\def\csname PY@tok@s2\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} \expandafter\def\csname PY@tok@nb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} \expandafter\def\csname PY@tok@ni\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@k\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} \expandafter\def\csname PY@tok@na\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.49,0.56,0.16}{##1}}} \expandafter\def\csname PY@tok@o\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} \expandafter\def\csname PY@tok@mf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} \expandafter\def\csname PY@tok@nl\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.63,0.00}{##1}}} \expandafter\def\csname PY@tok@nt\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} \expandafter\def\csname PY@tok@gs\endcsname{\let\PY@bf=\textbf} \expandafter\def\csname PY@tok@vi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} \expandafter\def\csname PY@tok@gu\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}} \expandafter\def\csname PY@tok@kr\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} \def\PYZbs{\char`\\} \def\PYZus{\char`\_} \def\PYZob{\char`\{} \def\PYZcb{\char`\}} \def\PYZca{\char`\^} \def\PYZam{\char`\&} \def\PYZlt{\char`\<} \def\PYZgt{\char`\>} \def\PYZsh{\char`\#} \def\PYZpc{\char`\%} \def\PYZdl{\char`\$} \def\PYZhy{\char`\-} \def\PYZsq{\char`\'} \def\PYZdq{\char`\"} \def\PYZti{\char`\~} % for compatibility with earlier versions \def\PYZat{@} \def\PYZlb{[} \def\PYZrb{]} \makeatother % Prevent overflowing lines due to hard-to-break entities \sloppy % Setup hyperref package \hypersetup{ breaklinks=true, % so long urls are correctly broken across lines colorlinks=true, urlcolor=blue, linkcolor=darkorange, citecolor=darkgreen, } % Slightly bigger margins than the latex defaults \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in} \newcommand{\highlighta}[1]{{\sethlcolor{yellow} \textcolor{red}{\hl{#1}}}} \newcommand{\highlightb}[1]{{\sethlcolor{red} \textcolor{yellow}{\hl{#1}}}} \newcommand{\highlightc}[1]{{\sethlcolor{green} \textcolor{yellow}{\hl{#1}}}} \newenvironment{highlightA}{\begin{mdframed}[hidealllines=true,backgroundcolor=yellow!20]}{\end{mdframed}} \newenvironment{highlightB}{\begin{mdframed}[hidealllines=true,backgroundcolor=red!20]}{\end{mdframed}} \newenvironment{highlightC}{\begin{mdframed}[hidealllines=true,backgroundcolor=green!20]}{\end{mdframed}} %\usepackage{foo} \begin{document} \maketitle \section{Exporting the notebook}\label{exporting-the-notebook} As suggested by @juhasch, it is interesting to keep the highlights when exporting the notebook to another format. We give and explain below some possibilities: \subsection{Short version}\label{short-version} \begin{itemize} \item Html export: \begin{Shaded} \begin{Highlighting}[] \KeywordTok{jupyter} \NormalTok{nbconvert FILE --config JUPYTER_DATA_DIR/extensions/highlight_html_cfg.py } \end{Highlighting} \end{Shaded} \item LaTeX export: \begin{Shaded} \begin{Highlighting}[] \KeywordTok{jupyter} \NormalTok{nbconvert FILE --config JUPYTER_DATA_DIR/extensions/highlight_latex_cfg.py } \end{Highlighting} \end{Shaded} where JUPYTER\_DATA\_DIR can be found from the output of \begin{Shaded} \begin{Highlighting}[] \KeywordTok{jupyter} \NormalTok{--paths} \end{Highlighting} \end{Shaded} eg \texttt{\textasciitilde{}/.local/share/jupyter} in my case. Seems to be \texttt{c:\textbackslash{}users\textbackslash{}NAME\textbackslash{}AppData\textbackslash{}Roaming\textbackslash{}jupyter} under Windows. \end{itemize} Examples can be found here: \href{tst_highlights.ipynb}{initial notebook}, \href{tst_highlights.html}{html version}, \href{tst_highlights.pdf}{pdf version} (after an additional LaTeX \(\rightarrow\) pdf compilation). \subsection{Html export}\label{html-export} This is quite easy. Actually, highlight formatting embedded in markdown cells is preserved while converting with the standard \begin{Shaded} \begin{Highlighting}[] \KeywordTok{jupyter} \NormalTok{nbconvert file.ipynb} \end{Highlighting} \end{Shaded} However, the css file is missing and must be added. Here we have several possibilities \begin{itemize} \item Embed the css \emph{within} the notebook. For that, consider the last cell of the present notebook. This code reads the css file \texttt{highlighter.css} in the extension directory and displays the corresponding style. So doing the \texttt{\textless{}style\textgreater{}\ ...\textless{}/style\textgreater{}} section will be present in the cell output and interpreted by the web browser. Drawbacks of this solution is that user still have to execute this cell and that the this is not language agnostic. \item Use a \textbf{template file} to link or include the css file during conversion. Such a file is provided as \texttt{templates/highlighter.tpl}. It was choosen here to \emph{include} the css content in the produced html file rather than linking it. This avoids the necessity to keep the css file with the html files. \item This works directly if the css resides in the same directory as the file the user is attempting to convert --thus requires the user to copy \texttt{highlighter.css} in the current directory. Then the conversion is simply \begin{Shaded} \begin{Highlighting}[] \KeywordTok{jupyter} \NormalTok{nbconvert file.ipynb --template highlighter} \end{Highlighting} \end{Shaded} \item It still remains two problems with this approach. First, it can be annoying to have to systematically copy the css file in the current directory. Second, the data within the html tags is not converted (and thus markdown remains unmodified). A solution is to use a pair of preprocessor/postprocessor that modify the html tags and enable the subsequent markdown to html converter to operate on the included data. Also, a config file is provided which redefines the template path to enable direct inclusion of the css file in the extension directory. Unfortunately, \highlighta{it seems that the \emph{full path} to the config file has to be provided}. This file resides in the extensions subdirectory of the jupyter\_data\_dir. The path can be found by looking at the output of \begin{Shaded} \begin{Highlighting}[] \KeywordTok{jupyter} \NormalTok{--paths} \end{Highlighting} \end{Shaded} Then the command to issue for converting the notebook to html is \begin{Shaded} \begin{Highlighting}[] \KeywordTok{jupyter} \NormalTok{nbconvert FILE --config JUPYTER_DATA_DIR/extensions/highlight_html_cfg.py } \end{Highlighting} \end{Shaded} \end{itemize} For instance \begin{Shaded} \begin{Highlighting}[] \KeywordTok{jupyter} \NormalTok{nbconvert tst_highlights.ipynb --config ~/.local/share/jupyter/extensions/highlight_html_cfg.py } \end{Highlighting} \end{Shaded} \subsection{LaTeX export}\label{latex-export} This is a bit more complicated since the direct conversion removes all html formatting present in markdown cells. Thus use again a \textbf{preprocessor} which runs before the markdown \(\rightarrow\) LaTeX conversion. In turn, it appears that we also need to postprocess the result. Three LaTeX commands, namely \emph{highlighta, highlightb, highlightc}, and three environments \emph{highlightA, highlightB, highlightC} are defined. Highlighting html markup is then transformed into the corresponding LaTeX commands and the text for completely highlighted cells is put in the adequate LaTeX environment. Pre and PostProcessor classes are defined in the file \texttt{pp\_highlighter.py} located in the \texttt{extensions} directory. A LaTeX template, that includes the necessary packages and the definitions of commands/environments is provides as \texttt{highlighter.tplx} in the template directory. The template inherits from \texttt{article.ltx}. For more complex scenarios, typically if the latex template file has be customized, the user shall modify its template or inherit from his base template rather than from article. Finally, a config file fixes the different options for the conversion. Then the command to issue is simply \begin{Shaded} \begin{Highlighting}[] \KeywordTok{jupyter} \NormalTok{nbconvert FILE --config JUPYTER_DATA_DIR/extensions/highlight_latex_cfg.py } \end{Highlighting} \end{Shaded} e.g. \begin{Shaded} \begin{Highlighting}[] \KeywordTok{jupyter} \NormalTok{nbconvert tst_highlights.ipynb --config ~/.local/share/jupyter/extensions/highlight_latex_cfg.py } \end{Highlighting} \end{Shaded} \subsection{Configuring paths}\label{configuring-paths} \highlighta{For those who do not have taken the extension from the \texttt{jupyter_contrib_nbextensions} repository or have not configured extensions via its \texttt{setup.py} utility,} a file \texttt{set\_paths.py} is present in the extension directory (it is merely a verbatim copy of the relevant parts in setup.py). This file configure the paths to the \texttt{templates} and \texttt{extension} directories. It should be executed by something like \begin{Shaded} \begin{Highlighting}[] \KeywordTok{python3} \NormalTok{set_paths.py} \end{Highlighting} \end{Shaded} Additionaly, you may also have to execute \texttt{mv\_paths.py} if you installed from the original repo via \texttt{jupyter\ nbextension\ install\ ..} \begin{Shaded} \begin{Highlighting}[] \KeywordTok{python3} \NormalTok{mv_paths.py} \end{Highlighting} \end{Shaded} \subsection{Example for embedding the css within the notebook before conversion}\label{example-for-embedding-the-css-within-the-notebook-before-conversion} \begin{Verbatim}[commandchars=\\\{\}] >>> \PY{k+kn}{from} \PY{n+nn}{IPython}\PY{n+nn}{.}\PY{n+nn}{core}\PY{n+nn}{.}\PY{n+nn}{display} \PY{k}{import} \PY{n}{display}\PY{p}{,} \PY{n}{HTML} ... \PY{k+kn}{from} \PY{n+nn}{jupyter\PYZus{}core}\PY{n+nn}{.}\PY{n+nn}{paths} \PY{k}{import} \PY{n}{jupyter\PYZus{}config\PYZus{}dir}\PY{p}{,} \PY{n}{jupyter\PYZus{}data\PYZus{}dir} ... \PY{k+kn}{import} \PY{n+nn}{os} ... \PY{n}{csspath}\PY{o}{=}\PY{n}{os}\PY{o}{.}\PY{n}{path}\PY{o}{.}\PY{n}{join}\PY{p}{(}\PY{n}{jupyter\PYZus{}data\PYZus{}dir}\PY{p}{(}\PY{p}{)}\PY{p}{,}\PY{l+s}{\PYZsq{}}\PY{l+s}{nbextensions}\PY{l+s}{\PYZsq{}}\PY{p}{,} ... \PY{l+s}{\PYZsq{}}\PY{l+s}{highlighter}\PY{l+s}{\PYZsq{}}\PY{p}{,}\PY{l+s}{\PYZsq{}}\PY{l+s}{highlighter.css}\PY{l+s}{\PYZsq{}}\PY{p}{)} ... \PY{n}{HTML}\PY{p}{(}\PY{l+s}{\PYZsq{}}\PY{l+s}{\PYZlt{}style\PYZgt{}}\PY{l+s}{\PYZsq{}}\PY{o}{+}\PY{n+nb}{open}\PY{p}{(}\PY{n}{csspath}\PY{p}{,} \PY{l+s}{\PYZdq{}}\PY{l+s}{r}\PY{l+s}{\PYZdq{}}\PY{p}{)}\PY{o}{.}\PY{n}{read}\PY{p}{(}\PY{p}{)}\PY{o}{+}\PY{l+s}{\PYZsq{}}\PY{l+s}{\PYZlt{}/style\PYZgt{}}\PY{l+s}{\PYZsq{}}\PY{p}{)} \end{Verbatim} \begin{verbatim} <IPython.core.display.HTML object> \end{verbatim} % Add a bibliography block to the postdoc \end{document}
TeX
4
WTRipper/jupyter_contrib_nbextensions
src/jupyter_contrib_nbextensions/nbextensions/highlighter/export_highlights.tex
[ "BSD-3-Clause-Clear" ]
REBOL [ System: "REBOL [R3] Language Interpreter and Run-time Environment" Title: "REBOL 3 Mezzanine: To-Type Helpers" Rights: { Copyright 2012 REBOL Technologies REBOL is a trademark of REBOL Technologies } License: { Licensed under the Apache License, Version 2.0 See: http://www.apache.org/licenses/LICENSE-2.0 } ] ; These must be listed now, because there is no longer a global context for mezz functions: ; Are we sure we really want all these?? -Carl A108 to-logic: to-integer: to-decimal: to-percent: to-money: to-char: to-pair: to-tuple: to-time: to-date: to-binary: to-string: to-file: to-email: to-url: to-tag: to-bitset: to-image: to-vector: to-block: to-paren: to-path: to-set-path: to-get-path: to-lit-path: to-map: to-datatype: to-typeset: to-word: to-set-word: to-get-word: to-lit-word: to-ref: to-refinement: to-issue: to-command: to-closure: to-function: to-object: to-module: to-error: to-port: to-gob: to-event: none ; Auto-build the functions for the above TO-* words. use [word] [ foreach type system/catalog/datatypes [ ; The list above determines what will be made here: if in lib word: make word! head remove back tail ajoin ["to-" type] [ ; Add doc line only if this build has autodocs: set in lib :word func either string? first spec-of :make [ reduce [reform ["Converts to" form type "value."] 'value] ][ [value] ] compose [to (type) :value] ] ] ]
Rebol
4
0branch/r3
src/mezz/mezz-types.reb
[ "Apache-2.0" ]
import unittest from test import test_tools test_tools.skip_if_missing("peg_generator") with test_tools.imports_under_tool("peg_generator"): from pegen.grammar_parser import GeneratedParser as GrammarParser from pegen.validator import SubRuleValidator, ValidationError from pegen.testutil import parse_string from pegen.grammar import Grammar class TestPegen(unittest.TestCase): def test_rule_with_no_collision(self) -> None: grammar_source = """ start: bad_rule sum: | NAME '-' NAME | NAME '+' NAME """ grammar: Grammar = parse_string(grammar_source, GrammarParser) validator = SubRuleValidator(grammar) for rule_name, rule in grammar.rules.items(): validator.validate_rule(rule_name, rule) def test_rule_with_simple_collision(self) -> None: grammar_source = """ start: bad_rule sum: | NAME '+' NAME | NAME '+' NAME ';' """ grammar: Grammar = parse_string(grammar_source, GrammarParser) validator = SubRuleValidator(grammar) with self.assertRaises(ValidationError): for rule_name, rule in grammar.rules.items(): validator.validate_rule(rule_name, rule) def test_rule_with_collision_after_some_other_rules(self) -> None: grammar_source = """ start: bad_rule sum: | NAME '+' NAME | NAME '*' NAME ';' | NAME '-' NAME | NAME '+' NAME ';' """ grammar: Grammar = parse_string(grammar_source, GrammarParser) validator = SubRuleValidator(grammar) with self.assertRaises(ValidationError): for rule_name, rule in grammar.rules.items(): validator.validate_rule(rule_name, rule)
Python
4
oleksandr-pavlyk/cpython
Lib/test/test_peg_generator/test_grammar_validator.py
[ "0BSD" ]
CLASS zcl_abapgit_gui_utils DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. CLASS-METHODS is_renderable IMPORTING !io_obj TYPE REF TO object RETURNING VALUE(rv_yes) TYPE abap_bool . CLASS-METHODS is_event_handler IMPORTING !io_obj TYPE REF TO object RETURNING VALUE(rv_yes) TYPE abap_bool . PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS ZCL_ABAPGIT_GUI_UTILS IMPLEMENTATION. METHOD is_event_handler. DATA li_event_handler TYPE REF TO zif_abapgit_gui_event_handler. TRY. li_event_handler ?= io_obj. rv_yes = abap_true. CATCH cx_sy_move_cast_error. rv_yes = abap_false. ENDTRY. ENDMETHOD. METHOD is_renderable. DATA li_renderable TYPE REF TO zif_abapgit_gui_renderable. TRY. li_renderable ?= io_obj. rv_yes = abap_true. CATCH cx_sy_move_cast_error. rv_yes = abap_false. ENDTRY. ENDMETHOD. ENDCLASS.
ABAP
4
jeevanrajv1901/ABAPGIT
src/ui/core/zcl_abapgit_gui_utils.clas.abap
[ "MIT" ]
/** * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* Main Container */ .mainContainerV1 { flex: 1 1 0%; max-width: 100%; padding: 40px 0; } .mainContainerV1 .wrapperV1 { text-align: left; } /* End of Main Container */ /* Utils */ .wrapperV1 { margin: 0px auto; max-width: 1100px; padding: 0 20px; } @media only screen and (min-width: 1500px) { .wrapperV1 { max-width: 1400px; } } .wrapperV1 blockquote > p:first-child { padding-top: 0; } .center { display: block; text-align: center; } /* End of Utils */ /* GridBlock */ .gridBlockV1 { padding: 0; } .gridBlockV1 > * { box-sizing: border-box; } .gridBlockV1 .twoByGridBlock img, .gridBlockV1 .threeByGridBlock img, .gridBlockV1 .fourByGridBlock img { max-width: 100%; } .gridBlockV1 .gridClear { clear: both; } @media only screen and (max-width: 735px) { .gridBlockV1 .fourByGridBlock { flex: 1 0 26%; } } @media only screen and (min-width: 736px) { .gridBlockV1 { display: flex; flex-direction: row; flex-wrap: wrap; } .gridBlockV1 > * { margin: 0 12px; } .gridBlockV1 > *:first-child { margin-left: 0; } .gridBlockV1 > *:last-child { margin-right: 0; } .gridBlockV1 .twoByGridBlock { flex: 1 0 40%; } .gridBlockV1 .threeByGridBlock { flex: 1 0 26%; } .gridBlockV1 .fourByGridBlock { flex: 1 0 20%; } h2 + .gridBlockV1 { padding-top: 20px; } } @media only screen and (min-width: 1400px) { .gridBlockV1 { display: flex; flex-direction: row; flex-wrap: wrap; } } .alignCenter { text-align: center; } .alignRight { text-align: right; } .imageAlignSide { display: flex; flex-flow: row wrap; } .blockImage { max-width: 730px; } .imageAlignSide .blockImage { flex: 0 1 500px; max-width: 500px; } @media only screen and (max-width: 735px) { .imageAlignSide .blockImage { display: none; } } .imageAlignSide .blockContent { flex: 1 1; } .imageAlignBottom .blockImage { margin: 0 auto 20px; max-width: 730px; } .imageAlignBottom.alignCenter .blockImage { margin-left: auto; margin-right: auto; } .imageAlignTop .blockImage { margin-bottom: 20px; max-width: 80px; } .imageAlignTop.alignCenter .blockImage { margin-left: auto; margin-right: auto; } .imageAlignRight .blockImage { margin-left: 40px; } .imageAlignLeft .blockImage { margin-right: 40px; } /* End of GridBlock */ /* Start of Container */ .containerV1 .gridBlockV1 .blockContent p { padding: 0; } .containerV1 .wrapperV1 .alignCenter h2 { text-align: center; } .containerV1 .wrapperV1 .imageAlignSide h2 { text-align: left; } .containerV1 .wrapperV1 .imageAlignSide p { margin: 0; margin-bottom: 40px; max-width: 560px; } .highlightBackground { background: rgba(153, 66, 79, 0.7); color: #fff; } .highlightBackground a { border-color: white; color: #fff; font-weight: 800; } .containerV1.highlightBackground .wrapperV1 h1, .containerV1.highlightBackground .wrapperV1 h2, .containerV1.highlightBackground .wrapperV1 h3, .containerV1.highlightBackground .wrapperV1 h4, .containerV1.highlightBackground .wrapperV1 h5 { border-color: white; color: white; } .lightBackground { /* background: #f7f7f7; */ background: var(--ifm-menu-color-background-active); } .darkBackground { background: #808080; color: #fff; } .darkBackground a { color: #d6b3b8; } .darkBackground code { color: #d6b3b8; } .containerV1.darkBackground .wrapperV1 h1, .containerV1.darkBackground .wrapperV1 h2, .containerV1.darkBackground .wrapperV1 h3, .containerV1.darkBackground .wrapperV1 h4, .containerV1.darkBackground .wrapperV1 h5 { border-color: #fff; color: #fff; } .containerV1.paddingAll { padding: 40px; } .containerV1.paddingBottom { padding-bottom: 80px; } .containerV1.paddingLeft { padding-left: 40px; } .containerV1.paddingRight { padding-right: 40px; } .containerV1.paddingTop { padding-top: 80px; } @media only screen and (max-width: 735px) { .containerV1.paddingBottom { padding-bottom: 40px; } .containerV1.paddingTop { padding-top: 20px; } } @media only screen and (max-width: 1023px) { .responsiveList .blockContent { position: relative; } .responsiveList .blockContent > div { padding-left: 20px; } .responsiveList .blockContent:before { content: '\2022'; position: absolute; } } /* End of Container */
CSS
4
sfiquet/jest
website/src/components/v1/legacyCSS.css
[ "MIT" ]
# Copyright (c) 2018-2021, Carnegie Mellon University # See LICENSE for details Class(AVX_LDST, rec( list := [], __call__ := meth(arg) local self; self := arg[1]; Append(self.list, Drop(arg, 1)); end, getList := self >> self.list :: SSE_LDST.list, )); _evshuf1 := self >> let( a := _unwrap(self.args[1].ev()), p := self.args[2].p, self.semantic(a, p)); _evshuf2 := self >> let( a := _unwrap(self.args[1].ev()), b := _unwrap(self.args[2].ev()), p := self.args[3].p, self.semantic(a, b, p)); _evpack := self >> let( a := _unwrap(self.args[1].ev()), b := _unwrap(self.args[2].ev()), self.semantic(a, b, [])); ####################################################################################### # AVX 4-way 64-bit floating-point instructions vzero_4x64f_const := TVect(T_Real(64), 4).zero(); vzero_4x64f := () -> vzero_4x64f_const; # Load # AVX_LDST( # __m256d _mm256_maskload_pd(double *a, __m256i mask); Class(vloadmask_4x64f, VecExp_4.unary(), rec( mask := n -> Reversed(Flat(List([1..4], i->["0x00000000", When(i <= n, "0x80000000", "0x00000000")]))) )), # __m256d _mm256_broadcast_sd(const double *a) Class(vbroadcast_4x64f, VecExp_4.unary()), # __m256d _mm256_loadu_pd(double const *a) Class(vloadu_4x64f, VecExp_4.unary()) ); # Store # AVX_LDST( # void _mm256_maskstore_pd(double *a, __m256i mask, __m256d b); Class(vstoremask_4x64f, VecStoreCommand.ternary(), rec( mask := n -> Reversed(Flat(List([1..4], i->["0x00000000", When(i <= n, "0x80000000", "0x00000000")]))) )), # void _mm256_storeu_pd(double *a, __m256d b) Class(vstoreu_4x64f, VecStoreCommand.binary()) ); Class(addsub_4x64f, VecExp_4.binary(), rec( ev := self >> add(self.args[1], mul(self.t.value([-1.0, 1.0, -1.0, 1.0]), self.args[2])).ev(), )); Class(fmaddsub_4x64f, VecExp_4.ternary()); # __m256d _mm256_insertf128_pd(__m256d a, __m128d b, int offset); Class(vinsert_2l_4x64f, VecExp_4.binary(), rec( ev := self >> let( a := _unwrap(self.args[1].ev()), b := _unwrap(self.args[2].ev()), When( self.args[3].p[1] = 0, b :: a{[3 .. 4]}, a{[1 .. 2]} :: b )), computeType := self >> self.args[1].t, )); # __m128d _mm256_extractf128_pd(__m256d a, int offset); Class(vextract_2l_4x64f, VecExp_4.unary(), rec( semantic := (in1, p) -> in1{[1+2*p[1] .. 2 + 2*p[1]]}, ev := _evshuf1, computeType := self >> Checked(IsVecT(self.args[1].t), TVect(self.args[1].t.t, 2)), #self.args[1].t.size/2, )); # Binary shuffle # # __m256d _mm256_unpacklo_pd(__m256d a, __m256d b); Class(vunpacklo_4x64f, VecExp_4.binary(), rec( semantic := (in1, in2, p) -> [in1[1], in2[1], in1[3], in2[3]], ev := _evpack )); # __m256d _mm256_unpackhi_pd(__m256d a, __m256d b); Class(vunpackhi_4x64f, VecExp_4.binary(), rec( semantic := (in1, in2, p) -> [in1[2], in2[2], in1[4], in2[4]], ev := _evpack )); # __m256d _mm256_shuffle_pd(__m256d a, __m256d b, const int select); Class(vshuffle_4x64f, VecExp_4.binary(), rec( semantic := (in1, in2, p) -> [in1[p[1]], in2[p[2]], in1[p[3]+2], in2[p[4]+2]], params := self >> [[1,2], [1,2], [1,2], [1,2]], ev := _evshuf2 )); # __m256d _mm256_permute2_pd(__m256d a, __m256d b, __m256i control, int imm); Class(vperm2_4x64f, VecExp_4.binary(), rec( semantic := (in1, in2, p) -> let(lane1 := Concat(in1{[1..2]}, in2{[1..2]}), lane2 := Concat(in1{[3..4]}, in2{[3..4]}), [lane1[p[1]], lane1[p[2]], lane2[p[3]], lane2[p[4]]]), params := self >> [[1..4], [1..4], [1..4], [1..4]], ev := _evshuf2 )); #__m256d _mm256_blend_pd(__m256d m1, __m256d m2, const int mask); Class(vblend_4x64f, VecExp_4.binary(), rec( semantic := (in1, in2, p) -> List( Zip2(TransposedMat([in1, in2]), p), e -> e[1][e[2]]), params := self >> Replicate(4, [1,2]), ev := _evshuf2 )); # __m256d _mm256_permute2f128_pd(__m256d a, __m256d b, int control); Class(vpermf128_4x64f, VecExp_4.binary(), rec( semantic := (in1, in2, p) -> let(v128 := [[in1[1], in1[2]], [in1[3], in1[4]], [in2[1], in2[2]], [in2[3], in2[4]]], Concat(v128[p[1]], v128[p[2]])), params := self >> [[1..4], [1..4]], ev := _evshuf2 )); # Unary shuffle # # __m256d _mm256_permute_pd(__m256d a, int control); Class(vperm_4x64f, VecExp_4.unary(), rec( semantic := (in1, p) -> [in1[p[1]], in1[p[2]], in1[p[3]+2], in1[p[4]+2]], params := self >> [[1,2], [1,2], [1,2], [1,2]], ev := _evshuf1 )); Class(vuunpacklo_4x64f, VecExp_4.unaryFromBinop(vunpacklo_4x64f)); Class(vuunpackhi_4x64f, VecExp_4.unaryFromBinop(vunpackhi_4x64f)); Class(vushuffle_4x64f, VecExp_4.unaryFromBinop(vshuffle_4x64f)); Class(vuperm2_4x64f, VecExp_4.unaryFromBinop(vperm2_4x64f)); Class(vupermf128_4x64f, VecExp_4.unaryFromBinop(vpermf128_4x64f)); ####################################################################################### # AVX 8-way 32-bit float instructions vzero_8x32f_const := TVect(T_Real(64), 8).zero(); vzero_8x32f := () -> vzero_8x32f_const; Class(addsub_8x32f, VecExp_8.binary(), rec( ev := self >> add(self.args[1], mul(self.t.value([-1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0]), self.args[2])).ev(), )); Class(fmaddsub_8x32f, VecExp_8.ternary()); # Load # AVX_LDST( # __m256 _mm256_maskload_ps(float *a, __m256i mask); Class(vloadmask_8x32f, VecExp_8.unary(), rec( mask := n -> Reversed(List([1..8], i -> When(i <= n, "0x80000000", "0x00000000"))) )), # __m256 _mm256_loadu_ps(float const *a) Class(vloadu_8x32f, VecExp_8.unary()) ); # Store # AVX_LDST( # void _mm256_maskstore_ps(float *a, __m256i mask, __m256 b); Class(vstoremask_8x32f, VecStoreCommand.ternary(), rec( mask := n -> Reversed(List([1..8], i->When(i <= n, "0x80000000", "0x00000000"))) )), # void _mm256_storeu_ps(float *a, __m256 b) Class(vstoreu_8x32f, VecStoreCommand.binary()) ); # __m256 _mm256_insertf128_ps(__m256 a, __m128d , int offset); Class(vinsert_4l_8x32f, VecExp_4.binary(), rec( ev := self >> let( a := _unwrap(self.args[1].ev()), b := _unwrap(self.args[2].ev()), When( self.args[3].p[1] = 0, b :: a{[5 .. 8]}, a{[1 .. 4]} :: b )), computeType := self >> self.args[1].t, )); # __m128 _mm256_extractf128_pd(__m256 a, int offset); Class(vextract_4l_8x32f, VecExp_8.unary(), rec( semantic := (in1, p) -> in1{[1+4*p[1] .. 4 + 4*p[1]]}, ev := _evshuf1, computeType := self >> Checked(IsVecT(self.args[1].t), TVect(self.args[1].t.t, 4)), #self.args[1].t.size/2, )); # Binary shuffle # # __m256 _mm256_unpacklo_ps(__m256 a, __m256 b); Class(vunpacklo_8x32f, VecExp_8.binary(), rec( semantic := (in1, in2, p) -> [in1[1], in2[1], in1[2], in2[2], in1[5], in2[5], in1[6], in2[6]], ev := _evpack, )); # __m256 _mm256_unpackhi_ps(__m256 a, __m256 b); Class(vunpackhi_8x32f, VecExp_8.binary(), rec( semantic := (in1, in2, p) -> [in1[3], in2[3], in1[4], in2[4], in1[7], in2[7], in1[8], in2[8]], ev := _evpack, )); # __m256 _mm256_permute2f128_ps(__m256 a, __m256 b, int control); Class(vpermf128_8x32f, VecExp_8.binary(), rec( semantic := (in1, in2, p) -> let(v128 := [in1{[1..4]}, in1{[5..8]}, in2{[1..4]}, in2{[5..8]}], Concat(v128[p[1]], v128[p[2]])), params := self >> [[1..4], [1..4]], ev := _evshuf2, )); # __m256 _mm256_permute2_ps(__m256 a, __m256 b, __m256i control, int imm); Class(vperm2_8x32f, VecExp_8.binary(), rec( semantic := (in1, in2, p) -> let(lane1 := Concat(in1{[1..4]}, in2{[1..4]}), lane2 := Concat(in1{[5..8]}, in2{[5..8]}), [lane1[p[1]], lane1[p[2]], lane1[p[3]], lane1[p[4]], lane2[p[1]], lane2[p[2]], lane2[p[3]], lane2[p[4]]]), params := self >> [[1..8], [1..8], [1..8], [1..8]], ev := _evshuf2 )); # __m256 _mm256_shuffle_ps(__m256 a, __m256 b, const int select); Class(vshuffle_8x32f, VecExp_8.binary(), rec( semantic := (in1, in2, p) -> [in1[p[1]], in1[p[2]], in2[p[3]], in2[p[4]], in1[p[1]+4], in1[p[2]+4], in2[p[3]+4], in2[p[4]+4]], params := self >> [[1..4], [1..4], [1..4], [1..4]], ev := _evshuf2, )); #__m256 _mm256_blend_ps(__m256 m1, __m256 m2, const int mask); Class(vblend_8x32f, VecExp_8.binary(), rec( semantic := (in1, in2, p) -> List( Zip2(TransposedMat([in1, in2]), p), e -> e[1][e[2]]), params := self >> Replicate(8, [1,2]), ev := _evshuf2 )); # Unary shuffle # # __m256 _mm256_permute_ps(__m256 a, int control); Class(vperm_8x32f, VecExp_8.unary(), rec( semantic := (in1, p) -> [in1[p[1]], in1[p[2]], in1[p[3]], in1[p[4]], in1[p[1]+4], in1[p[2]+4], in1[p[3]+4], in1[p[4]+4]], params := self >> [[1..4], [1..4], [1..4], [1..4]], ev := _evshuf1 )); Class(vuunpacklo_8x32f, VecExp_8.unaryFromBinop(vunpacklo_8x32f)); Class(vuunpackhi_8x32f, VecExp_8.unaryFromBinop(vunpackhi_8x32f)); Class(vushuffle_8x32f, VecExp_8.unaryFromBinop(vshuffle_8x32f)); Class(vupermf128_8x32f, VecExp_8.unaryFromBinop(vpermf128_8x32f)); # __m256 _mm256_permutevar_ps(__m256 a, __m256i control); Class(vpermv_8x32f, VecExp_8.unary(), rec( semantic := (in1, p) -> [in1[p[1]], in1[p[2]], in1[p[3]], in1[p[4]], in1[p[5]+4], in1[p[6]+4], in1[p[7]+4], in1[p[8]+4]], params := self >> Replicate(8, [1,2]), ev := _evshuf1, )); # __m256 _mm256_movehdup_ps (__m256 a); Class(vhdup_8x32f, VecExp_8.unary(), rec( semantic := (in1, p) -> [in1[2], in1[2], in1[4], in1[4], in1[6], in1[6], in1[8], in1[8]], ev := self >> let( v := self._vval(1), self.t.value(self.semantic(v, []))), )); # __m256 _mm256_moveldup_ps (__m256 a); Class(vldup_8x32f, VecExp_8.unary(), rec( semantic := (in1, p) -> [in1[1], in1[1], in1[3], in1[3], in1[5], in1[5], in1[7], in1[7]], ev := self >> let( v := self._vval(1), self.t.value(self.semantic(v, []))), )); # vcxtr_8x32f is a virtual instruction: in-register Tensor(L(4,2),I(2)) # later rewritten to vblend_8x32f(x, vperm_8x32f(vupermf128_8x32f(x, [ 2, 1 ]), [3,4,1,2]), [1,1,2,2,2,2,1,1]) # this helps SIMD_ISA_DB to find this permutation Class(vcxtr_8x32f, VecExp_8.unary(), rec( semantic := (in1, p) -> [in1[1], in1[2], in1[5], in1[6], in1[3], in1[4], in1[7], in1[8]], ev := self >> let( v := self._vval(1), self.t.value(self.semantic(v, []))), vcost := 5, # 3 instructions + dependency penalty )); # Type Conversion # __m256 _mm256_cvtpd_ps (__m256d a) Class(vcvt_8x32f_4x64f, VecExp_4.unary(), rec( computeType := (self) >> TVect(T_Real(32), 8) )); # __m256d _mm256_cvtps_pd (__m128 a) Class(vcvt_4x64f_4x32f, VecExp_4.unary(), rec( computeType := (self) >> TVect(T_Real(64), 4) )); # __m256d _mm256_cvtepi32_pd (__m128i src) Class(vcvt_4x64f_4x32i, VecExp_4.unary(), rec( computeType := (self) >> TVect(T_Real(64), 4) )); # __m128i _mm256_cvtpd_epi32 (__m256d src), rounding Class(vcvt_4x32i_4x64f, VecExp_4.unary(), rec( computeType := (self) >> TVect(T_Int(32), 4) )); # __m128i _mm256_cvttpd_epi32 (__m256d src), truncation Class(vcvtt_4x32i_4x64f, VecExp_4.unary(), rec( computeType := (self) >> TVect(T_Int(32), 4) )); # __m256 _mm256_cvtepi32_ps (__m256i src) Class(vcvt_8x32f_8x32i, VecExp_8.unary(), rec( computeType := (self) >> TVect(T_Real(32), 8) )); # type conversion 8x32f to 8x32i, rounding # __m256i _mm256_cvtps_epi32 (__m256 a) Class(vcvt_8x32i_8x32f, VecExp_8.unary(), rec( computeType := (self) >> TVect(T_Int(32), 8) )); # type conversion 8x32f to 8x32i, truncation toward zero # __m256i _mm256_cvttps_epi32 (__m256 a) Class(vcvtt_8x32i_8x32f, VecExp_8.unary(), rec( computeType := (self) >> TVect(T_Int(32), 8) ));
GAP
5
sr7cb/spiral-software
namespaces/spiral/platforms/avx/code.gi
[ "BSD-2-Clause-FreeBSD" ]
package com.baeldung.springintegration.controllers; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; @ManagedBean(name = "helloPFMBean") @SessionScoped public class HelloPFMBean { private String magicWord; public String getMagicWord() { return magicWord; } public void setMagicWord(String magicWord) { this.magicWord = magicWord; } public String go() { if (this.magicWord != null && this.magicWord.toUpperCase() .equals("BAELDUNG")) { return "pm:success"; } return "pm:failure"; } }
Java
4
zeesh49/tutorials
jsf/src/main/java/com/baeldung/springintegration/controllers/HelloPFMBean.java
[ "MIT" ]
#!/bin/csh c++ -std=c++1z ${1} -I ${ROOTSYS}/include -L ${ROOTSYS}/lib -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lTMVA -lMinuit -lXMLIO -lMLP -lTreePlayer -lz -lGui -pthread -lm -ldl mv a.out ${1}.exe
Tcsh
2
ckamtsikis/cmssw
DPGAnalysis/HcalTools/macros/rmt/compile.csh
[ "Apache-2.0" ]
import "std/test" let grandparentInitRan = false class grandParent { const init = fn() { grandparentInitRan = true } const doStuff = fn(msg) { return 'Grandparent: '+msg } } class parentPrinter ^ grandParent { let z const init = fn() { parent() this.z = "parent thing" } const doStuff = fn(msg) { return 'Parent: ' + this.z + ' Msg: ' + msg } const parentOnly = fn() { return "I'm the parent" } const doStuff2 = fn(msg) { return parent.doStuff(msg) } } class printer ^ parentPrinter { let x const t = "Thing" const init = fn(x) { parent() this.x = x } // Overloaded fntion const doStuff = fn(msg) { return 'ID: ' + toString(this.x) + ' Msg: ' + msg } const doStuff2 = fn(msg) { return parent.doStuff(msg) } const doStuff3 = fn(msg) { return parent.doStuff2(msg) } const setX = fn(x) { this.x = x } } test.run("Class inheritance", fn(assert) { let myPrinter = new printer(1) assert.isTrue(grandparentInitRan) let expected = 'ID: 1 Msg: Hello' assert.isEq(myPrinter.doStuff('Hello'), expected) // Overloaded method expected = 'parent thing' assert.isEq(myPrinter.z, expected) expected = "I'm the parent" assert.isEq(myPrinter.parentOnly(), expected) expected = 'Parent: parent thing Msg: Hello' assert.isEq(myPrinter.doStuff2('Hello'), expected) expected = 'Grandparent: Hello' assert.isEq(myPrinter.doStuff3('Hello'), expected) })
Inform 7
4
lfkeitel/nitrogen
tests/classes/parent.ni
[ "BSD-3-Clause" ]
/* * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.actuate.endpoint.web.reactive; import java.util.Collections; import java.util.Set; import org.springframework.boot.actuate.endpoint.web.EndpointMapping; import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint; import org.springframework.boot.actuate.endpoint.web.WebOperation; import org.springframework.boot.actuate.endpoint.web.WebOperationRequestPredicate; import org.springframework.boot.actuate.health.AdditionalHealthEndpointPath; import org.springframework.boot.actuate.health.HealthEndpointGroup; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.reactive.HandlerMapping; import org.springframework.web.reactive.result.method.RequestMappingInfo; /** * A custom {@link HandlerMapping} that allows health groups to be mapped to an additional * path. * * @author Madhura Bhave * @since 2.6.0 */ public class AdditionalHealthEndpointPathsWebFluxHandlerMapping extends AbstractWebFluxEndpointHandlerMapping { private final EndpointMapping endpointMapping; private final ExposableWebEndpoint endpoint; private final Set<HealthEndpointGroup> groups; public AdditionalHealthEndpointPathsWebFluxHandlerMapping(EndpointMapping endpointMapping, ExposableWebEndpoint endpoint, Set<HealthEndpointGroup> groups) { super(endpointMapping, Collections.singletonList(endpoint), null, null, false); this.endpointMapping = endpointMapping; this.groups = groups; this.endpoint = endpoint; } @Override protected void initHandlerMethods() { for (WebOperation operation : this.endpoint.getOperations()) { WebOperationRequestPredicate predicate = operation.getRequestPredicate(); String matchAllRemainingPathSegmentsVariable = predicate.getMatchAllRemainingPathSegmentsVariable(); if (matchAllRemainingPathSegmentsVariable != null) { for (HealthEndpointGroup group : this.groups) { AdditionalHealthEndpointPath additionalPath = group.getAdditionalPath(); if (additionalPath != null) { RequestMappingInfo requestMappingInfo = getRequestMappingInfo(operation, additionalPath.getValue()); registerReadMapping(requestMappingInfo, this.endpoint, operation); } } } } } private RequestMappingInfo getRequestMappingInfo(WebOperation operation, String additionalPath) { WebOperationRequestPredicate predicate = operation.getRequestPredicate(); String path = this.endpointMapping.createSubPath(additionalPath); RequestMethod method = RequestMethod.valueOf(predicate.getHttpMethod().name()); String[] consumes = StringUtils.toStringArray(predicate.getConsumes()); String[] produces = StringUtils.toStringArray(predicate.getProduces()); return RequestMappingInfo.paths(path).methods(method).consumes(consumes).produces(produces).build(); } @Override protected LinksHandler getLinksHandler() { return null; } }
Java
5
techAi007/spring-boot
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AdditionalHealthEndpointPathsWebFluxHandlerMapping.java
[ "Apache-2.0" ]
import MenuItem from '@material-ui/core/MenuItem'; import Tab from '@material-ui/core/Tab'; import { green as greenColor, red, yellow } from '@material-ui/core/colors'; import MuiTabs from '@material-ui/core/Tabs'; import TableContext from '@material-ui/core/Table/TableContext'; import SwitchBase from '@material-ui/core/internal/SwitchBase'; import Ripple from '@material-ui/core/ButtonBase/Ripple'; import { useTheme, createTheme } from '@material-ui/core/styles';
JavaScript
2
dany-freeman/material-ui
packages/mui-codemod/src/v5.0.0/optimal-imports.test/expected.js
[ "MIT" ]
#if defined __AVX512__ || defined __AVX512F__ #include <immintrin.h> void test() { __m512i a, b, c; a = _mm512_dpwssd_epi32(a, b, c); // VNNI } #else #error "AVX512-CLX is not supported" #endif int main() { return 0; }
C++
3
thisisgopalmandal/opencv
cmake/checks/cpu_avx512clx.cpp
[ "BSD-3-Clause" ]
<?xml version="1.0" encoding="UTF-8"?> <faces-config> <faces-config-extension> <namespace-uri>http://www.ibm.com/xsp/custom</namespace-uri> <default-prefix>xc</default-prefix> </faces-config-extension> <composite-component> <component-type>_layoutBS3</component-type> <composite-name>_layoutBS3</composite-name> <composite-file>/_layoutBS3.xsp</composite-file> <composite-extension> <designer-extension> <in-palette>true</in-palette> </designer-extension> </composite-extension> <property> <property-name>pageTitle</property-name> <property-class>string</property-class> </property> <property> <property-name>color</property-name> <property-class>string</property-class> </property> <property> <property-name>navbarTopInverse</property-name> <property-class>boolean</property-class> <property-extension> <designer-extension> <default-value>true</default-value> </designer-extension> </property-extension> </property> <property> <property-name>navbarBottomInverse</property-name> <property-class>boolean</property-class> <property-extension> <designer-extension> <default-value>true</default-value> </designer-extension> </property-extension> </property> <property> <property-name>hideHelpArea</property-name> <property-class>boolean</property-class> <property-extension> <designer-extension> <default-value>false</default-value> </designer-extension> </property-extension> </property> <property> <property-name>fullWidth</property-name> <property-class>boolean</property-class> <property-extension> <designer-extension> <default-value>false</default-value> </designer-extension> </property-extension> </property> <property> <property-name>hideRightColumn</property-name> <property-class>boolean</property-class> </property> <property> <property-name>hideLeftColumn</property-name> <property-class>boolean</property-class> </property> </composite-component> </faces-config>
XPages
3
zeromancer1972/XPages-JDBC
CustomControls/_layoutBS3.xsp-config
[ "Apache-2.0" ]
# this code gives the numbers of integers, floats, and strings present in the list a = ["Hello", 35, "b", 45.5, "world", 60] i = f = s = 0 for j in a: if isinstance(j, int): i = i + 1 elif isinstance(j, float): f = f + 1 else: s = s + 1 print(f"Number of integers are: {i}") print(f"Number of Floats are: {f}") print(f"numbers of strings are: {s}")
Python
3
Wish1991/Python
Differentiate_List.py
[ "MIT" ]
data Bar = MkBar data Baz = MkBaz data Vect : Nat -> Type -> Type where Nil : Vect Z a (::) : a -> Vect k a -> Vect (S k) a desc : Type -> String desc Int = "Int" desc Nat = "Nat" desc (Vect n a) = "Vector of " ++ show n ++ " " ++ desc a desc Type = "Type" desc _ = "Something else" descNat : Type -> String descNat t = "Function from Nat to " ++ desc t descFn : (x : Type) -> String descFn ((x : Nat) -> b) = descNat (b Z) descFn (a -> b) = "Function on " ++ desc a descFn x = desc x main : IO () main = do printLn (descFn (Nat -> Nat)) printLn (descFn ((x : Nat) -> Vect x Int)) printLn (descFn (Type -> Int))
Idris
4
boxfire/rapid
tests/chez/chez007/TypeCase.idr
[ "BSD-3-Clause" ]
lib LibC TCP_NODELAY = 0x01 end
Crystal
1
n00p3/crystal
src/lib_c/x86_64-openbsd/c/netinet/tcp.cr
[ "Apache-2.0" ]
// run-pass #![allow(dead_code)] const ARR: [usize; 1] = [2]; const ARR2: [i32; ARR[0]] = [5, 6]; fn main() { }
Rust
3
Eric-Arellano/rust
src/test/ui/consts/const-index-feature-gate.rs
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
--TEST-- Test array_is_list() function --FILE-- <?php function test_is_list(string $desc, $val) : void { try { printf("%s: %s\n", $desc, json_encode(array_is_list($val))); } catch (TypeError $e) { printf("%s: threw %s\n", $desc, $e->getMessage()); } } test_is_list("empty", []); test_is_list("one", [1]); test_is_list("two", [1,2]); test_is_list("three", [1,2,3]); test_is_list("four", [1,2,3,4]); test_is_list("ten", range(0, 10)); test_is_list("null", null); test_is_list("int", 123); test_is_list("float", 1.23); test_is_list("string", "string"); test_is_list("object", new stdClass()); test_is_list("true", true); test_is_list("false", false); test_is_list("string key", ["a" => 1]); test_is_list("mixed keys", [0 => 0, "a" => 1]); test_is_list("ordered keys", [0 => 0, 1 => 1]); test_is_list("shuffled keys", [1 => 0, 0 => 1]); test_is_list("skipped keys", [0 => 0, 2 => 2]); $arr = [1, 2, 3]; unset($arr[0]); test_is_list("unset first", $arr); $arr = [1, 2, 3]; unset($arr[1]); test_is_list("unset middle", $arr); $arr = [1, 2, 3]; unset($arr[2]); test_is_list("unset end", $arr); $arr = [1, "a" => "a", 2]; unset($arr["a"]); test_is_list("unset string key", $arr); $arr = [1 => 1, 0 => 0]; unset($arr[1]); test_is_list("unset into order", $arr); $arr = ["a" => 1]; unset($arr["a"]); test_is_list("unset to empty", $arr); $arr = [1, 2, 3]; $arr[] = 4; test_is_list("append implicit", $arr); $arr = [1, 2, 3]; $arr[3] = 4; test_is_list("append explicit", $arr); $arr = [1, 2, 3]; $arr[4] = 5; test_is_list("append with gap", $arr); --EXPECT-- empty: true one: true two: true three: true four: true ten: true null: threw array_is_list(): Argument #1 ($array) must be of type array, null given int: threw array_is_list(): Argument #1 ($array) must be of type array, int given float: threw array_is_list(): Argument #1 ($array) must be of type array, float given string: threw array_is_list(): Argument #1 ($array) must be of type array, string given object: threw array_is_list(): Argument #1 ($array) must be of type array, stdClass given true: threw array_is_list(): Argument #1 ($array) must be of type array, bool given false: threw array_is_list(): Argument #1 ($array) must be of type array, bool given string key: false mixed keys: false ordered keys: true shuffled keys: false skipped keys: false unset first: false unset middle: false unset end: true unset string key: true unset into order: true unset to empty: true append implicit: true append explicit: true append with gap: false
PHP
4
NathanFreeman/php-src
ext/standard/tests/general_functions/array_is_list.phpt
[ "PHP-3.01" ]
// Happy 5th birthday! // // #algofive // rotate color white sphereDetail 3 for i: 0 to 20 step 1 push rotate 10*wave(1000) scale 0.5 + 1.2*wave(10000) color white stroke 6 box F1+1 pop stroke 3 color hsv(wave(10000)*255, 200, map(F1, 0,1,0,255)) scale 2 push tile 4,4,4 sphere 0.5 end pop end
Cycript
2
marcinbiegun/creativecoding-sketches
Cyril/data/code_performance1/1.cy
[ "MIT" ]
Rebol [ title: "Required value for needs file test" ] export test-needs-file-value: 42
Rebol
2
0branch/r3
src/tests/units/files/test-needs-file-value.reb
[ "Apache-2.0" ]
# Copyright (C) 2001-2003, Parrot Foundation. # $Id$ =head1 NAME examples/pasm/cat.pasm - cat-like utility =head1 SYNOPSIS % ./parrot examples/pasm/cat.pasm =head1 DESCRIPTION Simple C<cat>-like utility to test PIO read/write. Does not use STDIO. Echoes what you type once you hit return. You'll have to Ctl-C to exit. =cut getstdin P0 getstdout P1 REDO: readline S0, P0 print S0 if S0, REDO end # Local Variables: # mode: pir # fill-column: 100 # End: # vim: expandtab shiftwidth=4 ft=pir:
Parrot Assembly
4
allisonrandal/pcc_testing
examples/pasm/cat.pasm
[ "Artistic-2.0" ]
import structs/[HashMap, ArrayList, List] import ../[Env, Process, wait, unistd, Pipe] import PipeUnix version(unix || apple) { include errno, signal errno : extern Int SIGTERM: extern Int SIGKILL: extern Int SIGSEGV: extern Int SIGABRT: extern Int WNOHANG: extern Int kill: extern func (Long, Int) signal: extern func (Int, Pointer) /** * Process implementation for *nix */ ProcessUnix: class extends Process { init: func ~unix (=args) {} /** terminate my child pid! */ terminate: func { if(pid) kill(pid, SIGTERM) } kill: func { if(pid) kill(pid, SIGKILL) } wait: func -> Int { _wait(0) } waitNoHang: func -> Int { _wait(WNOHANG) } /** * Wait for the process to end. Bad things will happen if you * haven't called `executeNoWait` before. */ _wait: func (options: Int) -> Int { status: Int result := -1 waitpid(pid, status&, options) err := errno if (status == -1) { errString := strerror(err) Exception new("Process wait(): %s" format(errString toString())) throw() } if (WIFEXITED(status)) { result = WEXITSTATUS(status) } else if(WIFSIGNALED(status)) { termSig := WTERMSIG(status) message := "Child received signal %d" format(termSig) match termSig { case SIGSEGV => message = message + " (Segmentation fault)" case SIGABRT => message = message + " (Abort)" case => // pffrt. } message = message + "\n" if (stdErr) { stdErr write(message) } else { stderr write(message) } /* if (termSig == SIGABRT) { // otherwise we'll hang "killing" println() kill() "killed!" println() } */ } if (result != -1) { // process exited? close stuff. if (stdOut != null) { stdOut close('w') } if (stdErr != null) { stdErr close('w') } } return result } /** Execute the process without waiting for it to end. You have to call `wait` manually. */ executeNoWait: func -> Long { pid = fork() if (pid == 0) { if (stdIn != null) { stdIn close('w') dup2(stdIn as PipeUnix readFD, 0) } if (stdOut != null) { stdOut close('r') dup2(stdOut as PipeUnix writeFD, 1) } if (stdErr != null) { stdErr close('r') dup2(stdErr as PipeUnix writeFD, 2) } /* amend the environment if needed */ if(env) { for(key in env getKeys()) { Env set(key, env[key], true) } } /* set a new cwd? */ if(cwd != null) { chdir(cwd as CString) } /* run the stuff. */ cArgs : CString * = gc_malloc(Pointer size * (args getSize() + 1)) for(i in 0..args getSize()) { cArgs[i] = args[i] toCString() } cArgs[args getSize()] = null // null-terminated - makes sense signal(SIGABRT, sigabrtHandler) execvp(cArgs[0], cArgs) exit(errno) // don't allow the forked process to continue if execvp fails } return pid } sigabrtHandler: static func { "Got a sigabrt" println() exit(255) } } }
ooc
5
fredrikbryntesson/launchtest
sdk/os/native/ProcessUnix.ooc
[ "MIT" ]
// @allowJs: true // @checkJs: true // @outDir: /out // @lib: es6 // @declaration: true // @filename: index.js /** @type {?} */ export const a = null; /** @type {*} */ export const b = null; /** @type {string?} */ export const c = null; /** @type {string=} */ export const d = null; /** @type {string!} */ export const e = null; /** @type {function(string, number): object} */ export const f = null; /** @type {function(new: object, string, number)} */ export const g = null; /** @type {Object.<string, number>} */ export const h = null;
TypeScript
3
monciego/TypeScript
tests/cases/conformance/jsdoc/declarations/jsDeclarationsReusesExistingNodesMappingJSDocTypes.ts
[ "Apache-2.0" ]
\documentclass{article} \usepackage[fancyhdr,pdf]{latex2man} \input{common.tex} \begin{document} \begin{Name}{3}{unw\_is\_fpreg}{David Mosberger-Tang}{Programming Library}{unw\_is\_fpreg}unw\_is\_fpreg -- check if a register is a floating-point register \end{Name} \section{Synopsis} \File{\#include $<$libunwind.h$>$}\\ \Type{int} \Func{unw\_is\_fpreg}(\Type{unw\_regnum\_t} \Var{reg});\\ \section{Description} The \Func{unw\_is\_fpreg}() routine checks whether register number \Var{reg} is a floating-point register. This routine is normally implemented as a macro and applications should not attempt to take its address. \section{Return Value} The \Func{unw\_is\_fpreg}() routine returns a non-zero value if \Var{reg} is a floating-point register. Otherwise, it returns a value of 0. \section{Thread and Signal Safety} \Func{unw\_is\_fpreg}() is thread-safe as well as safe to use from a signal handler. \section{See Also} \SeeAlso{libunwind(3)}, \SeeAlso{unw\_get\_reg(3)}, \SeeAlso{unw\_set\_reg(3)}, \SeeAlso{unw\_get\_fpreg(3)}, \SeeAlso{unw\_set\_fpreg(3)} \section{Author} \noindent David Mosberger-Tang\\ Email: \Email{dmosberger@gmail.com}\\ WWW: \URL{http://www.nongnu.org/libunwind/}. \LatexManEnd \end{document}
TeX
4
pyracanda/runtime
src/coreclr/pal/src/libunwind/doc/unw_is_fpreg.tex
[ "MIT" ]
;-----------------------------------------------------------------------------; ; Author: Stephen Fewer (stephen_fewer[at]harmonysecurity[dot]com) ; Rewritten for x64 by agix ; Compatible: Windows 7 ; Architecture: x64 ; Size: 570 bytes ; Build: >build.py stager_reverse_https ;-----------------------------------------------------------------------------; [BITS 64] [ORG 0] cld ; Clear the direction flag. and rsp, 0xFFFFFFFFFFFFFFF0 ; Ensure RSP is 16 byte aligned call start ; Call start, this pushes the address of 'api_call' onto the stack. %include "./src/block/block_api.asm" start: ; pop rbp ; pop off the address of 'api_call' for calling later. %include "./src/block/block_reverse_https.asm" ; By here we will have performed the reverse_tcp connection and EDI will be our socket
Assembly
4
OsmanDere/metasploit-framework
external/source/shellcode/windows/x64/src/stager/stager_reverse_https.asm
[ "BSD-2-Clause", "BSD-3-Clause" ]
Red [ Title: "Red MOVE test script" Author: "Nenad Rakocevic & Peter W A Wood" File: %move-test.red Tabs: 4 Rights: "Copyright (C) 2011-2015 Red Foundation. All rights reserved." License: "BSD-3 - https://github.com/red/red/blob/origin/BSD-3-License.txt" ] #include %../../../quick-test/quick-test.red ~~~start-file~~~ "move" ===start-group=== "same blocks" --test-- "move-1" list: [a b c d e] move list at list 1 --assert list = [a b c d e] --test-- "move-2" list: [a b c d e] move list at list 2 --assert list = [b a c d e] --test-- "move-3" list: [a b c d e] move list at list 3 --assert list = [b c a d e] --test-- "move-4" list: [a b c d e] move list at list 4 --assert list = [b c d a e] --test-- "move-5" list: [a b c d e] move list at list 5 --assert list = [b c d e a] --test-- "move-6" list: [a b c d e] move list at list 6 --assert list = [b c d e a] --test-- "move-7" list: [a b c d e] move list tail list --assert list = [b c d e a] --test-- "move-8" list: [a b c d e] move back tail list list --assert list = [e a b c d] --test-- "move-9" list: [a b c d e] move back back tail list at list 2 --assert list = [a d b c e] --test-- "move-10" list: [a b c d e] move/part list tail list 2 --assert list = [c d e a b] --test-- "move-11" hash: make hash! [a b c d e f g 1 2 3] hash2: skip hash 6 move hash hash2 move/part hash hash2 3 move/part hash2 hash 2 --assert 1 = hash/d --assert 'e = select hash 1 --assert 'f = hash/e --assert 'c = hash/b --assert 2 = hash/c --assert 3 = select hash 2 --test-- "issue-1905" list: [a b c d e f g] move/part list skip list 3 2 --assert list = [c d a b e f g] ===end-group=== ===start-group=== "different blocks" --test-- "move-diff-1" list1: [a b c] list2: [d e f] move list1 list2 --assert list1 = [b c] --assert list2 = [a d e f] --test-- "move-diff-2" list1: [a b c] list2: [d e f] move at list1 2 at list2 2 --assert list1 = [a c] --assert list2 = [d b e f] --test-- "move-diff-3" list1: [a b c] list2: [d e f] move list1 tail list2 --assert list1 = [b c] --assert list2 = [d e f a] --test-- "move-diff-4" list1: [a b c] list2: [d e f] move/part list1 list2 2 --assert list1 = [c] --assert list2 = [a b d e f] --test-- "move-diff-5" list1: [a b c] list2: [d e f] move/part at list1 2 at list2 2 2 --assert list1 = [a] --assert list2 = [d b c e f] --test-- "move-diff-6" list1: [a b c] list2: [d e f] move/part list1 tail list2 2 --assert list1 = [c] --assert list2 = [d e f a b] --test-- "move-diff-7" list1: [a b c] list2: [] move/part list1 tail list2 3 --assert list1 = [] --assert list2 = [a b c] --test-- "move-diff-8" hash1: make hash! [a b c d e f g 1 2 3] hash2: make hash! [x y z 7 8 9] move hash1 hash2 move/part hash1 hash2 3 move/part skip hash2 3 hash1 3 move/part skip hash1 3 skip hash2 2 3 --assert 'x = hash1/a --assert 1 = hash1/y --assert 'y = hash1/x --assert 2 = select hash1 1 --assert 'c = hash2/b --assert 'e = hash2/c --assert 'g = hash2/f --assert 7 = hash2/z --assert 8 = select hash2 7 ===end-group=== ===start-group=== "same strings" --test-- "mv-str-1" str: "abcde" move str at str 1 --assert str = "abcde" --test-- "mv-str-2" str: "abcde" move str at str 2 --assert str = "bacde" --test-- "mv-str-3" str: "abcde" move str at str 3 --assert str = "bcade" --test-- "mv-str-4" str: "abcde" move str at str 4 --assert str = "bcdae" --test-- "mv-str-5" str: "abcde" move str at str 5 --assert str = "bcdea" --test-- "mv-str-6" str: "abcde" move str at str 6 --assert str = "bcdea" --test-- "mv-str-7" str: "abcde" move str tail str --assert str = "bcdea" --test-- "mv-str-8" str: "abcde" move back tail str str --assert str = "eabcd" --test-- "mv-str-9" str: "abcde" move back back tail str at str 2 --assert str = "adbce" --test-- "mv-str-10" str: "abcde" move/part str tail str 2 --assert str = "cdeab" --test-- "issue-1905-str" str: "abcdefg" move/part str skip str 3 2 --assert str = "cdabefg" ===end-group=== ===start-group=== "different strings" --test-- "mv-str-diff-1" str1: "abc" str2: "def" move str1 str2 --assert str1 = "bc" --assert str2 = "adef" --test-- "mv-str-diff-2" str1: "abc" str2: "def" move at str1 2 at str2 2 --assert str1 = "ac" --assert str2 = "dbef" --test-- "mv-str-diff-3" str1: "abc" str2: "def" move str1 tail str2 --assert str1 = "bc" --assert str2 = "defa" --test-- "mv-str-diff-4" str1: "abc" str2: "def" move/part str1 str2 2 --assert str1 = "c" --assert str2 = "abdef" --test-- "mv-str-diff-5" str1: "abc" str2: "def" move/part at str1 2 at str2 2 2 --assert str1 = "a" --assert str2 = "dbcef" --test-- "mv-str-diff-6" str1: "abc" str2: "def" move/part str1 tail str2 2 --assert str1 = "c" --assert str2 = "defab" --test-- "mv-str-diff-7" str1: "abc" str2: "" move/part str1 tail str2 3 --assert str1 = "" --assert str2 = "abc" ===end-group=== ===start-group=== "different encodings" --test-- "mv-str-unit-1" str1: "abc" str2: "一二三" move str1 str2 --assert str1 = "bc" --assert str2 = "a一二三" --test-- "mv-str-unit-2" str1: "abc" str2: "一二三" move at str1 2 at str2 2 --assert str1 = "ac" --assert str2 = "一b二三" --test-- "mv-str-unit-3" str1: "abc" str2: "一二三" move str1 tail str2 --assert str1 = "bc" --assert str2 = "一二三a" --test-- "mv-str-unit-4" str1: "abc" str2: "一二三" move/part str1 str2 2 --assert str1 = "c" --assert str2 = "ab一二三" --test-- "mv-str-unit-5" str1: "abc" str2: "一二三" move/part at str1 2 at str2 2 2 --assert str1 = "a" --assert str2 = "一bc二三" --test-- "mv-str-unit-6" str1: "abc" str2: "一二三" move/part str1 tail str2 2 --assert str1 = "c" --assert str2 = "一二三ab" --test-- "mv-str-unit-7" str1: "一二三" str2: "" move/part str1 tail str2 3 --assert str1 = "" --assert str2 = "一二三" ===end-group=== ~~~end-file~~~
Red
5
0xflotus/red
tests/source/units/move-test.red
[ "BSL-1.0", "BSD-3-Clause" ]
/++ Auto-generated Linux syscall constants for SPARC +/ module mir.linux.arch.sparc.uapi._asm.unistd; version(LDC) pragma(LDC_no_moduleinfo); enum NR_restart_syscall = 0; enum NR_exit = 1; enum NR_fork = 2; enum NR_read = 3; enum NR_write = 4; enum NR_open = 5; enum NR_close = 6; enum NR_wait4 = 7; enum NR_creat = 8; enum NR_link = 9; enum NR_unlink = 10; enum NR_execv = 11; enum NR_chdir = 12; enum NR_chown = 13; enum NR_mknod = 14; enum NR_chmod = 15; enum NR_lchown = 16; enum NR_brk = 17; enum NR_perfctr = 18; enum NR_lseek = 19; enum NR_getpid = 20; enum NR_capget = 21; enum NR_capset = 22; enum NR_setuid = 23; enum NR_getuid = 24; enum NR_vmsplice = 25; enum NR_ptrace = 26; enum NR_alarm = 27; enum NR_sigaltstack = 28; enum NR_pause = 29; enum NR_utime = 30; enum NR_lchown32 = 31; enum NR_fchown32 = 32; enum NR_access = 33; enum NR_nice = 34; enum NR_chown32 = 35; enum NR_sync = 36; enum NR_kill = 37; enum NR_stat = 38; enum NR_sendfile = 39; enum NR_lstat = 40; enum NR_dup = 41; enum NR_pipe = 42; enum NR_times = 43; enum NR_getuid32 = 44; enum NR_umount2 = 45; enum NR_setgid = 46; enum NR_getgid = 47; enum NR_signal = 48; enum NR_geteuid = 49; enum NR_getegid = 50; enum NR_acct = 51; enum NR_getgid32 = 53; enum NR_ioctl = 54; enum NR_reboot = 55; enum NR_mmap2 = 56; enum NR_symlink = 57; enum NR_readlink = 58; enum NR_execve = 59; enum NR_umask = 60; enum NR_chroot = 61; enum NR_fstat = 62; enum NR_fstat64 = 63; enum NR_getpagesize = 64; enum NR_msync = 65; enum NR_vfork = 66; enum NR_pread64 = 67; enum NR_pwrite64 = 68; enum NR_geteuid32 = 69; enum NR_getegid32 = 70; enum NR_mmap = 71; enum NR_setreuid32 = 72; enum NR_munmap = 73; enum NR_mprotect = 74; enum NR_madvise = 75; enum NR_vhangup = 76; enum NR_truncate64 = 77; enum NR_mincore = 78; enum NR_getgroups = 79; enum NR_setgroups = 80; enum NR_getpgrp = 81; enum NR_setgroups32 = 82; enum NR_setitimer = 83; enum NR_ftruncate64 = 84; enum NR_swapon = 85; enum NR_getitimer = 86; enum NR_setuid32 = 87; enum NR_sethostname = 88; enum NR_setgid32 = 89; enum NR_dup2 = 90; enum NR_setfsuid32 = 91; enum NR_fcntl = 92; enum NR_select = 93; enum NR_setfsgid32 = 94; enum NR_fsync = 95; enum NR_setpriority = 96; enum NR_socket = 97; enum NR_connect = 98; enum NR_accept = 99; enum NR_getpriority = 100; enum NR_rt_sigreturn = 101; enum NR_rt_sigaction = 102; enum NR_rt_sigprocmask = 103; enum NR_rt_sigpending = 104; enum NR_rt_sigtimedwait = 105; enum NR_rt_sigqueueinfo = 106; enum NR_rt_sigsuspend = 107; enum NR_setresuid32 = 108; enum NR_getresuid32 = 109; enum NR_setresgid32 = 110; enum NR_getresgid32 = 111; enum NR_setregid32 = 112; enum NR_recvmsg = 113; enum NR_sendmsg = 114; enum NR_getgroups32 = 115; enum NR_gettimeofday = 116; enum NR_getrusage = 117; enum NR_getsockopt = 118; enum NR_getcwd = 119; enum NR_readv = 120; enum NR_writev = 121; enum NR_settimeofday = 122; enum NR_fchown = 123; enum NR_fchmod = 124; enum NR_recvfrom = 125; enum NR_setreuid = 126; enum NR_setregid = 127; enum NR_rename = 128; enum NR_truncate = 129; enum NR_ftruncate = 130; enum NR_flock = 131; enum NR_lstat64 = 132; enum NR_sendto = 133; enum NR_shutdown = 134; enum NR_socketpair = 135; enum NR_mkdir = 136; enum NR_rmdir = 137; enum NR_utimes = 138; enum NR_stat64 = 139; enum NR_sendfile64 = 140; enum NR_getpeername = 141; enum NR_futex = 142; enum NR_gettid = 143; enum NR_getrlimit = 144; enum NR_setrlimit = 145; enum NR_pivot_root = 146; enum NR_prctl = 147; enum NR_pciconfig_read = 148; enum NR_pciconfig_write = 149; enum NR_getsockname = 150; enum NR_inotify_init = 151; enum NR_inotify_add_watch = 152; enum NR_poll = 153; enum NR_getdents64 = 154; enum NR_fcntl64 = 155; enum NR_inotify_rm_watch = 156; enum NR_statfs = 157; enum NR_fstatfs = 158; enum NR_umount = 159; enum NR_sched_set_affinity = 160; enum NR_sched_get_affinity = 161; enum NR_getdomainname = 162; enum NR_setdomainname = 163; enum NR_quotactl = 165; enum NR_set_tid_address = 166; enum NR_mount = 167; enum NR_ustat = 168; enum NR_setxattr = 169; enum NR_lsetxattr = 170; enum NR_fsetxattr = 171; enum NR_getxattr = 172; enum NR_lgetxattr = 173; enum NR_getdents = 174; enum NR_setsid = 175; enum NR_fchdir = 176; enum NR_fgetxattr = 177; enum NR_listxattr = 178; enum NR_llistxattr = 179; enum NR_flistxattr = 180; enum NR_removexattr = 181; enum NR_lremovexattr = 182; enum NR_sigpending = 183; enum NR_query_module = 184; enum NR_setpgid = 185; enum NR_fremovexattr = 186; enum NR_tkill = 187; enum NR_exit_group = 188; enum NR_uname = 189; enum NR_init_module = 190; enum NR_personality = 191; enum NR_remap_file_pages = 192; enum NR_epoll_create = 193; enum NR_epoll_ctl = 194; enum NR_epoll_wait = 195; enum NR_ioprio_set = 196; enum NR_getppid = 197; enum NR_sigaction = 198; enum NR_sgetmask = 199; enum NR_ssetmask = 200; enum NR_sigsuspend = 201; enum NR_oldlstat = 202; enum NR_uselib = 203; enum NR_readdir = 204; enum NR_readahead = 205; enum NR_socketcall = 206; enum NR_syslog = 207; enum NR_lookup_dcookie = 208; enum NR_fadvise64 = 209; enum NR_fadvise64_64 = 210; enum NR_tgkill = 211; enum NR_waitpid = 212; enum NR_swapoff = 213; enum NR_sysinfo = 214; enum NR_ipc = 215; enum NR_sigreturn = 216; enum NR_clone = 217; enum NR_ioprio_get = 218; enum NR_adjtimex = 219; enum NR_sigprocmask = 220; enum NR_create_module = 221; enum NR_delete_module = 222; enum NR_get_kernel_syms = 223; enum NR_getpgid = 224; enum NR_bdflush = 225; enum NR_sysfs = 226; enum NR_afs_syscall = 227; enum NR_setfsuid = 228; enum NR_setfsgid = 229; enum NR__newselect = 230; enum NR_time = 231; enum NR_splice = 232; enum NR_stime = 233; enum NR_statfs64 = 234; enum NR_fstatfs64 = 235; enum NR__llseek = 236; enum NR_mlock = 237; enum NR_munlock = 238; enum NR_mlockall = 239; enum NR_munlockall = 240; enum NR_sched_setparam = 241; enum NR_sched_getparam = 242; enum NR_sched_setscheduler = 243; enum NR_sched_getscheduler = 244; enum NR_sched_yield = 245; enum NR_sched_get_priority_max = 246; enum NR_sched_get_priority_min = 247; enum NR_sched_rr_get_interval = 248; enum NR_nanosleep = 249; enum NR_mremap = 250; enum NR__sysctl = 251; enum NR_getsid = 252; enum NR_fdatasync = 253; enum NR_nfsservctl = 254; enum NR_sync_file_range = 255; enum NR_clock_settime = 256; enum NR_clock_gettime = 257; enum NR_clock_getres = 258; enum NR_clock_nanosleep = 259; enum NR_sched_getaffinity = 260; enum NR_sched_setaffinity = 261; enum NR_timer_settime = 262; enum NR_timer_gettime = 263; enum NR_timer_getoverrun = 264; enum NR_timer_delete = 265; enum NR_timer_create = 266; enum NR_vserver = 267; enum NR_io_setup = 268; enum NR_io_destroy = 269; enum NR_io_submit = 270; enum NR_io_cancel = 271; enum NR_io_getevents = 272; enum NR_mq_open = 273; enum NR_mq_unlink = 274; enum NR_mq_timedsend = 275; enum NR_mq_timedreceive = 276; enum NR_mq_notify = 277; enum NR_mq_getsetattr = 278; enum NR_waitid = 279; enum NR_tee = 280; enum NR_add_key = 281; enum NR_request_key = 282; enum NR_keyctl = 283; enum NR_openat = 284; enum NR_mkdirat = 285; enum NR_mknodat = 286; enum NR_fchownat = 287; enum NR_futimesat = 288; enum NR_fstatat64 = 289; enum NR_unlinkat = 290; enum NR_renameat = 291; enum NR_linkat = 292; enum NR_symlinkat = 293; enum NR_readlinkat = 294; enum NR_fchmodat = 295; enum NR_faccessat = 296; enum NR_pselect6 = 297; enum NR_ppoll = 298; enum NR_unshare = 299; enum NR_set_robust_list = 300; enum NR_get_robust_list = 301; enum NR_migrate_pages = 302; enum NR_mbind = 303; enum NR_get_mempolicy = 304; enum NR_set_mempolicy = 305; enum NR_kexec_load = 306; enum NR_move_pages = 307; enum NR_getcpu = 308; enum NR_epoll_pwait = 309; enum NR_utimensat = 310; enum NR_signalfd = 311; enum NR_timerfd_create = 312; enum NR_eventfd = 313; enum NR_fallocate = 314; enum NR_timerfd_settime = 315; enum NR_timerfd_gettime = 316; enum NR_signalfd4 = 317; enum NR_eventfd2 = 318; enum NR_epoll_create1 = 319; enum NR_dup3 = 320; enum NR_pipe2 = 321; enum NR_inotify_init1 = 322; enum NR_accept4 = 323; enum NR_preadv = 324; enum NR_pwritev = 325; enum NR_rt_tgsigqueueinfo = 326; enum NR_perf_event_open = 327; enum NR_recvmmsg = 328; enum NR_fanotify_init = 329; enum NR_fanotify_mark = 330; enum NR_prlimit64 = 331; enum NR_name_to_handle_at = 332; enum NR_open_by_handle_at = 333; enum NR_clock_adjtime = 334; enum NR_syncfs = 335; enum NR_sendmmsg = 336; enum NR_setns = 337; enum NR_process_vm_readv = 338; enum NR_process_vm_writev = 339; enum NR_kern_features = 340; enum NR_kcmp = 341; enum NR_finit_module = 342; enum NR_sched_setattr = 343; enum NR_sched_getattr = 344; enum NR_renameat2 = 345; enum NR_seccomp = 346; enum NR_getrandom = 347; enum NR_memfd_create = 348; enum NR_bpf = 349; enum NR_execveat = 350; enum NR_membarrier = 351; enum NR_userfaultfd = 352; enum NR_bind = 353; enum NR_listen = 354; enum NR_setsockopt = 355; enum NR_mlock2 = 356; enum NR_copy_file_range = 357; enum NR_preadv2 = 358; enum NR_pwritev2 = 359; enum NR_statx = 360; enum NR_io_pgetevents = 361; enum NR_pkey_mprotect = 362; enum NR_pkey_alloc = 363; enum NR_pkey_free = 364; enum NR_rseq = 365; enum NR_semget = 393; enum NR_semctl = 394; enum NR_shmget = 395; enum NR_shmctl = 396; enum NR_shmat = 397; enum NR_shmdt = 398; enum NR_msgget = 399; enum NR_msgsnd = 400; enum NR_msgrcv = 401; enum NR_msgctl = 402; enum NR_clock_gettime64 = 403; enum NR_clock_settime64 = 404; enum NR_clock_adjtime64 = 405; enum NR_clock_getres_time64 = 406; enum NR_clock_nanosleep_time64 = 407; enum NR_timer_gettime64 = 408; enum NR_timer_settime64 = 409; enum NR_timerfd_gettime64 = 410; enum NR_timerfd_settime64 = 411; enum NR_utimensat_time64 = 412; enum NR_pselect6_time64 = 413; enum NR_ppoll_time64 = 414; enum NR_io_pgetevents_time64 = 416; enum NR_recvmmsg_time64 = 417; enum NR_mq_timedsend_time64 = 418; enum NR_mq_timedreceive_time64 = 419; enum NR_semtimedop_time64 = 420; enum NR_rt_sigtimedwait_time64 = 421; enum NR_futex_time64 = 422; enum NR_sched_rr_get_interval_time64 = 423; enum NR_pidfd_send_signal = 424; enum NR_io_uring_setup = 425; enum NR_io_uring_enter = 426; enum NR_io_uring_register = 427; enum NR_open_tree = 428; enum NR_move_mount = 429; enum NR_fsopen = 430; enum NR_fsconfig = 431; enum NR_fsmount = 432; enum NR_fspick = 433; enum NR_pidfd_open = 434; enum NR_close_range = 436; enum NR_openat2 = 437; enum NR_pidfd_getfd = 438; enum NR_faccessat2 = 439; enum NR_process_madvise = 440; enum NR_epoll_pwait2 = 441; enum NR_mount_setattr = 442; enum NR_quotactl_fd = 443; enum NR_landlock_create_ruleset = 444; enum NR_landlock_add_rule = 445; enum NR_landlock_restrict_self = 446; enum NR_process_mrelease = 448;
D
3
libmir/mir-linux-kernel
source/mir/linux/arch/sparc/uapi/_asm/unistd.di
[ "BSL-1.0" ]
// SuperCollider Examples //boot server s.boot; // SC as system for sound synthesis and sound processing // patching synth moduls by writing synth defs: ( SynthDef("mod", { var sig, resfreq; sig = Saw.ar(100); resfreq = SinOsc.kr(2) * 200 + 500; sig = RLPF.ar(sig, resfreq, 0.1); sig = sig * 0.3; Out.ar(0, sig); }).play; ) // SuperCollider: a powerful expressive DSP language: ( 30.do { arg i; { Pan2.ar( SinOsc.ar(exprand(100.0, 3000.0) * LFNoise2.kr(rrand(0.1, 0.2)).range(0.95, 1.1), 0, LFNoise2.kr(rrand(0.3, 0.7)).range(0,0.5) ** 4), 1.0.rand2) }.play } ) // plot envelopes a = Env.perc(0.05, 1, 1, -4); b = a.delay(2); a.test.plot; b.test.plot; a = Env([0.5, 1, 0], [1, 1]).plot; a.delay(1).plot; // examples asStream function ( { e = Env.sine.asStream; 5.do({     e.next.postln;     0.25.wait; })}.fork )
SuperCollider
4
JavascriptID/sourcerer-app
src/test/resources/samples/langs/SuperCollider/example.scd
[ "MIT" ]
const path = require(`path`) const fs = require(`fs-extra`) const mime = require(`mime`) const prettyBytes = require(`pretty-bytes`) const md5File = require(`md5-file`) const { createContentDigest, slash } = require(`gatsby-core-utils`) exports.createFileNode = async ( pathToFile, createNodeId, pluginOptions = {} ) => { const slashed = slash(pathToFile) const parsedSlashed = path.parse(slashed) const slashedFile = { ...parsedSlashed, absolutePath: slashed, // Useful for limiting graphql query with certain parent directory relativeDirectory: slash( path.relative(pluginOptions.path || process.cwd(), parsedSlashed.dir) ), } const stats = await fs.stat(slashedFile.absolutePath) let internal if (stats.isDirectory()) { const contentDigest = createContentDigest({ stats: stats, absolutePath: slashedFile.absolutePath, }) internal = { contentDigest, type: `Directory`, description: `Directory "${path.relative(process.cwd(), slashed)}"`, } } else { const contentDigest = await md5File(slashedFile.absolutePath) const mediaType = mime.getType(slashedFile.ext) internal = { contentDigest, type: `File`, mediaType: mediaType ? mediaType : `application/octet-stream`, description: `File "${path.relative(process.cwd(), slashed)}"`, } } return { // Don't actually make the File id the absolute path as otherwise // people will use the id for that and ids shouldn't be treated as // useful information. id: createNodeId(pathToFile), children: [], parent: null, internal, sourceInstanceName: pluginOptions.name || `__PROGRAMMATIC__`, relativePath: slash( path.relative( pluginOptions.path || process.cwd(), slashedFile.absolutePath ) ), extension: slashedFile.ext.slice(1).toLowerCase(), prettySize: prettyBytes(stats.size), modifiedTime: stats.mtime.toJSON(), accessTime: stats.atime.toJSON(), changeTime: stats.ctime.toJSON(), birthTime: stats.birthtime.toJSON(), // Note: deprecate splatting the slashedFile object // Note: the object may contain different properties depending on File or Dir ...slashedFile, // TODO: deprecate copying the entire object // Note: not splatting for perf reasons (make sure Date objects are serialized) dev: stats.dev, mode: stats.mode, nlink: stats.nlink, uid: stats.uid, rdev: stats.rdev, blksize: stats.blksize, ino: stats.ino, size: stats.size, blocks: stats.blocks, atimeMs: stats.atimeMs, mtimeMs: stats.mtimeMs, ctimeMs: stats.ctimeMs, birthtimeMs: stats.birthtimeMs, atime: stats.atime.toJSON(), mtime: stats.mtime.toJSON(), ctime: stats.ctime.toJSON(), birthtime: stats.birthtime.toJSON(), } }
JavaScript
4
pipaliyajaydip/gatsby
packages/gatsby-source-filesystem/src/create-file-node.js
[ "MIT" ]
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. #If DEBUG Then ' See comment in DefiniteAssignment. #Const REFERENCE_STATE = True #End If Namespace Microsoft.CodeAnalysis.VisualBasic ''' <summary> ''' A region analysis walker that computes the set of variables that are definitely assigned ''' when a region is entered. ''' </summary> Friend Class DefinitelyAssignedWalker Inherits AbstractRegionDataFlowPass Private ReadOnly _definitelyAssignedOnEntry As New HashSet(Of Symbol)() Private ReadOnly _definitelyAssignedOnExit As New HashSet(Of Symbol)() Private Sub New(info As FlowAnalysisInfo, region As FlowAnalysisRegionInfo) MyBase.New(info, region) End Sub Friend Overloads Shared Function Analyze(info As FlowAnalysisInfo, region As FlowAnalysisRegionInfo) As (entry As HashSet(Of Symbol), ex As HashSet(Of Symbol)) Dim walker = New DefinitelyAssignedWalker(info, region) Try Dim success = walker.Analyze() Return If(success, (walker._definitelyAssignedOnEntry, walker._definitelyAssignedOnExit), (New HashSet(Of Symbol), New HashSet(Of Symbol))) Finally walker.Free() End Try End Function Protected Overrides Sub EnterRegion() ProcessRegion(_definitelyAssignedOnEntry) MyBase.EnterRegion() End Sub Protected Overrides Sub LeaveRegion() ProcessRegion(_definitelyAssignedOnExit) MyBase.LeaveRegion() End Sub Private Sub ProcessRegion(definitelyAssigned As HashSet(Of Symbol)) ' this can happen multiple times as flow analysis Is multi-pass. Always ' take the latest data And use that to determine our result. definitelyAssigned.Clear() If Me.IsConditionalState Then ' We're in a state where there are different flow paths (i.e. when-true and when-false). ' In that case, a variable Is only definitely assigned if it's definitely assigned through ' both paths. Me.ProcessState(definitelyAssigned, Me.StateWhenTrue, Me.StateWhenFalse) Else Me.ProcessState(definitelyAssigned, Me.State, state2opt:=Nothing) End If End Sub #If REFERENCE_STATE Then Private Sub ProcessState(definitelyAssigned As HashSet(Of Symbol), state1 As LocalState, state2opt As LocalState) #Else Private Sub ProcessState(definitelyAssigned As HashSet(Of Symbol), state1 As LocalState, state2opt As LocalState?) #End If For Each slot In state1.Assigned.TrueBits() If slot < variableBySlot.Length Then #If REFERENCE_STATE Then If state2opt Is Nothing OrElse state2opt.IsAssigned(slot) Then #Else If state2opt Is Nothing OrElse state2opt.Value.IsAssigned(slot) Then #End If Dim symbol = variableBySlot(slot).Symbol If symbol IsNot Nothing AndAlso symbol.Kind <> SymbolKind.Field Then definitelyAssigned.Add(symbol) End If End If End If Next End Sub End Class End Namespace
Visual Basic
5
ffMathy/roslyn
src/Compilers/VisualBasic/Portable/Analysis/FlowAnalysis/DefinitelyAssignedWalker.vb
[ "MIT" ]
#include <gtest/gtest.h> namespace caffe2 { namespace { TEST(ContextTest, BasicInit) { } } // namespace } // namespace caffe2
C++
3
Hacky-DH/pytorch
caffe2/contrib/opencl/context_test.cc
[ "Intel" ]
#tag Class Protected Class SKProduct Inherits NSObject #tag Method, Flags = &h21 Private Shared Function ClassRef() As Ptr static ref as ptr = NSClassFromString("SKProduct") return ref End Function #tag EndMethod #tag ComputedProperty, Flags = &h0 #tag Getter Get declare function downloadable_ lib StoreKitLib selector "isDownloadable" (obj_id as ptr) as Boolean Return downloadable_(self) End Get #tag EndGetter downloadable As Boolean #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get declare function downloadContentLengths_ lib StoreKitLib selector "downloadContentLengths" (obj_id as ptr) as ptr Return new NSArray(downloadContentLengths_(self)) End Get #tag EndGetter downloadContentLengths As NSArray #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get declare function downloadContentVersion_ lib StoreKitLib selector "downloadContentVersion" (obj_id as ptr) as CFStringRef Return downloadContentVersion_(self) End Get #tag EndGetter downloadContentVersion As Text #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get declare function localizedDescription_ lib StoreKitLib selector "localizedDescription" (obj_id as ptr) as CFStringRef Return localizedDescription_(self) End Get #tag EndGetter localizedDescription As Text #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get declare function localizedTitle_ lib StoreKitLib selector "localizedTitle" (obj_id as ptr) as CFStringRef Return localizedTitle_(self) End Get #tag EndGetter localizedTitle As Text #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get declare function price_ lib StoreKitLib selector "price" (obj_id as ptr) as ptr declare function doubleValue lib StoreKitLib selector "doubleValue" (obj_id as ptr) as Double Return doubleValue(price_(self)) End Get #tag EndGetter price As Double #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get declare function priceLocale_ lib StoreKitLib selector "priceLocale" (obj_id as ptr) as ptr declare function identifier_ lib FoundationLib selector "identifier" (ref as ptr) as CFStringRef dim localePtr As Ptr = priceLocale_(self) Dim identifier As Text = identifier_(localePtr) Return new xojo.core.Locale(identifier) End Get #tag EndGetter PriceLocale As xojo.core.locale #tag EndComputedProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get declare function productIdentifier_ lib StoreKitLib selector "productIdentifier" (obj_id as ptr) as CFStringRef Return productIdentifier_(self) End Get #tag EndGetter productIdentifier As Text #tag EndComputedProperty #tag ViewBehavior #tag ViewProperty Name="downloadable" Visible=false Group="Behavior" InitialValue="" Type="Boolean" EditorType="" #tag EndViewProperty #tag ViewProperty Name="downloadContentVersion" Visible=false Group="Behavior" InitialValue="" Type="Text" EditorType="" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" EditorType="" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" Type="Integer" EditorType="" #tag EndViewProperty #tag ViewProperty Name="localizedDescription" Visible=false Group="Behavior" InitialValue="" Type="Text" EditorType="" #tag EndViewProperty #tag ViewProperty Name="localizedTitle" Visible=false Group="Behavior" InitialValue="" Type="Text" EditorType="" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InitialValue="" Type="String" EditorType="" #tag EndViewProperty #tag ViewProperty Name="price" Visible=false Group="Behavior" InitialValue="" Type="Double" EditorType="" #tag EndViewProperty #tag ViewProperty Name="productIdentifier" Visible=false Group="Behavior" InitialValue="" Type="Text" EditorType="" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InitialValue="" Type="String" EditorType="" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" Type="Integer" EditorType="" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
Xojo
4
kingj5/iOSKit
Modules/StoreKit/SKProduct.xojo_code
[ "MIT" ]
extends /templates/core/modal-base block modal-header-content .clearfix .text-center h2.modal-title(data-i18n="courses.greetings") h3(data-i18n="choose_hero.programming_language_description") block modal-body-content #choice-area.text-center button.lang-choice-btn.btn.btn-success.btn-lg(data-language='python') img(src="/images/common/code_languages/python_small.png") span.spl Python p(data-i18n="choose_hero.python_blurb") button.lang-choice-btn.btn.btn-default(data-language='javascript') img(src="/images/common/code_languages/javascript_small.png") span.spl JavaScript p(data-i18n="choose_hero.javascript_blurb") #saving-progress.progress.progress-striped.active.hide .progress-bar(style="width: 100%") block modal-footer-content
Jade
4
cihatislamdede/codecombat
app/templates/courses/choose-language-modal.jade
[ "CC-BY-4.0", "MIT" ]
// run-pass #![allow(illegal_floating_point_literal_pattern)] // FIXME #41620 #![feature(exclusive_range_pattern)] pub fn main() { match 5_usize { 1_usize..=5_usize => {} _ => panic!("should match range"), } match 1_usize { 1_usize..5_usize => {} _ => panic!("should match range start"), } match 5_usize { 6_usize..=7_usize => panic!("shouldn't match range"), _ => {} } match 7_usize { 6_usize..7_usize => panic!("shouldn't match range end"), _ => {}, } match 5_usize { 1_usize => panic!("should match non-first range"), 2_usize..=6_usize => {} _ => panic!("math is broken") } match 'c' { 'a'..='z' => {} _ => panic!("should support char ranges") } match -3 { -7..=5 => {} _ => panic!("should match signed range") } match 3.0f64 { 1.0..=5.0 => {} _ => panic!("should match float range") } match -1.5f64 { -3.6..=3.6 => {} _ => panic!("should match negative float range") } match 3.5 { 0.0..3.5 => panic!("should not match the range end"), _ => {}, } match 0.0 { 0.0..3.5 => {}, _ => panic!("should match the range start"), } }
Rust
4
Eric-Arellano/rust
src/test/ui/binding/match-range.rs
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
module DurationTests exposing (all, start) import Duration exposing (Duration) import Expect exposing (..) import Test exposing (..) import Time start : Int start = 10 * 1000 second : Int second = 1 * 1000 minute : Int minute = 60 * 1000 hour : Int hour = 60 * 60 * 1000 all : Test all = describe "Duration" [ describe "formatting" [ test "seconds difference" <| \_ -> Expect.equal "1s" (Duration.format <| Duration.between (Time.millisToPosix start) (Time.millisToPosix (start + second))) , test "minutes difference" <| \_ -> Expect.equal "1m 2s" (Duration.format <| Duration.between (Time.millisToPosix start) (Time.millisToPosix (start + minute + (2 * second)))) , test "hours difference" <| \_ -> Expect.equal "1h 2m" (Duration.format <| Duration.between (Time.millisToPosix start) (Time.millisToPosix (start + hour + (2 * minute) + (3 * second)))) , test "days difference" <| \_ -> Expect.equal "1d 2h" (Duration.format <| Duration.between (Time.millisToPosix start) (Time.millisToPosix (start + (26 * hour) + (3 * minute) + (4 * second)))) ] ]
Elm
4
Caprowni/concourse
web/elm/tests/DurationTests.elm
[ "Apache-2.0" ]
Unit LazComLib_1_0_TLB; // Imported LazComLib on 19/11/2014 15:59:16 from D:\_development\Lazarus\LazComDll\LazComDll.tlb {$mode delphi}{$H+} interface Uses Windows,ActiveX,Classes,Variants; Const LazComLibMajorVersion = 1; LazComLibMinorVersion = 0; LazComLibLCID = 0; LIBID_LazComLib : TGUID = '{570A55B0-1122-49AE-A335-1F630EC4FE65}'; IID_ILazCom : TGUID = '{247EAD48-16D6-4C1C-9265-F841BF4BD411}'; CLASS_LazComCoClass : TGUID = '{93E11168-E984-415C-ACD6-853226D22CF9}'; //Enums //Forward declarations Type ILazCom = interface; ILazComDisp = dispinterface; //Map CoClass to its default interface LazComCoClass = ILazCom; //records, unions, aliases //interface declarations // ILazCom : ILazCom = interface(IDispatch) ['{247EAD48-16D6-4C1C-9265-F841BF4BD411}'] // LazComMethod : procedure LazComMethod;safecall; end; // ILazCom : ILazComDisp = dispinterface ['{247EAD48-16D6-4C1C-9265-F841BF4BD411}'] // LazComMethod : procedure LazComMethod;dispid 201; end; //CoClasses CoLazComCoClass = Class Public Class Function Create: ILazCom; Class Function CreateRemote(const MachineName: string): ILazCom; end; implementation uses comobj; Class Function CoLazComCoClass.Create: ILazCom; begin Result := CreateComObject(CLASS_LazComCoClass) as ILazCom; end; Class Function CoLazComCoClass.CreateRemote(const MachineName: string): ILazCom; begin Result := CreateRemoteComObject(MachineName,CLASS_LazComCoClass) as ILazCom; end; end.
Pascal
4
gammy55/linguist
samples/Pascal/lazcomlib_1_0_tlb.pas
[ "MIT" ]
--TEST-- Test escapeshellcmd() allowed argument length --FILE-- <?php ini_set('memory_limit', -1); $var_2 = str_repeat('A', 1024*1024*64); escapeshellcmd($var_2); ?> ===DONE=== --EXPECTF-- Fatal error: escapeshellcmd(): Command exceeds the allowed length of %d bytes in %s on line %d
PHP
3
thiagooak/php-src
ext/standard/tests/general_functions/escapeshellcmd_bug71270.phpt
[ "PHP-3.01" ]
--TEST-- static type cannot take part in an intersection type --FILE-- <?php class A { public function foo(): static&Iterator {} } ?> --EXPECTF-- Fatal error: Type static cannot be part of an intersection type in %s on line %d
PHP
3
NathanFreeman/php-src
Zend/tests/type_declarations/intersection_types/invalid_types/invalid_static_type.phpt
[ "PHP-3.01" ]
GET /api/v1/transactions/4957744b3ac54434b8270f2c854cc1040228c82ea4e72d66d2887a4d3e30b317 HTTP/1.1 Host: example.com
HTTP
1
jaromil/bigchaindb
docs/root/source/installation/api/http-samples/get-tx-id-request.http
[ "Apache-2.0" ]
lexer grammar t027eof; options { language=JavaScript; } END: '\u0000'; SPACE: ' ';
G-code
3
DanielMabadeje/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials
java/java2py/antlr-3.1.3/runtime/JavaScript/tests/functional/t027eof.g
[ "Apache-2.0" ]
static const q15_t in_com1[300] = { 0xD108, 0x3B5A, 0xF106, 0x2062, 0x4CFA, 0x1DB6, 0xE285, 0xB149, 0xBFC4, 0x2FB7, 0x0A15, 0x07C6, 0x225C, 0xCBC8, 0x11A0, 0x11FB, 0x28A3, 0x5478, 0x5D02, 0xD113, 0xD59C, 0x0487, 0xD0DB, 0x5322, 0xFCE5, 0x26BC, 0x4F8A, 0x09F3, 0xFD2E, 0xBC11, 0xC38F, 0xF0DD, 0x0DBA, 0xDFE9, 0xA087, 0xF159, 0xE146, 0x64B3, 0x07CE, 0xFF13, 0x307B, 0xDAD3, 0xD9CB, 0xEAA0, 0xEDCF, 0x2ED7, 0xE00B, 0x0DD3, 0xFAF1, 0xE772, 0xD4A9, 0x0C94, 0xEECC, 0x319E, 0x048A, 0x28B6, 0x0410, 0xD088, 0xD384, 0x139F, 0x4AB0, 0xCE25, 0xF525, 0xA03C, 0x041C, 0x56CC, 0x04EA, 0xFDC2, 0xEE8B, 0x3ABA, 0xEC7E, 0x1533, 0xC6FD, 0xE96A, 0xDF8E, 0x03A9, 0x208A, 0xD8A9, 0x2976, 0x4ABC, 0xF952, 0x59ED, 0x09DB, 0xB5F0, 0x0843, 0xC59A, 0xF10E, 0x045A, 0x1B38, 0xAD56, 0xF24D, 0x6042, 0xFE9C, 0x71BD, 0x6007, 0xADC1, 0xECC3, 0x1A71, 0xD5BB, 0xE3F6, 0x1701, 0xA442, 0x3010, 0x48FF, 0xD3FB, 0xEAEE, 0xF36A, 0xF228, 0xE4C9, 0x2C64, 0x2106, 0x489B, 0x30F4, 0xFB7E, 0x1C9C, 0xFE15, 0xC6A3, 0x9A99, 0x2BFD, 0x1D63, 0x3AA5, 0xFB34, 0xED3A, 0x0C5A, 0xF2FE, 0xDAB4, 0xCA4C, 0xFB7B, 0xFEBF, 0xF61A, 0x065E, 0x1303, 0xEE8E, 0x2292, 0xD594, 0x3689, 0xDC1F, 0x435A, 0x0F90, 0xCDB1, 0xDC2E, 0xA1EC, 0x34DB, 0xCF6E, 0x152F, 0x1797, 0xFB0C, 0x4785, 0xD4D8, 0xD7C9, 0x5B3A, 0x0747, 0xF654, 0x1C4D, 0x3B65, 0x0C53, 0xFF66, 0x079A, 0xEC38, 0x362A, 0x2618, 0xB6F0, 0x29F4, 0xF139, 0xEC87, 0x8000, 0xD4C4, 0x1F85, 0x098B, 0xCDA9, 0xC63F, 0x39AE, 0x0149, 0xDD87, 0xFAE0, 0xF51B, 0x389E, 0x0FB6, 0x05BE, 0xFDBB, 0xF30E, 0xDE64, 0x0057, 0x2F2B, 0x1B6C, 0x0739, 0x2EBB, 0x1909, 0xE0AF, 0xBA2C, 0x0131, 0xE31F, 0x08B0, 0x0E16, 0xD458, 0x1568, 0xD2CB, 0xE30C, 0xB568, 0xF760, 0xF404, 0x4622, 0xB9B9, 0x22FC, 0x0651, 0xB710, 0x15F4, 0x1ABA, 0x164F, 0xD45A, 0xF31B, 0x4CD9, 0x1163, 0x3D5B, 0xBC88, 0xCD7F, 0x18FA, 0x1182, 0x239A, 0x1295, 0x11E0, 0xC558, 0x0E11, 0xE018, 0xFD3C, 0xFC85, 0x3C98, 0x1C74, 0x2855, 0xEBDF, 0x1F2A, 0x2792, 0x0AAE, 0xFBD1, 0x2688, 0x07B1, 0xE9AD, 0xEDE5, 0xF01B, 0x280F, 0xD21B, 0xF470, 0x07FB, 0xD815, 0xFEB7, 0x2289, 0xDEE4, 0x000D, 0x0AE1, 0x2077, 0x2786, 0x0691, 0x231C, 0xC636, 0xCDC0, 0x3721, 0x3A78, 0x02E4, 0x1238, 0x1617, 0xF2BE, 0x429A, 0xED31, 0x3A2E, 0xFE1B, 0x0459, 0x47C0, 0xD4F7, 0xF7E0, 0xCAA9, 0x3120, 0x6F8D, 0x2032, 0x2A50, 0xA63B, 0x0444, 0x0C37, 0xACA3, 0x4D9D, 0xEC51, 0xFCA4, 0xE824, 0x00CB, 0x5CA4, 0xEEC7, 0x12D1, 0xF44F, 0x4AA4, 0xF5EF, 0xC3E9, 0xC075, 0xE5CD, 0x1771, 0x648B, 0x0D0B, 0xD580, 0xE39C, 0xEBBF, 0xE354, 0x1155 }; static const q15_t in_com2[300] = { 0x2EF8, 0x3B5A, 0x0EFA, 0x2062, 0x4CFA, 0x1DB6, 0x1D7B, 0x4EB7, 0x403C, 0x2FB7, 0x0A15, 0x07C6, 0x225C, 0x3438, 0x11A0, 0x11FB, 0x28A3, 0x5478, 0x5D02, 0x2EED, 0x2A64, 0x0487, 0x2F25, 0x5322, 0x031B, 0x26BC, 0x4F8A, 0x09F3, 0x02D2, 0x43EF, 0x3C71, 0x0F23, 0x0DBA, 0x2017, 0x5F79, 0x0EA7, 0x1EBA, 0x64B3, 0x07CE, 0x00ED, 0x307B, 0x252D, 0x2635, 0x1560, 0x1231, 0x2ED7, 0x1FF5, 0x0DD3, 0x050F, 0x188E, 0x2B57, 0x0C94, 0x1134, 0x319E, 0x048A, 0x28B6, 0x0410, 0x2F78, 0x2C7C, 0x139F, 0x4AB0, 0x31DB, 0x0ADB, 0x5FC4, 0x041C, 0x56CC, 0x04EA, 0x023E, 0x1175, 0x3ABA, 0x1382, 0x1533, 0x3903, 0x1696, 0x2072, 0x03A9, 0x208A, 0x2757, 0x2976, 0x4ABC, 0x06AE, 0x59ED, 0x09DB, 0x4A10, 0x0843, 0x3A66, 0x0EF2, 0x045A, 0x1B38, 0x52AA, 0x0DB3, 0x6042, 0x0164, 0x71BD, 0x6007, 0x523F, 0x133D, 0x1A71, 0x2A45, 0x1C0A, 0x1701, 0x5BBE, 0x3010, 0x48FF, 0x2C05, 0x1512, 0x0C96, 0x0DD8, 0x1B37, 0x2C64, 0x2106, 0x489B, 0x30F4, 0x0482, 0x1C9C, 0x01EB, 0x395D, 0x6567, 0x2BFD, 0x1D63, 0x3AA5, 0x04CC, 0x12C6, 0x0C5A, 0x0D02, 0x254C, 0x35B4, 0x0485, 0x0141, 0x09E6, 0x065E, 0x1303, 0x1172, 0x2292, 0x2A6C, 0x3689, 0x23E1, 0x435A, 0x0F90, 0x324F, 0x23D2, 0x5E14, 0x34DB, 0x3092, 0x152F, 0x1797, 0x04F4, 0x4785, 0x2B28, 0x2837, 0x5B3A, 0x0747, 0x09AC, 0x1C4D, 0x3B65, 0x0C53, 0x009A, 0x079A, 0x13C8, 0x362A, 0x2618, 0x4910, 0x29F4, 0x0EC7, 0x1379, 0x7FFF, 0x2B3C, 0x1F85, 0x098B, 0x3257, 0x39C1, 0x39AE, 0x0149, 0x2279, 0x0520, 0x0AE5, 0x389E, 0x0FB6, 0x05BE, 0x0245, 0x0CF2, 0x219C, 0x0057, 0x2F2B, 0x1B6C, 0x0739, 0x2EBB, 0x1909, 0x1F51, 0x45D4, 0x0131, 0x1CE1, 0x08B0, 0x0E16, 0x2BA8, 0x1568, 0x2D35, 0x1CF4, 0x4A98, 0x08A0, 0x0BFC, 0x4622, 0x4647, 0x22FC, 0x0651, 0x48F0, 0x15F4, 0x1ABA, 0x164F, 0x2BA6, 0x0CE5, 0x4CD9, 0x1163, 0x3D5B, 0x4378, 0x3281, 0x18FA, 0x1182, 0x239A, 0x1295, 0x11E0, 0x3AA8, 0x0E11, 0x1FE8, 0x02C4, 0x037B, 0x3C98, 0x1C74, 0x2855, 0x1421, 0x1F2A, 0x2792, 0x0AAE, 0x042F, 0x2688, 0x07B1, 0x1653, 0x121B, 0x0FE5, 0x280F, 0x2DE5, 0x0B90, 0x07FB, 0x27EB, 0x0149, 0x2289, 0x211C, 0x000D, 0x0AE1, 0x2077, 0x2786, 0x0691, 0x231C, 0x39CA, 0x3240, 0x3721, 0x3A78, 0x02E4, 0x1238, 0x1617, 0x0D42, 0x429A, 0x12CF, 0x3A2E, 0x01E5, 0x0459, 0x47C0, 0x2B09, 0x0820, 0x3557, 0x3120, 0x6F8D, 0x2032, 0x2A50, 0x59C5, 0x0444, 0x0C37, 0x535D, 0x4D9D, 0x13AF, 0x035C, 0x17DC, 0x00CB, 0x5CA4, 0x1139, 0x12D1, 0x0BB1, 0x4AA4, 0x0A11, 0x3C17, 0x3F8B, 0x1A33, 0x1771, 0x648B, 0x0D0B, 0x2A80, 0x1C64, 0x1441, 0x1CAC, 0x1155 }; static const q15_t in_absminmax[300] = { 0xDEEE, 0x26B1, 0x289F, 0x2227, 0x033B, 0xE000, 0xEA27, 0xFC9F, 0x02B7, 0x1881, 0x02DF, 0xD076, 0x2186, 0xE12E, 0xE27A, 0x2C65, 0x0F63, 0xD5EB, 0x5BBE, 0xFB7F, 0x525A, 0xD88E, 0xF583, 0x3C9B, 0xCEA3, 0xF446, 0x4382, 0xDA61, 0x1FB7, 0xEA48, 0x3623, 0x4BD6, 0x0A93, 0x0B1D, 0x0DE0, 0x0F89, 0xB6ED, 0x087E, 0x5A61, 0xD4C3, 0x45A6, 0xCD0C, 0x0210, 0x1EE8, 0xFB48, 0x2104, 0xF8E3, 0x129B, 0x09B4, 0xF0BA, 0xBB4C, 0xCEAC, 0xBF0A, 0x27C7, 0x0E6E, 0x1072, 0x53AC, 0x0A15, 0xFB59, 0xDDF1, 0xB089, 0x275D, 0xE2FB, 0x1DE5, 0x434C, 0x3AA7, 0xEA86, 0x8000, 0x41C6, 0x2857, 0xFFAC, 0x093D, 0xDA55, 0xCA67, 0xF387, 0xE32D, 0x03C3, 0x0469, 0xEB02, 0x269B, 0x17AC, 0x257A, 0x0E5C, 0x9860, 0x162A, 0x1AEF, 0xEF10, 0x4ECE, 0x34ED, 0x61FE, 0xF2C6, 0xEE46, 0x195D, 0x429F, 0xF37A, 0xE194, 0x5C5D, 0x1234, 0x0D37, 0x2935, 0x4670, 0xF2EF, 0x408B, 0x1F38, 0x0FCA, 0xA277, 0x1EDE, 0x02FF, 0xC2C0, 0x0F27, 0x404A, 0xC651, 0xDB58, 0xFC98, 0x183D, 0x2C7D, 0xE66C, 0xF184, 0xE4B2, 0xCA1B, 0x0C65, 0x3A81, 0xE81F, 0xFE65, 0xB11D, 0xE23C, 0x0120, 0xEF25, 0xC896, 0x0354, 0x04D6, 0x75D5, 0xE578, 0x1001, 0xEF89, 0x208C, 0xF83A, 0x026E, 0x8789, 0x4064, 0x136A, 0x02AB, 0xFE65, 0xF10B, 0xDFDD, 0xF15F, 0xDD10, 0xDB82, 0x1339, 0x15F5, 0xF6AA, 0xE8AD, 0xF6F4, 0x2361, 0xAE65, 0xF0B4, 0x2454, 0x51D9, 0x1E70, 0x450F, 0xCFA0, 0xD7DE, 0x3F61, 0xF974, 0xDD16, 0x2D3D, 0x0DA5, 0x2288, 0xE5C7, 0xE762, 0xB16B, 0x308D, 0x03B2, 0xEEAB, 0x016B, 0x1FDA, 0xC86B, 0xDBB7, 0x0ECB, 0x1755, 0xB552, 0x33BD, 0x2214, 0x13AA, 0x3784, 0xC80A, 0x247E, 0xF1A8, 0x2683, 0x1AB4, 0xE151, 0x13EC, 0x1D27, 0x4E8E, 0xFF2F, 0x1789, 0xD963, 0xEE9E, 0xF8C0, 0x1435, 0xCC8F, 0x1EAF, 0xF1E9, 0xF43B, 0x0B57, 0xD0C5, 0x3188, 0xECA2, 0x3A97, 0xFD2A, 0xFEEE, 0xBCF0, 0x1852, 0xDA62, 0x198A, 0xDA7D, 0xD1CA, 0xA6C4, 0x0046, 0xE5CE, 0x1694, 0x0D7B, 0xF2A7, 0x246A, 0xEBA3, 0x38FF, 0xF0C5, 0x4697, 0xCFF3, 0x2CD9, 0xC06D, 0x2B2F, 0x2672, 0xD4B6, 0xCA48, 0xF855, 0xE918, 0xEE94, 0x13A3, 0x3F0C, 0x1377, 0x02BA, 0xEDB6, 0x1D58, 0xDE73, 0x3E92, 0xDDE8, 0x0F1B, 0x05BB, 0xED4C, 0xD20D, 0x071B, 0x34E4, 0x79A3, 0xD997, 0x3C03, 0xF861, 0x2B30, 0x933B, 0xC32B, 0xDEEC, 0xED21, 0xE328, 0x3282, 0x3E64, 0xD0BC, 0xF4E5, 0x097A, 0x3625, 0xF885, 0xEB67, 0xEC51, 0xABC4, 0x513A, 0x24FD, 0x2ED4, 0xDFB4, 0xDEA5, 0xBE4F, 0x26A1, 0x1F40, 0x0851, 0x0190, 0xDD84, 0x085A, 0xFE3C, 0xDB38, 0xD5FD, 0x2573, 0xF659, 0x2A68, 0x0415, 0xCE22, 0x10BE, 0xB070, 0x1A6C, 0xC460, 0xD33C, 0x2BDB, 0xD686 }; static const q15_t ref_max_val[3] = { 0x4CFA, 0x4CFA, 0x5D02 }; static const uint16_t ref_max_idx[3] = { 0x0004, 0x0004, 0x0012 }; static const q15_t ref_min_val[3] = { 0xD108, 0xB149, 0xB149 }; static const uint16_t ref_min_idx[3] = { 0x0000, 0x0007, 0x0007 }; static const q15_t ref_absmax_val[3] = { 0x289F, 0x2F8A, 0x5BBE }; static const uint16_t ref_absmax_idx[3] = { 0x0002, 0x000B, 0x0012 }; static const q15_t ref_absmin_val[3] = { 0x033B, 0x02B7, 0x02B7 }; static const uint16_t ref_absmin_idx[3] = { 0x0004, 0x0008, 0x0008 }; static const q15_t ref_mean[4] = { 0x2968, 0x26C9, 0x2A98, 0x2684 }; static const q63_t ref_power[3] = { 0x000000003956D82D, 0x000000007CED0225, 0x00000000D96BDF35 }; static const q15_t ref_rms[4] = { 0x2DCB, 0x2CB5, 0x3132, 0x3048 }; static const q15_t ref_std[4] = { 0x2EA0, 0x2E13, 0x31F3, 0x3080 }; static const q15_t ref_var[4] = { 0x10FC, 0x1095, 0x137D, 0x1260 };
Max
1
psychogenic/zephyr
tests/lib/cmsis_dsp/statistics/src/q15.pat
[ "Apache-2.0" ]
source "../tests/includes/init-tests.tcl" source "../tests/includes/job-utils.tcl" test "QSCAN based on non blocking iterator" { # Create 512 queues, each has a job enqueued for {set i 0} {$i < 512} {incr i} { set qname [randomQueue] lappend myqueues $qname D 0 addjob $qname myjob 5000 replicate 1 retry 0 } set cur 0 set queues {} while 1 { set res [D 0 qscan $cur] set cur [lindex $res 0] set que [lindex $res 1] lappend queues {*}$que if {$cur == 0} break } # Eliminate duplicates set queues [lsort -unique $queues] assert_equal 512 [llength $queues] assert_equal [lsort $queues] [lsort $myqueues] # Remove all the jobs, queues D 0 debug flushall } test "QSCAN with BUSYLOOP option" { # Create 512 queues, each has a job enqueued for {set i 0} {$i < 512} {incr i} { D 0 addjob [randomQueue] myjob 5000 replicate 1 retry 0 } set res [D 0 qscan busyloop] set queues [lindex $res 1] assert_equal 512 [llength $queues] # Remove all the jobs, queues D 0 debug flushall } test "QSCAN with MINLEN or MAXLEN option" { # Create 512 queues, each has a job enqueued for {set i 0} {$i < 512} {incr i} { D 0 addjob [randomQueue] myjob 5000 replicate 1 retry 0 } # Get all queue names by qscan busyloop set res [D 0 qscan busyloop] set queues [lindex $res 1] # Add a job to each of the first 16 queues for {set i 0} {$i < 16} {incr i} { D 0 addjob [lindex $queues $i] myjob 5000 replicate 1 retry 0 } set res [D 0 qscan busyloop minlen 2] set queues [lindex $res 1] assert_equal 16 [llength $queues] # Add a job to each of the first 8 queues for {set i 0} {$i < 8} {incr i} { D 0 addjob [lindex $queues $i] myjob 5000 replicate 1 retry 0 } set res [D 0 qscan busyloop minlen 3] set queues [lindex $res 1] assert_equal 8 [llength $queues] set res [D 0 qscan busyloop minlen 2 maxlen 3] set queues [lindex $res 1] assert_equal 16 [llength $queues] # Remove all the jobs, queues D 0 debug flushall } test "QSCAN with IMPORTRATE option" { # Use Node-1 as producer and Node-2 as consumer for {set i 0} {$i < 4} {incr i} { D 1 addjob queue_0001 myjob 0 D 1 addjob queue_0002 myjob 0 D 1 addjob queue_0003 myjob 0 D 1 addjob queue_0004 myjob 0 } for {set i 0} {$i < 4} {incr i} { D 2 getjob from queue_0001 D 2 getjob from queue_0002 D 2 getjob from queue_0003 D 2 getjob from queue_0004 } set res [D 2 qscan busyloop importrate 1] set queues [lindex $res 1] assert_equal 4 [llength $queues] }
Tcl
4
justincase/disque
tests/cluster/tests/08-qscan.tcl
[ "BSD-3-Clause" ]
config = require("lapis.config").get! if config.postgres require "lapis.db.postgres.schema" elseif config.mysql require "lapis.db.mysql.schema" else error "You have to configure either postgres or mysql"
MoonScript
4
tommy-mor/lapis
lapis/db/schema.moon
[ "MIT", "Unlicense" ]
-- Copyright 2021 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. name = "Digitorus" type = "cert" function start() set_rate_limit(2) end function vertical(ctx, domain) scrape(ctx, {['url']=build_url(domain)}) end function build_url(domain) return "https://certificatedetails.com/api/list/" .. domain end
Ada
4
Elon143/Amass
resources/scripts/cert/digitorus.ads
[ "Apache-2.0" ]
LITHO,CANAL,CODIGO 000600,C,000301 000606,C,000240 000603,C,000303 000605,C,000305 000616,C,000261 000601,C,000242 000619,C,000333 000615,C,000323 000617,C,000335 000613,C,000321 000612,C,000279 000629,C,000353 000611,C,000338 000614,C,000210 000609,C,000314 000607,C,000207 000618,C,000308 000639,C,000270 000620,C,000205 000621,C,000345 000623,C,000334 000604,C,000257 000624,C,000315 000626,C,000199 000608,C,000203 000627,C,000319 000628,C,000281 000610,C,000224 000622,C,000356 000635,C,000248 000634,C,000250 000636,C,000287 000637,C,000327 000632,C,000295 000633,C,000292 000631,C,000196 000630,C,000201 000638,C,000208 000602,C,000246 000625,C,000342
IDL
1
plandauro/admision
storage/calificacion/2019-Ihojaidentificacionpe02.dlm
[ "MIT" ]
SmalltalkCISpec { #loading : [ SCIMetacelloLoadSpec { #directory : 'src', #baseline : 'PharoThings', #platforms : [ #pharo ] } ], #testing : { #include : { #projects : [ 'BaselineOfTostSerializer', 'BaselineOfReadWriteLock', 'BaselineOfObjectTravel', 'BaselineOfBasys' , 'BaselineOfSeemless', 'BaselineOfCalypso', 'BaselineOfPharoThings' ] } } }
STON
4
dionisiydk/PharoThings
.smalltalk.ston
[ "MIT" ]
te %_NTTREE%\unittests\conhost.api.tests.dll %1 %2 %3 %4 %5 %6 %7 %8 %9 te %_NTTREE%\unittests\conhost.uia.tests.dll %1 %2 %3 %4 %5 %6 %7 %8 %9
Batchfile
1
Ghosty141/Terminal
src/host/runft.bat
[ "MIT" ]
<GameProjectFile> <PropertyGroup Type="Scene" Name="crossplatform_UIPageView_Editor_1" ID="25848ead-412c-4d99-a737-9312d4f0dfa4" Version="2.1.0.0" /> <Content ctype="GameProjectContent"> <Content> <Animation Duration="0" Speed="1.0000" /> <ObjectData Name="Scene" FrameEvent="" CallBackType="Touch" ctype="SingleNodeObjectData"> <Position X="0.0000" Y="0.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint /> <CColor A="255" R="255" G="255" B="255" /> <Size X="480.0000" Y="320.0000" /> <PrePosition X="0.0000" Y="0.0000" /> <PreSize X="0.0000" Y="0.0000" /> <Children> <NodeObjectData Name="Panel_521" ActionTag="965055358" FrameEvent="" CallBackType="Touch" Tag="5" ObjectIndex="2" TouchEnable="True" BackColorAlpha="102" ComboBoxIndex="1" ColorAngle="90.0000" ctype="PanelObjectData"> <Position X="0.0000" Y="0.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint /> <CColor A="255" R="255" G="255" B="255" /> <Size X="480.0000" Y="320.0000" /> <PrePosition X="0.0000" Y="0.0000" /> <PreSize X="1.0000" Y="1.0000" /> <Children> <NodeObjectData Name="root_Panel" ActionTag="1851564209" FrameEvent="" CallBackType="Touch" Tag="81" ObjectIndex="3" TouchEnable="True" BackColorAlpha="102" ComboBoxIndex="1" ColorAngle="90.0000" Scale9Enable="True" Scale9Width="480" Scale9Height="320" ctype="PanelObjectData"> <Position X="0.0000" Y="0.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint /> <CColor A="255" R="255" G="255" B="255" /> <Size X="480.0000" Y="320.0000" /> <PrePosition X="0.0000" Y="0.0000" /> <PreSize X="1.0000" Y="1.0000" /> <Children> <NodeObjectData Name="Panel" ActionTag="1731076339" FrameEvent="" CallBackType="Touch" Tag="82" ObjectIndex="4" TouchEnable="True" BackColorAlpha="102" ColorAngle="90.0000" Scale9Enable="True" LeftEage="120" TopEage="120" Scale9OriginX="50" Scale9OriginY="57" Scale9Width="70" Scale9Height="63" ctype="PanelObjectData"> <Position X="0.0000" Y="263.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint /> <CColor A="255" R="255" G="255" B="255" /> <Size X="480.0000" Y="57.0000" /> <PrePosition X="0.0000" Y="0.8219" /> <PreSize X="1.0000" Y="0.1781" /> <FileData Type="Normal" Path="ribbon.png" /> <SingleColor A="255" R="150" G="200" B="255" /> <FirstColor A="255" R="150" G="200" B="255" /> <EndColor A="255" R="255" G="255" B="255" /> <ColorVector ScaleY="1.0000" /> </NodeObjectData> <NodeObjectData Name="UItest" ActionTag="-11648633" FrameEvent="" CallBackType="Touch" Tag="88" ObjectIndex="1" FontSize="20" LabelText="UI_test" ctype="TextObjectData"> <Position X="240.0000" Y="310.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint ScaleX="0.5000" ScaleY="0.5000" /> <CColor A="255" R="255" G="255" B="255" /> <Size X="70.0000" Y="20.0000" /> <PrePosition X="0.5000" Y="0.9688" /> <PreSize X="0.0000" Y="0.0000" /> </NodeObjectData> <NodeObjectData Name="background_Panel" ActionTag="-1445210192" FrameEvent="" CallBackType="Touch" Tag="83" ObjectIndex="5" TouchEnable="True" BackColorAlpha="102" ColorAngle="90.0000" Scale9Enable="True" LeftEage="4" RightEage="4" TopEage="4" BottomEage="4" Scale9OriginX="4" Scale9OriginY="4" Scale9Width="12" Scale9Height="12" ctype="PanelObjectData"> <Position X="38.0000" Y="75.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint /> <CColor A="255" R="255" G="255" B="255" /> <Size X="403.0000" Y="170.0000" /> <PrePosition X="0.0792" Y="0.2344" /> <PreSize X="0.8396" Y="0.5313" /> <Children> <NodeObjectData Name="PageView_1269" ActionTag="-657174986" FrameEvent="" CallBackType="Touch" Tag="45" ObjectIndex="1" TouchEnable="True" ClipAble="True" BackColorAlpha="102" ComboBoxIndex="1" ColorAngle="90.0000" ScrollDirectionType="0" ctype="PageViewObjectData"> <Position X="-2.0000" Y="0.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint /> <CColor A="255" R="255" G="255" B="255" /> <Size X="403.0000" Y="170.0000" /> <PrePosition X="-0.0050" Y="0.0000" /> <PreSize X="1.0000" Y="1.0000" /> <Children> <NodeObjectData Name="Panel_1270" ActionTag="2070353886" FrameEvent="" CallBackType="Touch" Tag="46" ObjectIndex="11" TouchEnable="True" BackColorAlpha="102" ComboBoxIndex="1" ColorAngle="90.0000" Scale9Enable="True" LeftEage="4" RightEage="4" TopEage="4" BottomEage="4" Scale9OriginX="4" Scale9OriginY="4" Scale9Width="95" Scale9Height="32" ctype="PanelObjectData"> <Position X="0.0000" Y="0.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint /> <CColor A="255" R="255" G="255" B="255" /> <Size X="403.0000" Y="170.0000" /> <PrePosition X="0.0000" Y="0.0000" /> <PreSize X="1.0000" Y="1.0000" /> <Children> <NodeObjectData Name="Label_1273" ActionTag="1922250827" FrameEvent="" CallBackType="Touch" Tag="49" ObjectIndex="8" FontSize="20" LabelText="page1" ctype="TextObjectData"> <Position X="201.0000" Y="85.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint ScaleX="0.5000" ScaleY="0.5000" /> <CColor A="255" R="255" G="255" B="255" /> <Size X="50.0000" Y="20.0000" /> <PrePosition X="0.4988" Y="0.5000" /> <PreSize X="0.0000" Y="0.0000" /> </NodeObjectData> </Children> <FileData Type="Normal" Path="button_n.png" /> <SingleColor A="255" R="150" G="200" B="255" /> <FirstColor A="255" R="150" G="200" B="255" /> <EndColor A="255" R="255" G="255" B="255" /> <ColorVector ScaleY="1.0000" /> </NodeObjectData> <NodeObjectData Name="Panel_1271" ActionTag="-669445777" FrameEvent="" CallBackType="Touch" Tag="47" ObjectIndex="14" TouchEnable="True" BackColorAlpha="102" ComboBoxIndex="1" ColorAngle="90.0000" Scale9Enable="True" LeftEage="4" RightEage="4" TopEage="4" BottomEage="4" Scale9OriginX="4" Scale9OriginY="4" Scale9Width="95" Scale9Height="32" ctype="PanelObjectData"> <Position X="403.0000" Y="0.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint /> <CColor A="255" R="255" G="255" B="255" /> <Size X="403.0000" Y="170.0000" /> <PrePosition X="1.0000" Y="0.0000" /> <PreSize X="1.0000" Y="1.0000" /> <Children> <NodeObjectData Name="Label_1274" ActionTag="866573099" FrameEvent="" CallBackType="Touch" Tag="50" ObjectIndex="9" FontSize="20" LabelText="page2" ctype="TextObjectData"> <Position X="201.0000" Y="85.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint ScaleX="0.5000" ScaleY="0.5000" /> <CColor A="255" R="255" G="255" B="255" /> <Size X="50.0000" Y="20.0000" /> <PrePosition X="0.4988" Y="0.5000" /> <PreSize X="0.0000" Y="0.0000" /> </NodeObjectData> </Children> <FileData Type="Normal" Path="button_n.png" /> <SingleColor A="255" R="150" G="200" B="255" /> <FirstColor A="255" R="150" G="200" B="255" /> <EndColor A="255" R="255" G="255" B="255" /> <ColorVector ScaleY="1.0000" /> </NodeObjectData> <NodeObjectData Name="Panel_1272" ActionTag="438760598" FrameEvent="" CallBackType="Touch" Tag="48" ObjectIndex="15" TouchEnable="True" BackColorAlpha="102" ComboBoxIndex="1" ColorAngle="90.0000" Scale9Enable="True" LeftEage="4" RightEage="4" TopEage="4" BottomEage="4" Scale9OriginX="4" Scale9OriginY="4" Scale9Width="95" Scale9Height="32" ctype="PanelObjectData"> <Position X="806.0000" Y="0.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint /> <CColor A="255" R="255" G="255" B="255" /> <Size X="403.0000" Y="170.0000" /> <PrePosition X="0.0000" Y="0.0000" /> <PreSize X="0.0000" Y="0.0000" /> <Children> <NodeObjectData Name="Label_1275" ActionTag="-1210197839" FrameEvent="" CallBackType="Touch" Tag="51" ObjectIndex="10" FontSize="20" LabelText="page3" ctype="TextObjectData"> <Position X="201.0000" Y="85.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint ScaleX="0.5000" ScaleY="0.5000" /> <CColor A="255" R="255" G="255" B="255" /> <Size X="50.0000" Y="20.0000" /> <PrePosition X="0.0000" Y="0.0000" /> <PreSize X="0.0000" Y="0.0000" /> </NodeObjectData> </Children> <FileData Type="Normal" Path="button_n.png" /> <SingleColor A="255" R="150" G="200" B="255" /> <FirstColor A="255" R="150" G="200" B="255" /> <EndColor A="255" R="255" G="255" B="255" /> <ColorVector ScaleY="1.0000" /> </NodeObjectData> </Children> <SingleColor A="255" R="100" G="250" B="255" /> <FirstColor A="255" R="100" G="250" B="255" /> <EndColor A="255" R="255" G="255" B="255" /> <ColorVector ScaleY="1.0000" /> </NodeObjectData> </Children> <FileData Type="Normal" Path="buttonBackground.png" /> <SingleColor A="255" R="150" G="200" B="255" /> <FirstColor A="255" R="150" G="200" B="255" /> <EndColor A="255" R="255" G="255" B="255" /> <ColorVector ScaleY="1.0000" /> </NodeObjectData> <NodeObjectData Name="back" ActionTag="1416676038" FrameEvent="" CallBackType="Touch" Tag="87" ObjectIndex="2" TouchEnable="True" FontSize="24" LabelText="Back" ctype="TextObjectData"> <Position X="436.0000" Y="22.0000" /> <Scale ScaleX="1.0000" ScaleY="1.0000" /> <AnchorPoint ScaleX="0.5000" ScaleY="0.5000" /> <CColor A="255" R="255" G="255" B="255" /> <Size X="48.0000" Y="24.0000" /> <PrePosition X="0.9083" Y="0.0688" /> <PreSize X="0.0000" Y="0.0000" /> </NodeObjectData> </Children> <FileData Type="Normal" Path="background.png" /> <SingleColor A="255" R="150" G="200" B="255" /> <FirstColor A="255" R="150" G="200" B="255" /> <EndColor A="255" R="255" G="255" B="255" /> <ColorVector ScaleY="1.0000" /> </NodeObjectData> </Children> <SingleColor A="255" R="150" G="200" B="255" /> <FirstColor A="255" R="150" G="200" B="255" /> <EndColor A="255" R="255" G="255" B="255" /> <ColorVector ScaleY="1.0000" /> </NodeObjectData> </Children> </ObjectData> </Content> </Content> </GameProjectFile>
Csound
3
dum999/CocosStudioSamples
CocosStudioProjects/crossplatform_UIPageView_Editor_1/cocosstudio/crossplatform_UIPageView_Editor_1.csd
[ "MIT" ]
#if (30 < 40 < 50) #warning "Test passed." #endif #if !(30 < 40 < 35) #warning "Test passed." #endif #if (30 < 40) #warning "Test passed." #endif #if !(40 < 35) #warning "Test passed." #endif main () { }
PAWN
2
pawn-lang/pawn
source/compiler/tests/constexpr_result_prop_gh_308.pwn
[ "Zlib" ]
{-# LANGUAGE CPP, RankNTypes, UndecidableInstances, GADTs, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Graphics.UI.FLTK.LowLevel.Table ( -- * Hierarchy -- -- $hierarchy -- * Widget Functions -- -- $functions ) where #include "Fl_ExportMacros.h" #include "Fl_Types.h" #include "Fl_TableC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum) import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Dispatch import Graphics.UI.FLTK.LowLevel.Hierarchy {# fun Fl_Table_draw as draw' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (Draw ()) Table orig impl where runOp _ _ table = withRef table $ \tablePtr -> draw' tablePtr {# fun Fl_Table_handle as handle' { id `Ptr ()', cFromEnum `Event' } -> `Int' #} instance (impl ~ ( Event -> IO( Either UnknownEvent ()))) => Op (Handle ()) Table orig impl where runOp _ _ table event = withRef table $ \tablePtr -> handle' tablePtr event >>= return . successOrUnknownEvent {# fun Fl_Table_resize as resize' { id `Ptr ()',`Int',`Int',`Int',`Int' } -> `()' #} instance (impl ~ ( Rectangle -> IO ())) => Op (Resize ()) Table orig impl where runOp _ _ table rectangle = let (x_pos', y_pos', width', height') = fromRectangle rectangle in withRef table $ \tablePtr -> resize' tablePtr x_pos' y_pos' width' height' {# fun Fl_Table_clear as clear' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (Clear ()) Table orig impl where runOp _ _ table = withRef table $ \tablePtr -> clear' tablePtr {# fun Fl_Table_show as show' { id `Ptr ()' } -> `()' supressWarningAboutRes #} instance (impl ~ ( IO ())) => Op (ShowWidget ()) Table orig impl where runOp _ _ widget = withRef widget $ \widgetPtr -> show' widgetPtr {# fun Fl_Table_hide as hide' { id `Ptr ()' } -> `()' supressWarningAboutRes #} instance (impl ~ ( IO ())) => Op (Hide ()) Table orig impl where runOp _ _ widget = withRef widget $ \widgetPtr -> hide' widgetPtr {# fun Fl_Table_set_rows as setRows' { id `Ptr ()',`Int' } -> `()' #} instance (impl ~ ( Rows -> IO ())) => Op (SetRows ()) Table orig impl where runOp _ _ table (Rows val) = withRef table $ \tablePtr -> setRows' tablePtr val {# fun Fl_Table_set_cols as setCols' { id `Ptr ()',`Int' } -> `()' #} instance (impl ~ ( Columns -> IO ())) => Op (SetCols ()) Table orig impl where runOp _ _ table (Columns val) = withRef table $ \tablePtr -> setCols' tablePtr val -- $hierarchy -- @ -- "Graphics.UI.FLTK.LowLevel.Base.Widget" -- | -- v -- "Graphics.UI.FLTK.LowLevel.Base.Group" -- | -- v -- "Graphics.UI.FLTK.LowLevel.Base.Table" -- | -- v -- "Graphics.UI.FLTK.LowLevel.Table" -- @ -- $functions -- @ -- clear :: 'Ref' 'Table' -> 'IO' () -- -- draw :: 'Ref' 'Table' -> 'IO' () -- -- handle :: 'Ref' 'Table' -> 'Event' -> 'IO'( 'Either' 'UnknownEvent' ()) -- -- hide :: 'Ref' 'Table' -> 'IO' () -- -- resize :: 'Ref' 'Table' -> 'Rectangle' -> 'IO' () -- -- setCols :: 'Ref' 'Table' -> 'Columns' -> 'IO' () -- -- setRows :: 'Ref' 'Table' -> 'Rows' -> 'IO' () -- -- showWidget :: 'Ref' 'Table' -> 'IO' () -- @
C2hs Haskell
4
ericu/fltkhs
src/Graphics/UI/FLTK/LowLevel/Table.chs
[ "MIT" ]
#version 450 layout(location = 0) out vec4 o_Target; layout(set = 2, binding = 0) uniform MyMaterial_color { vec4 color; }; void main() { o_Target = color * 0.5; }
GLSL
3
Schell-0x52/bevy
assets/shaders/hot.frag
[ "Apache-2.0", "MIT" ]
.email-sign-up strong, .email-sign-up p { font-family: 'Lato', sans-serif; font-size: 1rem; } @media (min-width: 500px) { .email-sign-up strong, .email-sign-up p { font-size: 1.17rem; } }
CSS
3
fcastillo-serempre/freeCodeCamp
client/src/pages/email-sign-up.css
[ "BSD-3-Clause" ]
// Binomial model with beta(1,1) prior data { int<lower=0> N; // number of experiments int<lower=0> y; // number of successes } parameters { real<lower=0,upper=1> theta; // probability of success in range (0,1) } model { // model block creates the log density to be sampled theta ~ beta(1, 1); // prior y ~ binomial(N, theta); // observation model / likelihood // the notation using ~ is syntactic sugar for // target += beta_lpdf(theta | 1, 1); // lpdf for continuous theta // target += binomial_lpmf(y | N, theta); // lpmf for discrete y // target is the log density to be sampled }
Stan
4
tonyctan/BDA_R_demos
demos_rstan/binom.stan
[ "BSD-3-Clause" ]
package com.airbnb.lottie.animation.content; import com.airbnb.lottie.model.KeyPathElement; public interface KeyPathElementContent extends KeyPathElement, Content { }
Java
2
congwiny/lottie-android
lottie/src/main/java/com/airbnb/lottie/animation/content/KeyPathElementContent.java
[ "Apache-2.0" ]
static const q15_t in_default_val[100] = { 0xE62B, 0x1CF7, 0x3208, 0x37FC, 0x2781, 0x3AD3, 0x69CF, 0x5E5B, 0x2BC7, 0xF39B, 0xFACD, 0xFC7A, 0xD180, 0xBC84, 0xAEE2, 0xDA97, 0xD292, 0xD9FC, 0xAF9D, 0xCA17, 0xFAD5, 0x4342, 0x2821, 0x2EB8, 0x3F63, 0x46A5, 0x4E09, 0x3C16, 0x1876, 0x1355, 0x04C3, 0x1530, 0xD8FB, 0x95D8, 0x9DDB, 0xD93C, 0xDC86, 0xD476, 0xC63A, 0xCDC3, 0x267F, 0x3926, 0x25C3, 0x31E3, 0x4759, 0x5D47, 0x690D, 0x3D75, 0x12E4, 0xF69C, 0xF606, 0x0373, 0xCB95, 0x8000, 0xA910, 0xB61A, 0xDDFF, 0xA016, 0xC5D5, 0xDF9E, 0x1FA5, 0x3811, 0x29D2, 0x061A, 0x291F, 0x570A, 0x6886, 0x383D, 0x12A8, 0x15C2, 0xE5EE, 0xEADA, 0xB11B, 0x9FC1, 0x9EDD, 0xBEE8, 0xC9B5, 0xB03B, 0xB88E, 0xE495, 0x2595, 0x5D53, 0x2599, 0x295B, 0x4C34, 0x6936, 0x5B61, 0x15D5, 0x07B1, 0x056F, 0x08EE, 0xF182, 0xD6CE, 0xABFD, 0xB1BC, 0xC994, 0xEC29, 0xC002, 0xC69B, 0x168A }; static const q15_t in_default_coeff[18] = { 0x00A4, 0x0000, 0xFF4F, 0x00A4, 0x37CF, 0xE614, 0x2000, 0x0000, 0xCD0D, 0x2000, 0x37E6, 0xE1E4, 0x2000, 0x0000, 0xC003, 0x2000, 0x3EA4, 0xE144 }; static const q15_t ref_default[100] = { 0xFF7C, 0x002E, 0x0092, 0x0195, 0x0324, 0x0618, 0x0A77, 0x0F3E, 0x1487, 0x19BA, 0x1EB8, 0x219D, 0x2141, 0x1DE7, 0x169B, 0x0C5C, 0xFE58, 0xEF0A, 0xDE9A, 0xD05E, 0xC538, 0xBF56, 0xBE37, 0xC44B, 0xD056, 0xE104, 0xF4F7, 0x09C0, 0x1D29, 0x2DA1, 0x38BC, 0x3E46, 0x3C2F, 0x3397, 0x2617, 0x14EA, 0x00F7, 0xED60, 0xDBD4, 0xCE0E, 0xC652, 0xC375, 0xC67F, 0xCFAD, 0xDD6C, 0xEE73, 0x0148, 0x138E, 0x242A, 0x314B, 0x39D4, 0x3D0E, 0x399C, 0x302B, 0x2306, 0x1120, 0xFDB2, 0xE88B, 0xD68F, 0xC761, 0xBDD7, 0xBA29, 0xBD05, 0xC5FF, 0xD530, 0xE847, 0xFD79, 0x1256, 0x25A3, 0x358B, 0x3F18, 0x4334, 0x3F99, 0x363C, 0x2764, 0x150A, 0x007C, 0xEB9B, 0xD930, 0xCACC, 0xC200, 0xBFE2, 0xC359, 0xCE50, 0xDEC4, 0xF2F7, 0x08D3, 0x1DD8, 0x3119, 0x3FA3, 0x483F, 0x49DD, 0x44C7, 0x3912, 0x28C3, 0x151E, 0x008B, 0xEBE5, 0xDAE7, 0xCF40 };
Max
3
maxvankessel/zephyr
tests/lib/cmsis_dsp/filtering/src/biquad_q15.pat
[ "Apache-2.0" ]
static const q7_t in_com1[256] = { 0x52, 0x01, 0x47, 0x20, 0xA5, 0xFD, 0xFC, 0x44, 0xF5, 0xCB, 0x2A, 0xE7, 0x1E, 0x28, 0xFF, 0xEF, 0x3E, 0x2C, 0x05, 0x32, 0xAE, 0x09, 0xBE, 0xF5, 0x24, 0xFA, 0xDE, 0xD6, 0xF4, 0xE7, 0x0D, 0xD7, 0x10, 0x19, 0x0C, 0xC8, 0xBB, 0x1E, 0x05, 0xAA, 0x44, 0x60, 0x2D, 0x21, 0x1C, 0xF0, 0x2E, 0x25, 0xF4, 0xF1, 0xC7, 0x19, 0x26, 0xBB, 0xD0, 0x08, 0x46, 0xF9, 0xEF, 0x7E, 0x19, 0x1E, 0x1B, 0x0A, 0x1F, 0x22, 0x12, 0x10, 0x13, 0x05, 0x41, 0x0F, 0x3B, 0xF6, 0xF9, 0x45, 0xE5, 0xE4, 0x14, 0xCD, 0xE5, 0xED, 0xF3, 0x14, 0x00, 0xEF, 0xEE, 0xDA, 0x19, 0x12, 0xB4, 0x0B, 0xAB, 0x14, 0x0A, 0xF7, 0x15, 0x35, 0x38, 0x0C, 0xCA, 0x32, 0x02, 0xD9, 0x1F, 0x00, 0xB9, 0x5C, 0xE4, 0x39, 0xE0, 0xE6, 0x09, 0xAD, 0x0E, 0x30, 0x24, 0xAE, 0xF5, 0x02, 0x1E, 0xE5, 0x1D, 0xE0, 0xC0, 0x16, 0xEB, 0x35, 0xAA, 0x30, 0xF4, 0x95, 0xFB, 0xFB, 0xD4, 0x17, 0x36, 0xF5, 0x26, 0x00, 0x59, 0xDD, 0x47, 0xC5, 0xE0, 0x86, 0xCA, 0x26, 0x3B, 0xC8, 0x36, 0x31, 0xD0, 0xAD, 0x05, 0x19, 0x07, 0xF4, 0xBE, 0xED, 0xC9, 0xD3, 0x17, 0xC0, 0x0D, 0xDE, 0xCF, 0xDA, 0x66, 0x95, 0xE2, 0xE4, 0x00, 0x10, 0xEC, 0xB8, 0xD5, 0x27, 0x0B, 0xDD, 0x13, 0x85, 0xD3, 0xDF, 0xCD, 0xD0, 0x36, 0x3A, 0xFC, 0xDB, 0x2B, 0xE0, 0x21, 0xDB, 0xE0, 0x1F, 0x64, 0xF0, 0x8F, 0x0E, 0x45, 0xE1, 0x39, 0x80, 0xBB, 0xF6, 0xC8, 0x42, 0x02, 0x38, 0x16, 0x62, 0xE2, 0x3B, 0xFD, 0xE4, 0xF6, 0x91, 0x15, 0xF0, 0xAB, 0x6A, 0x16, 0x0E, 0xF3, 0xC4, 0xE7, 0x0E, 0xAA, 0x34, 0x1D, 0x13, 0x44, 0xE8, 0xF2, 0xEF, 0x2E, 0x22, 0x44, 0x41, 0x2C, 0x2E, 0x74, 0x02, 0x16, 0x06, 0xEA, 0x45, 0xCB, 0xDE, 0xE5, 0xF3, 0x0F, 0xDE, 0x35, 0x09 }; static const q7_t in_com2[256] = { 0x1E, 0xDE, 0x10, 0xF2, 0x91, 0xDC, 0x37, 0x02, 0xDE, 0x08, 0x28, 0xC3, 0x00, 0xFD, 0x14, 0x14, 0xFC, 0x1E, 0x25, 0xF2, 0xEC, 0xD7, 0x5B, 0x66, 0xF2, 0x93, 0xF2, 0x11, 0x35, 0x2A, 0xEE, 0xFE, 0xE7, 0xE2, 0x27, 0xED, 0xDF, 0x02, 0x41, 0xC1, 0xED, 0x1C, 0xD8, 0x0D, 0x2D, 0xE7, 0xEA, 0xD6, 0xD3, 0x44, 0xB5, 0x63, 0x12, 0x2D, 0xF1, 0x1C, 0xDC, 0xD8, 0xD8, 0xD4, 0x05, 0xEB, 0x04, 0x48, 0xC6, 0xE1, 0x01, 0x30, 0x1D, 0x01, 0xEA, 0x17, 0xE0, 0xB4, 0x1D, 0xFD, 0xBB, 0xF3, 0xC1, 0x2C, 0x2B, 0xE0, 0x95, 0xD4, 0x0A, 0xEA, 0x07, 0xFF, 0x2F, 0x04, 0x17, 0xF7, 0x02, 0x09, 0x22, 0xE6, 0x0A, 0xCE, 0x36, 0x35, 0xF1, 0x33, 0x01, 0x27, 0x96, 0xCC, 0xEB, 0xBC, 0x1C, 0x30, 0x9B, 0xC8, 0x09, 0xD4, 0x07, 0x25, 0x00, 0x2F, 0x3A, 0xF3, 0x0F, 0x2A, 0xF6, 0x2B, 0xEE, 0xE9, 0xE1, 0xE3, 0x01, 0x0D, 0x1D, 0x0F, 0x40, 0x0A, 0x01, 0x12, 0x39, 0x2F, 0x2F, 0x0C, 0xE7, 0x08, 0x09, 0xE9, 0xB8, 0xED, 0x93, 0xFD, 0x21, 0xED, 0xE5, 0xCF, 0x65, 0xE3, 0x16, 0xEC, 0xB9, 0x02, 0xFA, 0x3A, 0x13, 0x14, 0x27, 0x2A, 0xE4, 0x32, 0xE1, 0xF0, 0xEF, 0x51, 0x0E, 0x4B, 0x18, 0xF2, 0xB6, 0x18, 0x16, 0xF2, 0xFA, 0x0A, 0xFE, 0x14, 0x84, 0x1B, 0x03, 0x05, 0xDC, 0xD9, 0x50, 0xF2, 0x1F, 0xF1, 0x34, 0x7B, 0x0C, 0x02, 0xCC, 0x2D, 0xFC, 0xBE, 0x27, 0x0E, 0x1A, 0xFA, 0xD8, 0xFA, 0x14, 0x49, 0xC0, 0x24, 0x05, 0x18, 0xE6, 0xBC, 0x7F, 0xE0, 0x24, 0xEE, 0x3B, 0xA6, 0xC2, 0xF9, 0x00, 0xCB, 0xE0, 0xF0, 0xF7, 0xD3, 0x09, 0xE4, 0x0F, 0xF3, 0xA8, 0xD8, 0xD0, 0x22, 0x96, 0x1B, 0x0F, 0x44, 0xA0, 0x45, 0x0C, 0xF4, 0x00, 0xC2, 0xEA, 0xE3, 0x2A, 0x0E, 0xD5, 0xE2, 0x0E, 0xDC, 0x09, 0xC1 }; static const q7_t in_bitwise1[47] = { 0xFB, 0xD4, 0xF1, 0xD8, 0x8A, 0x8F, 0x00, 0xF8, 0xD2, 0xD0, 0xE3, 0x46, 0xC4, 0x64, 0x5E, 0xB8, 0x45, 0x14, 0x1C, 0x71, 0x9D, 0x9A, 0x5F, 0x42, 0xFE, 0x7C, 0xCA, 0x2C, 0x3F, 0x1B, 0xFA, 0xC7, 0xB5, 0x33, 0x72, 0x46, 0xF0, 0x8A, 0x39, 0xCC, 0xA2, 0x05, 0xA4, 0x41, 0x87, 0xE0, 0x79 }; static const q7_t in_bitwise2[47] = { 0xA7, 0xE3, 0x1B, 0xCA, 0x5D, 0x6A, 0x31, 0x4C, 0xB2, 0x00, 0xB9, 0xA2, 0x09, 0xEE, 0xA0, 0x4E, 0xC2, 0x21, 0x65, 0x98, 0xD6, 0xCC, 0x50, 0xD6, 0x27, 0x04, 0x0D, 0x18, 0x3E, 0xE5, 0x44, 0x3C, 0x44, 0x5F, 0xC8, 0xBC, 0x2C, 0x67, 0x7A, 0x36, 0x88, 0x8A, 0xC7, 0xBA, 0x91, 0x45, 0xB9 }; static const q7_t in_rand[33] = { 0xF6, 0xFE, 0xF5, 0x1B, 0x0D, 0x13, 0xF9, 0x10, 0xF6, 0x02, 0xE4, 0xD5, 0xF5, 0xF7, 0x14, 0xDF, 0xFB, 0xE6, 0xF0, 0xEE, 0x02, 0x18, 0x0E, 0x0E, 0x16, 0xF8, 0xF3, 0xF2, 0xFF, 0x0F, 0xF6, 0x0D, 0x1C }; static const q7_t in_maxpos[33] = { 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7E }; static const q7_t in_maxneg[33] = { 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81, 0xFF, 0x81 }; static const q7_t in_maxneg2[33] = { 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80 }; static const q7_t in_clip[303] = { 0x8D, 0x8E, 0x8E, 0x8F, 0x90, 0x91, 0x91, 0x92, 0x93, 0x94, 0x94, 0x95, 0x96, 0x97, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9C, 0x9D, 0x9E, 0x9E, 0x9F, 0xA0, 0xA1, 0xA1, 0xA2, 0xA3, 0xA4, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA8, 0xA9, 0xAA, 0xAB, 0xAB, 0xAC, 0xAD, 0xAE, 0xAE, 0xAF, 0xB0, 0xB1, 0xB1, 0xB2, 0xB3, 0xB4, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB8, 0xB9, 0xBA, 0xBB, 0xBB, 0xBC, 0xBD, 0xBE, 0xBE, 0xBF, 0xC0, 0xC1, 0xC1, 0xC2, 0xC3, 0xC4, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC8, 0xC9, 0xCA, 0xCB, 0xCB, 0xCC, 0xCD, 0xCE, 0xCE, 0xCF, 0xD0, 0xD1, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD5, 0xD6, 0xD7, 0xD8, 0xD8, 0xD9, 0xDA, 0xDB, 0xDB, 0xDC, 0xDD, 0xDE, 0xDE, 0xDF, 0xE0, 0xE1, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE5, 0xE6, 0xE7, 0xE8, 0xE8, 0xE9, 0xEA, 0xEB, 0xEB, 0xEC, 0xED, 0xEE, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF2, 0xF3, 0xF4, 0xF5, 0xF5, 0xF6, 0xF7, 0xF8, 0xF8, 0xF9, 0xFA, 0xFB, 0xFB, 0xFC, 0xFD, 0xFE, 0xFE, 0xFF, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x06, 0x07, 0x08, 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x0C, 0x0D, 0x0E, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x12, 0x13, 0x14, 0x15, 0x15, 0x16, 0x17, 0x18, 0x18, 0x19, 0x1A, 0x1B, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x1F, 0x20, 0x21, 0x22, 0x22, 0x23, 0x24, 0x25, 0x25, 0x26, 0x27, 0x28, 0x28, 0x29, 0x2A, 0x2B, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x2F, 0x30, 0x31, 0x32, 0x32, 0x33, 0x34, 0x35, 0x35, 0x36, 0x37, 0x38, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3C, 0x3D, 0x3E, 0x3F, 0x3F, 0x40, 0x41, 0x42, 0x42, 0x43, 0x44, 0x45, 0x45, 0x46, 0x47, 0x48, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4C, 0x4D, 0x4E, 0x4F, 0x4F, 0x50, 0x51, 0x52, 0x52, 0x53, 0x54, 0x55, 0x55, 0x56, 0x57, 0x58, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5C, 0x5D, 0x5E, 0x5F, 0x5F, 0x60, 0x61, 0x62, 0x62, 0x63, 0x64, 0x65, 0x65, 0x66, 0x67, 0x68, 0x69, 0x69, 0x6A, 0x6B, 0x6C, 0x6C, 0x6D, 0x6E, 0x6F, 0x6F, 0x70, 0x71, 0x72, 0x72, 0x73 }; static const q7_t ref_add[256] = { 0x70, 0xDF, 0x57, 0x12, 0x80, 0xDA, 0x33, 0x47, 0xD3, 0xD3, 0x52, 0xAA, 0x1E, 0x24, 0x13, 0x03, 0x3A, 0x4A, 0x2A, 0x25, 0x9A, 0xE0, 0x19, 0x5B, 0x16, 0x8E, 0xD0, 0xE7, 0x29, 0x11, 0xFC, 0xD5, 0xF8, 0xFB, 0x33, 0xB6, 0x9A, 0x20, 0x46, 0x80, 0x31, 0x7B, 0x05, 0x2E, 0x49, 0xD7, 0x17, 0xFB, 0xC8, 0x36, 0x80, 0x7D, 0x38, 0xE8, 0xC1, 0x24, 0x22, 0xD1, 0xC7, 0x51, 0x1E, 0x09, 0x20, 0x52, 0xE5, 0x03, 0x13, 0x41, 0x30, 0x06, 0x2C, 0x26, 0x1B, 0xAB, 0x16, 0x42, 0xA0, 0xD6, 0xD5, 0xFA, 0x10, 0xCD, 0x88, 0xE8, 0x0A, 0xD9, 0xF5, 0xD8, 0x48, 0x16, 0xCB, 0x01, 0xAD, 0x1D, 0x2B, 0xDE, 0x20, 0x03, 0x6E, 0x41, 0xBB, 0x65, 0x03, 0x00, 0xB5, 0xCC, 0xA4, 0x18, 0x00, 0x69, 0x80, 0xAE, 0x13, 0x81, 0x14, 0x55, 0x23, 0xDD, 0x2F, 0xF5, 0x2D, 0x0F, 0x13, 0x0C, 0xAE, 0xFF, 0xCC, 0x18, 0xAA, 0x3D, 0x11, 0xA3, 0x3B, 0x04, 0xD5, 0x29, 0x6F, 0x24, 0x56, 0x0C, 0x41, 0xE5, 0x51, 0xAE, 0x98, 0x80, 0x80, 0x23, 0x5D, 0xB5, 0x1B, 0x00, 0x35, 0x90, 0x1A, 0x05, 0xC0, 0xF6, 0xB8, 0x27, 0xDC, 0xE7, 0x3E, 0xEA, 0xF1, 0x11, 0xB0, 0xCA, 0x55, 0xE6, 0xF0, 0x2E, 0x18, 0x02, 0xA2, 0xD1, 0xEB, 0x19, 0x06, 0xE7, 0x11, 0x99, 0x80, 0xFA, 0xD0, 0xD5, 0x12, 0x13, 0x4C, 0xCD, 0x4A, 0xD1, 0x55, 0x56, 0xEC, 0x21, 0x30, 0x1D, 0x8B, 0xCB, 0x6B, 0xEF, 0x53, 0x80, 0x93, 0xF0, 0xDC, 0x7F, 0xC2, 0x5C, 0x1B, 0x7A, 0xC8, 0xF7, 0x7D, 0xC4, 0x1A, 0x80, 0x50, 0x95, 0x80, 0x63, 0x16, 0xD9, 0xD2, 0xB4, 0xDE, 0xE0, 0xB3, 0x18, 0x2B, 0x06, 0xED, 0xC0, 0xC2, 0x11, 0xC3, 0x3D, 0x52, 0x7F, 0xCC, 0x73, 0x7F, 0xF5, 0x16, 0xC8, 0xD5, 0x27, 0xF5, 0xEC, 0xBA, 0xD4, 0x1E, 0xBA, 0x3E, 0xCB }; static const q7_t ref_add_possat[33] = { 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F }; static const q7_t ref_add_negsat[33] = { 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80 }; static const q7_t ref_sub[256] = { 0x33, 0x23, 0x37, 0x2E, 0x14, 0x21, 0xC5, 0x42, 0x16, 0xC2, 0x02, 0x24, 0x1F, 0x2B, 0xEB, 0xDB, 0x41, 0x0E, 0xDF, 0x40, 0xC2, 0x32, 0x80, 0x8E, 0x32, 0x67, 0xEC, 0xC5, 0xC0, 0xBC, 0x1F, 0xD8, 0x29, 0x37, 0xE5, 0xDB, 0xDC, 0x1C, 0xC3, 0xE9, 0x56, 0x44, 0x55, 0x14, 0xEF, 0x09, 0x44, 0x4E, 0x21, 0xAD, 0x12, 0xB6, 0x14, 0x8E, 0xDF, 0xEC, 0x69, 0x21, 0x17, 0x7F, 0x14, 0x33, 0x17, 0xC1, 0x59, 0x41, 0x10, 0xE0, 0xF6, 0x05, 0x57, 0xF9, 0x5A, 0x42, 0xDC, 0x48, 0x2B, 0xF1, 0x53, 0xA1, 0xBA, 0x0D, 0x5D, 0x40, 0xF5, 0x04, 0xE7, 0xDB, 0xEA, 0x0E, 0x9E, 0x14, 0xAA, 0x0B, 0xE8, 0x11, 0x0B, 0x67, 0x02, 0xD7, 0xD9, 0xFF, 0x01, 0xB2, 0x7F, 0x33, 0xCE, 0x7F, 0xC8, 0x09, 0x44, 0x1D, 0x00, 0xD9, 0x07, 0x0B, 0x24, 0x80, 0xBA, 0x10, 0x0F, 0xBB, 0x27, 0xB5, 0xD2, 0x2D, 0x0A, 0x52, 0xA9, 0x24, 0xD7, 0x86, 0xBC, 0xF1, 0xD4, 0x05, 0xFD, 0xC6, 0xF7, 0xF3, 0x72, 0xD5, 0x3E, 0xDC, 0x28, 0x99, 0x37, 0x29, 0x1A, 0xDA, 0x51, 0x63, 0x80, 0xCA, 0xEF, 0x2D, 0x4E, 0xF3, 0xC5, 0xB4, 0xB6, 0xBF, 0xF0, 0x96, 0x2A, 0xAC, 0xEE, 0xEA, 0x77, 0x80, 0xD5, 0x99, 0xE8, 0x1F, 0x36, 0xA0, 0xBF, 0x35, 0x11, 0xD3, 0x15, 0x80, 0x4F, 0xC3, 0xCA, 0xCC, 0x5A, 0x62, 0xAD, 0xE8, 0x0C, 0xEE, 0xED, 0x80, 0xD4, 0x1E, 0x7F, 0xC3, 0x92, 0x50, 0x1E, 0xD2, 0x1F, 0x86, 0xE3, 0xFC, 0xB3, 0xF9, 0x42, 0x14, 0x11, 0x4B, 0xFC, 0x7F, 0x80, 0x04, 0xD3, 0xA3, 0xDA, 0x4A, 0xE8, 0x71, 0x16, 0x43, 0x13, 0xD4, 0xF0, 0x3B, 0xA1, 0x50, 0x0E, 0x20, 0x7F, 0x0F, 0x22, 0xCD, 0x7F, 0x07, 0x35, 0xFE, 0x7F, 0xE8, 0x68, 0x0E, 0x16, 0x44, 0x00, 0x62, 0xA1, 0xD0, 0x11, 0x11, 0x01, 0x02, 0x2C, 0x48 }; static const q7_t ref_sub_possat[33] = { 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F }; static const q7_t ref_sub_negsat[33] = { 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80 }; static const q7_t ref_mult[256] = { 0x13, 0x00, 0x09, 0xFC, 0x4F, 0x01, 0xFE, 0x01, 0x03, 0xFC, 0x0D, 0x0C, 0x00, 0xFF, 0x00, 0xFD, 0xFE, 0x0A, 0x01, 0xFB, 0x0D, 0xFD, 0xD1, 0xF7, 0xFC, 0x05, 0x04, 0xFA, 0xFB, 0xF8, 0xFE, 0x01, 0xFD, 0xFA, 0x04, 0x08, 0x12, 0x00, 0x02, 0x2B, 0xF6, 0x15, 0xF2, 0x03, 0x0A, 0x03, 0xF8, 0xF4, 0x04, 0xF8, 0x21, 0x14, 0x05, 0xE8, 0x06, 0x02, 0xED, 0x02, 0x05, 0xD5, 0x01, 0xFB, 0x01, 0x06, 0xF2, 0xF8, 0x00, 0x06, 0x04, 0x00, 0xF5, 0x03, 0xF2, 0x06, 0xFE, 0xFE, 0x0E, 0x03, 0xF6, 0xEF, 0xF7, 0x05, 0x0B, 0xF9, 0x00, 0x03, 0xFF, 0x00, 0x09, 0x01, 0xF3, 0xFF, 0xFF, 0x01, 0x03, 0x02, 0x02, 0xEB, 0x18, 0x05, 0x06, 0x14, 0x00, 0xF4, 0xE6, 0x00, 0x0C, 0xCF, 0xFA, 0x15, 0x1A, 0x0B, 0x01, 0x1D, 0x01, 0x0E, 0x00, 0xE2, 0xFB, 0x00, 0x03, 0xF7, 0xFE, 0xF5, 0x09, 0xFC, 0x05, 0xF4, 0x00, 0x05, 0xFD, 0xF4, 0xFE, 0x00, 0x00, 0x03, 0x18, 0xFC, 0x0E, 0x00, 0xEF, 0xFE, 0x05, 0x0B, 0x12, 0x13, 0x2E, 0xFF, 0x0F, 0x08, 0xF5, 0xED, 0xDB, 0x13, 0x01, 0xFC, 0xFC, 0x00, 0x03, 0xF7, 0xF8, 0xF9, 0x07, 0xEB, 0xFD, 0xF3, 0x0C, 0x05, 0xF2, 0xBD, 0xFD, 0xEF, 0x00, 0xFE, 0x0B, 0xF2, 0xF9, 0xFC, 0xFF, 0xFD, 0x00, 0xEC, 0x2B, 0xF9, 0xFF, 0xFE, 0xF1, 0xEE, 0xFE, 0x04, 0x0A, 0x04, 0x0D, 0xDC, 0xFD, 0x00, 0xD8, 0xFA, 0x03, 0xF9, 0x15, 0xFD, 0x0C, 0x06, 0x16, 0x00, 0xF7, 0x26, 0xFF, 0x10, 0x01, 0x12, 0x06, 0xE0, 0xFD, 0x07, 0xFD, 0x10, 0x0A, 0x0C, 0x29, 0xFA, 0x00, 0xFA, 0x03, 0x07, 0x02, 0xFB, 0xFA, 0xF5, 0x03, 0xFE, 0xD1, 0x08, 0x05, 0xFC, 0xDA, 0x07, 0x08, 0x22, 0xDF, 0x19, 0x0B, 0x00, 0x00, 0xFD, 0x04, 0xF0, 0xEF, 0xFC, 0x09, 0x03, 0x02, 0x09, 0x04, 0xFB }; static const q7_t ref_mult_possat[33] = { 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7F }; static const q7_t ref_negate[256] = { 0xAE, 0xFF, 0xB9, 0xE0, 0x5B, 0x03, 0x04, 0xBC, 0x0B, 0x35, 0xD6, 0x19, 0xE2, 0xD8, 0x01, 0x11, 0xC2, 0xD4, 0xFB, 0xCE, 0x52, 0xF7, 0x42, 0x0B, 0xDC, 0x06, 0x22, 0x2A, 0x0C, 0x19, 0xF3, 0x29, 0xF0, 0xE7, 0xF4, 0x38, 0x45, 0xE2, 0xFB, 0x56, 0xBC, 0xA0, 0xD3, 0xDF, 0xE4, 0x10, 0xD2, 0xDB, 0x0C, 0x0F, 0x39, 0xE7, 0xDA, 0x45, 0x30, 0xF8, 0xBA, 0x07, 0x11, 0x82, 0xE7, 0xE2, 0xE5, 0xF6, 0xE1, 0xDE, 0xEE, 0xF0, 0xED, 0xFB, 0xBF, 0xF1, 0xC5, 0x0A, 0x07, 0xBB, 0x1B, 0x1C, 0xEC, 0x33, 0x1B, 0x13, 0x0D, 0xEC, 0x00, 0x11, 0x12, 0x26, 0xE7, 0xEE, 0x4C, 0xF5, 0x55, 0xEC, 0xF6, 0x09, 0xEB, 0xCB, 0xC8, 0xF4, 0x36, 0xCE, 0xFE, 0x27, 0xE1, 0x00, 0x47, 0xA4, 0x1C, 0xC7, 0x20, 0x1A, 0xF7, 0x53, 0xF2, 0xD0, 0xDC, 0x52, 0x0B, 0xFE, 0xE2, 0x1B, 0xE3, 0x20, 0x40, 0xEA, 0x15, 0xCB, 0x56, 0xD0, 0x0C, 0x6B, 0x05, 0x05, 0x2C, 0xE9, 0xCA, 0x0B, 0xDA, 0x00, 0xA7, 0x23, 0xB9, 0x3B, 0x20, 0x7A, 0x36, 0xDA, 0xC5, 0x38, 0xCA, 0xCF, 0x30, 0x53, 0xFB, 0xE7, 0xF9, 0x0C, 0x42, 0x13, 0x37, 0x2D, 0xE9, 0x40, 0xF3, 0x22, 0x31, 0x26, 0x9A, 0x6B, 0x1E, 0x1C, 0x00, 0xF0, 0x14, 0x48, 0x2B, 0xD9, 0xF5, 0x23, 0xED, 0x7B, 0x2D, 0x21, 0x33, 0x30, 0xCA, 0xC6, 0x04, 0x25, 0xD5, 0x20, 0xDF, 0x25, 0x20, 0xE1, 0x9C, 0x10, 0x71, 0xF2, 0xBB, 0x1F, 0xC7, 0x7F, 0x45, 0x0A, 0x38, 0xBE, 0xFE, 0xC8, 0xEA, 0x9E, 0x1E, 0xC5, 0x03, 0x1C, 0x0A, 0x6F, 0xEB, 0x10, 0x55, 0x96, 0xEA, 0xF2, 0x0D, 0x3C, 0x19, 0xF2, 0x56, 0xCC, 0xE3, 0xED, 0xBC, 0x18, 0x0E, 0x11, 0xD2, 0xDE, 0xBC, 0xBF, 0xD4, 0xD2, 0x8C, 0xFE, 0xEA, 0xFA, 0x16, 0xBB, 0x35, 0x22, 0x1B, 0x0D, 0xF1, 0x22, 0xCB, 0xF7 }; static const q7_t ref_negate_possat[33] = { 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F }; static const q7_t ref_offset[256] = { 0x7F, 0x41, 0x7F, 0x60, 0xE5, 0x3D, 0x3C, 0x7F, 0x35, 0x0B, 0x6A, 0x27, 0x5E, 0x68, 0x3F, 0x2F, 0x7E, 0x6C, 0x45, 0x72, 0xEE, 0x49, 0xFE, 0x35, 0x64, 0x3A, 0x1E, 0x16, 0x34, 0x27, 0x4D, 0x17, 0x50, 0x59, 0x4C, 0x08, 0xFB, 0x5E, 0x45, 0xEA, 0x7F, 0x7F, 0x6D, 0x61, 0x5C, 0x30, 0x6E, 0x65, 0x34, 0x31, 0x07, 0x59, 0x66, 0xFB, 0x10, 0x48, 0x7F, 0x39, 0x2F, 0x7F, 0x59, 0x5E, 0x5B, 0x4A, 0x5F, 0x62, 0x52, 0x50, 0x53, 0x45, 0x7F, 0x4F, 0x7B, 0x36, 0x39, 0x7F, 0x25, 0x24, 0x54, 0x0D, 0x25, 0x2D, 0x33, 0x54, 0x40, 0x2F, 0x2E, 0x1A, 0x59, 0x52, 0xF4, 0x4B, 0xEB, 0x54, 0x4A, 0x37, 0x55, 0x75, 0x78, 0x4C, 0x0A, 0x72, 0x42, 0x19, 0x5F, 0x40, 0xF9, 0x7F, 0x24, 0x79, 0x20, 0x26, 0x49, 0xED, 0x4E, 0x70, 0x64, 0xEE, 0x35, 0x42, 0x5E, 0x25, 0x5D, 0x20, 0x00, 0x56, 0x2B, 0x75, 0xEA, 0x70, 0x34, 0xD5, 0x3B, 0x3B, 0x14, 0x57, 0x76, 0x35, 0x66, 0x40, 0x7F, 0x1D, 0x7F, 0x05, 0x20, 0xC6, 0x0A, 0x66, 0x7B, 0x08, 0x76, 0x71, 0x10, 0xED, 0x45, 0x59, 0x47, 0x34, 0xFE, 0x2D, 0x09, 0x13, 0x57, 0x00, 0x4D, 0x1E, 0x0F, 0x1A, 0x7F, 0xD5, 0x22, 0x24, 0x40, 0x50, 0x2C, 0xF8, 0x15, 0x67, 0x4B, 0x1D, 0x53, 0xC5, 0x13, 0x1F, 0x0D, 0x10, 0x76, 0x7A, 0x3C, 0x1B, 0x6B, 0x20, 0x61, 0x1B, 0x20, 0x5F, 0x7F, 0x30, 0xCF, 0x4E, 0x7F, 0x21, 0x79, 0xC0, 0xFB, 0x36, 0x08, 0x7F, 0x42, 0x78, 0x56, 0x7F, 0x22, 0x7B, 0x3D, 0x24, 0x36, 0xD1, 0x55, 0x30, 0xEB, 0x7F, 0x56, 0x4E, 0x33, 0x04, 0x27, 0x4E, 0xEA, 0x74, 0x5D, 0x53, 0x7F, 0x28, 0x32, 0x2F, 0x6E, 0x62, 0x7F, 0x7F, 0x6C, 0x6E, 0x7F, 0x42, 0x56, 0x46, 0x2A, 0x7F, 0x0B, 0x1E, 0x25, 0x33, 0x4F, 0x1E, 0x75, 0x49 }; static const q7_t ref_offset_possat[33] = { 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F, 0x74, 0x7F }; static const q7_t ref_offset_negsat[33] = { 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80, 0x8C, 0x80 }; static const q7_t ref_scale[256] = { 0x29, 0x00, 0x23, 0x10, 0xD2, 0xFF, 0xFE, 0x22, 0xFA, 0xE5, 0x15, 0xF3, 0x0F, 0x14, 0xFF, 0xF7, 0x1F, 0x16, 0x02, 0x19, 0xD7, 0x05, 0xDF, 0xFA, 0x12, 0xFD, 0xEF, 0xEB, 0xFA, 0xF3, 0x07, 0xEB, 0x08, 0x0C, 0x06, 0xE4, 0xDD, 0x0F, 0x02, 0xD5, 0x22, 0x30, 0x17, 0x10, 0x0E, 0xF8, 0x17, 0x12, 0xFA, 0xF9, 0xE3, 0x0D, 0x13, 0xDD, 0xE8, 0x04, 0x23, 0xFD, 0xF8, 0x3F, 0x0C, 0x0F, 0x0E, 0x05, 0x10, 0x11, 0x09, 0x08, 0x09, 0x03, 0x21, 0x08, 0x1D, 0xFB, 0xFC, 0x23, 0xF3, 0xF2, 0x0A, 0xE7, 0xF2, 0xF6, 0xF9, 0x0A, 0x00, 0xF7, 0xF7, 0xED, 0x0C, 0x09, 0xDA, 0x05, 0xD6, 0x0A, 0x05, 0xFC, 0x0B, 0x1A, 0x1C, 0x06, 0xE5, 0x19, 0x01, 0xED, 0x10, 0x00, 0xDD, 0x2E, 0xF2, 0x1C, 0xF0, 0xF3, 0x05, 0xD6, 0x07, 0x18, 0x12, 0xD7, 0xFA, 0x01, 0x0F, 0xF3, 0x0F, 0xF0, 0xE0, 0x0B, 0xF6, 0x1A, 0xD5, 0x18, 0xFA, 0xCA, 0xFE, 0xFD, 0xEA, 0x0B, 0x1B, 0xFB, 0x13, 0x00, 0x2D, 0xEE, 0x24, 0xE3, 0xF0, 0xC3, 0xE5, 0x13, 0x1E, 0xE4, 0x1B, 0x19, 0xE8, 0xD6, 0x02, 0x0D, 0x03, 0xFA, 0xDF, 0xF7, 0xE5, 0xEA, 0x0C, 0xE0, 0x07, 0xEF, 0xE7, 0xED, 0x33, 0xCB, 0xF1, 0xF2, 0x00, 0x08, 0xF6, 0xDC, 0xEB, 0x14, 0x06, 0xEE, 0x0A, 0xC2, 0xEA, 0xEF, 0xE7, 0xE8, 0x1B, 0x1D, 0xFE, 0xED, 0x16, 0xF0, 0x10, 0xED, 0xF0, 0x10, 0x32, 0xF8, 0xC7, 0x07, 0x22, 0xF0, 0x1D, 0xC0, 0xDE, 0xFB, 0xE4, 0x21, 0x01, 0x1C, 0x0B, 0x31, 0xF1, 0x1E, 0xFF, 0xF2, 0xFB, 0xC9, 0x0B, 0xF8, 0xD5, 0x35, 0x0B, 0x07, 0xF9, 0xE2, 0xF4, 0x07, 0xD5, 0x1A, 0x0E, 0x09, 0x22, 0xF4, 0xF9, 0xF8, 0x17, 0x11, 0x22, 0x21, 0x16, 0x17, 0x3A, 0x01, 0x0B, 0x03, 0xF5, 0x22, 0xE6, 0xEF, 0xF3, 0xF9, 0x08, 0xEF, 0x1B, 0x05 }; static const q7_t ref_scale_possat[33] = { 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F }; static const q31_t ref_dot_prod_3[1] = { 0x00003F91 }; static const q31_t ref_dot_prod_4[1] = { 0x00002194 }; static const q31_t ref_dot_prod_4n1[1] = { 0x0000451D }; static const q31_t ref_dot_prod_long[1] = { 0x00000CE0 }; static const q7_t ref_abs[256] = { 0x52, 0x01, 0x47, 0x20, 0x5B, 0x03, 0x04, 0x44, 0x0B, 0x35, 0x2A, 0x19, 0x1E, 0x28, 0x01, 0x11, 0x3E, 0x2C, 0x05, 0x32, 0x52, 0x09, 0x42, 0x0B, 0x24, 0x06, 0x22, 0x2A, 0x0C, 0x19, 0x0D, 0x29, 0x10, 0x19, 0x0C, 0x38, 0x45, 0x1E, 0x05, 0x56, 0x44, 0x60, 0x2D, 0x21, 0x1C, 0x10, 0x2E, 0x25, 0x0C, 0x0F, 0x39, 0x19, 0x26, 0x45, 0x30, 0x08, 0x46, 0x07, 0x11, 0x7E, 0x19, 0x1E, 0x1B, 0x0A, 0x1F, 0x22, 0x12, 0x10, 0x13, 0x05, 0x41, 0x0F, 0x3B, 0x0A, 0x07, 0x45, 0x1B, 0x1C, 0x14, 0x33, 0x1B, 0x13, 0x0D, 0x14, 0x00, 0x11, 0x12, 0x26, 0x19, 0x12, 0x4C, 0x0B, 0x55, 0x14, 0x0A, 0x09, 0x15, 0x35, 0x38, 0x0C, 0x36, 0x32, 0x02, 0x27, 0x1F, 0x00, 0x47, 0x5C, 0x1C, 0x39, 0x20, 0x1A, 0x09, 0x53, 0x0E, 0x30, 0x24, 0x52, 0x0B, 0x02, 0x1E, 0x1B, 0x1D, 0x20, 0x40, 0x16, 0x15, 0x35, 0x56, 0x30, 0x0C, 0x6B, 0x05, 0x05, 0x2C, 0x17, 0x36, 0x0B, 0x26, 0x00, 0x59, 0x23, 0x47, 0x3B, 0x20, 0x7A, 0x36, 0x26, 0x3B, 0x38, 0x36, 0x31, 0x30, 0x53, 0x05, 0x19, 0x07, 0x0C, 0x42, 0x13, 0x37, 0x2D, 0x17, 0x40, 0x0D, 0x22, 0x31, 0x26, 0x66, 0x6B, 0x1E, 0x1C, 0x00, 0x10, 0x14, 0x48, 0x2B, 0x27, 0x0B, 0x23, 0x13, 0x7B, 0x2D, 0x21, 0x33, 0x30, 0x36, 0x3A, 0x04, 0x25, 0x2B, 0x20, 0x21, 0x25, 0x20, 0x1F, 0x64, 0x10, 0x71, 0x0E, 0x45, 0x1F, 0x39, 0x7F, 0x45, 0x0A, 0x38, 0x42, 0x02, 0x38, 0x16, 0x62, 0x1E, 0x3B, 0x03, 0x1C, 0x0A, 0x6F, 0x15, 0x10, 0x55, 0x6A, 0x16, 0x0E, 0x0D, 0x3C, 0x19, 0x0E, 0x56, 0x34, 0x1D, 0x13, 0x44, 0x18, 0x0E, 0x11, 0x2E, 0x22, 0x44, 0x41, 0x2C, 0x2E, 0x74, 0x02, 0x16, 0x06, 0x16, 0x45, 0x35, 0x22, 0x1B, 0x0D, 0x0F, 0x22, 0x35, 0x09 }; static const q7_t ref_shift[33] = { 0xEC, 0xFB, 0xE9, 0x35, 0x1B, 0x25, 0xF3, 0x21, 0xEB, 0x04, 0xC7, 0xAB, 0xEA, 0xEF, 0x28, 0xBF, 0xF6, 0xCC, 0xDF, 0xDC, 0x05, 0x30, 0x1C, 0x1B, 0x2C, 0xEF, 0xE7, 0xE4, 0xFE, 0x1E, 0xEC, 0x19, 0x38 }; static const q7_t ref_shift_possat[33] = { 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x7F }; static const q7_t ref_shift_negsat[33] = { 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80, 0xFE, 0x80 }; static const uint8_t ref_and[47] = { 0xA3, 0xC0, 0x11, 0xC8, 0x08, 0x0A, 0x00, 0x48, 0x92, 0x00, 0xA1, 0x02, 0x00, 0x64, 0x00, 0x08, 0x40, 0x00, 0x04, 0x10, 0x94, 0x88, 0x50, 0x42, 0x26, 0x04, 0x08, 0x08, 0x3E, 0x01, 0x40, 0x04, 0x04, 0x13, 0x40, 0x04, 0x20, 0x02, 0x38, 0x04, 0x80, 0x00, 0x84, 0x00, 0x81, 0x40, 0x39 }; static const uint8_t ref_or[47] = { 0xFF, 0xF7, 0xFB, 0xDA, 0xDF, 0xEF, 0x31, 0xFC, 0xF2, 0xD0, 0xFB, 0xE6, 0xCD, 0xEE, 0xFE, 0xFE, 0xC7, 0x35, 0x7D, 0xF9, 0xDF, 0xDE, 0x5F, 0xD6, 0xFF, 0x7C, 0xCF, 0x3C, 0x3F, 0xFF, 0xFE, 0xFF, 0xF5, 0x7F, 0xFA, 0xFE, 0xFC, 0xEF, 0x7B, 0xFE, 0xAA, 0x8F, 0xE7, 0xFB, 0x97, 0xE5, 0xF9 }; static const uint8_t ref_not[47] = { 0x04, 0x2B, 0x0E, 0x27, 0x75, 0x70, 0xFF, 0x07, 0x2D, 0x2F, 0x1C, 0xB9, 0x3B, 0x9B, 0xA1, 0x47, 0xBA, 0xEB, 0xE3, 0x8E, 0x62, 0x65, 0xA0, 0xBD, 0x01, 0x83, 0x35, 0xD3, 0xC0, 0xE4, 0x05, 0x38, 0x4A, 0xCC, 0x8D, 0xB9, 0x0F, 0x75, 0xC6, 0x33, 0x5D, 0xFA, 0x5B, 0xBE, 0x78, 0x1F, 0x86 }; static const uint8_t ref_xor[47] = { 0x5C, 0x37, 0xEA, 0x12, 0xD7, 0xE5, 0x31, 0xB4, 0x60, 0xD0, 0x5A, 0xE4, 0xCD, 0x8A, 0xFE, 0xF6, 0x87, 0x35, 0x79, 0xE9, 0x4B, 0x56, 0x0F, 0x94, 0xD9, 0x78, 0xC7, 0x34, 0x01, 0xFE, 0xBE, 0xFB, 0xF1, 0x6C, 0xBA, 0xFA, 0xDC, 0xED, 0x43, 0xFA, 0x2A, 0x8F, 0x63, 0xFB, 0x16, 0xA5, 0xC0 }; static const q7_t ref_clip1[271] = { 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC1, 0xC1, 0xC2, 0xC3, 0xC4, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC8, 0xC9, 0xCA, 0xCB, 0xCB, 0xCC, 0xCD, 0xCE, 0xCE, 0xCF, 0xD0, 0xD1, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD5, 0xD6, 0xD7, 0xD8, 0xD8, 0xD9, 0xDA, 0xDB, 0xDB, 0xDC, 0xDD, 0xDE, 0xDE, 0xDF, 0xE0, 0xE1, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE5, 0xE6, 0xE7, 0xE8, 0xE8, 0xE9, 0xEA, 0xEB, 0xEB, 0xEC, 0xED, 0xEE, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF2, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3, 0xF3 }; static const q7_t ref_clip2[288] = { 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC1, 0xC1, 0xC2, 0xC3, 0xC4, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC8, 0xC9, 0xCA, 0xCB, 0xCB, 0xCC, 0xCD, 0xCE, 0xCE, 0xCF, 0xD0, 0xD1, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD5, 0xD6, 0xD7, 0xD8, 0xD8, 0xD9, 0xDA, 0xDB, 0xDB, 0xDC, 0xDD, 0xDE, 0xDE, 0xDF, 0xE0, 0xE1, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE5, 0xE6, 0xE7, 0xE8, 0xE8, 0xE9, 0xEA, 0xEB, 0xEB, 0xEC, 0xED, 0xEE, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF2, 0xF3, 0xF4, 0xF5, 0xF5, 0xF6, 0xF7, 0xF8, 0xF8, 0xF9, 0xFA, 0xFB, 0xFB, 0xFC, 0xFD, 0xFE, 0xFE, 0xFF, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x06, 0x07, 0x08, 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x0C, 0x0D, 0x0E, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x12, 0x13, 0x14, 0x15, 0x15, 0x16, 0x17, 0x18, 0x18, 0x19, 0x1A, 0x1B, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x1F, 0x20, 0x21, 0x22, 0x22, 0x23, 0x24, 0x25, 0x25, 0x26, 0x27, 0x28, 0x28, 0x29, 0x2A, 0x2B, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x2F, 0x30, 0x31, 0x32, 0x32, 0x33, 0x34, 0x35, 0x35, 0x36, 0x37, 0x38, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3C, 0x3D, 0x3E, 0x3F, 0x3F, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }; static const q7_t ref_clip3[303] = { 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0E, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x12, 0x13, 0x14, 0x15, 0x15, 0x16, 0x17, 0x18, 0x18, 0x19, 0x1A, 0x1B, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x1F, 0x20, 0x21, 0x22, 0x22, 0x23, 0x24, 0x25, 0x25, 0x26, 0x27, 0x28, 0x28, 0x29, 0x2A, 0x2B, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x2F, 0x30, 0x31, 0x32, 0x32, 0x33, 0x34, 0x35, 0x35, 0x36, 0x37, 0x38, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3C, 0x3D, 0x3E, 0x3F, 0x3F, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 };
Max
1
Trifunik/zephyr
tests/lib/cmsis_dsp/basicmath/src/q7.pat
[ "Apache-2.0" ]
%{ //#define YYDEBUG /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !! !! ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION !! !! !! !! DO NOT CHANGE THIS FILE (CqlParser.cs) BY HAND!!!! !! !! YOU HAVE BEEN WARNED !!!! !! !! !! !! ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION !! !! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ using System; using System.Data.Common.EntitySql.AST; using System.Data.Entity; /*////////////////////////////////////////////////////////////////////////////// This pragma is needed since symbols used for defining precedence are not always code generated by yacc ///////////////////////////////////////////////////////////////////////////////*/ #pragma warning disable 414 %} %token IDENTIFIER, ESCAPED_IDENTIFIER %token PARAMETER, LITERAL // // Keywords // %token ALL, AND, ANYELEMENT, APPLY, AS, ASC %token BETWEEN, BY %token CASE, CAST, COLLATE, COLLECTION, CROSS, CREATEREF %token DEREF, DESC, DISTINCT %token ELEMENT, ELSE, END, EXCEPT, EXISTS, ESCAPE %token FLATTEN, FROM, FULL, FUNCTION %token GROUP, GROUPPARTITION %token HAVING %token IN, INNER, INTERSECT, IS %token JOIN %token KEY %token LEFT, LIKE, LIMIT %token MULTISET %token NAVIGATE NOT NULL %token OF, OFTYPE, ON, OR, ORDER, OUTER, OVERLAPS, ONLY %token QMARK %token REF, RELATIONSHIP, RIGHT, ROW %token SELECT, SET, SKIP %token THEN, TOP, TREAT %token UNION, USING %token VALUE %token WHEN, WHERE, WITH // // Punctuators & Operators // %token COMMA, COLON, SCOLON, DOT, EQUAL %token L_PAREN, R_PAREN, L_BRACE, R_BRACE, L_CURLY, R_CURLY %token PLUS, MINUS %token STAR, FSLASH, PERCENT %token NOT, AND, OR %token OP_EQ, OP_NEQ, OP_LT, OP_LE, OP_GT, OP_GE // // Precedence (increasing in the order of declaration) // %left OR %left AND %right NOT %nonassoc BETWEEN %nonassoc IS %nonassoc IN %nonassoc LIKE %nonassoc ESCAPE %left OVERLAPS %left EXCEPT %left UNION ALL %left INTERSECT %nonassoc OP_EQ EQUAL OP_NEQ %nonassoc OP_GT OP_LT OP_GE OP_LE %left PLUS MINUS %left STAR FSLASH PERCENT %right UNARYPLUS UNARYMINUS %left DOT %nonassoc LEFT RIGHT CROSS OUTER INNER FULL %left APPLY JOIN %left ON %nonassoc AS %start commandStart %% commandStart : /* e */ { $$ = _parsedTree = null; } | command { $$ = _parsedTree = (Node)$1; } ; command : optNamespaceImportList queryStatement { $$ = new Command(ToNodeList<NamespaceImport>($1),(Statement)$2); SetErrCtx(AstNode($$), ($1 != null) ? AstNodePos($1) : AstNodePos($2), EntityRes.CtxCommandExpression); } ; //~~~~~~~~~~~~~~ // Prolog //~~~~~~~~~~~~~~ optNamespaceImportList: /* e */ { $$ = null; } | namespaceImportList { $$ = $1; } ; namespaceImportList : namespaceImport { $$ = new NodeList<NamespaceImport>((NamespaceImport)$1); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxNamespaceImportList); } | namespaceImportList namespaceImport { $$ = ToNodeList<NamespaceImport>($1).Add((NamespaceImport)$2); } ; namespaceImport : USING identifier SCOLON { $$ = new NamespaceImport((Identifier)$2); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxNamespaceImport); } | USING dotExpr SCOLON { $$ = new NamespaceImport((DotExpr)$2); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxNamespaceImport); } | USING assignExpr SCOLON { $$ = new NamespaceImport((BuiltInExpr)$2); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxAliasedNamespaceImport); } ; //~~~~~~~~~~~~~~~~ // Query statement //~~~~~~~~~~~~~~~~ queryStatement : optQueryDefList generalExpr optSemiColon { $$ = new QueryStatement(ToNodeList<AST.FunctionDefinition>($1),(Node)$2); SetErrCtx(AstNode($$), ($1 != null) ? AstNodePos($1) : AstNodePos($2), EntityRes.CtxQueryStatement); } ; //~~~~~~~~~~~~~~~~~~~~~~~~ // Query inline definitions //~~~~~~~~~~~~~~~~~~~~~~~~ optQueryDefList: /* e */ { $$ = null; } | functionDefList { $$ = $1; } ; functionDefList : functionDef { $$ = new NodeList<AST.FunctionDefinition>((AST.FunctionDefinition)$1); SetErrCtx(AstNode($$), AstNodePos($1), AstNode($1).ErrCtx.ErrorContextInfo); } | functionDefList functionDef { $$ = ToNodeList<AST.FunctionDefinition>($1).Add((AST.FunctionDefinition)$2); SetErrCtx(AstNode($$), AstNodePos($$), AstNode($2).ErrCtx.ErrorContextInfo); } ; functionDef : FUNCTION identifier functionParamsDef AS L_PAREN generalExpr R_PAREN { $$ = new AST.FunctionDefinition((Identifier)$2, ToNodeList<PropDefinition>($3), (Node)$6, Terminal($1).IPos, Terminal($7).IPos); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxFunctionDefinition); } ; functionParamsDef : L_PAREN /* e */ R_PAREN { $$ = null; } | L_PAREN functionParamDefList R_PAREN { $$ = $2; } ; functionParamDefList : functionParamDef { $$ = new NodeList<PropDefinition>((PropDefinition)$1); SetErrCtx(AstNode($$), AstNodePos($1), AstNode($1).ErrCtx.ErrorContextInfo); } | functionParamDefList COMMA functionParamDef { $$ = ToNodeList<PropDefinition>($1).Add((PropDefinition)$3); SetErrCtx(AstNode($$), AstNodePos($$), AstNode($3).ErrCtx.ErrorContextInfo); } ; functionParamDef : identifier typeDef { $$ = new PropDefinition((Identifier)$1, (Node)$2); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxFunctionDefinition); } ; //~~~~~~~~~~~~~~ // General Expr //~~~~~~~~~~~~~~ generalExpr : queryExpr { $$ = $1; } | Expr { $$ = $1; } ; optSemiColon : /* e */ { $$ = null; } | SCOLON { $$ = null; } ; //~~~~~~~~~~~~~~ // Query Expr //~~~~~~~~~~~~~~ queryExpr : selectClause fromClause optWhereClause optGroupByClause optHavingClause optOrderByClause { $$ = new QueryExpr( (SelectClause)$1 , (FromClause)$2 , (Node)$3 , (GroupByClause)$4 , (HavingClause)$5 , (OrderByClause)$6 ); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxQueryExpression); } ; selectClause : SELECT { StartMethodExprCounting(); } optAllOrDistinct optTopClause aliasExprList { $$ = new SelectClause(ToNodeList<AliasedExpr>($5), SelectKind.Row, (DistinctKind)$3, (Node)$4, EndMethodExprCounting()); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxSelectRowClause); } | SELECT { StartMethodExprCounting(); } VALUE optAllOrDistinct optTopClause aliasExprList { $$ = new SelectClause(ToNodeList<AliasedExpr>($6), SelectKind.Value, (DistinctKind)$4, (Node)$5, EndMethodExprCounting()); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxSelectValueClause); } ; optAllOrDistinct : /* e */ { $$ = DistinctKind.None; } | ALL { $$ = DistinctKind.All; } | DISTINCT { $$ = DistinctKind.Distinct; } ; optTopClause : /* e */ { $$ = null; } | TOP L_PAREN generalExpr R_PAREN { $$ = $3; SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxTopSubClause); } ; fromClause : FROM fromClauseList { $$ = new FromClause(ToNodeList<FromClauseItem>($2)); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxFromClause); } ; fromClauseList : fromClauseItem { $$ = new NodeList<FromClauseItem>((FromClauseItem)$1); SetErrCtx(AstNode($$), AstNodePos($1), AstNode($1).ErrCtx.ErrorContextInfo); } | fromClauseList COMMA fromClauseItem { $$ = ToNodeList<FromClauseItem>($1).Add((FromClauseItem)$3); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxFromClauseList); } ; fromClauseItem : aliasExpr { $$ = new FromClauseItem((AliasedExpr)$1); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxFromClauseItem); } | L_PAREN joinClauseItem R_PAREN { $$ = new FromClauseItem((JoinClauseItem)$2); SetErrCtx(AstNode($$), AstNodePos($2), EntityRes.CtxFromJoinClause); } | joinClauseItem { $$ = new FromClauseItem((JoinClauseItem)$1); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxFromJoinClause); } | L_PAREN applyClauseItem R_PAREN { $$ = new FromClauseItem((ApplyClauseItem)$2); SetErrCtx(AstNode($$), AstNodePos($2), EntityRes.CtxFromApplyClause); } | applyClauseItem { $$ = new FromClauseItem((ApplyClauseItem)$1); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxFromApplyClause); } ; joinClauseItem : fromClauseItem joinType fromClauseItem %prec JOIN { $$ = new JoinClauseItem((FromClauseItem)$1, (FromClauseItem)$3, (JoinKind)$2); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxJoinClause); } | fromClauseItem joinType fromClauseItem ON Expr %prec ON { $$ = new JoinClauseItem((FromClauseItem)$1, (FromClauseItem)$3, (JoinKind)$2, (Node)$5); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxJoinOnClause); } ; applyClauseItem : fromClauseItem applyType fromClauseItem %prec APPLY { $$ = new ApplyClauseItem((FromClauseItem)$1, (FromClauseItem)$3, (ApplyKind)$2); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxApplyClause); } ; joinType : CROSS JOIN { $$ = JoinKind.Cross; } | LEFT OUTER JOIN { $$ = JoinKind.LeftOuter; } | LEFT JOIN { $$ = JoinKind.LeftOuter; } | RIGHT OUTER JOIN { $$ = JoinKind.RightOuter; } | RIGHT JOIN { $$ = JoinKind.RightOuter; } | JOIN { $$ = JoinKind.Inner; } | INNER JOIN { $$ = JoinKind.Inner; } | FULL JOIN { $$ = JoinKind.FullOuter; } | FULL OUTER JOIN { $$ = JoinKind.FullOuter; } | FULL OUTER { $$ = JoinKind.FullOuter; } ; applyType : CROSS APPLY { $$ = ApplyKind.Cross; } | OUTER APPLY { $$ = ApplyKind.Outer; }; optWhereClause : /* e */ { $$ = null; } | whereClause { $$ = $1; } ; whereClause : WHERE Expr { $$ = (Node)$2; SetErrCtx(AstNode($$), AstNodePos($2), EntityRes.CtxWhereClause); } ; optGroupByClause : /* e */ { $$ = null; } | groupByClause { $$ = $1; } ; groupByClause : GROUP BY aliasExprList { $$ = new GroupByClause(ToNodeList<AliasedExpr>($3)); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxGroupByClause); } ; optHavingClause : /* e */ { $$ = null; } | havingClause { $$ = $1; } ; havingClause : HAVING { StartMethodExprCounting(); } Expr { $$ = new HavingClause((Node)$3, EndMethodExprCounting()); SetErrCtx(AstNode($$), AstNodePos($3), EntityRes.CtxHavingClause); } ; optOrderByClause : /* e */ { $$ = null; } | orderByClause { $$ = $1; } ; orderByClause : ORDER BY { StartMethodExprCounting(); } orderByItemList optSkipSubClause optLimitSubClause { $$ = new OrderByClause(ToNodeList<OrderByClauseItem>($4), (Node)$5, (Node)$6, EndMethodExprCounting()); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxOrderByClauseItem); } ; optSkipSubClause : /* e */ { $$ = null; } | SKIP Expr { $$ = $2; SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxSkipSubClause); } ; optLimitSubClause : /* e */ { $$ = null; } | LIMIT Expr { $$ = $2; SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxLimitSubClause); } ; orderByItemList : orderByClauseItem { $$ = new NodeList<OrderByClauseItem>((OrderByClauseItem)$1); SetErrCtx(AstNode($$), AstNodePos($1), AstNode($1).ErrCtx.ErrorContextInfo); } | orderByItemList COMMA orderByClauseItem { $$ = ToNodeList<OrderByClauseItem>($1).Add((OrderByClauseItem)$3); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxOrderByClause); } ; orderByClauseItem : Expr optAscDesc { $$ = new OrderByClauseItem((Node)$1, (OrderKind)$2); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxOrderByClauseItem); } | Expr COLLATE simpleIdentifier optAscDesc { $$ = new OrderByClauseItem((Node)$1, (OrderKind)$4, (Identifier)$3); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxCollatedOrderByClauseItem); } ; optAscDesc : /* e */ { $$ = OrderKind.None; } | ASC { $$ = OrderKind.Asc; } | DESC { $$ = OrderKind.Desc; }; //~~~~~~~~~~~~~~~~~~~~~ // Expressions //~~~~~~~~~~~~~~~~~~~~~ exprList : Expr { $$ = new NodeList<Node>((Node)$1); SetErrCtx(AstNode($$), AstNodePos($1), AstNode($1).ErrCtx.ErrorContextInfo); } | exprList COMMA Expr { $$ = ToNodeList<Node>($1).Add((Node)$3); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxExpressionList); } ; Expr : parenExpr { $$ = $1; } | PARAMETER { $$ = (QueryParameter)$1; } | identifier { $$ = (Identifier)$1; } | builtInExpr { $$ = $1; } | dotExpr { $$ = $1; } | refExpr { $$ = $1; } | createRefExpr { $$ = $1; } | keyExpr { $$ = $1; } | groupPartitionExpr { $$ = $1; IncrementMethodExprCount(); } | methodExpr { $$ = $1; IncrementMethodExprCount(); } | ctorExpr { $$ = $1; } | derefExpr { $$ = $1; } | navigateExpr { $$ = $1; } | literalExpr { $$ = $1; } ; parenExpr : L_PAREN generalExpr R_PAREN { $$ = new ParenExpr((Node)$2); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxParen); } ; betweenPrefix : Expr BETWEEN Expr %prec BETWEEN { $$ = new NodeList<Node>((Node)$1).Add((Node)$3); } ; notBetweenPrefix : Expr NOT BETWEEN Expr %prec BETWEEN { $$ = new NodeList<Node>((Node)$1).Add((Node)$4); } ; builtInExpr // // Arithmetic // : Expr PLUS Expr { $$ = new BuiltInExpr(BuiltInKind.Plus, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxPlus); } | Expr MINUS Expr { $$ = new BuiltInExpr(BuiltInKind.Minus, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxMinus); } | Expr STAR Expr { $$ = new BuiltInExpr(BuiltInKind.Multiply, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxMultiply); } | Expr FSLASH Expr { $$ = new BuiltInExpr(BuiltInKind.Divide, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxDivide); } | Expr PERCENT Expr { $$ = new BuiltInExpr(BuiltInKind.Modulus, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxModulus); } | MINUS Expr %prec UNARYMINUS { Literal literal = $2 as Literal; if ( literal != null && literal.IsNumber && !literal.IsSignedNumber ) { literal.PrefixSign(Terminal($1).Token); $$ = $2; } else { $$ = new BuiltInExpr(BuiltInKind.UnaryMinus, Terminal($1).Token, (Node)$2); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxUnaryMinus); } } | PLUS Expr %prec UNARYPLUS { Literal literal = $2 as Literal; if ( null != literal && literal.IsNumber && !literal.IsSignedNumber ) { literal.PrefixSign(Terminal($1).Token); $$ = $2; } else { $$ = new BuiltInExpr(BuiltInKind.UnaryPlus, Terminal($1).Token, (Node)$2); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxUnaryPlus); } } // // Comparison // | Expr OP_NEQ Expr { $$ = new BuiltInExpr(BuiltInKind.NotEqual, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxNotEqual); } | Expr OP_GT Expr { $$ = new BuiltInExpr(BuiltInKind.GreaterThan, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxGreaterThan); } | Expr OP_GE Expr { $$ = new BuiltInExpr(BuiltInKind.GreaterEqual, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxGreaterThanEqual); } | Expr OP_LT Expr { $$ = new BuiltInExpr(BuiltInKind.LessThan, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxLessThan); } | Expr OP_LE Expr { $$ = new BuiltInExpr(BuiltInKind.LessEqual, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxLessThanEqual); } // // Set & Multiset Operations // | Expr INTERSECT Expr { $$ = new BuiltInExpr(BuiltInKind.Intersect, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxIntersect); } | Expr UNION Expr { $$ = new BuiltInExpr(BuiltInKind.Union, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxUnion); } | Expr UNION ALL Expr { $$ = new BuiltInExpr(BuiltInKind.UnionAll, Terminal($2).Token, (Node)$1, (Node)$4); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxUnionAll); } | Expr EXCEPT Expr { $$ = new BuiltInExpr(BuiltInKind.Except, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxExcept); } | Expr OVERLAPS Expr { $$ = new BuiltInExpr(BuiltInKind.Overlaps, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxOverlaps); } | Expr IN Expr { $$ = new BuiltInExpr(BuiltInKind.In, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxIn); } | Expr NOT IN Expr { $$ = new BuiltInExpr(BuiltInKind.NotIn, Terminal($2).Token, (Node)$1, (Node)$4); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxNotIn); } | EXISTS L_PAREN generalExpr R_PAREN { $$ = new BuiltInExpr(BuiltInKind.Exists, Terminal($1).Token, (Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxExists); } | ANYELEMENT L_PAREN generalExpr R_PAREN { $$ = new BuiltInExpr(BuiltInKind.AnyElement, Terminal($1).Token, (Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxAnyElement); } | ELEMENT L_PAREN generalExpr R_PAREN { $$ = new BuiltInExpr(BuiltInKind.Element, Terminal($1).Token, (Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxElement); } | FLATTEN L_PAREN generalExpr R_PAREN { $$ = new BuiltInExpr(BuiltInKind.Flatten, Terminal($1).Token, (Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxFlatten); } | SET L_PAREN generalExpr R_PAREN { $$ = new BuiltInExpr(BuiltInKind.Distinct, Terminal($1).Token, (Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxSet); } // // Nullability Test Ops // | Expr IS NULL { $$ = new BuiltInExpr(BuiltInKind.IsNull, "IsNull", (Node)$1); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxIsNull); } | Expr IS NOT NULL { $$ = new BuiltInExpr(BuiltInKind.IsNotNull, "IsNotNull", (Node)$1); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxIsNotNull); } // // Case When Then Expr // | searchedCaseExpr { $$ = (CaseExpr)$1; } // // Type Ops // | TREAT L_PAREN Expr AS typeName R_PAREN { $$ = new BuiltInExpr(BuiltInKind.Treat, Terminal($1).Token, (Node)$3, (Node)$5); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxTreat); } | CAST L_PAREN Expr AS typeName R_PAREN { $$ = new BuiltInExpr(BuiltInKind.Cast, Terminal($1).Token, (Node)$3, (Node)$5); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxCast); } // // OFTYPE(e, [ONLY] T) // | OFTYPE L_PAREN Expr COMMA typeName R_PAREN { $$ = new BuiltInExpr(BuiltInKind.OfType, Terminal($1).Token, (Node)$3, (Node)$5, Literal.NewBooleanLiteral( false ) /* only */); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxOfType); } | OFTYPE L_PAREN Expr COMMA ONLY typeName R_PAREN { $$ = new BuiltInExpr(BuiltInKind.OfType, "OFTYPE ONLY", (Node)$3, (Node)$6, Literal.NewBooleanLiteral( true ) /* only */); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxOfTypeOnly); } // // IS [NOT] OF ( [ONLY] T ) // | Expr IS OF L_PAREN typeName R_PAREN { $$ = new BuiltInExpr( BuiltInKind.IsOf, "IS OF", (Node)$1, (Node)$5, Literal.NewBooleanLiteral( false ), /* only */ Literal.NewBooleanLiteral( false ) /* not */ ); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxIsOf); } | Expr IS NOT OF L_PAREN typeName R_PAREN { $$ = new BuiltInExpr( BuiltInKind.IsOf, "IS NOT OF", (Node)$1, /* instance */ (Node)$6, /* type */ Literal.NewBooleanLiteral( false ), /* only */ Literal.NewBooleanLiteral( true ) /* not */ ); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxIsNotOf); } | Expr IS OF L_PAREN ONLY typeName R_PAREN { $$ = new BuiltInExpr( BuiltInKind.IsOf, "IS OF ONLY", (Node)$1, /* instance */ (Node)$6, /* type */ Literal.NewBooleanLiteral( true ), /* only */ Literal.NewBooleanLiteral( false ) /* not */ ); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxIsOf); } | Expr IS NOT OF L_PAREN ONLY typeName R_PAREN { $$ = new BuiltInExpr( BuiltInKind.IsOf, "IS NOT OF ONLY", (Node)$1, /* instance */ (Node)$7, /* type */ Literal.NewBooleanLiteral( true ), /* only */ Literal.NewBooleanLiteral( true ) /* not */ ); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxIsNotOf); } // // Like // | Expr LIKE Expr { $$ = new BuiltInExpr(BuiltInKind.Like, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxLike); } | Expr NOT LIKE Expr { $$ = new BuiltInExpr(BuiltInKind.Not, Terminal($2).Token, new BuiltInExpr(BuiltInKind.Like, Terminal($3).Token, (Node)$1, (Node)$4)); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxNotLike); } | Expr LIKE Expr ESCAPE Expr { $$ = new BuiltInExpr(BuiltInKind.Like, Terminal($2).Token, (Node)$1, (Node)$3, (Node)$5); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxLike); } | Expr NOT LIKE Expr ESCAPE Expr { $$ = new BuiltInExpr(BuiltInKind.Not, Terminal($2).Token, new BuiltInExpr(BuiltInKind.Like, Terminal($3).Token, (Node)$1, (Node)$4, (Node)$6)); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxNotLike); } // // Between // | betweenPrefix AND Expr { NodeList<Node> elist = (NodeList<Node>)$1; System.Diagnostics.Debug.Assert(elist.Count==2); $$ = new BuiltInExpr(BuiltInKind.Between, "between", elist[0], elist[1], (Node)$3 ); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxBetween); } // // Not Between // | notBetweenPrefix AND Expr { NodeList<Node> elist = (NodeList<Node>)$1; System.Diagnostics.Debug.Assert(elist.Count==2); $$ = new BuiltInExpr(BuiltInKind.NotBetween, "notbetween", elist[0], elist[1], (Node)$3 ); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxNotBetween); } // // Logical // | Expr OR Expr { $$ = new BuiltInExpr(BuiltInKind.Or, "or", (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxOr); } | NOT Expr { $$ = new BuiltInExpr(BuiltInKind.Not, "not", (Node)$2); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxNot); } | Expr AND Expr // see note (1) in the file header { $$ = new BuiltInExpr(BuiltInKind.And, "and", (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxAnd); } | equalsOrAssignExpr { $$ = $1; } ; equalsOrAssignExpr : assignExpr { $$ = $1; } | equalsExpr { $$ = $1; } ; assignExpr : Expr EQUAL Expr { $$ = new BuiltInExpr(BuiltInKind.Equal, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxEquals); } ; equalsExpr : Expr OP_EQ Expr { $$ = new BuiltInExpr(BuiltInKind.Equal, Terminal($2).Token, (Node)$1, (Node)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxEquals); } ; aliasExpr : Expr AS identifier { $$ = new AliasedExpr((Node)$1, (Identifier)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxAlias); } | Expr { $$ = new AliasedExpr((Node)$1); SetErrCtx(AstNode($$), AstNodePos($1), AstNode($1).ErrCtx.ErrorContextInfo); } ; aliasExprList : aliasExpr { $$ = new NodeList<AliasedExpr>((AliasedExpr)$1); SetErrCtx(AstNode($$), AstNodePos($1), AstNode($1).ErrCtx.ErrorContextInfo); } | aliasExprList COMMA aliasExpr { $$ = ToNodeList<AliasedExpr>($1).Add((AliasedExpr)$3); SetErrCtx(AstNode($$), AstNodePos($$), EntityRes.CtxExpressionList); } ; searchedCaseExpr : CASE whenThenExprList END { $$ = new CaseExpr(ToNodeList<WhenThenExpr>($2)); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxCase); } | CASE whenThenExprList caseElseExpr END { $$ = new CaseExpr(ToNodeList<WhenThenExpr>($2), (Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxCase); } ; whenThenExprList : WHEN Expr THEN Expr { $$ = new NodeList<WhenThenExpr>(new WhenThenExpr((Node)$2, (Node)$4)); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxCaseWhenThen); } | whenThenExprList WHEN Expr THEN Expr { $$ = ToNodeList<WhenThenExpr>($1).Add(new WhenThenExpr((Node)$3, (Node)$5)); } ; caseElseExpr : ELSE Expr { $$ = (Node)$2; SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxCaseElse); } ; ctorExpr : ROW L_PAREN aliasExprList R_PAREN { $$ = new RowConstructorExpr(ToNodeList<AliasedExpr>($3)); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxRowCtor); } | MULTISET L_PAREN exprList R_PAREN { $$ = new MultisetConstructorExpr(ToNodeList<Node>($3)); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxMultisetCtor); } | L_CURLY exprList R_CURLY { $$ = new MultisetConstructorExpr(ToNodeList<Node>($2)); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxMultisetCtor); } ; dotExpr : Expr DOT identifier { $$ = new DotExpr((Node)$1, (Identifier)$3); SetErrCtx(AstNode($$), Terminal($2), EntityRes.CtxMemberAccess); } ; refExpr : REF L_PAREN generalExpr R_PAREN { $$ = new RefExpr((Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxRef); } ; derefExpr : DEREF L_PAREN generalExpr R_PAREN { $$ = new DerefExpr((Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxDeref); } ; createRefExpr : CREATEREF L_PAREN Expr COMMA Expr R_PAREN { $$ = new CreateRefExpr((Node)$3, (Node)$5); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxCreateRef); } | CREATEREF L_PAREN Expr COMMA Expr COMMA typeName R_PAREN { $$ = new CreateRefExpr((Node)$3, (Node)$5, (Node)$7); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxCreateRef); } ; keyExpr : KEY L_PAREN generalExpr R_PAREN { $$ = new KeyExpr((Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxKey); } ; groupPartitionExpr : GROUPPARTITION L_PAREN optAllOrDistinct generalExpr R_PAREN { $$ = new GroupPartitionExpr((DistinctKind)$3, (Node)$4); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxGroupPartition); } ; methodExpr : dotExpr L_PAREN /* e */ R_PAREN { $$ = new MethodExpr((Node)$1, DistinctKind.None, null); SetErrCtx(AstNode($$), AstNodePos(((DotExpr)$1).Identifier), EntityRes.CtxMethod); } | dotExpr L_PAREN optAllOrDistinct exprList R_PAREN optWithRelationship { $$ = new MethodExpr((Node)$1, (DistinctKind)$3, ToNodeList<Node>($4), ToNodeList<RelshipNavigationExpr>($6)); SetErrCtx(AstNode($$), AstNodePos(((DotExpr)$1).Identifier), EntityRes.CtxMethod); } | dotExpr L_PAREN optAllOrDistinct queryExpr R_PAREN optWithRelationship { $$ = new MethodExpr((Node)$1, (DistinctKind)$3, new NodeList<Node>((Node)$4), ToNodeList<RelshipNavigationExpr>($6)); SetErrCtx(AstNode($$), AstNodePos(((DotExpr)$1).Identifier), EntityRes.CtxMethod); } | identifier L_PAREN /* e */ R_PAREN { $$ = new MethodExpr((Identifier)$1, DistinctKind.None, null); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxMethod); } | identifier L_PAREN optAllOrDistinct exprList R_PAREN optWithRelationship { $$ = new MethodExpr((Identifier)$1, (DistinctKind)$3, ToNodeList<Node>($4), ToNodeList<RelshipNavigationExpr>($6)); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxMethod); } | identifier L_PAREN optAllOrDistinct queryExpr R_PAREN optWithRelationship { $$ = new MethodExpr((Identifier)$1,(DistinctKind)$3, new NodeList<Node>((Node)$4), ToNodeList<RelshipNavigationExpr>($6)); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxMethod); } ; // // Navigate( e, relationType ) // navigateExpr : NAVIGATE L_PAREN Expr COMMA typeName R_PAREN { $$ = new RelshipNavigationExpr((Node)$3, (Node)$5, null, null); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxNavigate); } // // Navigate( e, relationType, toEnd ) // | NAVIGATE L_PAREN Expr COMMA typeName COMMA identifier R_PAREN { $$ = new RelshipNavigationExpr((Node)$3, (Node)$5, (Identifier)$7, null); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxNavigate); } // // Navigate( e, relationType, ToEnd, FromEnd ) // | NAVIGATE L_PAREN Expr COMMA typeName COMMA identifier COMMA identifier R_PAREN { $$ = new RelshipNavigationExpr((Node)$3, (Node)$5, (Identifier)$7, (Identifier)$9); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxNavigate); } ; optWithRelationship : /* e */ { $$ = null; } | relationshipList { $$ = $1; } ; relationshipList : WITH relationshipExpr { $$ = new NodeList<RelshipNavigationExpr>((RelshipNavigationExpr)$2); SetErrCtx(AstNode($$), AstNodePos($2), EntityRes.CtxRelationshipList); } | relationshipList relationshipExpr { $$ = ToNodeList<RelshipNavigationExpr>($1).Add((RelshipNavigationExpr)$2); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxRelationshipList); } ; // // RELATIONSHIP( e, relationType ) // relationshipExpr : RELATIONSHIP L_PAREN Expr COMMA typeName R_PAREN { $$ = new RelshipNavigationExpr((Node)$3, (Node)$5, null, null); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxRelationship); } // // RELATIONSHIP( e, relationType, fromEnd ) // | RELATIONSHIP L_PAREN Expr COMMA typeName COMMA identifier R_PAREN { $$ = new RelshipNavigationExpr((Node)$3, (Node)$5, null, (Identifier)$7); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxRelationship); } // // RELATIONSHIP( e, relationType, fromEnd, toEnd ) // | RELATIONSHIP L_PAREN Expr COMMA typeName COMMA identifier COMMA identifier R_PAREN { $$ = new RelshipNavigationExpr((Node)$3, (Node)$5, (Identifier)$9, (Identifier)$7); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxRelationship); } ; typeName : identifier { $$ = $1; SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxTypeName); } | qualifiedTypeName { $$ = $1; SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxTypeName); } | identifier ESCAPED_IDENTIFIER { Identifier identifier = (Identifier)$1; Identifier escapedIdentifier = (Identifier)$2; if (identifier.IsEscaped || escapedIdentifier.Name.Length > 0) { throw EntityUtil.EntitySqlError(identifier.ErrCtx, System.Data.Entity.Strings.InvalidMetadataMemberName); } $$ = new Identifier(identifier.Name + "[]", /*isEscaped*/false, _query, AstNodePos($1)); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxTypeName); } | qualifiedTypeName ESCAPED_IDENTIFIER { DotExpr dotExpr = (DotExpr)$1; Identifier identifier = dotExpr.Identifier; Identifier escapedIdentifier = (Identifier)$2; if (identifier.IsEscaped || escapedIdentifier.Name.Length > 0) { throw EntityUtil.EntitySqlError(identifier.ErrCtx, System.Data.Entity.Strings.InvalidMetadataMemberName); } $$ = new DotExpr(dotExpr.Left, new Identifier(identifier.Name + "[]", /*isEscaped*/false, _query, AstNodePos($1))); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxTypeName); } | typeNameWithTypeSpec { $$ = (MethodExpr)$1; SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxTypeName); } ; qualifiedTypeName : typeName DOT identifier { $$ = new DotExpr((Node)$1, (Identifier)$3); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxTypeName); } ; typeNameWithTypeSpec : qualifiedTypeName L_PAREN /* e */ R_PAREN { $$ = new MethodExpr((Node)$1, DistinctKind.None, null); SetErrCtx(AstNode($$), AstNodePos(((DotExpr)$1).Identifier), EntityRes.CtxTypeNameWithTypeSpec); } | qualifiedTypeName L_PAREN exprList R_PAREN { $$ = new MethodExpr((Node)$1, DistinctKind.None, ToNodeList<Node>($3)); SetErrCtx(AstNode($$), AstNodePos(((DotExpr)$1).Identifier), EntityRes.CtxTypeNameWithTypeSpec); } | identifier L_PAREN /* e */ R_PAREN { $$ = new MethodExpr((Identifier)$1, DistinctKind.None, null); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxTypeNameWithTypeSpec); } | identifier L_PAREN exprList R_PAREN { $$ = new MethodExpr((Identifier)$1, DistinctKind.None, ToNodeList<Node>($3)); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxTypeNameWithTypeSpec); } ; identifier : ESCAPED_IDENTIFIER { $$ = (Identifier)$1; SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxEscapedIdentifier); } | simpleIdentifier { $$ = (Identifier)$1; SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxSimpleIdentifier); } ; simpleIdentifier : IDENTIFIER { $$ = (Identifier)$1; } ; literalExpr : LITERAL { $$ = $1; SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxLiteral); } | NULL { $$ = new Literal(null, LiteralKind.Null, _query, TerminalPos($1)); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxNullLiteral); } ; //~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Type definitions //~~~~~~~~~~~~~~~~~~~~~~~~~~~ typeDef : typeName { $$ = $1; } | collectionTypeDef { $$ = $1; } | refTypeDef { $$ = $1; } | rowTypeDef { $$ = $1; } ; collectionTypeDef : COLLECTION L_PAREN typeDef R_PAREN { $$ = new CollectionTypeDefinition((Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxCollectionTypeDefinition); } ; refTypeDef : REF L_PAREN typeName R_PAREN { $$ = new RefTypeDefinition((Node)$3); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxRefTypeDefinition); } ; rowTypeDef : ROW L_PAREN propertyDefList R_PAREN { $$ = new RowTypeDefinition(ToNodeList<PropDefinition>($3)); SetErrCtx(AstNode($$), Terminal($1), EntityRes.CtxRowTypeDefinition); } ; propertyDefList : propertyDef { $$ = new NodeList<PropDefinition>((PropDefinition)$1); SetErrCtx(AstNode($$), AstNodePos($1), AstNode($1).ErrCtx.ErrorContextInfo); } | propertyDefList COMMA propertyDef { $$ = ToNodeList<PropDefinition>($1).Add((PropDefinition)$3); SetErrCtx(AstNode($$), AstNodePos($$), AstNode($3).ErrCtx.ErrorContextInfo); } ; propertyDef : identifier typeDef { $$ = new PropDefinition((Identifier)$1, (Node)$2); SetErrCtx(AstNode($$), AstNodePos($1), EntityRes.CtxRowTypeDefinition); } ; %% #pragma warning restore 414
Yacc
5
run1206/EntityFramework6
src/EntityFramework/Core/Common/EntitySql/CqlGrammar.y
[ "Apache-2.0" ]
2016-02-24 01:18:27 > fs0ciety (~whoami@c27-253-43-52.thoms4.vic.optusnet.com.au) has joined #bspwm 2016-02-24 01:18:27 [01:18] 2016-02-24 01:18:27 - Topic for #bspwm is ""BSPWM support channel"" 2016-02-24 01:18:27 - Topic set by earsplit (~sunn@pool-96-246-172-70.nwrknj.fios.verizon.net) on Thu, 07 Nov 2013 04:12:02 2016-02-24 01:18:27 - Channel #bspwm: 59 nicks (0 ops, 0 voices, 59 normals) 2016-02-24 01:18:27 - PvNotice(ChanServ): "Welcome to the bspwm support channel. Mailing list:'bspwm at librelist.com', Tutorial: 'https://github.com/windelicato/dotfiles/wiki/bspwm-for-dummies'" 2016-02-24 01:18:27 - URL for #bspwm: https://github.com/baskerville/bspwm 2016-02-24 01:18:33 - Channel created on Thu, 07 Nov 2013 03:59:37 2016-02-24 01:18:38 fs0ciety i was wondering if someone can help with me on how to get circulate working 2016-02-24 01:19:04 fs0ciety i tried bspc desktop --circulate forward but it doesnt seem to do anything 2016-02-24 01:19:10 fs0ciety neither does rotate 2016-02-24 01:19:27 fs0ciety just wonder how you go about rotating all the windows so they are either vertial or horizontal? 2016-02-24 01:25:00 [01:19] 2016-02-24 01:29:03 < Norith (~Norith@unaffiliated/norith) has quit (Ping timeout: 250 seconds) 2016-02-24 01:35:00 [01:29]
IRC log
0
0x4b1dN/2016-dots
misc/weechat/logs/irc.freenode.#bspwm.weechatlog
[ "MIT" ]
items = ['a', 'b'] // push, append at the end items[] = 'c' var_dump(items) // pop, take at the end last_element = items[] var_dump(last_element) // unshift, insert at the begin []items = 'd' var_dump(items) // shift, take at the begin first_element = []items var_dump(first_element, items)
Tea
1
lemonworks/tealang.github.io
tests/syntax/square-expression.tea
[ "Apache-2.0" ]
implementation module StalinSort import StdEnv stalinSort :: [a] -> [a] | < a stalinSort [] = [] stalinSort [x] = [x] stalinSort [x, y : zs] | x <= y = [x : stalinSort [y : zs]] | otherwise = stalinSort [x : zs]
Clean
3
abrudz/stalin-sort
clean/StalinSort.icl
[ "MIT" ]
module snabb-nfvconfig-v1 { namespace "http://snabb.co/nfvconfig-v1"; prefix snabb-nfvconfig-v1; import ietf-yang-types { prefix yang; } import ietf-inet-types { prefix inet; } organization "Snabb"; contact "snabb-devel@googlegroups.com"; description "This module describes the configuration of SnabbNFV."; revision "2016-10-27" { description "Initial version that reflects Snabb Switch 2016.11 “Babaco”."; reference "https://github.com/snabbco/snabb/releases/tag/v2016.11"; } typedef pcap-filter { type string; description "A pcap-filter(7) expression."; } typedef gbps { type decimal64 { fraction-digits 4; range "0..max"; } description "Gigabits per second."; } identity tunnel-type { description "Base identity from which all tunnel types are derived."; } identity L2TPv3 { base "tunnel-type"; description "Layer 2 Tunneling Protocol Version 3"; } identity crypto-type { description "Base identity from which all transport cryptography types are derived."; } identity esp-aes-128-gcm { base "crypto-type"; description "Encapsulating Security Payload using AES 128 in Galois Counter Mode"; } typedef hexstring4 { type "string" { pattern "[0-9a-fA-F]{8}"; } description "Four bytes encoded as a hexadecimal string."; } typedef hexstring8 { type "string" { pattern "[0-9a-fA-F]{16}"; } description "Eight bytes encoded as a hexadecimal string."; } typedef hexstring16 { type "string" { pattern "[0-9a-fA-F]{32}"; } description "Sixteen bytes encoded as a hexadecimal string."; } list port { key port_id; description "An entry containing configuration information applicable to a particular virtual port."; leaf port_id { type string; mandatory true; description "The unique identifier of the port."; } leaf mac_address { type yang:mac-address; mandatory true; description "MAC address of the port."; } leaf vlan { type uint16 { range "0..4095"; } description "Vlan tag."; } leaf ingress_filter { type pcap-filter; description "Ingress traffic filtering rules."; } leaf egress_filter { type pcap-filter; description "Egress traffic filtering rules."; } container tunnel { description "L2TPv3 tunnel configuration."; leaf type { type identityref { base "tunnel-type"; } mandatory true; description "Tunnel type identifier."; } leaf local_cookie { type hexstring8; mandatory true; description "Local cookie"; } leaf remote_cookie { type hexstring8; mandatory true; description "Remote cookie"; } leaf next_hop { type yang:mac-address; description "Gateway MAC address."; } leaf local_ip { type inet:ipv6-address-no-zone; mandatory true; description "Local IPv6 address."; } leaf remote_ip { type inet:ipv6-address-no-zone; mandatory true; description "Remote IPv6 address."; } leaf session { type int32; description "The session field of the L2TPv3 header will be overwritten with this value."; } } leaf rx_police { type gbps; description "Allowed input rate in Gigabits per second."; } leaf tx_police { type gbps; description "Allowed output rate in Gigabits per second."; } container crypto { description "Transport cryptography configuration."; leaf type { type identityref { base "crypto-type"; } mandatory true; description "Cryptography type identifier."; } leaf spi { type uint32 { range "256..max"; } mandatory true; description "“Security Parameters Index” as specified in RFC 4303."; } leaf transmit_key { type hexstring16; mandatory true; description "128-bit AES key as specified in RFC 4106 used for the encryption of outgoing packets."; } leaf transmit_salt { type hexstring4; mandatory true; description "Salt as specified in RFC 4106 used for the encryption of outgoing packets."; } leaf receive_key { type hexstring16; mandatory true; description "128-bit AES key as specified in RFC 4106 used for the decryption of incoming packets."; } leaf receive_salt { type hexstring4; mandatory true; description "Salt as specified in RFC 4106 used for the decryption of incoming packets."; } leaf auditing { type boolean; default false; description "Indicates whether to enable or disable “Auditing” as specified in RFC 4303. The default is no auditing."; } } } }
YANG
5
peahonen/snabb
src/program/snabbnfv/snabb-nfvconfig-v1.yang
[ "Apache-2.0" ]
"""Define constants for the Soma component.""" DOMAIN = "soma" HOST = "host" PORT = "port" API = "api"
Python
3
domwillcode/home-assistant
homeassistant/components/soma/const.py
[ "Apache-2.0" ]
= Ōlelo Wiki [[http://rubygems.org/gems/olelo|{{https://badge.fury.io/rb/olelo.png|Gem}}]] [[https://travis-ci.org/minad/olelo|{{https://secure.travis-ci.org/minad/olelo.png?branch=master|Build Status}}]] [[https://gemnasium.com/minad/olelo|{{https://gemnasium.com/minad/olelo.png?travis|Dependency Status}}]] [[https://codeclimate.com/github/minad/olelo|{{https://codeclimate.com/github/minad/moneta.png|Code Climate}}]] Ōlelo is a wiki that stores pages in a [[http://git-scm.org/|Git]] repository, supports many markup styles and has an extensible, hackable architecture! If you want to see a demo installation go to http://www.gitwiki.org/. == Features Ōlelo implements a plugin system. A lot of the features are implemented as plugins and can be activated or deactivated as you wish. Core features: * Edit, move or delete pages * Page attribute editor * Support for hierarchical wikis (directory structure) * File upload * History, commit and diff view * Locales, currently supported languages Czech, English, French, German Features, implemented by plugins: * Support for many markup languages (Creole, Markdown, Textile, ...) * RSS/Atom changelog for whole wiki or pages * Section editing for Creole and Markdown markup * Embedded LaTeX formulas (Rendered as image or using [[http://mathjax.org/|MathJax]] * Syntax highlighted embedded code blocks * Image resizing, SVG to PNG/JPEG conversion * Auto-generated table of contents * Wiki syntax can be extended with tags (gist, math, footnotes, ...) * Editor preview * View pages as S5 presentation * Privacy features: Access control lists, Private wiki which needs login, readonly wiki == Quick start The best way to install Ōlelo is via 'gem'. {{{ $ gem install olelo }}} Go to a git repository via command line and start the Ōlelo webserver. {{{ $ olelo }}} Point your web browser at http://localhost:8080/. This is all you have to do, now you are good to go to use your wiki! == Installation from source Installation from source is especially useful if you want to do development or use the newest features. Clone the git repository: {{{ git clone git://github.com/minad/olelo.git }}} Now change to the Ōlelo source directory and use Bundler to install the dependencies. {{{ $ cd olelo $ bundle install }}} Start the Ōlelo webserver from the Ōlelo source directory. {{{ $ bin/olelo }}} == Deployment For production purposes, I recommend that you deploy the wiki with [[http://unicorn.bogomips.org|Unicorn]]. You should use the rackup configuration from the Ōlelo source or gem directory. {{{ $ unicorn path-to/config.ru }}} Unicorn is a very flexible ruby application server and Ōlelo runs very well on it. You can adapt the number of Unicorn workers depending on the load you expect. It is a good idea to observe the Unicorn workers as described in https://github.com/blog/519-unicorn-god and kill missbehaving workers if necessary. You can call this snippet in a cronjob which terminates all workers gracefully that need more than 100M. {{{ #!/bin/bash ps -e -www -o pid,rss,command | grep '[u]nicorn worker' | while read -r -a a; do pid=${a[0]} mem=${a[1]} [[ "$mem" -gt 100000 ]] && kill -s QUIT $pid done }}} == Configuration For deployment you might want to tweak some settings. Ōlelo reads the files 'config/config.yml.default' and 'config/config.yml' in that order. So just copy the default configuration 'config/config.yml.default' to 'config/config.yml' and make your modifications. If you installed Ōlelo as gem this is not a good idea since you don't want to fiddle in the gem directory. For this purpose the environment variable '$OLELO_CONFIG' exists which can point to the configuration file that you want to use. {{{ export OLELO_CONFIG=/home/olelo/olelo_config.yml }}} You can also use the '$OLELO_CONFIG' environment variable if you want to run multiple Ōlelo instances with different configurations, for example to serve different pages from different repositories. == Setting up a private wiki using Apache Assuming the wiki server is running on localhost:5000 (e.g. unicorn), we can redirect Apache requests by adding the following lines to your virtual host. This works also with https. {{{ # Private wiki ProxyPass /wiki http://localhost:5000 ProxyPassReverse /wiki http://localhost:5000 ProxyPreserveHost On ProxyRequests Off RequestHeader set X-Forwarded-Proto https <Proxy *> Order deny,allow Allow from all </Proxy> }}} In your Ōlelo 'config.yml' you should set the following options: {{{ base_path: '/wiki' # Enable the private wiki plugin disabled_plugins: - security/readonly_wiki #- security/private_wiki - editor/recaptcha authentication: enable_signup: false }}} == Dependencies If you installed Ōlelo as gem or used Bundler you don't really have to care about the dependencies. The standard installation provides the core dependencies and a good selection of optional dependencies. Core dependencies: * [[http://www.git-scm.com|Git]] * [[http://slim-lang.com/|Slim template language]] * [[http://libgit2.github.com/|Rugged git library]] * [[http://rack.github.com/|Rack]] * [[https://github.com/minad/mimemagic/|MimeMagic]] Some dependencies are optional, for example depending on the markup you want to use. * [[https://github.com/minad/creole|Creole markup library]] * [[https://github.com/vmg/redcarpet|Redcarpet Markdown library]] * [[http://redcloth.org/|RedCloth Textile markup library]] * [[http://www.imagemagick.org/|ImageMagick for image resizing]] * [[http://nokogiri.org/|Nokogiri for auto-generated table of contents]] * [[https://github.com/jayferd/rouge|Rouge for syntax highlighting of code blocks]] * [[https://github.com/minad/moneta/|Moneta Storage Interface]] == Development === Important concepts * Plugin architecture * Aspects under 'plugins/aspects' which provide different 'views' for a page * Filters under 'plugins/filters' which make it possible to build up aspects from a filter chain. These aspects are configured under 'config/aspects.rb' * Tags are provided by the 'plugins/tags/main.rb' plugin and can be integrated in a filter chain. They look like html tags and can be used to extend the wiki syntax. === Tipps * Execute 'rake --tasks' to see the available development tasks * Activate development mode by setting the option 'production: false' in 'config/config.yml' * Increase the log verbosity by setting 'log.level: DEBUG' in 'config/config.yml' * Do not hesitate to create an issue at the [[https://github.com/minad/olelo/issues|issue tracker]] == Authors Git-Wiki was originally developed by Simon Rozet. The development of Ōlelo to its current state was done by Daniel Mendler and contributors. The current code base doesn't have much in common with the original Git-Wiki proof-of-concept. Contributors: * Alex Eagle * Alex Wall * Hrvoje * Korthaerd * Luca Greco * Pavel Suchmann * Raffael Schmid == License Ōlelo is released under the MIT license.
Creole
4
swipswaps/olelo
README.creole
[ "MIT" ]
Import trans Global _trans:Translator Class Translator '***** Expressions ***** Method TransConstExpr$( expr:ConstExpr ) Abstract Method TransNewObjectExpr$( expr:NewObjectExpr ) Abstract Method TransNewArrayExpr$( expr:NewArrayExpr ) Abstract Method TransSelfExpr$( expr:SelfExpr ) Abstract Method TransCastExpr$( expr:CastExpr ) Abstract Method TransUnaryExpr$( expr:UnaryExpr ) Abstract Method TransBinaryExpr$( expr:BinaryExpr ) Abstract Method TransIndexExpr$( expr:IndexExpr ) Abstract Method TransSliceExpr$( expr:SliceExpr ) Abstract Method TransArrayExpr$( expr:ArrayExpr ) Abstract Method TransStmtExpr$( expr:StmtExpr ) Abstract Method TransVarExpr$( expr:VarExpr ) Abstract Method TransMemberVarExpr$( expr:MemberVarExpr ) Abstract Method TransInvokeExpr$( expr:InvokeExpr ) Abstract Method TransInvokeMemberExpr$( expr:InvokeMemberExpr ) Abstract Method TransInvokeSuperExpr$( expr:InvokeSuperExpr ) Abstract '***** Statements ***** Method TransExprStmt$( stmt:ExprStmt ) Abstract Method TransAssignStmt$( stmt:AssignStmt ) Abstract Method TransReturnStmt$( stmt:ReturnStmt ) Abstract Method TransContinueStmt$( stmt:ContinueStmt ) Abstract Method TransBreakStmt$( stmt:BreakStmt ) Abstract Method TransDeclStmt$( stmt:DeclStmt ) Abstract Method TransIfStmt$( stmt:IfStmt ) Abstract Method TransWhileStmt$( stmt:WhileStmt ) Abstract Method TransRepeatStmt$( stmt:RepeatStmt ) Abstract Method TransForStmt$( stmt:ForStmt ) Abstract Method TransTryStmt$( stmt:TryStmt ) Abstract Method TransThrowStmt$( stmt:ThrowStmt ) Abstract '***** Decls ***** Method TransBlock$( block:BlockDecl ) Abstract Method TransApp$( app:AppDecl ) Abstract End '***** CTranslator for C based languages ***** Class CTranslator Extends Translator Field emitDebugInfo? Field indent$ Field lines:=New StringStack Field unreachable,broken Field mungedScopes:=New StringMap<StringSet> Field funcMungs:=New StringMap<FuncDeclList> Field mungedFuncs:=New StringMap<FuncDecl> '***** Utility ***** Method TransValue$( ty:Type,value$ ) Abstract Method TransCatchVar$( init:LocalDecl ) End Method TransLocalDecl$( munged$,init:Expr ) Abstract '***** Declarations ***** Method TransGlobal$( decl:GlobalDecl ) Abstract Method TransField$( decl:FieldDecl,lhs:Expr ) Abstract Method TransFunc$( decl:FuncDecl,args:Expr[],lhs:Expr ) Abstract Method TransSuperFunc$( decl:FuncDecl,args:Expr[] ) Abstract '***** Expressions ***** Method TransIntrinsicExpr$( decl:Decl,expr:Expr,args:Expr[] ) Abstract Method BeginLocalScope() mungedScopes.Set "$",New StringSet End Method EndLocalScope() mungedScopes.Set "$",Null End Method MungMethodDecl( fdecl:FuncDecl ) If fdecl.munged Return If fdecl.overrides MungMethodDecl fdecl.overrides fdecl.munged=fdecl.overrides.munged Return Endif Local funcs:=funcMungs.Get( fdecl.ident ) If funcs For Local tdecl:=Eachin funcs If fdecl.EqualsArgs( tdecl ) fdecl.munged=tdecl.munged Return Endif Next Else funcs=New FuncDeclList funcMungs.Set fdecl.ident,funcs Endif Local id:=fdecl.ident If mungedFuncs.Contains( id ) Local n:=1 Repeat n+=1 id=fdecl.ident+String(n) Until Not mungedFuncs.Contains( id ) Endif mungedFuncs.Set id,fdecl fdecl.munged="p_"+id funcs.AddLast fdecl End Method MungDecl( decl:Decl ) If decl.munged Return Local fdecl:FuncDecl=FuncDecl( decl ) If fdecl And fdecl.IsMethod() Return MungMethodDecl( fdecl ) Local id:=decl.ident,munged$,scope$ If LocalDecl( decl ) scope="$" munged="t_"+id Else If ClassDecl( decl ) scope="" munged="c_"+id Else If ModuleDecl( decl ) scope="" munged="bb_"+id Else If ClassDecl( decl.scope ) scope=decl.scope.munged munged="m_"+id Else If ModuleDecl( decl.scope ) If ENV_LANG="cs" Or ENV_LANG="java" scope=decl.scope.munged munged="g_"+id Else scope="" munged=decl.scope.munged+"_"+id Endif Else InternalErr Endif Local set:=mungedScopes.Get( scope ) If set If set.Contains( munged.ToLower() ) Local id=1 Repeat id+=1 Local t$=munged+String(id) If set.Contains( t.ToLower() ) Continue munged=t Exit Forever Endif Else If scope="$" Print "OOPS2" InternalErr Endif set=New StringSet mungedScopes.Set scope,set Endif set.Insert munged.ToLower() decl.munged=munged End Method Bra$( str$ ) If str.StartsWith( "(" ) And str.EndsWith( ")" ) Local n=1 For Local i=1 Until str.Length-1 Select str[i..i+1] Case "(" n+=1 Case ")" n-=1 If Not n Return "("+str+")" End Next If n=1 Return str Endif Return "("+str+")" End 'Utility C/C++ style... Method Enquote$( str$ ) Return .Enquote( str,ENV_LANG ) End Method TransUnaryOp$( op$ ) Select op Case "+" Return "+" Case "-" Return "-" Case "~~" Return op Case "not" Return "!" End Select InternalErr End Method TransBinaryOp$( op$,rhs$ ) Select op Case "+","-" If rhs.StartsWith( op ) Return op+" " Return op Case "*","/" Return op Case "shl" Return "<<" Case "shr" Return ">>" Case "mod" Return " % " Case "and" Return " && " Case "or" Return " || " Case "=" Return "==" Case "<>" Return "!=" Case "<","<=",">",">=" Return op Case "&","|" Return op Case "~~" Return "^" End Select InternalErr End Method TransAssignOp$( op$ ) Select op Case "~~=" Return "^=" Case "mod=" Return "%=" Case "shl=" Return "<<=" Case "shr=" Return ">>=" End Return op End Method ExprPri( expr:Expr ) ' '1=primary, '2=postfix '3=prefix ' If NewObjectExpr( expr ) Return 3 Else If UnaryExpr( expr ) Select UnaryExpr( expr ).op Case "+","-","~~","not" Return 3 End Select InternalErr Else If BinaryExpr( expr ) Select BinaryExpr( expr ).op Case "*","/","mod" Return 4 Case "+","-" Return 5 Case "shl","shr" Return 6 Case "<","<=",">",">=" Return 7 Case "=","<>" Return 8 Case "&" Return 9 Case "~~" Return 10 Case "|" Return 11 Case "and" Return 12 Case "or" Return 13 End InternalErr Endif Return 2 End Method TransSubExpr$( expr:Expr,pri=2 ) Local t_expr$=expr.Trans() If ExprPri( expr )>pri t_expr=Bra( t_expr ) Return t_expr End Method TransExprNS$( expr:Expr ) If Not expr.SideEffects() Return expr.Trans() Return CreateLocal( expr ) End Method CreateLocal$( expr:Expr ) Local tmp:=New LocalDecl( "",0,expr.exprType,expr ) MungDecl tmp Emit TransLocalDecl( tmp.munged,expr )+";" Return tmp.munged End Method EmitEnter( func:FuncDecl ) End Method EmitEnterBlock() End Method EmitSetErr( errInfo$ ) End Method EmitLeaveBlock() End Method EmitLeave() End '***** Simple statements ***** 'Expressions Method TransStmtExpr$( expr:StmtExpr ) Local t$=expr.stmt.Trans() If t Emit t+";" Return expr.expr.Trans() End Method TransVarExpr$( expr:VarExpr ) Local decl:=VarDecl( expr.decl ) If decl.munged.StartsWith( "$" ) Return TransIntrinsicExpr( decl,Null,[] ) If LocalDecl( decl ) Return decl.munged If FieldDecl( decl ) Return TransField( FieldDecl( decl ),Null ) If GlobalDecl( decl ) Return TransGlobal( GlobalDecl( decl ) ) InternalErr End Method TransMemberVarExpr$( expr:MemberVarExpr ) Local decl:=VarDecl( expr.decl ) If decl.munged.StartsWith( "$" ) Return TransIntrinsicExpr( decl,expr.expr,[] ) If FieldDecl( decl ) Return TransField( FieldDecl( decl ),expr.expr ) InternalErr End Method TransInvokeExpr$( expr:InvokeExpr ) Local decl:=FuncDecl( expr.decl ),t$ If decl.munged.StartsWith( "$" ) Return TransIntrinsicExpr( decl,Null,expr.args ) If decl Return TransFunc( FuncDecl(decl),expr.args,Null ) InternalErr End Method TransInvokeMemberExpr$( expr:InvokeMemberExpr ) Local decl:=FuncDecl( expr.decl ),t$ If decl.munged.StartsWith( "$" ) Return TransIntrinsicExpr( decl,expr.expr,expr.args ) If decl Return TransFunc( FuncDecl(decl),expr.args,expr.expr ) InternalErr End Method TransInvokeSuperExpr$( expr:InvokeSuperExpr ) Local decl:=FuncDecl( expr.funcDecl ),t$ If decl.munged.StartsWith( "$" ) Return TransIntrinsicExpr( decl,expr,[] ) If decl Return TransSuperFunc( FuncDecl( decl ),expr.args ) InternalErr End Method TransExprStmt$( stmt:ExprStmt ) Return stmt.expr.TransStmt() End Method TransAssignStmt$( stmt:AssignStmt ) If Not stmt.rhs Return stmt.lhs.Trans() Endif If stmt.tmp1 MungDecl stmt.tmp1 Emit TransLocalDecl( stmt.tmp1.munged,stmt.tmp1.init )+";" Endif If stmt.tmp2 MungDecl stmt.tmp2 Emit TransLocalDecl( stmt.tmp2.munged,stmt.tmp2.init )+";" Endif Return TransAssignStmt2( stmt ) End Method TransAssignStmt2$( stmt:AssignStmt ) Return stmt.lhs.TransVar()+TransAssignOp( stmt.op )+stmt.rhs.Trans() End Method TransReturnStmt$( stmt:ReturnStmt ) Local t$="return" If stmt.expr t+=" "+stmt.expr.Trans() unreachable=True Return t End Method TransContinueStmt$( stmt:ContinueStmt ) unreachable=True Return "continue" End Method TransBreakStmt$( stmt:BreakStmt ) unreachable=True broken+=1 Return "break" End '***** Block statements - all very C like! ***** Method BeginLoop() End Method EndLoop() End Method Emit( t$ ) If Not t Return If t.StartsWith( "}" ) indent=indent[..indent.Length-1] Endif lines.Push indent+t If t.EndsWith( "{" ) indent+="~t" Endif End Method JoinLines$() Local code$=lines.Join( "~n" ) lines.Clear Return code End Method TransBlock$( block:BlockDecl ) EmitBlock block,False End 'returns unreachable status! ' Method EmitBlock( block:BlockDecl,realBlock?=True ) PushEnv block Local func:=FuncDecl( block ) If func emitDebugInfo=ENV_CONFIG<>"release" If func.attrs & DECL_NODEBUG emitDebugInfo=False If emitDebugInfo EmitEnter func Else If emitDebugInfo And realBlock EmitEnterBlock Endif Local lastStmt:Stmt=Null For Local stmt:Stmt=Eachin block.stmts _errInfo=stmt.errInfo If unreachable Exit lastStmt=stmt If emitDebugInfo Local rs:=ReturnStmt( stmt ) If rs If rs.expr ' If stmt.errInfo EmitSetErr stmt.errInfo ' Local t_expr:=TransExprNS( rs.expr ) EmitLeave Emit "return "+t_expr+";" Else EmitLeave Emit "return;" Endif unreachable=True Continue Endif If stmt.errInfo EmitSetErr stmt.errInfo Endif Local t$=stmt.Trans() If t Emit t+";" Next _errInfo="" Local unr=unreachable unreachable=False If unr 'Actionscript's reachability analysis is...weird. If func And ENV_LANG="as" And Not VoidType( func.retType ) If Not ReturnStmt( lastStmt ) Emit "return "+TransValue( func.retType,"" )+";" Endif Else If func If emitDebugInfo EmitLeave If Not VoidType( func.retType ) If func.IsCtor() Emit "return this;" Else If func.ModuleScope().IsStrict() _errInfo=func.errInfo Err "Missing return statement." Endif Emit "return "+TransValue( func.retType,"" )+";" Endif Endif Else If emitDebugInfo And realBlock EmitLeaveBlock Endif PopEnv Return unr End Method TransDeclStmt$( stmt:DeclStmt ) Local decl:=LocalDecl( stmt.decl ) If decl MungDecl decl Return TransLocalDecl( decl.munged,decl.init ) Endif Local cdecl:=ConstDecl( stmt.decl ) If cdecl Return Endif InternalErr End Method TransIfStmt$( stmt:IfStmt ) If ConstExpr( stmt.expr ) And ENV_LANG<>"java" 'ignore If Const in java... If ConstExpr( stmt.expr ).value If Not stmt.thenBlock.stmts.IsEmpty() Emit "if(true){" If EmitBlock( stmt.thenBlock ) unreachable=True Emit "}" Endif Else If Not stmt.elseBlock.stmts.IsEmpty() Emit "if(true){" If EmitBlock( stmt.elseBlock ) unreachable=True Emit "}" Endif Endif Else If Not stmt.elseBlock.stmts.IsEmpty() Emit "if"+Bra( stmt.expr.Trans() )+"{" Local unr=EmitBlock( stmt.thenBlock ) Emit "}else{" Local unr2=EmitBlock( stmt.elseBlock ) Emit "}" If unr And unr2 unreachable=True Else Emit "if"+Bra( stmt.expr.Trans() )+"{" Local unr=EmitBlock( stmt.thenBlock ) Emit "}" Endif End Method TransWhileStmt$( stmt:WhileStmt ) Local nbroken=broken Emit "while"+Bra( stmt.expr.Trans() )+"{" BeginLoop Local unr=EmitBlock( stmt.block ) EndLoop Emit "}" If broken=nbroken And ConstExpr( stmt.expr ) And ConstExpr( stmt.expr ).value unreachable=True broken=nbroken End Method TransRepeatStmt$( stmt:RepeatStmt ) Local nbroken=broken Emit "do{" BeginLoop Local unr=EmitBlock( stmt.block ) EndLoop Emit "}while(!"+Bra( stmt.expr.Trans() )+");" If broken=nbroken And ConstExpr( stmt.expr ) And Not ConstExpr( stmt.expr ).value unreachable=True broken=nbroken End Method TransForStmt$( stmt:ForStmt ) Local nbroken=broken Local init$=stmt.init.Trans() Local expr$=stmt.expr.Trans() Local incr$=stmt.incr.Trans() Emit "for("+init+";"+expr+";"+incr+"){" BeginLoop Local unr=EmitBlock( stmt.block ) EndLoop Emit "}" If broken=nbroken And ConstExpr( stmt.expr ) And ConstExpr( stmt.expr ).value unreachable=True broken=nbroken End Method TransTryStmt$( stmt:TryStmt ) Err "TODO!" End Method TransThrowStmt$( stmt:ThrowStmt ) unreachable=True Return "throw "+stmt.expr.Trans() End Method PostProcess$( source$ ) Return source End End
Monkey
4
Regal-Internet-Brothers/webcc-monkey
webcc.data/modules/trans/translator.monkey
[ "Zlib" ]
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. param( [Parameter(Mandatory)] [semver] $ReleaseVersion, [Parameter()] [string] $WingetRepoPath = "$PSScriptRoot/../../winget-pkgs", [Parameter()] [string] $FromRepository = 'rjmholt', [Parameter()] [string] $GitHubToken ) function GetMsiHash { param( [Parameter(Mandatory)] [string] $ReleaseVersion, [Parameter(Mandatory)] $MsiName ) $releaseParams = @{ Tag = "v$ReleaseVersion" OwnerName = 'PowerShell' RepositoryName = 'PowerShell' } if ($GitHubToken) { $releaseParams.AccessToken = $GitHubToken } $releaseDescription = (Get-GitHubRelease @releaseParams).body $regex = [regex]::new("powershell-$ReleaseVersion-win-x64.msi.*?([0-9A-F]{64})", 'SingleLine,IgnoreCase') return $regex.Match($releaseDescription).Groups[1].Value } function GetThisScriptRepoUrl { # Find the root of the repo $prefix = $PSScriptRoot while ($prefix) { if (Test-Path "$prefix/LICENSE.txt") { break } $prefix = Split-Path $prefix } $stem = $PSCommandPath.Substring($prefix.Length + 1).Replace('\', '/') return "https://github.com/PowerShell/PowerShell/blob/master/$stem" } function Exec { param([scriptblock]$sb) & $sb if ($LASTEXITCODE -ne 0) { throw "Invocation failed for '$sb'. See above errors for details" } } $ErrorActionPreference = 'Stop' $wingetPath = (Resolve-Path $WingetRepoPath).Path # Ensure we have git and PowerShellForGitHub installed Import-Module -Name PowerShellForGitHub $null = Get-Command git # Get the MSI hash from the release body $msiName = "PowerShell-$ReleaseVersion-win-x64.msi" $msiHash = GetMsiHash -ReleaseVersion $ReleaseVersion -MsiName $msiName $publisherName = 'Microsoft' # Create the manifest $productName = if ($ReleaseVersion.PreReleaseLabel) { 'PowerShell-Preview' } else { 'PowerShell' } $manifestDir = Join-Path $wingetPath 'manifests' 'm' $publisherName $productName $ReleaseVersion $manifestPath = Join-Path $manifestDir "$publisherName.$productName.yaml" $manifestContent = @" PackageIdentifier: $publisherName.$productName PackageVersion: $ReleaseVersion PackageName: $productName Publisher: $publisherName PackageUrl: https://microsoft.com/PowerShell License: MIT LicenseUrl: https://github.com/PowerShell/PowerShell/blob/master/LICENSE.txt Moniker: $($productName.ToLower()) ShortDescription: $publisherName.$productName Description: PowerShell is a cross-platform (Windows, Linux, and macOS) automation and configuration tool/framework that works well with your existing tools and is optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. It includes a command-line shell, an associated scripting language and a framework for processing cmdlets. Tags: - powershell - pwsh Homepage: https://github.com/PowerShell/PowerShell Installers: - Architecture: x64 InstallerUrl: https://github.com/PowerShell/PowerShell/releases/download/v$ReleaseVersion/$msiName InstallerSha256: $msiHash InstallerType: msi PackageLocale: en-US ManifestType: singleton ManifestVersion: 1.0.0 "@ Push-Location $wingetPath try { $branch = "pwsh-$ReleaseVersion" Exec { git checkout master } Exec { git checkout -b $branch } New-Item -Path $manifestDir -ItemType Directory Set-Content -Path $manifestPath -Value $manifestContent -Encoding utf8NoBOM Exec { git add $manifestPath } Exec { git commit -m "Add $productName $ReleaseVersion" } Exec { git push origin $branch } $prParams = @{ Title = "Add $productName $ReleaseVersion" Body = "This pull request is automatically generated. See $(GetThisScriptRepoUrl)." Head = $branch HeadOwner = $FromRepository Base = 'master' Owner = 'Microsoft' RepositoryName = 'winget-pkgs' MaintainerCanModify = $true } if ($GitHubToken) { $prParams.AccessToken = $GitHubToken } New-GitHubPullRequest @prParams } finally { git checkout master Pop-Location }
PowerShell
5
dahlia/PowerShell
tools/releaseToWinget.ps1
[ "MIT" ]
Lemma step_deterministic : deterministic step. Proof with eauto. unfold deterministic. intros t t' t'' E1 E2. generalize dependent t''. induction E1; intros t'' E2; inversion E2; subst; clear E2... (* ST_AppAbs *) - inversion H3. - exfalso; apply value__normal in H... (* ST_App1 *) - inversion E1. - f_equal... - exfalso; apply value__normal in H1... (* ST_App2 *) - exfalso; apply value__normal in H3... - exfalso; apply value__normal in H... - f_equal... (* ST_Pair1 *) - f_equal... - exfalso; apply value__normal in H1... (* ST_Pair2 *) - exfalso; apply value__normal in H... - f_equal... (* ST_Fst *) - f_equal... - exfalso. inversion E1; subst. + apply value__normal in H0... + apply value__normal in H1... (* ST_FstPair *) - exfalso. inversion H2; subst. + apply value__normal in H... + apply value__normal in H0... (* ST_Snd *) - f_equal... - exfalso. inversion E1; subst. + apply value__normal in H0... + apply value__normal in H1... (* ST_SndPair *) - exfalso. inversion H2; subst. + apply value__normal in H... + apply value__normal in H0... - (* ST_TestTrue *) inversion H3. - (* ST_TestFalse *) inversion H3. (* ST_Test *) - inversion E1. - inversion E1. - f_equal... Qed.
Coq
3
andorp/plfa.github.io
papers/scp/determinism.coq
[ "CC-BY-4.0" ]
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=C:\Program Files (x86)\AutoIt3\Icons\au3.ico #AutoIt3Wrapper_Outfile=LogFileParser.exe #AutoIt3Wrapper_Outfile_x64=LogFileParser64.exe #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Res_Comment=$LogFile parser utility for NTFS #AutoIt3Wrapper_Res_Description=$LogFile parser utility for NTFS #AutoIt3Wrapper_Res_Fileversion=2.0.0.48 #AutoIt3Wrapper_Res_LegalCopyright=Joakim Schicht #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 5 #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/mo #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GuiEdit.au3> #Include <WinAPIEx.au3> #include <Array.au3> #Include <String.au3> #include <SQLite.au3> ;#include <SQLite.dll.au3> #include <File.au3> #include <Math.au3> #include "SecureConstants.au3" Global $VerboseOn = 0, $CharReplacement=":", $de="|", $PrecisionSeparator=".", $PrecisionSeparator2="", $DoSplitCsv=False, $csvextra, $InputLogFile,$TargetMftCsvFile, $UsnJrnlFile, $SectorsPerCluster, $DoReconstructDataRuns=0, $debuglogfile, $CurrentTimestamp, $EncodingWhenOpen=2, $ReconstructDone=False Global $begin, $ElapsedTime, $CurrentRecord, $i, $PreviousUsn,$PreviousUsnFileName, $PreviousRedoOp, $PreviousAttribute, $PreviousUsnReason, $undo_length, $RealMftRef, $PreviousRealRef, $FromRcrdSlack, $IncompleteTransaction=0 Global $ProgressLogFile, $ProgressReconstruct, $CurrentProgress=-1, $ProgressStatus, $ProgressUsnJrnl, $ProgressSize Global $CurrentFileOffset, $InputFileSize, $MaxRecords, $Record_Size=4096, $SectorSize=512, $Remainder = "", $_COMMON_KERNEL32DLL=DllOpen("kernel32.dll"), $PredictedRefNumber, $LogFileCsv, $LogFileIndxCsv, $LogFileDataRunsCsv, $LogFileDataRunsCsvFile, $LogFileDataRunsModCsv, $NtfsDbFile, $LogFileCsvFile, $LogFileIndxCsvfile, $LogFileDataRunsModCsvfile, $LogFileUsnJrnlCsv,$LogFileUsnJrnlCsvFile;$LogFileUndoWipeIndxCsv, $LogFileUndoWipeIndxCsvfile, Global $RecordOffset, $this_lsn, $client_previous_lsn, $redo_operation, $undo_operation, $record_offset_in_mft, $attribute_offset, $hOutFileMFT, $tBuffer, $nBytes2, $HDR_BaseRecord, $FilePath, $HDR_SequenceNo Global $nBytes, $rFile, $DataRunArr[2][18], $NewDataRunArr[1][18], $RowsProcessed, $MaxRows, $hQuery, $aRow, $aRow2, $iRows, $iColumns, $aRes, $sOutputFile Global $RSTRsig = "52535452", $RCRDsig = "52435244", $BAADsig = "42414144", $CHKDsig = "43484d44", $Emptysig = "ffffffff" Global $SI_CTime, $SI_ATime, $SI_MTime, $SI_RTime, $SI_FilePermission, $SI_MaxVersions, $SI_VersionNumber, $SI_ClassID, $SI_SecurityID, $SI_QuotaCharged, $SI_USN, $SI_PartialValue Global $SI_CTime_Core,$SI_ATime_Core,$SI_MTime_Core,$SI_RTime_Core,$SI_CTime_Precision,$SI_ATime_Precision,$SI_MTime_Precision,$SI_RTime_Precision Global $FN_CTime, $FN_ATime, $FN_MTime, $FN_RTime, $FN_AllocSize, $FN_RealSize, $FN_Flags, $FN_Name, $FN_NameType Global $FN_CTime_Core,$FN_ATime_Core,$FN_MTime_Core,$FN_RTime_Core,$FN_CTime_Precision,$FN_ATime_Precision,$FN_MTime_Precision,$FN_RTime_Precision Global $UsnJrnlFileReferenceNumber, $UsnJrnlParentFileReferenceNumber, $UsnJrnlTimestamp, $UsnJrnlReason, $UsnJrnlFileName, $FileNameModified, $UsnJrnlUsn, $UsnJrnlRef Global $UsnJrnlCsv, $UsnJrnlCsvFile, $AttributeString, $KeptRef=-1, $TextInformation, $RedoChunkSize, $UndoChunkSize, $KeptRefTmp, $redo_length Global $DT_NonResidentFlag, $DT_Flags, $DT_ComprUnitSize, $DT_RealSize, $DT_DataRuns, $DT_InitStreamSize, $DT_OffsetToDataRuns, $DT_StartVCN, $DT_LastVCN, $DT_AllocSize, $DT_Name ;Global $FN_CTime_Core,$FN_CTime_Precision,$FN_ATime_Core,$FN_ATime_Precision,$FN_MTime_Core,$FN_MTime_Precision,$FN_RTime_Core,$FN_RTime_Precision ;Global $SI_CTime_Core,$SI_CTime_Precision,$SI_ATime_Core,$SI_ATime_Precision,$SI_MTime_Core,$SI_MTime_Precision,$SI_RTime_Core,$SI_RTime_Precision Global $LogFileFileNamesCsv,$LogFileFileNamesCsvFile,$LogFileTxfDataCsv,$LogFileTxfDataCsvFile Global $SDHArray[1][1],$SIIArray[1][1],$de2=":",$LogFileSecureSDSCsv,$LogFileSecureSDHCsv,$LogFileSecureSIICsv,$LogFileSecureSDSCsvFile,$LogFileSecureSDHCsvFile,$LogFileSecureSIICsvFile Global $TargetSDSOffsetHex,$SecurityDescriptorHash,$SecurityId,$ControlText,$SidOwner,$SidGroup Global $SAclRevision,$SAceCount,$SAceTypeText,$SAceFlagsText,$SAceMask,$SAceObjectType,$SAceInheritedObjectType,$SAceSIDString,$SAceObjectFlagsText Global $DAclRevision,$DAceCount,$DAceTypeText,$DAceFlagsText,$DAceMask,$DAceObjectType,$DAceInheritedObjectType,$DAceSIDString,$DAceObjectFlagsText Global $OpenAttributesArray[1][14],$AttributeNamesDumpArray[1][4],$DirtyPageTableDumpArray32bit[1][10],$DirtyPageTableDumpArray64bit[1][15],$lsn_openattributestable=0,$FileOutputTesterArray[26],$FileNamesArray[1][3],$SlackOpenAttributesArray[1][14],$SlackAttributeNamesDumpArray[1][4] Global $LogFileOpenAttributeTableCsv,$LogFileOpenAttributeTableCsvFile,$LogFileDirtyPageTable32bitCsv,$LogFileDirtyPageTable32bitCsvFile,$LogFileDirtyPageTable64bitCsv,$LogFileDirtyPageTable64bitCsvFile,$LogFileBitsInNonresidentBitMapCsv,$LogFileBitsInNonresidentBitMapCsvFile,$LogFileTransactionTableCsv,$LogFileTransactionTableCsvFile Global $LogFileReparseRCsv,$LogFileQuotaQCsv,$LogFileQuotaOCsv,$LogFileObjIdOCsv,$LogFileReparseRCsvFile,$LogFileQuotaQCsvFile,$LogFileQuotaOCsvFile,$LogFileObjIdOCsvFile,$LogFileRCRDCsv,$LogFileRCRDCsvFile Global $client_index,$record_type,$transaction_id,$lf_flags,$target_attribute,$lcns_to_follow,$MftClusterIndex,$target_vcn,$target_lcn,$InOpenAttributeTable=-1,$LsnValidationLevel Global $LogFileTransactionHeaderCsv,$LogFileTransactionHeaderCsvFile,$LogFileSlackOpenAttributeTableCsv,$LogFileSlackOpenAttributeTableCsvFile,$LogFileSlackAttributeNamesDumpCsv,$LogFileSlackAttributeNamesDumpCsvFile,$LogFileAttributeListCsv,$LogFileAttributeListCsvFile Global $GlobalDataKeepCounter=0,$GlobalRecordSpreadCounter=0,$GlobalRecordSpreadReset=0,$GlobalRecordSpreadReset2=0,$DoRebuildBrokenHeader=False,$MinSizeBrokenTransaction = 80, $Is32bit=0, $DoExtractResidentUpdates=0 Global $RUN_VCN[1], $RUN_Clusters[1], $MFT_RUN_Clusters[1], $MFT_RUN_VCN[1], $DataQ[1], $AttrQ[1], $BytesPerCluster Global $IsCompressed = False, $IsSparse = False Global $hDisk, $sBuffer, $DataRun, $DATA_InitSize, $DATA_RealSize, $ImageOffset = 0, $ADS_Name Global $TargetImageFile, $Entries, $IsImage=False, $IsPhysicalDrive=False, $ComboPhysicalDrives, $Combo, $MFT_Record_Size Global $EaNonResidentArray[1][9], $VerboseArr, $LogFileSqlFile, $LogFileUpdateFilenameI30SqlFile, $LogFileINDXI30SqlFile, $LogFileUpdateFileNameCsv,$LogFileUpdateFileNameCsvFile,$CheckSkipSqlite3=0,$LogFileCheckpointRecordCsvFile,$LogFileCheckpointRecordCsv Global $SQLite3Exe = @ScriptDir & "\sqlite3.exe" Global $TimestampErrorVal = "0000-00-00 00:00:00" Global $IntegerErrorVal = -1 Global $IntegerPartialValReplacement = -2 ;"PARTIAL VALUE" Global $MftRefReplacement = -2 ;Parent Global $FragmentMode=0, $RebuiltFragment, $LogFileFragmentFile, $VerifyFragment=0, $OutFragmentName="OutFragment.bin", $SkipFixups=0, $checkFixups, $CleanUp=0, $checkBrokenLogFile, $BrokenLogFile=0, $RegExPatternHexNotNull = "[1-9a-fA-F]" Global $LogFileEntriesObjectIdCsvFile, $LogFileEntriesObjectIdCsv, $HDR_MFTREcordNumber Global Const $GUI_EVENT_CLOSE = -3 Global Const $GUI_CHECKED = 1 Global Const $GUI_UNCHECKED = 4 ;Global Const $ES_AUTOVSCROLL = 64 Global Const $WS_VSCROLL = 0x00200000 Global Const $DT_END_ELLIPSIS = 0x8000 Global Const $GUI_DISABLE = 128 Global Const $STANDARD_INFORMATION = '10000000' Global Const $ATTRIBUTE_LIST = '20000000' Global Const $FILE_NAME = '30000000' Global Const $OBJECT_ID = '40000000' Global Const $SECURITY_DESCRIPTOR = '50000000' Global Const $VOLUME_NAME = '60000000' Global Const $VOLUME_INFORMATION = '70000000' Global Const $DATA = '80000000' Global Const $INDEX_ROOT = '90000000' Global Const $INDEX_ALLOCATION = 'A0000000' Global Const $BITMAP = 'B0000000' Global Const $REPARSE_POINT = 'C0000000' Global Const $EA_INFORMATION = 'D0000000' Global Const $EA = 'E0000000' Global Const $PROPERTY_SET = 'F0000000' Global Const $LOGGED_UTILITY_STREAM = '00010000' Global Const $ATTRIBUTE_END_MARKER = 'FFFFFFFF' Global $tDelta = _WinTime_GetUTCToLocalFileTimeDelta() Global $TimeDiff = 5748192000000000 Global $DateTimeFormat,$ExampleTimestampVal = "01CD74B3150770B8",$TimestampPrecision=3, $UTCconfig, $ParserOutDir Global $myctredit, $CheckUnicode, $MinSizeResidentExtraction, $SeparatorInput, $SeparatorInput2, $Check32bit, $CheckReconstruct, $CheckExtractResident, $CheckBrokenHeaderRebuild, $VerboseLsnList, $CheckCsvSplit Global $InputSectorPerCluster, $InputMFTRecordSize If Not FileExists($SQLite3Exe) Then MsgBox(0,"Error","sqlite3.exe not found in current directory") Exit EndIf $Progversion = "NTFS $LogFile Parser 2.0.0.48" If $cmdline[0] > 0 Then $CommandlineMode = 1 ConsoleWrite($Progversion & @CRLF) _GetInputParams() _Main() Else DllCall("kernel32.dll", "bool", "FreeConsole") $CommandlineMode = 0 Opt("GUICloseOnESC", 1) $ButtonColor=0xD0D0D0 $Form = GUICreate($Progversion, 600, 580, -1, -1) ; HotKeySet("{ESC}", "ExitPgm") $Menu_help = GUICtrlCreateMenu("&Help") ;$Menu_Documentation = GUICtrlCreateMenuItem("&Documentation", $Menu_Help) $Menu_Donate = GUICtrlCreateMenuItem("&Donate", $Menu_Help) $Menu_GetHelp = GUICtrlCreateMenuItem("&Help", $Menu_Help) GUICtrlSetTip($Form, "Press ESC to exit") $LabelLogFile = GUICtrlCreateLabel("$LogFile:",20,10,80,20) $LogFileField = GUICtrlCreateInput("mandatory (unless fragment)",70,10,350,20) GUICtrlSetState($LogFileField, $GUI_DISABLE) $ButtonLogFile = GUICtrlCreateButton("Select $LogFile", 430, 10, 100, 20) GUICtrlSetBkColor($ButtonLogFile, $ButtonColor) ;$LabelUsnJrnl = GUICtrlCreateLabel("$UsnJrnl:",20,35,80,20) ;$UsnJrnlField = GUICtrlCreateInput("No longer needed",70,35,350,20) ;GUICtrlSetState($UsnJrnlField, $GUI_DISABLE) ;$ButtonUsnJrnl = GUICtrlCreateButton("Select $UsnJrnl", 430, 35, 100, 20) ;GUICtrlSetState($ButtonUsnJrnl, $GUI_DISABLE) $LabelFragment = GUICtrlCreateLabel("Fragment:",20,35,80,20) $FragmentField = GUICtrlCreateInput("Broken transaction fragment (optional)",70,35,350,20) GUICtrlSetState($FragmentField, $GUI_DISABLE) $ButtonFragment = GUICtrlCreateButton("Select fragment", 430, 35, 100, 20) GUICtrlSetBkColor($ButtonFragment, $ButtonColor) $LabelMFT = GUICtrlCreateLabel("MFT:",20,60,80,20) $MFTField = GUICtrlCreateInput("Output of latest mft2csv (optional)",70,60,350,20) GUICtrlSetState($MFTField, $GUI_DISABLE) $ButtonMFT = GUICtrlCreateButton("Get MFT csv", 430, 60, 100, 20) GUICtrlSetBkColor($ButtonMFT, $ButtonColor) $LabelTimestampFormat = GUICtrlCreateLabel("Timestamp format:",20,85,90,20) $ComboTimestampFormat = GUICtrlCreateCombo("", 110, 85, 30, 25) $LabelTimestampPrecision = GUICtrlCreateLabel("Precision:",150,85,50,20) $ComboTimestampPrecision = GUICtrlCreateCombo("", 200, 85, 70, 25) $CheckCsvSplit = GUICtrlCreateCheckbox("split csv", 280, 85, 60, 20) GUICtrlSetState($CheckCsvSplit, $GUI_UNCHECKED) $LabelPrecisionSeparator = GUICtrlCreateLabel("Precision separator:",350,85,100,20) $PrecisionSeparatorInput = GUICtrlCreateInput($PrecisionSeparator,450,85,15,20) $Label1 = GUICtrlCreateLabel("Set decoded timestamps to specific region:",20,110,230,20) $Combo2 = GUICtrlCreateCombo("", 230, 110, 85, 25) $LabelPrecisionSeparator2 = GUICtrlCreateLabel("Precision separator2:",350,110,100,20) $PrecisionSeparatorInput2 = GUICtrlCreateInput($PrecisionSeparator2,450,110,15,20) $CheckSkipSqlite3 = GUICtrlCreateCheckbox("skip sqlite3", 500, 110, 80, 20) GUICtrlSetState($CheckSkipSqlite3, $GUI_UNCHECKED) $checkFixups = GUICtrlCreateCheckbox("Skip Fixups", 500, 140, 80, 20) GUICtrlSetState($checkFixups, $GUI_UNCHECKED) $checkBrokenLogFile = GUICtrlCreateCheckbox("Broken $LogFile", 500, 165, 100, 20) GUICtrlSetState($checkBrokenLogFile, $GUI_UNCHECKED) $LabelTimestampError = GUICtrlCreateLabel("Timestamp ErrorVal:",20,140,100,20) $TimestampErrorInput = GUICtrlCreateInput($TimestampErrorVal,120,140,130,20) $InputExampleTimestamp = GUICtrlCreateInput("",260,140,190,20) GUICtrlSetState($InputExampleTimestamp, $GUI_DISABLE) $LabelSeparator = GUICtrlCreateLabel("Set separator:",20,165,70,20) $SaparatorInput = GUICtrlCreateInput($de,90,165,20,20) $SaparatorInput2 = GUICtrlCreateInput($de,120,165,30,20) GUICtrlSetState($SaparatorInput2, $GUI_DISABLE) $CheckUnicode = GUICtrlCreateCheckbox("Unicode", 160, 165, 60, 20) GUICtrlSetState($CheckUnicode, $GUI_UNCHECKED) $CheckReconstruct = GUICtrlCreateCheckbox("Reconstruct data runs", 220, 165, 120, 20) GUICtrlSetState($CheckReconstruct, $GUI_UNCHECKED) $CheckBrokenHeaderRebuild = GUICtrlCreateCheckbox("Rebuild headers (in slack)", 350, 165, 140, 20) GUICtrlSetState($CheckBrokenHeaderRebuild, $GUI_UNCHECKED) $Label2 = GUICtrlCreateLabel("Sectors per cluster:",20,200,100,20) $InputSectorPerCluster = GUICtrlCreateInput("8",120,200,30,20) $Label3 = GUICtrlCreateLabel("MFT record size:",170,200,80,20) $InputMFTRecordSize = GUICtrlCreateInput("1024",260,200,40,20) $Label4 = GUICtrlCreateLabel("LSN error level:",310,200,80,20) $InputErrorLevel = GUICtrlCreateInput("0.1",400,200,40,20) $InputErrorLevelTranslated = GUICtrlCreateInput("",450,200,80,20) GUICtrlSetState($InputErrorLevelTranslated, $GUI_DISABLE) $Check32bit = GUICtrlCreateCheckbox("Source is from 32-bit OS", 20, 235, 160, 20) GUICtrlSetState($Check32bit, $GUI_UNCHECKED) $CheckExtractResident = GUICtrlCreateCheckbox("Extract non + resident updates of min size:",190, 235, 215, 20) GUICtrlSetState($CheckExtractResident, $GUI_UNCHECKED) $MinSizeResidentExtraction = GUICtrlCreateInput("2",410,235,30,20) $LabelVerboseLsns = GUICtrlCreateLabel("LSN's to trigger verbose output (comma separate):",20,260,240,20) $InputVerboseLsns = GUICtrlCreateInput("",260,260,200,20) $ButtonStart = GUICtrlCreateButton("Start", 480, 250, 50, 30) GUICtrlSetBkColor($ButtonStart, $ButtonColor) $ButtonExit = GUICtrlCreateButton("Exit", 540, 250, 30, 30) GUICtrlSetBkColor($ButtonExit, $ButtonColor) GUICtrlSetTip($ButtonExit, "Press ESC to exit") $myctredit = GUICtrlCreateEdit("", 0, 290, 600, 85, BitOr($ES_AUTOVSCROLL,$WS_VSCROLL)) _GUICtrlEdit_SetLimitText($myctredit, 128000) _InjectTimeZoneInfo() _InjectTimestampFormat() _InjectTimestampPrecision() $PrecisionSeparator = GUICtrlRead($PrecisionSeparatorInput) $PrecisionSeparator2 = GUICtrlRead($PrecisionSeparatorInput2) _TranslateTimestamp() _TranslateErrorLevel() GUISetState(@SW_SHOW) If StringInStr(@ScriptDir,"&") Or StringInStr(@ScriptDir,";") Or StringInStr(@ScriptDir,"=") Then If Not $CommandlineMode Then _DisplayInfo("Error: Current directory path contains a buggy char. Please change directory." & @CRLF) ConsoleWrite("Error: Current directory path contains a buggy char. Please change directory." & @CRLF) EndIf While 1 $nMsg = GUIGetMsg() Sleep(50) _TranslateSeparator() $PrecisionSeparator = GUICtrlRead($PrecisionSeparatorInput) $PrecisionSeparator2 = GUICtrlRead($PrecisionSeparatorInput2) _TranslateTimestamp() _TranslateErrorLevel() Switch $nMsg ; Case $Menu_Documentation ; ShellExecute("https://github.com/jschicht/LogFileParser") Case $Menu_Donate ShellExecute("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=joakim%2eschicht%40gmail%2ecom&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest") Case $Menu_GetHelp ShellExecute("mailto:joakim%2eschicht%40gmail%2ecom") Case $ButtonLogFile _SelectLogFile() Case $ButtonMFT _SelectMftCsv() ; Case $ButtonUsnJrnl ; _SelectUsnJrnl() Case $ButtonFragment _SelectFragment() ; _CheckFragment() Case $ButtonStart _Main() Case $ButtonExit Exit Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndIf Func _Main() Local $last_lsn,$page_flags,$page_count,$page_position,$next_record_offset,$page_unknown,$last_end_lsn Local $next_last_lsn,$next_page_count,$next_page_position,$next_last_end_lsn ;Local $next_page_flags,$next_next_record_offset,$next_page_unknown Global $DataRunArr[2][18], $NewDataRunArr[1][18] Global $GlobalCounter = 1,$AttrArray[$GlobalCounter][2] $DoReconstructDataRuns=0 $DoRebuildBrokenHeader=False If StringInStr(@ScriptDir,"&") Or StringInStr(@ScriptDir,";") Or StringInStr(@ScriptDir,"=") Then If Not $CommandlineMode Then _DisplayInfo("Error: Current directory path contains a buggy char. Please change directory." & @CRLF) ConsoleWrite("Error: Current directory path contains a buggy char. Please change directory." & @CRLF) Return EndIf If Not $CommandlineMode Then GUICtrlSetData($ProgressLogFile, 0) GUICtrlSetData($ProgressUsnJrnl, 0) GUICtrlSetData($ProgressReconstruct, 0) EndIf If Not $CommandlineMode Then If GUICtrlRead($CheckCsvSplit) = 1 Then $DoSplitCsv = True EndIf EndIf If Not $CommandlineMode Then $SectorsPerCluster = GUICtrlRead($InputSectorPerCluster) Else $SectorsPerCluster = $SectorsPerCluster EndIf If Not StringIsDigit($SectorsPerCluster) Or ($SectorsPerCluster <> 1 And $SectorsPerCluster <> 2 And $SectorsPerCluster <> 4 And $SectorsPerCluster <> 8 And $SectorsPerCluster <> 16 And $SectorsPerCluster <> 32 And $SectorsPerCluster <> 64 And $SectorsPerCluster <> 128) Then If Not $CommandlineMode Then _DisplayInfo("Error: SectorsPerCluster not given in expected format (decimal)." & @CRLF) Return EndIf $BytesPerCluster=$SectorsPerCluster*512 If Not $CommandlineMode Then $MFT_Record_Size = GUICtrlRead($InputMFTRecordSize) Else $MFT_Record_Size = $MFT_Record_Size EndIf If $MFT_Record_Size <> 1024 And $MFT_Record_Size <> 4096 Then If Not $CommandlineMode Then _DisplayInfo("Error: MFT record size should be an integer of either 1024 or 4096" & @CRLF) Return EndIf If $CommandlineMode Then $checkFixups = $checkFixups Else $checkFixups = GUICtrlRead($checkFixups) EndIf If $checkFixups = 1 Then $SkipFixups = True EndIf If Not $CommandlineMode Then $CheckUnicode = GUICtrlRead($CheckUnicode) Else $CheckUnicode = $CheckUnicode EndIf If $CheckUnicode = 1 Then ;$EncodingWhenOpen = 2+32 $EncodingWhenOpen = 2+128 EndIf If Not $CommandlineMode Then $CheckSkipSqlite3 = GUICtrlRead($CheckSkipSqlite3) EndIf If Not $CheckSkipSqlite3 = 1 Then $CheckSkipSqlite3 = 0 If $CommandlineMode Then $checkBrokenLogFile = $checkBrokenLogFile Else $checkBrokenLogFile = GUICtrlRead($checkBrokenLogFile) EndIf If $checkBrokenLogFile = 1 Then $BrokenLogFile = 1 EndIf If Not $CommandlineMode Then $Check32bit = GUICtrlRead($Check32bit) Else $Check32bit = $Check32bit EndIf If $Check32bit = 1 Then $Is32bit = True Else $Is32bit = False EndIf If Not $CommandlineMode Then $CheckReconstruct = GUICtrlRead($CheckReconstruct) Else $CheckReconstruct = $CheckReconstruct EndIf If $CheckReconstruct = 1 Then $DoReconstructDataRuns = 1 If $ReconstructDone Then MsgBox(0,"Error","Reconstruct of dataruns requires a restart of the program") Return EndIf EndIf If Not $CommandlineMode Then $CheckExtractResident = GUICtrlRead($CheckExtractResident) Else $CheckExtractResident = $CheckExtractResident EndIf If $CheckExtractResident = 1 Then If Not $CommandlineMode Then $MinSizeResidentExtraction = GUICtrlRead($MinSizeResidentExtraction) If $MinSizeResidentExtraction > 0 Then $DoExtractResidentUpdates=1 EndIf EndIf If Not $CommandlineMode Then $CheckBrokenHeaderRebuild = GUICtrlRead($CheckBrokenHeaderRebuild) Else $CheckBrokenHeaderRebuild = $CheckBrokenHeaderRebuild EndIf If $CheckBrokenHeaderRebuild = 1 Then $DoRebuildBrokenHeader = True EndIf If Not $CommandlineMode Then $tDelta = _GetUTCRegion(GUICtrlRead($Combo2))-$tDelta If @error Then _DisplayInfo("Error: Timezone configuration failed." & @CRLF) Return EndIf $tDelta = $tDelta*-1 ;Since delta is substracted from timestamp later on EndIf ;If $LsnValidationLevel = 0 Then If Not StringIsFloat($LsnValidationLevel) Or Not ($LsnValidationLevel > 0 Or $LsnValidationLevel < 1) Then If Not $CommandlineMode Then _DisplayInfo("Error: LsnValidationLevel: " & $LsnValidationLevel & @CRLF) Return EndIf If $FragmentMode Then _CheckFragment() If @error Then If Not $CommandlineMode Then _DisplayInfo("Error: Fragment failed validation." & @CRLF) Return SetError(1) EndIf If $CommandlineMode Then _DumpOutput("Error: Fragment failed validation." & @CRLF) Exit(3) EndIf EndIf $InputLogFile = $LogFileFragmentFile If $VerifyFragment Then _WriteOutputFragment() If @error Then If Not $CommandlineMode Then _DisplayInfo("Output fragment was verified but could not be written to: " & $ParserOutDir & "\" & $OutFragmentName & @CRLF) Return SetError(1) Else _DumpOutput("Output fragment was verified but could not be written to: " & $ParserOutDir & "\" & $OutFragmentName & @CRLF) Exit(4) EndIf Else ConsoleWrite("Output fragment verified and written to: " & $ParserOutDir & "\" & $OutFragmentName & @CRLF) EndIf Exit EndIf EndIf If FileExists($InputLogFile)=0 Then If Not $CommandlineMode Then _DisplayInfo("Error: LogFile could not be found." & @CRLF) Return EndIf If Not $CommandlineMode Then $ParserOutDir = @ScriptDir Else $ParserOutDir = $ParserOutDir EndIf If StringRight($ParserOutDir,1) = "\" Then $ParserOutDir = StringTrimRight($ParserOutDir,1) EndIf _PrepareOutput($ParserOutDir) If $DoExtractResidentUpdates Then DirCreate($ParserOutDir&"\ResidentExtract") DirCreate($ParserOutDir&"\NonResidentExtract") EndIf ;Fix the path to csv file inside the sql $FixedPath = StringReplace($LogFileCsvFile,"\","\\") Sleep(500) _ReplaceStringInFile($LogFileSqlFile,"__PathToCsv__",$FixedPath) If $CheckUnicode = 1 Then _ReplaceStringInFile($LogFileSqlFile,"latin1", "utf8") ;Fix the path to csv file inside the sql $FixedPath = StringReplace($LogFileUpdateFileNameCsvFile,"\","\\") Sleep(500) _ReplaceStringInFile($LogFileUpdateFilenameI30SqlFile,"__PathToCsv__",$FixedPath) If $CheckUnicode = 1 Then _ReplaceStringInFile($LogFileUpdateFilenameI30SqlFile,"latin1", "utf8") ;Fix the path to csv file inside the sql $FixedPath = StringReplace($LogFileIndxCsvfile,"\","\\") Sleep(500) _ReplaceStringInFile($LogFileINDXI30SqlFile,"__PathToCsv__",$FixedPath) If $CheckUnicode = 1 Then _ReplaceStringInFile($LogFileINDXI30SqlFile,"latin1", "utf8") ;Put output filenames into an array $FileOutputTesterArray[0] = $LogFileCsvFile $FileOutputTesterArray[1] = $LogFileIndxCsvFile $FileOutputTesterArray[2] = $LogFileDataRunsCsvFile $FileOutputTesterArray[3] = $LogFileSecureSDSCsvFile $FileOutputTesterArray[4] = $LogFileSecureSDHCsvFile $FileOutputTesterArray[5] = $LogFileSecureSIICsvFile $FileOutputTesterArray[6] = $LogFileOpenAttributeTableCsvFile $FileOutputTesterArray[7] = $LogFileDirtyPageTable32bitCsvFile $FileOutputTesterArray[8] = $LogFileBitsInNonresidentBitMapCsvFile $FileOutputTesterArray[9] = $LogFileUsnJrnlCsvFile $FileOutputTesterArray[10] = $LogFileReparseRCsvFile $FileOutputTesterArray[11] = $LogFileQuotaQCsvFile $FileOutputTesterArray[12] = $LogFileQuotaOCsvFile $FileOutputTesterArray[13] = $LogFileObjIdOCsvFile $FileOutputTesterArray[14] = $LogFileTransactionTableCsvFile $FileOutputTesterArray[15] = $LogFileRCRDCsvFile $FileOutputTesterArray[16] = $LogFileSlackOpenAttributeTableCsvFile $FileOutputTesterArray[17] = $LogFileSlackAttributeNamesDumpCsvFile $FileOutputTesterArray[18] = $LogFileAttributeListCsvFile $FileOutputTesterArray[19] = $LogFileFileNamesCsvFile $FileOutputTesterArray[20] = $LogFileTxfDataCsvFile $FileOutputTesterArray[21] = $LogFileUpdateFileNameCsvFile $FileOutputTesterArray[22] = $LogFileCheckpointRecordCsvFile $FileOutputTesterArray[23] = $LogFileDirtyPageTable64bitCsvFile $FileOutputTesterArray[24] = $LogFileTransactionHeaderCsvFile $FileOutputTesterArray[25] = $LogFileEntriesObjectIdCsvFile _WriteCSVHeader() If $DoSplitCsv Then _WriteCSVExtraHeader() ;Secure headers _WriteCSVHeaderSecureSDS() _WriteCSVHeaderSecureSDH() _WriteCSVHeaderSecureSII() ;Various csv headers _WriteCSVHeaderOpenAttributeTable() _WriteCSVHeaderDirtyPageTable32bit() _WriteCSVHeaderDirtyPageTable64bit() _WriteCSVHeaderBitsInNonresidentBitMap() _WriteCSVHeaderReparseR() _WriteCSVHeaderQuotaQ() _WriteCSVHeaderQuotaO() _WriteCSVHeaderObjIdO() _WriteCSVHeaderTransactionTable() _WriteCSVHeaderRCRD() _WriteCSVHeaderTransactionHeader() _WriteCSVHeaderSlackOpenAttributeTable() _WriteCSVHeaderSlackAttributeNamesDump() _WriteCSVHeaderAttributeList() _WriteCSVHeaderFileNames() _WriteCSVHeaderTxfData() _WriteCSVHeaderCheckpointRecord() _WriteObjectIdCsvHeader() $FileNamesArray[0][0] = "Ref" $FileNamesArray[0][1] = "FileName" $FileNamesArray[0][2] = "LSN" $EaNonResidentArray[0][0] = "MFTRef" $EaNonResidentArray[0][1] = "EntrySize" $EaNonResidentArray[0][2] = "EntryName" $EaNonResidentArray[0][3] = "Written" $EaNonResidentArray[0][4] = "LSN" $EaNonResidentArray[0][5] = "target_attribute" $EaNonResidentArray[0][6] = "MftClusterIndex" $EaNonResidentArray[0][7] = "target_vcn" $EaNonResidentArray[0][8] = "OutputFileName" _DebugOut("Using $LogFile: " & $InputLogFile) If $CheckUnicode = 1 Then _DebugOut("Unicode: 1") Else _DebugOut("Unicode: 0") EndIf If Not $CommandlineMode Then $TimestampErrorVal = GUICtrlRead($TimestampErrorInput) EndIf If Not $CommandlineMode Then $PrecisionSeparator = GUICtrlRead($PrecisionSeparatorInput) Else $PrecisionSeparator = $PrecisionSeparator EndIf If StringLen($PrecisionSeparator) <> 1 Then If Not $CommandlineMode Then _DisplayInfo("Error: Precision separator not set properly" & @crlf) _DebugOut("Error: Precision separator not set properly: " & GUICtrlRead($PrecisionSeparatorInput)) Return Else _DebugOut("Using precision separator: " & $PrecisionSeparator) EndIf If Not $CommandlineMode Then $PrecisionSeparator2 = GUICtrlRead($PrecisionSeparatorInput2) Else $PrecisionSeparator2 = $PrecisionSeparator2 EndIf If Not $CommandlineMode Then $VerboseLsnList = GUICtrlRead($InputVerboseLsns) Else $VerboseLsnList = $VerboseLsnList EndIf If $VerboseLsnList <> "" Then $VerboseArr = StringSplit($VerboseLsnList,",") Else $VerboseArr = "" EndIf _DebugOut("LSN's for verbose output: " & $VerboseLsnList) _DebugOut("LSN Validation level: " & $LsnValidationLevel & " (" & $LsnValidationLevel*100 & " %)") _DebugOut("Timestamps presented in UTC: " & $UTCconfig) _DebugOut("Sectors per cluster: " & $SectorsPerCluster) _DebugOut("DataRun reconstruct configuration: " & $DoReconstructDataRuns) _DebugOut("Rebuild broken header for transactions found in slack: " & $DoRebuildBrokenHeader) _DebugOut("32-bit: " & $Is32bit) _DebugOut("SkipSqlite3: " & $CheckSkipSqlite3) _DebugOut("DoExtractResidentUpdates: " & $DoExtractResidentUpdates) _DebugOut("FragmentMode: " & $FragmentMode) _DebugOut("SkipFixups: " & $SkipFixups) _DebugOut("BrokenLogFile: " & $BrokenLogFile) If Not $FragmentMode Then $tBuffer = DllStructCreate("byte[" & $Record_Size & "]") $tBuffer2 = DllStructCreate("byte[" & $SectorSize & "]") $hFile = _WinAPI_CreateFile("\\.\" & $InputLogFile,2,2,7) If $hFile = 0 Then _DebugOut("Error: Creating handle on $LogFile: " & _WinAPI_GetLastErrorMessage()) Exit EndIf EndIf If FileExists($UsnJrnlFile) Then _DebugOut("Using $UsnJrnl: " & $UsnJrnlFile) If $TargetMftCsvFile Then _DebugOut("Using MFT csv: " & $TargetMftCsvFile) _DebugOut("Using DateTime format: " & $DateTimeFormat) _DebugOut("Using timestamp precision: " & $TimestampPrecision) _DebugOut("------------------- END CONFIGURATION -----------------------") $begin = TimerInit() If Not $CommandlineMode Then ;$Progress = GUICtrlCreateLabel("Decoding $LogFile data and writing to csv", 10, 280,540,20) $Progress = GUICtrlCreateLabel("Decoding $LogFile data and writing to csv", 10, 380,540,20) GUICtrlSetFont($Progress, 12) $ProgressStatus = GUICtrlCreateLabel("", 10, 410, 580, 20) $ElapsedTime = GUICtrlCreateLabel("", 10, 425, 580, 20) $ProgressLogFile = GUICtrlCreateProgress(10, 450, 580, 30) $ProgressUsnJrnl = GUICtrlCreateProgress(10, 485, 580, 30) $ProgressReconstruct = GUICtrlCreateProgress(10, 520, 580, 30) AdlibRegister("_LogFileProgress", 500) EndIf If Not $FragmentMode Then $InputFileSize = _WinAPI_GetFileSizeEx($hFile) $MaxRecords = Ceiling($InputFileSize/$Record_Size) $RCRDRecord="" ;$ConcatenatedRCRD="" $DataUnprocessed = "" ;$PreviousRcrdLsn = 0 ;$PreviousRcrdPosition = 0 $NextRecordChunk="" For $i = 0 To $MaxRecords-1 $CurrentRecord=$i _WinAPI_SetFilePointerEx($hFile, $i*$Record_Size, $FILE_BEGIN) _WinAPI_ReadFile($hFile, DllStructGetPtr($tBuffer), $Record_Size, $nBytes) $LogFileRecord = DllStructGetData($tBuffer, 1) $CurrentFileOffset = DllCall('kernel32.dll', 'int', 'SetFilePointerEx', 'ptr', $hFile, 'int64', 0, 'int64*', 0, 'dword', 1) $CurrentFileOffset = $CurrentFileOffset[3]-$Record_Size $Magic = StringMid($LogFileRecord,3,8) If $Magic = $RCRDsig Then If Not $SkipFixups Then $RCRDRecord = _DoFixup($LogFileRecord) If $RCRDRecord = "" then _DebugOut("Error: Record corrupt. The fixup failed at: " & $CurrentFileOffset) $Remainder = "" ContinueLoop EndIf Else $RCRDRecord = $LogFileRecord EndIf $last_lsn = StringMid($RCRDRecord,19,16) $last_lsn = Dec(_SwapEndian($last_lsn),2) $page_flags = "0x" & _SwapEndian(StringMid($RCRDRecord,35,8)) $page_count = Dec(_SwapEndian(StringMid($RCRDRecord,43,4)),2) $page_position = Dec(_SwapEndian(StringMid($RCRDRecord,47,4)),2) $next_record_offset = "0x" & _SwapEndian(StringMid($RCRDRecord,51,4)) $page_unknown = "0x" & _SwapEndian(StringMid($RCRDRecord,55,12)) $last_end_lsn = StringMid($RCRDRecord,67,16) $last_end_lsn = Dec(_SwapEndian($last_end_lsn),2) ; ConsoleWrite("$i: " & $i & @CRLF) ;Start - Get values from next record If $i < $MaxRecords-1 Then _WinAPI_SetFilePointerEx($hFile, ($i+1)*$Record_Size, $FILE_BEGIN) _WinAPI_ReadFile($hFile, DllStructGetPtr($tBuffer2), $SectorSize, $nBytes2) $NextRecordChunk = DllStructGetData($tBuffer2, 1) If StringMid($NextRecordChunk,3,8) = $RCRDsig Then $next_last_lsn = StringMid($NextRecordChunk,19,16) $next_last_lsn = Dec(_SwapEndian($next_last_lsn),2) ;$next_page_flags = "0x" & _SwapEndian(StringMid($NextRecordChunk,35,8)) $next_page_count = Dec(_SwapEndian(StringMid($NextRecordChunk,43,4)),2) $next_page_position = Dec(_SwapEndian(StringMid($NextRecordChunk,47,4)),2) ;$next_next_record_offset = "0x" & _SwapEndian(StringMid($NextRecordChunk,51,4)) ;$next_page_unknown = "0x" & _SwapEndian(StringMid($NextRecordChunk,55,12)) $next_last_end_lsn = StringMid($NextRecordChunk,67,16) $next_last_end_lsn = Dec(_SwapEndian($next_last_end_lsn),2) Else ; EndIf EndIf ;End - Get values from next record $RulesString="" ;Rules that determine if data flow will continue into next record $rule1 = ($last_lsn = $last_end_lsn) If $rule1 Then $RulesString&="rule1;" $rule2 = ($last_lsn > $next_last_lsn) If $rule2 Then $RulesString&="rule2;" $rule3 = ($last_end_lsn > $next_last_end_lsn And $next_last_end_lsn <> 0) If $rule3 Then $RulesString&="rule3;" ; $rule4 = ($last_lsn = $next_last_lsn And $last_end_lsn <> 0 And $next_last_end_lsn <> 0 And $last_end_lsn > $next_last_end_lsn) ; If $rule4 Then $RulesString&="rule4;" $rule5 = ($page_count - $page_position = 0) And ($next_page_position > 1) If $rule5 Then $RulesString&="rule5;" $rule6 = ($page_count - $page_position <> 0) And ($next_page_position - $page_position <> 1) If $rule6 Then $RulesString&="rule6;" $rule7 = ($page_count - $page_position <> 0) And ($next_page_position - $page_position = 0) And ($page_count <> $next_page_count) If $rule7 Then $RulesString&="rule7;" ; If ($last_lsn = $last_end_lsn) Or ($last_lsn > $next_last_lsn) Or ($last_end_lsn > $next_last_end_lsn And $next_last_end_lsn <> 0) Or (($page_count - $page_position = 0) And ($next_page_position > 1)) Or (($page_count - $page_position <> 0) And ($next_page_position - $page_position <> 1)) Or (($page_count - $page_position <> 0) And ($next_page_position - $page_position = 0) And ($page_count <> $next_page_count)) Then If $rule1 Or $rule2 Or $rule3 Or $rule5 Or $rule6 Or $rule7 Or $BrokenLogFile Then $NoMoreData=1 Else $NoMoreData=0 EndIf If $i = $MaxRecords-1 Then $NoMoreData=1 $RCRDHeader = StringMid($RCRDRecord,1,130) $RCRDRecord = $RCRDHeader&$Remainder&StringMid($RCRDRecord,131) $DataUnprocessed = _DecodeRCRD($RCRDRecord, $CurrentFileOffset, StringLen($Remainder), $NoMoreData) If $NoMoreData Then $Remainder = "" $GlobalDataKeepCounter=0 ; If Not ($last_lsn = $last_end_lsn) Then _DumpOutput("------------- Skipping returned data -----------------Offset: 0x" & Hex($CurrentFileOffset,8) & @CRLF) ; _DumpOutput("------------- Skipping returned data -----------------Offset: 0x" & Hex($CurrentFileOffset,8) & @CRLF) ; ConsoleWrite("Offset: 0x" & Hex($CurrentFileOffset,8) & @CRLF) Else $Remainder = $DataUnprocessed $GlobalDataKeepCounter+=1 EndIf $GlobalRecordSpreadReset2 = $GlobalRecordSpreadReset If $last_lsn = $next_last_lsn And $GlobalDataKeepCounter Then $GlobalRecordSpreadCounter += 1 $GlobalRecordSpreadReset = 0 Else If $GlobalRecordSpreadCounter Then $GlobalRecordSpreadReset = $GlobalRecordSpreadCounter $GlobalRecordSpreadCounter = 0 Else $GlobalRecordSpreadReset = 0 $GlobalRecordSpreadCounter = 0 EndIf EndIf FileWriteLine($LogFileRCRDCsv, "0x"&Hex($CurrentFileOffset,8)&$de&$last_lsn&$de&$page_flags&$de&$page_count&$de&$page_position&$de&$next_record_offset&$de&$page_unknown&$de&$last_end_lsn&$de&$GlobalDataKeepCounter&$de&$RulesString&$de&$GlobalRecordSpreadCounter&$de&$GlobalRecordSpreadReset2&@crlf) ;$PreviousRcrdLsn = $last_lsn ;$PreviousRcrdPosition = $page_position ContinueLoop ElseIf $Magic = $RSTRsig Then If $VerboseOn Then ConsoleWrite("RSTR record" & @CRLF) _DecodeRSTR($LogFileRecord) ContinueLoop ElseIf $Magic = $BAADsig Then _DumpOutput("PageVerbose: BAAD record at 0x" & Hex($CurrentFileOffset,8) & @CRLF) ContinueLoop ElseIf $Magic = $CHKDsig Then _DumpOutput("PageVerbose: CHKD record at 0x" & Hex($CurrentFileOffset,8) & @CRLF) ContinueLoop ElseIf $Magic = $Emptysig Then _DumpOutput("PageVerbose: Overwritten or unitialized page at 0x" & Hex($CurrentFileOffset,8) & @CRLF) ContinueLoop ElseIf $Magic <> $RSTRsig And $Magic <> $RCRDsig And $Magic <> $Emptysig Then _DumpOutput("PageVerbose: Invalid page signature at 0x" & Hex($CurrentFileOffset,8) & @CRLF) ContinueLoop EndIf Next Else _DecodeRCRD($RebuiltFragment, 0, 0, 1) $MaxRecords=1 $CurrentRecord=0 EndIf #cs _DumpOutput("$hFile: " & $hFile & @CRLF) _DumpOutput("$hOutFileMFT: " & $hOutFileMFT & @CRLF) _DumpOutput("$LogFileCsv: " & $LogFileCsv & @CRLF) _DumpOutput("$LogFileIndxCsv: " & $LogFileIndxCsv & @CRLF) _DumpOutput("$LogFileDataRunsCsv: " & $LogFileDataRunsCsv & @CRLF) _DumpOutput("$LogFileSecureSDSCsv: " & $LogFileSecureSDSCsv & @CRLF) _DumpOutput("$LogFileSecureSDHCsv: " & $LogFileSecureSDHCsv & @CRLF) _DumpOutput("$LogFileSecureSIICsv: " & $LogFileSecureSIICsv & @CRLF) _DumpOutput("$LogFileOpenAttributeTableCsv: " & $LogFileOpenAttributeTableCsv & @CRLF) _DumpOutput("$LogFileDirtyPageTable32bitCsv: " & $LogFileDirtyPageTable32bitCsv & @CRLF) _DumpOutput("$LogFileBitsInNonresidentBitMapCsv: " & $LogFileBitsInNonresidentBitMapCsv & @CRLF) ;_DumpOutput("$UsnJrnlCsv: " & $UsnJrnlCsv & @CRLF) _DumpOutput("$LogFileReparseRCsv: " & $LogFileReparseRCsv & @CRLF) _DumpOutput("$LogFileQuotaQCsv: " & $LogFileQuotaQCsv & @CRLF) _DumpOutput("$LogFileQuotaOCsv: " & $LogFileQuotaOCsv & @CRLF) _DumpOutput("$LogFileObjIdOCsv: " & $LogFileObjIdOCsv & @CRLF) _DumpOutput("$LogFileTransactionTableCsv: " & $LogFileTransactionTableCsv & @CRLF) _DumpOutput("$LogFileSlackOpenAttributeTableCsv: " & $LogFileSlackOpenAttributeTableCsv & @CRLF) _DumpOutput("$LogFileSlackAttributeNamesDumpCsv: " & $LogFileSlackAttributeNamesDumpCsv & @CRLF) _DumpOutput("$LogFileAttributeListCsv: " & $LogFileAttributeListCsv & @CRLF) _DumpOutput("$LogFileFileNamesCsv: " & $LogFileFileNamesCsv & @CRLF) _DumpOutput("$LogFileUpdateFileNameCsv: " & $LogFileUpdateFileNameCsv & @CRLF) #ce If Not $FragmentMode Then _WinAPI_CloseHandle($hFile) _WinAPI_CloseHandle($hOutFileMFT) FileFlush($LogFileCsv) FileFlush($LogFileIndxCsv) FileFlush($LogFileDataRunsCsv) FileFlush($LogFileSecureSDSCsv) FileFlush($LogFileSecureSDHCsv) FileFlush($LogFileSecureSIICsv) FileFlush($LogFileOpenAttributeTableCsv) FileFlush($LogFileDirtyPageTable32bitCsv) FileFlush($LogFileDirtyPageTable64bitCsv) FileFlush($LogFileBitsInNonresidentBitMapCsv) FileFlush($UsnJrnlCsv) FileFlush($LogFileReparseRCsv) FileFlush($LogFileQuotaQCsv) FileFlush($LogFileQuotaOCsv) FileFlush($LogFileObjIdOCsv) FileFlush($LogFileTransactionTableCsv) FileFlush($LogFileSlackOpenAttributeTableCsv) FileFlush($LogFileSlackAttributeNamesDumpCsv) FileFlush($LogFileAttributeListCsv) FileFlush($LogFileFileNamesCsv) FileFlush($LogFileUpdateFileNameCsv) FileFlush($LogFileCheckpointRecordCsv) FileFlush($LogFileEntriesObjectIdCsv) FileClose($LogFileCsv) FileClose($LogFileIndxCsv) FileClose($LogFileDataRunsCsv) FileClose($LogFileSecureSDSCsv) FileClose($LogFileSecureSDHCsv) FileClose($LogFileSecureSIICsv) FileClose($LogFileOpenAttributeTableCsv) FileClose($LogFileDirtyPageTable32bitCsv) FileClose($LogFileDirtyPageTable64bitCsv) FileClose($LogFileBitsInNonresidentBitMapCsv) FileClose($UsnJrnlCsv) FileClose($LogFileReparseRCsv) FileClose($LogFileQuotaQCsv) FileClose($LogFileQuotaOCsv) FileClose($LogFileObjIdOCsv) FileClose($LogFileTransactionTableCsv) FileClose($LogFileSlackOpenAttributeTableCsv) FileClose($LogFileSlackAttributeNamesDumpCsv) FileClose($LogFileAttributeListCsv) FileClose($LogFileFileNamesCsv) FileClose($LogFileUpdateFileNameCsv) FileClose($LogFileCheckpointRecordCsv) FileClose($LogFileEntriesObjectIdCsv) If Not $CommandlineMode Then AdlibUnRegister("_LogFileProgress") GUICtrlSetData($ProgressStatus, "Processing LogFile page " & $CurrentRecord+1 & " of " & $MaxRecords) GUICtrlSetData($ElapsedTime, "Elapsed time = " & _WinAPI_StrFromTimeInterval(TimerDiff($begin))) GUICtrlSetData($ProgressLogFile, 100 * ($CurrentRecord+1) / $MaxRecords) EndIf If Not $CommandlineMode Then _DisplayInfo("$LogFile processing finished in " & _WinAPI_StrFromTimeInterval(TimerDiff($begin)) & "." & @CRLF) _DumpOutput("------------------ END PROCESSING -------------------" & @CRLF) _DumpOutput("$LogFile processing finished in " & _WinAPI_StrFromTimeInterval(TimerDiff($begin)) & "." & @CRLF) For $FileNumber = 0 To UBound($FileOutputTesterArray)-1 If FileExists($FileOutputTesterArray[$FileNumber]) Then ; ConsoleWrite("Checking output: " & $FileOutputTesterArray[$FileNumber] & @CRLF) If (_FileCountLines($FileOutputTesterArray[$FileNumber]) < 2) Then FileMove($FileOutputTesterArray[$FileNumber],$FileOutputTesterArray[$FileNumber]&".empty",1) _DumpOutput("Empty output: " & $FileOutputTesterArray[$FileNumber] & " is postfixed with .empty" & @CRLF) EndIf EndIf Next If FileExists($ParserOutDir & "\LogFile.csv.empty") Then If Not $CommandlineMode Then _DisplayInfo("Error: No valid transactions decoded." & @CRLF) Return SetError(1) EndIf If $CommandlineMode Then _DumpOutput("Error: No valid transactions decoded." & @CRLF) Exit(1) EndIf EndIf If $CheckSkipSqlite3 = 1 Then If Not $CommandlineMode Then _DisplayInfo("Done!" & @CRLF) Return Else _DumpOutput("Done!" & @CRLF) Return EndIf EndIf Sleep(500) If @AutoItX64 Then $Sqlite3DllString = @ScriptDir & "\sqlite3_x64.dll" Else $Sqlite3DllString = @ScriptDir & "\sqlite3.dll" EndIf ;set encoding ;If GUICtrlRead($CheckUnicode) = 1 Then If $CheckUnicode = 1 Then ;_DumpOutput("Executing sqlite3.exe" & @CRLF) ;$SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "PRAGMA encoding = 'UTF-16le';CREATE TABLE bogus(one INTEGER,two TEXT);", $sOutputFile, $SQLite3Exe) $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "PRAGMA encoding = 'UTF-8';CREATE TABLE bogus(one INTEGER,two TEXT);", $sOutputFile, $SQLite3Exe) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not PRAGMA encoding = UTF-8: " & $NtfsDbFile & " : " & @error) _DumpOutput("Error Could not PRAGMA encoding = UTF-8, $SQLiteExecution: " & $SQLiteExecution & @CRLF) Exit EndIf ;_DumpOutput("Loading sqlite3.dll" & @CRLF) _SQLite_Startup2($Sqlite3DllString) If @error Then MsgBox(0,"Error","Could not load " & $Sqlite3DllString & " Returned error val: " & @error) Exit EndIf ;_DumpOutput("Opening" & @CRLF) $hDb = _SQLite_Open($NtfsDbFile) ;Open db If @error Then MsgBox(0,"Error","Opening database failed and returned error val: " & @extended) Exit EndIf ;_DumpOutput("Query" & @CRLF) _SQLite_QuerySingleRow(-1, "PRAGMA encoding;", $aRow2) If $aRow2[0] <> 'UTF-8' Then MsgBox(0,"Error","Detecting encoding was not correct") Exit EndIf _SQLite_Close() _SQLite_Shutdown() EndIf ; Create database with tables and import csv If Not $CommandlineMode Then _DisplayInfo("Importing csv's to db and updating tables." & @CRLF) _DumpOutput("Importing csv's to db and updating tables." & @CRLF) $begin = TimerInit() If $DoReconstructDataRuns Then $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "CREATE TABLE DataRuns (lf_Offset TEXT,lf_MFTReference INTEGER,lf_MFTBaseRecRef INTEGER,lf_FileName TEXT,lf_LSN INTEGER,lf_RedoOperation TEXT,lf_UndoOperation TEXT,lf_OffsetInMft INTEGER,lf_AttributeOffset INTEGER,lf_SI_USN INTEGER,lf_DataName TEXT,lf_Flags TEXT,lf_NonResident TEXT,lf_CompressionUnitSize TEXT,lf_FileSize INTEGER,lf_InitializedStreamSize INTEGER,lf_OffsetToDataRuns INTEGER,lf_DataRuns TEXT);", $sOutputFile, $SQLite3Exe) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not create table DataRuns in database: " & $NtfsDbFile & " : " & @error) _DumpOutput("Error Could not create table DataRuns, $SQLiteExecution: " & $SQLiteExecution & @CRLF) Exit EndIf EndIf ;$SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "CREATE TABLE LogFile (lf_Offset TEXT,lf_MFTReference INTEGER,lf_RealMFTReference INTEGER,lf_MFTBaseRecRef INTEGER,lf_LSN INTEGER,lf_LSNPrevious INTEGER,lf_RedoOperation TEXT,lf_UndoOperation TEXT,lf_OffsetInMft INTEGER,lf_FileName TEXT,lf_CurrentAttribute TEXT,lf_TextInformation TEXT,lf_UsnJrlFileName TEXT,lf_UsnJrlMFTReference INTEGER,lf_UsnJrlMFTParentReference INTEGER,lf_UsnJrlTimestamp TEXT,lf_UsnJrlReason TEXT,lf_UsnJrnlUsn INTEGER,lf_SI_CTime TEXT,lf_SI_ATime TEXT,lf_SI_MTime TEXT,lf_SI_RTime TEXT,lf_SI_FilePermission TEXT,lf_SI_MaxVersions INTEGER,lf_SI_VersionNumber INTEGER,lf_SI_ClassID INTEGER,lf_SI_SecurityID INTEGER,lf_SI_QuotaCharged INTEGER,lf_SI_USN INTEGER,lf_SI_PartialValue TEXT,lf_FN_CTime TEXT,lf_FN_ATime TEXT,lf_FN_MTime TEXT,lf_FN_RTime TEXT,lf_FN_AllocSize INTEGER,lf_FN_RealSize INTEGER,lf_FN_Flags TEXT,lf_FN_Namespace TEXT,lf_DT_StartVCN INTEGER,lf_DT_LastVCN INTEGER,lf_DT_ComprUnitSize INTEGER,lf_DT_AllocSize INTEGER,lf_DT_RealSize INTEGER,lf_DT_InitStreamSize INTEGER,lf_DT_DataRuns TEXT,lf_DT_Name TEXT,lf_FileNameModified INTEGER,lf_RedoChunkSize INTEGER,lf_UndoChunkSize INTEGER);", $sOutputFile) $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "CREATE TABLE LogFile (lf_Offset TEXT,lf_MFTReference INTEGER,lf_RealMFTReference INTEGER,lf_MFTBaseRecRef INTEGER,lf_LSN INTEGER,lf_LSNPrevious INTEGER,lf_RedoOperation TEXT,lf_UndoOperation TEXT,lf_OffsetInMft INTEGER,lf_FileName TEXT,lf_CurrentAttribute TEXT,lf_TextInformation TEXT,lf_UsnJrlFileName TEXT,lf_UsnJrlMFTReference INTEGER,lf_UsnJrlMFTParentReference INTEGER,lf_UsnJrlTimestamp TEXT,lf_UsnJrlReason TEXT,lf_UsnJrnlUsn INTEGER,lf_SI_CTime TEXT,lf_SI_ATime TEXT,lf_SI_MTime TEXT,lf_SI_RTime TEXT,lf_SI_FilePermission TEXT,lf_SI_MaxVersions INTEGER,lf_SI_VersionNumber INTEGER,lf_SI_ClassID INTEGER,lf_SI_SecurityID INTEGER,lf_SI_QuotaCharged INTEGER,lf_SI_USN INTEGER,lf_SI_PartialValue TEXT,lf_FN_CTime TEXT,lf_FN_ATime TEXT,lf_FN_MTime TEXT,lf_FN_RTime TEXT,lf_FN_AllocSize INTEGER,lf_FN_RealSize INTEGER,lf_FN_Flags TEXT,lf_FN_Namespace TEXT,lf_DT_StartVCN INTEGER,lf_DT_LastVCN INTEGER,lf_DT_ComprUnitSize INTEGER,lf_DT_AllocSize INTEGER,lf_DT_RealSize INTEGER,lf_DT_InitStreamSize INTEGER,lf_DT_DataRuns TEXT,lf_DT_Name TEXT,lf_FileNameModified INTEGER,lf_RedoChunkSize INTEGER,lf_UndoChunkSize INTEGER,lf_record_type INTEGER,lf_transaction_id INTEGER,lf_flags INTEGER,lf_target_attribute INTEGER,lf_lcns_to_follow INTEGER,lf_attribute_offset INTEGER,lf_MftClusterIndex INTEGER,lf_target_vcn INTEGER,lf_target_lcn INTEGER,InOpenAttributeTable INTEGER,FromRcrdSlack INTEGER,IncompleteTransaction INTEGER);", $sOutputFile, $SQLite3Exe) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not create table LogFile in database: " & $NtfsDbFile & " : " & @error) _DumpOutput("Error Could not create table LogFile, $SQLiteExecution: " & $SQLiteExecution & @CRLF) Exit EndIf $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "CREATE TABLE IndexEntries (lf_Offset TEXT,lf_LSN INTEGER,lf_EntryNumber INTEGER,lf_MFTReference INTEGER,lf_MFTReferenceSeqNo INTEGER,lf_IndexFlags TEXT,lf_MFTParentReference INTEGER,lf_MFTParentReferenceSeqNo INTEGER,lf_CTime TEXT,lf_ATime TEXT,lf_MTime TEXT,lf_RTime TEXT,lf_AllocSize INTEGER,lf_RealSize INTEGER,lf_FileFlags TEXT,lf_ReparseTag TEXT,lf_FileName TEXT,lf_FileNameModified TEXT,lf_NameSpace TEXT,lf_SubNodeVCN TEXT);", $sOutputFile, $SQLite3Exe) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not create table IndexEntries in database: " & $NtfsDbFile & " : " & @error) _DumpOutput("Error Could not create table IndexEntries, $SQLiteExecution: " & $SQLiteExecution & @CRLF) Exit EndIf ;Import csv for dataruns If FileExists($LogFileDataRunsCsvfile) Then if $DoReconstructDataRuns Then $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, ".mode csv" & @CRLF & ".separator " & $de & @CRLF & ".import '" & FileGetShortName($LogFileDataRunsCsvfile) & "' DataRuns" & @CRLF, $sOutputFile) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not import " & $LogFileDataRunsCsvfile & " into database: " & @error) _DumpOutput("Error importing csv to DataRuns, $SQLiteExecution: " & $SQLiteExecution & @CRLF) Exit EndIf EndIf EndIf ;Import main csv of logfile output If FileExists($LogFileCsvFile) Then $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, ".mode csv" & @CRLF & ".separator " & $de & @CRLF & ".import '" & FileGetShortName($LogFileCsvFile) & "' LogFile" & @CRLF, $sOutputFile) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not import " & $LogFileCsvFile & " into database: " & @error) _DumpOutput("Error importing csv to LogFile, $SQLiteExecution: " & $SQLiteExecution & @CRLF) Exit EndIf EndIf ;Import csv of INDX decodes If FileExists($LogFileIndxCsvfile) Then $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, ".mode csv" & @CRLF & ".separator " & $de & @CRLF & ".import '" & FileGetShortName($LogFileIndxCsvfile) & "' IndexEntries" & @CRLF, $sOutputFile) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not import " & $LogFileIndxCsvfile & " into database: " & @error) _DumpOutput("Error importing csv to IndexEntries, $SQLiteExecution: " & $SQLiteExecution & @CRLF) EndIf EndIf _SQLite_Startup2($Sqlite3DllString) If @error Then MsgBox(0,"Error","Could not load " & $Sqlite3DllString & " Returned error val: " & @error) Exit EndIf $hDb = _SQLite_Open($NtfsDbFile) ;Open db If @error Then MsgBox(0,"Error","Opening database failed and returned error val: " & @extended) Exit EndIf $command = _SQLite_Exec($hDb, "DELETE from LogFile where ROWID = 1;") If @error Then MsgBox(0,"Error","DELETE from LogFile failed and returned error val: " & $command) Exit EndIf $command = _SQLite_Exec($hDb, "DELETE from IndexEntries where ROWID = 1;") If @error Then MsgBox(0,"Error","DELETE from IndexEntries failed and returned error val: " & $command) Exit EndIf _SQLite_Close() _SQLite_Shutdown() If $TargetMftCsvFile Then $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "CREATE TABLE Mft (" _ & "RecordOffset TEXT,Signature TEXT,IntegrityCheck TEXT,Style TEXT,HEADER_MFTREcordNumber INTEGER,HEADER_SequenceNo INTEGER,Header_HardLinkCount INTEGER,FN_ParentReferenceNo INTEGER,FN_ParentSequenceNo INTEGER,FN_FileName TEXT,FilePath TEXT,HEADER_Flags TEXT," _ & "RecordActive TEXT,FileSizeBytes INTEGER,SI_FilePermission TEXT,FN_Flags TEXT,FN_NameType TEXT,ADS TEXT,SI_CTime TEXT,SI_ATime TEXT,SI_MTime TEXT,SI_RTime TEXT,MSecTest TEXT,FN_CTime TEXT,FN_ATime TEXT,FN_MTime TEXT,FN_RTime TEXT,CTimeTest TEXT," _ & "FN_AllocSize INTEGER,FN_RealSize INTEGER,FN_EaSize INTEGER,SI_USN INTEGER,DATA_Name TEXT,DATA_Flags TEXT,DATA_LengthOfAttribute TEXT,DATA_IndexedFlag TEXT,DATA_VCNs INTEGER,DATA_NonResidentFlag INTEGER,DATA_CompressionUnitSize INTEGER,HEADER_LSN INTEGER,HEADER_RecordRealSize INTEGER," _ & "HEADER_RecordAllocSize INTEGER,HEADER_BaseRecord INTEGER,HEADER_BaseRecSeqNo INTEGER,HEADER_NextAttribID TEXT,DATA_AllocatedSize INTEGER,DATA_RealSize INTEGER,DATA_InitializedStreamSize INTEGER,SI_HEADER_Flags TEXT,SI_MaxVersions INTEGER,SI_VersionNumber INTEGER," _ & "SI_ClassID INTEGER,SI_OwnerID INTEGER,SI_SecurityID INTEGER,SI_Quota INTEGER,FN_CTime_2 TEXT,FN_ATime_2 TEXT,FN_MTime_2 TEXT,FN_RTime_2 TEXT,FN_AllocSize_2 INTEGER,FN_RealSize_2 INTEGER,FN_EaSize_2 INTEGER,FN_Flags_2 TEXT,FN_NameLength_2 INTEGER,FN_NameType_2 TEXT,FN_FileName_2 TEXT," _ & "GUID_ObjectID TEXT,GUID_BirthVolumeID TEXT,GUID_BirthObjectID TEXT,GUID_DomainID TEXT,VOLUME_NAME_NAME TEXT,VOL_INFO_NTFS_VERSION TEXT,VOL_INFO_FLAGS TEXT,FN_CTime_3 TEXT,FN_ATime_3 TEXT,FN_MTime_3 TEXT,FN_RTime_3 TEXT,FN_AllocSize_3 INTEGER," _ & "FN_RealSize_3 INTEGER,FN_EaSize_3 INTEGER,FN_Flags_3 TEXT,FN_NameLength_3 INTEGER,FN_NameType_3 TEXT,FN_FileName_3 TEXT,DATA_Name_2 TEXT,DATA_NonResidentFlag_2 INTEGER,DATA_Flags_2 TEXT,DATA_LengthOfAttribute_2 INTEGER,DATA_IndexedFlag_2 INTEGER,DATA_StartVCN_2 INTEGER," _ & "DATA_LastVCN_2 INTEGER,DATA_VCNs_2 INTEGER,DATA_CompressionUnitSize_2 INTEGER,DATA_AllocatedSize_2 INTEGER,DATA_RealSize_2 INTEGER,DATA_InitializedStreamSize_2 INTEGER,DATA_Name_3 TEXT,DATA_NonResidentFlag_3 INTEGER,DATA_Flags_3 TEXT,DATA_LengthOfAttribute_3 INTEGER," _ & "DATA_IndexedFlag_3 INTEGER,DATA_StartVCN_3 INTEGER,DATA_LastVCN_3 INTEGER,DATA_VCNs_3 INTEGER,DATA_CompressionUnitSize_3 INTEGER,DATA_AllocatedSize_3 INTEGER,DATA_RealSize_3 INTEGER,DATA_InitializedStreamSize_3 INTEGER,STANDARD_INFORMATION_ON INTEGER," _ & "ATTRIBUTE_LIST_ON INTEGER,FILE_NAME_ON INTEGER,OBJECT_ID_ON INTEGER,SECURITY_DESCRIPTOR_ON INTEGER,VOLUME_NAME_ON INTEGER,VOLUME_INFORMATION_ON INTEGER,DATA_ON INTEGER,INDEX_ROOT_ON INTEGER,INDEX_ALLOCATION_ON INTEGER,BITMAP_ON INTEGER,REPARSE_POINT_ON INTEGER," _ & "EA_INFORMATION_ON INTEGER,EA_ON INTEGER,PROPERTY_SET_ON INTEGER,LOGGED_UTILITY_STREAM_ON INTEGER" _ & ");", $sOutputFile, $SQLite3Exe) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not create table Mft in database: " & @error) _DumpOutput("Error Could not create table Mft, $SQLiteExecution: " & $SQLiteExecution & @CRLF) EndIf $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, ".mode csv" & @CRLF & ".separator " & $de & @CRLF & ".import '" & FileGetShortName($TargetMftCsvFile) & "' Mft" & @CRLF, $sOutputFile) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not import " & $TargetMftCsvFile & " into database: " & @error) _DumpOutput("Error importing csv to Mft, $SQLiteExecution: " & $SQLiteExecution & @CRLF) EndIf ; _SQLite_Startup2($Sqlite3DllString) ; if $TargetMftCsvFile Then ; $command = _SQLite_Exec($hDb, "DELETE from Mft where ROWID = 1;") ; If @error Then ; MsgBox(0,"Error","DELETE from Mft failed and returned error val: " & $command) ; Exit ; EndIf ; EndIf ; _SQLite_Close() ; _SQLite_Shutdown() _SQLite_SQLiteExe2($NtfsDbFile, "DELETE from Mft where ROWID = 1;", $sOutputFile) _SQLite_SQLiteExe2($NtfsDbFile, "UPDATE Mft set header_lsn = -1 where header_lsn = '';", $sOutputFile) $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "CREATE TABLE MftTmp as select HEADER_MFTRecordNumber,HEADER_LSN,FN_FileName,FilePath from Mft;", $sOutputFile, $SQLite3Exe) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not create table MftTmp in database: " & @error) _DumpOutput("Error Could not create table MftTmp, $SQLiteExecution: " & $SQLiteExecution & @CRLF) EndIf $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "CREATE TABLE LogFileTmp as select * from LogFile left join MftTmp on LogFile.lf_LSN=MftTmp.HEADER_LSN;", $sOutputFile, $SQLite3Exe) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not create table LogFileTmp in database: " & @error) _DumpOutput("Error Could not create table LogFileTmp, $SQLiteExecution: " & $SQLiteExecution & @CRLF) EndIf _SQLite_SQLiteExe2($NtfsDbFile, "DROP TABLE LogFile;", $sOutputFile) _SQLite_SQLiteExe2($NtfsDbFile, "ALTER TABLE LogFileTmp rename to LogFile;", $sOutputFile) EndIf If Not $CommandlineMode Then _DisplayInfo("Csv import and table updates took " & _WinAPI_StrFromTimeInterval(TimerDiff($begin)) & "." & @CRLF) _DumpOutput("Csv import and table updates took " & _WinAPI_StrFromTimeInterval(TimerDiff($begin)) & "." & @CRLF) ;----------------- UsnJrnl If FileExists($UsnJrnlFile) Then If Not $CommandlineMode Then $Progress = GUICtrlCreateLabel("Decoding $UsnJrnl info and writing to csv", 10, 380,540,20) GUICtrlSetFont($Progress, 12) EndIf $begin = TimerInit() Dim $hUsnJrnl, $RawPage="" ;$tBuffer2 ;$TestHeader ;$UsnJrnlPage="" $Remainder="" ;$SQLiteExecution $Record_Size = 4096 $nBytes="" $tBuffer2 = DllStructCreate("byte[" & $Record_Size & "]") $hUsnJrnl = _WinAPI_CreateFile("\\.\" & $UsnJrnlFile,2,2,7) If $hUsnJrnl = 0 Then ConsoleWrite("Error: Creating handle on file" & @CRLF) Exit EndIf $UsnJrnlCsvFile = $ParserOutDir & "\UsnJrnl.csv" $UsnJrnlCsv = FileOpen($UsnJrnlCsvFile, $EncodingWhenOpen) If @error Then ConsoleWrite("Error creating: " & $UsnJrnlCsvFile & @CRLF) Exit EndIf $UsnJrnl_Csv_Header = "MFTReference"&$de&"MFTParentReference"&$de&"USN"&$de&"Timestamp"&$de&"Reason"&$de&"SourceInfo"&$de&"FileAttributes"&$de&"FileName"&$de&"FileNameModified" FileWriteLine($UsnJrnlCsv, $UsnJrnl_Csv_Header & @CRLF) $InputFileSize = _WinAPI_GetFileSizeEx($hUsnJrnl) ConsoleWrite("$MaxRecords " & $MaxRecords & @CRLF) ; 1712425 If Not $CommandlineMode Then AdlibRegister("_UsnJrnlProgress",500) $MaxRecords = Ceiling($InputFileSize/$Record_Size) For $i = 0 To $MaxRecords-1 $CurrentRecord = $i _WinAPI_SetFilePointerEx($hUsnJrnl, $i*$Record_Size, $FILE_BEGIN) _WinAPI_ReadFile($hUsnJrnl, DllStructGetPtr($tBuffer2), $Record_Size, $nBytes) $RawPage = DllStructGetData($tBuffer2, 1) _UsnProcessPage(StringMid($RawPage,3)) Next If Not $CommandlineMode Then AdlibUnRegister("_UsnJrnlProgress") GUICtrlSetData($ProgressStatus, "Processing UsnJrnl record " & $CurrentRecord+1 & " of " & $MaxRecords) GUICtrlSetData($ElapsedTime, "Elapsed time = " & _WinAPI_StrFromTimeInterval(TimerDiff($begin))) GUICtrlSetData($ProgressUsnJrnl, 100 * ($CurrentRecord+1) / $MaxRecords) EndIf _WinAPI_CloseHandle($hUsnJrnl) _WinAPI_CloseHandle($UsnJrnlCsv) $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "CREATE TABLE UsnJrnl (UsnJrnlMFTReference INTEGER,UsnJrnlMFTParentReference INTEGER,UsnJrnlUSN INTEGER,UsnJrnlTimestamp TEXT,UsnJrnlReason TEXT,UsnJrnlSourceInfo TEXT,UsnJrnlFileAttributes TEXT,UsnJrnlFileName TEXT,UsnJrnlFileNameModified INTEGER);", $sOutputFile, $SQLite3Exe) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not create table UsnJrnl in database: " & @error) _DumpOutput("Error Could not create table UsnJrnl, $SQLiteExecution: " & $SQLiteExecution & @CRLF) Exit EndIf $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, ".mode csv" & @CRLF & ".separator " & $de & @CRLF & ".import '" & FileGetShortName($UsnJrnlCsvFile) & "' UsnJrnl" & @CRLF, $sOutputFile) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not import " & $UsnJrnlCsvFile & " into database: " & @error) _DumpOutput("Error importing csv to UsnJrnl, $SQLiteExecution: " & $SQLiteExecution & @CRLF) Exit EndIf _SQLite_Startup2($Sqlite3DllString) If @error Then MsgBox(0,"Error","Could not load " & $Sqlite3DllString & " Returned error val: " & @error) Exit EndIf $hDb = _SQLite_Open($NtfsDbFile) ;Open db If @error Then MsgBox(0,"Error","Opening database failed and returned error val: " & @extended) Exit EndIf $command = _SQLite_Exec($hDb, "DELETE from UsnJrnl where ROWID = 1;") If @error Then MsgBox(0,"Error","DELETE from UsnJrnl failed and returned error val: " & $command) Exit EndIf ; _SQLite_Exec($hDb, "DELETE from LogFile where ROWID = 1;") ; Join filename from UsnJrnl into LogFile If Not $CommandlineMode Then ProgressOn("Stage 3: (joining data from UsnJrnl into LogFile)", "", "", -1, -1, 16) ProgressSet(0, 0 & " percent") EndIf $command = _SQLite_Exec($hDb, "create table LogFileTmp as select * from LogFile inner join UsnJrnl on LogFile.lf_SI_USN=UsnJrnl.UsnJrnlUSN where lf_SI_USN <> '' and lf_SI_USN <> " & $IntegerErrorVal & " and lf_SI_USN <> " & $IntegerPartialValReplacement & ";") If @error Then MsgBox(0,"Error","Create table LogFileTmp failed and returned error val: " & $command) Exit EndIf $command = _SQLite_Exec($hDb, "update LogFile set lf_UsnJrlFileName = (select UsnJrnlFileName from LogFileTmp where LogFileTmp.UsnJrnlUSN=LogFile.lf_SI_USN) where lf_SI_USN <> '' and lf_SI_USN <> " & $IntegerErrorVal & " and lf_SI_USN <> " & $IntegerPartialValReplacement & ";") If @error Then MsgBox(0,"Error","update LogFile set lf_UsnJrlFileName failed and returned error val: " & $command) Exit EndIf If Not $CommandlineMode Then ProgressSet(20, 20 & " percent") $command = _SQLite_Exec($hDb, "update LogFile set lf_UsnJrlMFTReference = (select UsnJrnlMFTReference from LogFileTmp where LogFileTmp.UsnJrnlUSN=LogFile.lf_SI_USN) where lf_SI_USN <> '' and lf_SI_USN <> " & $IntegerErrorVal & " and lf_SI_USN <> " & $IntegerPartialValReplacement & ";") If @error Then MsgBox(0,"Error","update LogFile set lf_UsnJrlMFTReference failed and returned error val: " & $command) Exit EndIf If Not $CommandlineMode Then ProgressSet(40, 40 & " percent") $command = _SQLite_Exec($hDb, "update LogFile set lf_UsnJrlMFTParentReference = (select UsnJrnlMFTParentReference from LogFileTmp where LogFileTmp.UsnJrnlUSN=LogFile.lf_SI_USN) where lf_SI_USN <> '' and lf_SI_USN <> " & $IntegerErrorVal & " and lf_SI_USN <> " & $IntegerPartialValReplacement & ";") If @error Then MsgBox(0,"Error","update LogFile set lf_UsnJrlMFTParentReference failed and returned error val: " & $command) Exit EndIf If Not $CommandlineMode Then ProgressSet(60, 60 & " percent") $command = _SQLite_Exec($hDb, "update LogFile set lf_UsnJrlTimestamp = (select UsnJrnlTimestamp from LogFileTmp where LogFileTmp.UsnJrnlUSN=LogFile.lf_SI_USN) where lf_SI_USN <> '' and lf_SI_USN <> " & $IntegerErrorVal & " and lf_SI_USN <> " & $IntegerPartialValReplacement & ";") If @error Then MsgBox(0,"Error","update LogFile set lf_UsnJrlTimestamp failed and returned error val: " & $command) Exit EndIf If Not $CommandlineMode Then ProgressSet(80, 80 & " percent") $command = _SQLite_Exec($hDb, "update LogFile set lf_UsnJrlReason = (select UsnJrnlReason from LogFileTmp where LogFileTmp.UsnJrnlUSN=LogFile.lf_SI_USN) where lf_SI_USN <> '' and lf_SI_USN <> " & $IntegerErrorVal & " and lf_SI_USN <> " & $IntegerPartialValReplacement & ";") If @error Then MsgBox(0,"Error","update LogFile set lf_UsnJrlReason failed and returned error val: " & $command) Exit EndIf If $DoReconstructDataRuns Then ; $command = _SQLite_Exec($hDb, "create table LogFile2 as select * from LogFile order by LSN asc;") $command = _SQLite_Exec($hDb, "update DataRuns set lf_FileName = (select UsnJrnlFileName from LogFileTmp where LogFileTmp.UsnJrnlUSN=DataRuns.lf_SI_USN) where lf_SI_USN <> '' and lf_SI_USN <> " & $IntegerErrorVal & " and lf_SI_USN <> " & $IntegerPartialValReplacement & ";") If @error Then MsgBox(0,"Error","update DataRuns set FileName failed and returned error val: " & $command) Exit EndIf EndIf If Not $CommandlineMode Then ProgressSet(100, "Done") _SQLite_Close() _SQLite_Shutdown() If Not $CommandlineMode Then ProgressOff() _DisplayInfo("$UsnJrnl processing finished in " & _WinAPI_StrFromTimeInterval(TimerDiff($begin)) & @CRLF) EndIf _DumpOutput("$UsnJrnl processing finished in " & _WinAPI_StrFromTimeInterval(TimerDiff($begin)) & @CRLF) EndIf If FileExists($UsnJrnlFile) Or $TargetMftCsvFile Then $SQLiteExecution2 = _SQLite_SQLiteExe2($NtfsDbFile, ".headers on" & @CRLF & ".mode csv" & @CRLF & ".separator " & $de & @CRLF & ".output LogFileJoined.csv" & @CRLF & "select * from LogFile;" & @CRLF, $sOutputFile) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not export LogFile table to csv: " & @error) _DumpOutput("@error: " & @error & @CRLF) _DumpOutput("Error exporting from LogFile table to LogFileJoined.csv, $SQLiteExecution: " & $SQLiteExecution & @CRLF) Exit EndIf FileMove(@ScriptDir&"\LogFileJoined.csv",$ParserOutDir&"\LogFileJoined.csv",9) EndIf ;remove bogus table If $CheckUnicode = 1 Then $SQLiteExecution2 = _SQLite_SQLiteExe2($NtfsDbFile, "DROP TABLE bogus;", $sOutputFile) If $SQLiteExecution2 <> 0 Then MsgBox(0,"Error","Could not DROP TABLE bogus: " & @error) _DumpOutput("@error: " & @error & @CRLF) _DumpOutput("Error Could not DROP TABLE bogus, $SQLiteExecution: " & $SQLiteExecution & @CRLF) ; Exit EndIf EndIf ;--------- DataRuns If Not $DoReconstructDataRuns Then If Not $CommandlineMode Then _DisplayInfo("Done!" & @CRLF) _DumpOutput("Done!" & @CRLF) ; GUICtrlSetData($ProgressLogFile, 0) ; GUICtrlSetData($ProgressUsnJrnl, 0) ; GUICtrlSetData($ProgressReconstruct, 0) Return EndIf If Not $CommandlineMode Then $Progress = GUICtrlCreateLabel("Reconstructing dataruns", 10, 380,540,20) GUICtrlSetFont($Progress, 12) EndIf $begin = TimerInit() ;$sSQliteDll = _SQLite_Startup2($Sqlite3DllString) _SQLite_Startup2($Sqlite3DllString) If @error Then MsgBox(0,"Error","Could not load " & $Sqlite3DllString & " Returned error val: " & @error) Exit EndIf ;ConsoleWrite("SQLite3.dll Loaded: " & $sSQliteDll & @CRLF) ;ConsoleWrite("SQLite version: " & _SQLite_LibVersion() & @CRLF) $hDb = _SQLite_Open($NtfsDbFile) ;Open db If @error Then MsgBox(0,"Error","Opening database failed and returned error val: " & @extended) Exit EndIf $command = _SQLite_Exec($hDb, "UPDATE Dataruns set lf_OffsetToDataRuns = 0 where lf_OffsetToDataRuns = '';") ;Replace all empty values so we can filter the column later on If @error Then MsgBox(0,"Error","Updating the DataRuns table failed and returned error val: " & $command) Exit EndIf $command = _SQLite_GetTable2d($hDb, "SELECT Count(*) FROM DataRuns;", $aRes, $iRows, $iColumns) ;Get number of rows If @error Then MsgBox(0,"Error","Counting rows failed and returned error val: " & $command) Exit EndIf If IsArray($aRes) Then ConsoleWrite("Total rows to process for dataruns: " & $aRes[1][0] & @CRLF) $MaxRows=$aRes[1][0] Else MsgBox(0,"Error","Could not resolve rows in DataRuns table.") Exit EndIf $RowsProcessed=0 $command = _SQLite_Query($hDb, "SELECT distinct(lf_MFTReference) from Dataruns;", $hQuery) ; Get distinct reference numbers If @error Then MsgBox(0,"Error","SQL select query failed and returned error val: " & $command) Exit EndIf If Not $CommandlineMode Then ; ProgressOn("Stage 4: (reconstructing dataruns)", "", "", -1, -1, 16) AdlibRegister("_DataRunReconstructProgress") EndIf ConsoleWrite("Reconstructing dataruns may take some time.." & @CRLF) $Counter = 0 While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK $TargetRef = $aRow[0] If $TargetRef = 'lf_MFTReference' Then ContinueLoop ; ConsoleWrite("Current FileRef: " & $TargetRef & @CRLF) $command = _SQLite_GetTable2d($hDb, "SELECT * from Dataruns where lf_MFTReference = "&"'"&$TargetRef&"'"&" order by lf_LSN asc;", $DataRunArr, $iRows, $iColumns) ;Generate array from each ref and order it low-high by LSN If @error Then MsgBox(0,"Error","SQL select query failed and returned error val: " & $command) Exit EndIf ; _ArrayDisplay($DataRunArr,"$DataRunArr") _ArrayDelete($DataRunArr,0) ;Remove header ; _ArrayDisplay($DataRunArr,"$DataRunArr") For $i = 0 To UBound($DataRunArr)-1 $RowsProcessed+=1 $TestRef = $DataRunArr[$i][1] $RefAlreadyExist = _ArraySearch($NewDataRunArr,$TestRef,0,0,1,2,1,1) $RedoOperation = $DataRunArr[$i][5] If $RefAlreadyExist = -1 Or ($RedoOperation="CreateAttribute" Or $RedoOperation="InitializeFileRecordSegment") Then If $RedoOperation<>"CreateAttribute" And $RedoOperation<>"InitializeFileRecordSegment" And $DataRunArr[$i][16]="" Then $DataRunArr[$i][16] = 64 ;Write to new row $NewDataRunArr[$Counter][0] = $DataRunArr[$i][0] ; Offset first record $NewDataRunArr[$Counter][1] = $DataRunArr[$i][1] ; Ref $NewDataRunArr[$Counter][2] = $DataRunArr[$i][2] ; BaseRecRef $NewDataRunArr[$Counter][3] = $DataRunArr[$i][3] ; File Name $NewDataRunArr[$Counter][4] = $DataRunArr[$i][4] ; LSN $NewDataRunArr[$Counter][5] = $DataRunArr[$i][5] ; Redo Op $NewDataRunArr[$Counter][6] = $DataRunArr[$i][6] ; Undo Op $NewDataRunArr[$Counter][7] = $DataRunArr[$i][7] ; Offset In MFT $NewDataRunArr[$Counter][8] = $DataRunArr[$i][8] ; Attribute Offset $NewDataRunArr[$Counter][9] = $DataRunArr[$i][9] ; USN $NewDataRunArr[$Counter][10] = $DataRunArr[$i][10] ; DataName $NewDataRunArr[$Counter][11] = $DataRunArr[$i][11] ; Flags $NewDataRunArr[$Counter][12] = $DataRunArr[$i][12] ; Non-Resident $NewDataRunArr[$Counter][13] = $DataRunArr[$i][13] ; Compression unit size $NewDataRunArr[$Counter][14] = $DataRunArr[$i][14] ; File size $NewDataRunArr[$Counter][15] = $DataRunArr[$i][15] ; Initialized size $NewDataRunArr[$Counter][16] = $DataRunArr[$i][16] ; Offset to datarun ; $NewDataRunArr[$Counter][16] = $MaxOffsetToDataruns ; Offset to datarun If $DataRunArr[$i][17] <> "" Then $NewDataRunArr[$Counter][17] = _UpdateDataRunInformation($NewDataRunArr[$Counter][5],$NewDataRunArr[$Counter][8],$NewDataRunArr[$Counter][16],$DataRunArr[$i][17],$NewDataRunArr[$Counter][17]) $Counter+=1 Redim $NewDataRunArr[2+$Counter][18] ContinueLoop EndIf ; Update existing row If $DataRunArr[$i][2] <> "" Then $NewDataRunArr[$Counter-1][2] = $DataRunArr[$i][2] If $DataRunArr[$i][3] <> "" Then $NewDataRunArr[$Counter-1][3] = $DataRunArr[$i][3] If $DataRunArr[$i][4] <> "" Then $NewDataRunArr[$Counter-1][4] = $DataRunArr[$i][4] If $DataRunArr[$i][5] <> "" Then $NewDataRunArr[$Counter-1][5] = $DataRunArr[$i][5] If $DataRunArr[$i][6] <> "" Then $NewDataRunArr[$Counter-1][6] = $DataRunArr[$i][6] If $DataRunArr[$i][7] <> "0" Then $NewDataRunArr[$Counter-1][7] = $DataRunArr[$i][7] If $DataRunArr[$i][8] <> "0" Then $NewDataRunArr[$Counter-1][8] = $DataRunArr[$i][8] ; If $DataRunArr[$i][9] <> "" Then $NewDataRunArr[$Counter-1][9] = $DataRunArr[$i][9] If $DataRunArr[$i][10] <> "" Then $NewDataRunArr[$Counter-1][10] = $DataRunArr[$i][10] If $DataRunArr[$i][11] <> "" Then $NewDataRunArr[$Counter-1][11] = $DataRunArr[$i][11] If $DataRunArr[$i][12] <> "" Then $NewDataRunArr[$Counter-1][12] = $DataRunArr[$i][12] If $DataRunArr[$i][13] <> "" Then $NewDataRunArr[$Counter-1][13] = $DataRunArr[$i][13] If $DataRunArr[$i][14] <> "" Then $NewDataRunArr[$Counter-1][14] = $DataRunArr[$i][14] If $DataRunArr[$i][15] <> "" Then $NewDataRunArr[$Counter-1][15] = $DataRunArr[$i][15] If $DataRunArr[$i][16] <> "" Then $NewDataRunArr[$Counter-1][16] = $DataRunArr[$i][16] If $DataRunArr[$i][17] <> "" Then $NewDataRunArr[$Counter-1][17] = _UpdateDataRunInformation($NewDataRunArr[$Counter-1][5],$NewDataRunArr[$Counter-1][8],$NewDataRunArr[$Counter-1][16],$DataRunArr[$i][17],$NewDataRunArr[$Counter-1][17]) Next _ArrayDelete($NewDataRunArr,UBound($NewDataRunArr)) WEnd ;_ArrayDisplay($NewDataRunArr,"$NewDataRunArr") if $NewDataRunArr[UBound($NewDataRunArr)-1][0] = '' Then _ArrayDelete($NewDataRunArr,UBound($NewDataRunArr)) if $NewDataRunArr[UBound($NewDataRunArr)-1][0] = '' Then _ArrayDelete($NewDataRunArr,UBound($NewDataRunArr)) ;_ArrayDelete($NewDataRunArr,UBound($NewDataRunArr)) ;_ArrayDelete($NewDataRunArr,UBound($NewDataRunArr)) ;_ArrayDisplay($NewDataRunArr,"$NewDataRunArr") ;Write line by line of final dataruns information from array to csv For $k = 0 To UBound($NewDataRunArr)-1 FileWriteLine($LogFileDataRunsModCsv, $NewDataRunArr[$k][1]&$de&$NewDataRunArr[$k][2]&$de&$NewDataRunArr[$k][3]&$de&$NewDataRunArr[$k][4]&$de&$NewDataRunArr[$k][7]&$de&$NewDataRunArr[$k][10]&$de&$NewDataRunArr[$k][11]&$de&$NewDataRunArr[$k][12]&$de&$NewDataRunArr[$k][14]&$de&$NewDataRunArr[$k][15]&$de&$NewDataRunArr[$k][17] & @CRLF) Next FileFlush($LogFileDataRunsModCsv) FileClose($LogFileDataRunsModCsv) If Not $CommandlineMode Then _DisplayInfo("Reconstruction of dataruns finished in " & _WinAPI_StrFromTimeInterval(TimerDiff($begin)) & @CRLF) $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, "CREATE TABLE DataRunsResolved (lf_MFTReference INTEGER,lf_MFTBaseRecRef INTEGER,lf_FileName TEXT,lf_LSN INTEGER,lf_OffsetInMft INTEGER,lf_DataName TEXT,lf_Flags TEXT,lf_NonResident INTEGER,lf_FileSize INTEGER,lf_InitializedStreamSize INTEGER,lf_DataRuns TEXT);", $sOutputFile, $SQLite3Exe) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not create table DataRunsResolved in database: " & @error) _DumpOutput("Error Could not create table DataRunsResolved, $SQLiteExecution: " & $SQLiteExecution & @CRLF) Exit EndIf $SQLiteExecution = _SQLite_SQLiteExe2($NtfsDbFile, ".mode csv" & @CRLF & ".separator " & $de & @CRLF & ".import '" & FileGetShortName($LogFileDataRunsModCsvfile) & "' DataRunsResolved" & @CRLF, $sOutputFile) If $SQLiteExecution <> 0 Then MsgBox(0,"Error","Could not import " & $LogFileDataRunsModCsvfile & " into database: " & @error) _DumpOutput("Error importing csv to DataRunsResolved, $SQLiteExecution: " & $SQLiteExecution & @CRLF) EndIf $command = _SQLite_Exec($hDb, "DELETE from DataRunsResolved where ROWID = 1;") If @error Then MsgBox(0,"Error","DELETE from DataRunsResolved failed and returned error val: " & $command) Exit EndIf _SQLite_Close() _SQLite_Shutdown() If Not $CommandlineMode Then AdlibUnRegister("_DataRunReconstructProgress") GUICtrlSetData($ProgressStatus, "Reconstructing dataruns at row " & $RowsProcessed+1 & " of " & $MaxRows) GUICtrlSetData($ElapsedTime, "Elapsed time = " & _WinAPI_StrFromTimeInterval(TimerDiff($begin))) GUICtrlSetData($ProgressReconstruct, 100 * ($RowsProcessed+1) / $MaxRows) _DisplayInfo("Done!" & @CRLF) EndIf _DumpOutput("Done!" & @CRLF) $ReconstructDone=True Return EndFunc #cs RCRD 0x40: 64 byte header 0x30: record 48 byte header + data #ce Func _DecodeRCRD($RCRDRecord, $RCRDOffset, $OffsetAdjustment, $DoNotReturnData) Local $DataPart = 0, $NextOffset = 131, $TotalSizeOfRCRD = StringLen($RCRDRecord), $CharsToMove=0, $LsnSignatureFound=0, $last_lsn_tmp_refup, $last_lsn_tmp_refdown, $RebuiltLsn ;Local $ZeroSample="0000000000000000", $LsnSignatureLength=10 Global $SlackPerRCRDCounter=0 $PredictedRefNumber = "" $FromRcrdSlack = 0 If $BrokenLogFile Then $FromRcrdSlack=1 ;_DumpOutput("<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>" & @CRLF) ;_DumpOutput("$RCRDOffset: 0x" & Hex($RCRDOffset,8) & @CRLF) ;ConsoleWrite(_HexEncode(StringMid($RCRDRecord,1,130)) & @CRLF) ;ConsoleWrite("$TotalSizeOfRCRD: 0x" & Hex(Int(($TotalSizeOfRCRD-3)/2),8) & @CRLF) ;ConsoleWrite(_HexEncode("0x"&StringMid($RCRDRecord,131)) & @CRLF) ;ConsoleWrite(_HexEncode(StringMid($RCRDRecord,1)) & @CRLF) $last_lsn_tmp = StringMid($RCRDRecord,19,16) $last_lsn_tmp = Dec(_SwapEndian($last_lsn_tmp),2) $last_end_lsn_tmp = StringMid($RCRDRecord,67,16) $last_end_lsn_tmp = Dec(_SwapEndian($last_end_lsn_tmp),2) $max_last_lsn = _Max($last_lsn_tmp,$last_end_lsn_tmp) $last_lsn_tmp_refup = Round($max_last_lsn*(1+$LsnValidationLevel)) $last_lsn_tmp_refdown = Round($max_last_lsn*(1-$LsnValidationLevel)) $this_lsn_tmp = StringMid($RCRDRecord,$NextOffset,16) $this_lsn_tmp = Dec(_SwapEndian($this_lsn_tmp),2) $next_record_offset = Dec(_SwapEndian(StringMid($RCRDRecord,51,4)),2) $client_previous_lsn_tmp = StringMid($RCRDRecord,$NextOffset+16,16) $client_previous_lsn_tmp = Dec(_SwapEndian($client_previous_lsn_tmp),2) $client_undo_next_lsn_tmp = StringMid($RCRDRecord,$NextOffset+32,16) $client_undo_next_lsn_tmp = Dec(_SwapEndian($client_undo_next_lsn_tmp),2) ;If ($this_lsn_tmp > $last_lsn_tmp) Or ($this_lsn_tmp < $last_lsn_tmp - 1000) Then ; _DumpOutput("Error: RCRD seems corrupt at offset: 0x" & Hex($RCRDOffset,8) & @CRLF) ; _DumpOutput("Bytes reassembled: " & $OffsetAdjustment & @CRLF) ; _DumpOutput("$last_lsn_tmp: " & $last_lsn_tmp & @CRLF) ; _DumpOutput("$this_lsn_tmp: " & $this_lsn_tmp & @CRLF) ; _DumpOutput(_HexEncode(StringMid($RCRDRecord,1)) & @CRLF) ; Return ;EndIf ;$TestChunk2 = StringMid($last_lsn_tmp_mod,16-$LsnSignatureLength) ;ConsoleWrite("$TestChunk2: " & $TestChunk2 & @CRLF) If ($this_lsn_tmp > $max_last_lsn) Or ($client_previous_lsn_tmp > $max_last_lsn) Or ($client_undo_next_lsn_tmp > $max_last_lsn) Or ($this_lsn_tmp < $last_lsn_tmp_refdown) Or ($client_previous_lsn_tmp < $last_lsn_tmp_refdown And $client_previous_lsn_tmp <> 0) Or ($client_undo_next_lsn_tmp < $last_lsn_tmp_refdown And $client_undo_next_lsn_tmp <> 0) Then _DumpOutput("Scanning for LSN signature from RCRD offset: 0x" & Hex($RCRDOffset,8) & @CRLF) ; _DumpOutput("$DoNotReturnData: " & $DoNotReturnData & @CRLF) ; _DumpOutput("$OffsetAdjustment: " & $OffsetAdjustment & @CRLF) ; _DumpOutput("$last_lsn_tmp: " & $last_lsn_tmp & @CRLF); ; _DumpOutput("$last_end_lsn_tmp: " & $last_end_lsn_tmp & @CRLF) ; _DumpOutput("$max_last_lsn: " & $max_last_lsn & @CRLF) ; _DumpOutput("$last_lsn_tmp_refup: " & $last_lsn_tmp_refup & @CRLF) ; _DumpOutput("$last_lsn_tmp_refdown: " & $last_lsn_tmp_refdown & @CRLF) ; _DumpOutput("$NextOffset: " & $NextOffset & @CRLF) ; _DumpOutput("$CharsToMove: " & $CharsToMove & @CRLF) While 1 If $CharsToMove+$NextOffset > $TotalSizeOfRCRD Then ExitLoop ; _DumpOutput("0x"&Hex(Int(($NextOffset+$CharsToMove-3)/2),8) & @CRLF) $TestChunk1 = StringMid($RCRDRecord,$NextOffset+$CharsToMove,16) $TestChunk1 = Dec(_SwapEndian($TestChunk1),2) ; _DumpOutput("$TestChunk1: " & $TestChunk1 & @CRLF) If ($TestChunk1 > $last_lsn_tmp_refdown) And ($TestChunk1 < $last_lsn_tmp_refup) Then $TestChunk2 = StringMid($RCRDRecord,$NextOffset+$CharsToMove+16,16) $TestChunk2 = Dec(_SwapEndian($TestChunk2),2) ; _DumpOutput("$TestChunk2: " & $TestChunk2 & @CRLF) $TestChunk3 = StringMid($RCRDRecord,$NextOffset+$CharsToMove+16+16,16) $TestChunk3 = Dec(_SwapEndian($TestChunk3),2) ; _DumpOutput("$TestChunk3: " & $TestChunk3 & @CRLF) If (($TestChunk2 > $last_lsn_tmp_refdown) And ($TestChunk2 < $last_lsn_tmp_refup)) Or ($TestChunk2 = 0) Then If (($TestChunk3 > $last_lsn_tmp_refdown) And ($TestChunk3 < $last_lsn_tmp_refup)) Or ($TestChunk3 = 0) Then ; ConsoleWrite("Match1!!!" & @CRLF) $LsnSignatureFound=1 ExitLoop Else ; ConsoleWrite("False positive" & @CRLF) $CharsToMove+=16 ContinueLoop EndIf Else ; ConsoleWrite("False positive" & @CRLF) $CharsToMove+=16 ContinueLoop EndIf ; ConsoleWrite("Match2!!!" & @CRLF) ; ExitLoop EndIf $CharsToMove+=16 If $CharsToMove+$NextOffset > $TotalSizeOfRCRD Then ExitLoop WEnd If Not $LsnSignatureFound Then _DumpOutput("LSN signature not found:" & @CRLF) _DumpOutput(_HexEncode("0x"&StringMid($RCRDRecord,$NextOffset)) & @CRLF) Return "" Else If $CharsToMove > 0 Then If $DoNotReturnData > 0 And $OffsetAdjustment > 0 Then ;This check should not be necessary????????????????????????? $RecordOffset = "0x" & Hex(Int($RCRDOffset-$OffsetAdjustment/2),8) ; _DumpOutput("Unknown slack space found at record offset 0x" & Hex(Int($RCRDOffset-$OffsetAdjustment+($NextOffset-3)/2),8) & " - 0x" & Hex(Int($RCRDOffset-$OffsetAdjustment+($NextOffset+$CharsToMove-3)/2),8) & @CRLF) _DumpOutput("Unknown slack space found at record offset 0x" & Hex(Int($RCRDOffset-$OffsetAdjustment/2),8) & " - 0x" & Hex(Int($RCRDOffset-$OffsetAdjustment+$CharsToMove/2),8) & @CRLF) Else $RecordOffset = "0x" & Hex(Int($RCRDOffset+($NextOffset-3)/2),8) _DumpOutput("Unknown slack space found at record offset 0x" & Hex(Int($RCRDOffset+($NextOffset-3)/2),8) & " - 0x" & Hex(Int($RCRDOffset+($NextOffset+$CharsToMove-3)/2),8) & @CRLF) EndIf _DumpOutput(_HexEncode("0x"&StringMid($RCRDRecord,$NextOffset,$CharsToMove)) & @CRLF) If $DoRebuildBrokenHeader And $CharsToMove >= $MinSizeBrokenTransaction Then _DumpOutput("Attempting a repair of possible broken header 1.." & @CRLF) $ClientData = _CheckAndRepairTransactionHeader(StringMid($RCRDRecord,$NextOffset,$CharsToMove)) If Not @Error Then $RebuiltLsn = StringMid($ClientData,1,16) $RebuiltLsn = Dec(_SwapEndian($RebuiltLsn),2) $IncompleteTransaction=1 _DecodeLSNRecord($ClientData,$RebuiltLsn) EndIf EndIf EndIf _DumpOutput("Found LSN signature match at record offset 0x"&Hex(Int($RCRDOffset+($NextOffset+$CharsToMove-3)/2),8) & @CRLF) $NextOffset += $CharsToMove EndIf $FromRcrdSlack=1 else $FromRcrdSlack=0 EndIf $SizeOfClientData = StringMid($RCRDRecord,$NextOffset+48,8) $SizeOfClientData = Dec(_SwapEndian($SizeOfClientData),2) ;_DumpOutput("RCRD Offset: 0x" & Hex($RCRDOffset,8) & @CRLF) ;_DumpOutput("$SizeOfClientData: 0x" & Hex(Int($SizeOfClientData),8) & @CRLF) If Not $DoNotReturnData Then If 96+($SizeOfClientData*2) > $TotalSizeOfRCRD-$NextOffset Then ; _DumpOutput("Data returned 0 (" & $GlobalDataKeepCounter & ")" & @CRLF) ; _DumpOutput("Returned data:" & @CRLF) ; _DumpOutput(_HexEncode("0x"&StringMid($RCRDRecord,$NextOffset)) & @CRLF) Return StringMid($RCRDRecord,$NextOffset) EndIf EndIf Do If $DataPart And $GlobalRecordSpreadReset Then $RecordOffset = $RCRDOffset+(($NextOffset-$OffsetAdjustment-3+(128*$GlobalRecordSpreadReset))/2) ; $RecordOffset = $RCRDOffset+(($NextOffset-$OffsetAdjustment-3)/2) $RecordOffset = "0x"&Hex(Int($RecordOffset)) ElseIf $DataPart Then $RecordOffset = $RCRDOffset+(($NextOffset-$OffsetAdjustment-3)/2) $RecordOffset = "0x"&Hex(Int($RecordOffset)) Else $RecordOffset = $RCRDOffset+(($NextOffset-$OffsetAdjustment-3-(128*$GlobalDataKeepCounter))/2) $RecordOffset = "0x"&Hex(Int($RecordOffset)) EndIf If $NextOffset-$OffsetAdjustment >= $next_record_offset*2 Then ; _DumpOutput("RCRD Offset: 0x" & Hex($RCRDOffset,8) & @CRLF) If Not $DoNotReturnData Then ; _DumpOutput("Data returned 1 (" & $GlobalDataKeepCounter & ")" & @CRLF) ; _DumpOutput("Return data (split record) at end of RCRD at 0x" & Hex(Int($next_record_offset),4) & @CRLF) ; _DumpOutput("Bytes returned: 0x" & Hex(Int((($TotalSizeOfRCRD-3-$OffsetAdjustment)/2)-$next_record_offset),8) & @CRLF) ; _DumpOutput("$NextOffset: " & $NextOffset & @CRLF) ; _DumpOutput("$OffsetAdjustment: " & $OffsetAdjustment & @CRLF) ; _DumpOutput("$NextOffset-$OffsetAdjustment: " & $NextOffset-$OffsetAdjustment & @CRLF) ; _DumpOutput("$next_record_offset: " & $next_record_offset*2 & @CRLF) ; _DumpOutput("$next_record_offset: 0x" & Hex(Int($next_record_offset),4) & @CRLF) ; _DumpOutput(_HexEncode("0x"&StringMid($RCRDRecord,3+($next_record_offset*2))) & @CRLF) ; _DumpOutput(_HexEncode("0x"&StringMid($RCRDRecord,$NextOffset)) & @CRLF) Return StringMid($RCRDRecord,$NextOffset) Else _DumpOutput("Analyzing slack space starting at " & $RecordOffset & @CRLF) _TestSlackSpace(StringMid($RCRDRecord,$NextOffset),$max_last_lsn,$RecordOffset) Return "" EndIf EndIf $SizeOfClientData = StringMid($RCRDRecord,$NextOffset+48,8) $SizeOfClientData = Dec(_SwapEndian($SizeOfClientData),2) $SizeOfClientData = $SizeOfClientData*2 If $SizeOfClientData = 0 Then _DumpOutput("Error: $SizeOfClientData was 0 at " & $RecordOffset & @CRLF) _DumpOutput(_HexEncode("0x"&StringMid($RCRDRecord,$NextOffset)) & @CRLF) ; _TestSlackSpace(StringMid($RCRDRecord,$NextOffset),$last_lsn_tmp,$RecordOffset) ExitLoop EndIf #cs If $RCRDOffset > 0x1A28000 Then _DumpOutput("------------------------------------" & @CRLF) _DumpOutput("RCRD Offset: 0x" & Hex($RCRDOffset,8) & @CRLF) _DumpOutput("$SizeOfClientData: 0x" & Hex(Int($SizeOfClientData/2),8) & @CRLF) _DumpOutput("$SizeOfClientData: " & $SizeOfClientData & @CRLF) _DumpOutput("$NextOffset: " & $NextOffset & @CRLF) _DumpOutput("$OffsetAdjustment: " & $OffsetAdjustment & @CRLF) _DumpOutput("$TotalSizeOfRCRD: " & $TotalSizeOfRCRD & @CRLF) EndIf #ce $ClientData = StringMid($RCRDRecord,$NextOffset,96+$SizeOfClientData) ; 48 bytes header + data If $NextOffset-1-$OffsetAdjustment+96+$SizeOfClientData > $TotalSizeOfRCRD Then ; We need to return the incomplete record, and attach it to the beginning of the next RCRD and continue processing If Not $DoNotReturnData Then ; _DumpOutput("Data returned 2 (" & $GlobalDataKeepCounter & ")" & @CRLF) ; Return $ClientData Return StringMid($RCRDRecord,$NextOffset) Else _DumpOutput("Error should not really be here: " & $RecordOffset & @CRLF) _DumpOutput("$NextOffset: " & $NextOffset & @CRLF) _DumpOutput("$OffsetAdjustment: " & $OffsetAdjustment & @CRLF) _DumpOutput("$SizeOfClientData: " & $SizeOfClientData & @CRLF) _DumpOutput("Part 1: " & $NextOffset-$OffsetAdjustment+96+$SizeOfClientData & @CRLF) _DumpOutput("Part 2: " & $TotalSizeOfRCRD & @CRLF) _TestSlackSpace($ClientData,$max_last_lsn,$RecordOffset) Return "" EndIf EndIf ; _DumpOutput("Transaction: " & @CRLF) ; _DumpOutput(_HexEncode("0x"&$ClientData) & @CRLF) _DecodeLSNRecord($ClientData,$max_last_lsn) $NextOffset += 96+$SizeOfClientData $DataPart += 1 Until $NextOffset >= $TotalSizeOfRCRD If Not $DoNotReturnData Then _DumpOutput("Error: Something must be wrong" & @CRLF) _DumpOutput(_HexEncode("0x"&StringMid($RCRDRecord,$NextOffset)) & @CRLF) EndIf Return "" EndFunc Func _TestSlackSpace($InputData,$last_lsn_tmp,$Offset) ;$InputData = SlackSpace data in RCRD ;$last_lsn_tmp = From header of RCRD Local $CharsToMove=0, $LsnSignatureFound=0, $TotalSizeOfRCRD=StringLen($InputData), $NextOffset = 1, $last_lsn_tmp_refup, $last_lsn_tmp_refdown $FromRcrdSlack += 1 $SlackPerRCRDCounter += 1 $last_lsn_tmp_refup = $last_lsn_tmp*(1+$LsnValidationLevel) $last_lsn_tmp_refdown = $last_lsn_tmp*(1-$LsnValidationLevel) If $TotalSizeOfRCRD < $MinSizeBrokenTransaction Then _DumpOutput("SlackSpace: The size of input data was too small for a valid record header:" & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) Return Else ; _DumpOutput("SlackSpace: Size of input data: 0x" & Hex(Int($TotalSizeOfRCRD/2),8) & @CRLF) EndIf ; _DumpOutput("$last_lsn_tmp: 0x" & _SwapEndian(Hex($last_lsn_tmp,16)) & @CRLF) ; _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) $this_lsn_tmp = StringMid($InputData,1,16) $this_lsn_tmp = Dec(_SwapEndian($this_lsn_tmp),2) $client_previous_lsn_tmp = StringMid($InputData,$NextOffset+16,16) $client_previous_lsn_tmp = Dec(_SwapEndian($client_previous_lsn_tmp),2) $client_undo_next_lsn_tmp = StringMid($InputData,$NextOffset+32,16) $client_undo_next_lsn_tmp = Dec(_SwapEndian($client_undo_next_lsn_tmp),2) If ($this_lsn_tmp > $last_lsn_tmp) Or ($client_previous_lsn_tmp > $last_lsn_tmp) Or ($client_undo_next_lsn_tmp > $last_lsn_tmp) Or ($this_lsn_tmp < $last_lsn_tmp_refdown) Or ($client_previous_lsn_tmp < $last_lsn_tmp_refdown And $client_previous_lsn_tmp <> 0) Or ($client_undo_next_lsn_tmp < $last_lsn_tmp_refdown And $client_undo_next_lsn_tmp <> 0) Then _DumpOutput("SlackSpace: Scanning for LSN signature" & @CRLF) While 1 If $CharsToMove+$NextOffset > $TotalSizeOfRCRD Then ExitLoop $TestChunk1 = StringMid($InputData,$NextOffset+$CharsToMove,16) $TestChunk1 = Dec(_SwapEndian($TestChunk1),2) ; ConsoleWrite("0x"&Hex(Int(($NextOffset+$CharsToMove-3)/2),8) & " $TestChunk1: " & $TestChunk1 & @CRLF) If ($TestChunk1 > $last_lsn_tmp_refdown) And ($TestChunk1 < $last_lsn_tmp_refup) Then ; If $last_lsn_tmp_mod = $TestChunk Then $TestChunk2 = StringMid($InputData,$NextOffset+$CharsToMove+16,16) $TestChunk2 = Dec(_SwapEndian($TestChunk2),2) ; ConsoleWrite("$TestChunk2: " & $TestChunk2 & @CRLF) $TestChunk3 = StringMid($InputData,$NextOffset+$CharsToMove+16+16,16) $TestChunk3 = Dec(_SwapEndian($TestChunk3),2) ; ConsoleWrite("$TestChunk3: " & $TestChunk3 & @CRLF) If (($TestChunk2 > $last_lsn_tmp_refdown) And ($TestChunk2 < $last_lsn_tmp_refup)) Or ($TestChunk2 = 0) Then If (($TestChunk3 > $last_lsn_tmp_refdown) And ($TestChunk3 < $last_lsn_tmp_refup)) Or ($TestChunk3 = 0) Then ; ConsoleWrite("Match1!!!" & @CRLF) $LsnSignatureFound=1 ExitLoop Else ; ConsoleWrite("False positive" & @CRLF) $CharsToMove+=16 ContinueLoop EndIf Else ; ConsoleWrite("False positive" & @CRLF) $CharsToMove+=16 ContinueLoop EndIf ; ConsoleWrite("Match2!!!" & @CRLF) ; ExitLoop EndIf $CharsToMove+=16 If $CharsToMove+$NextOffset > $TotalSizeOfRCRD Then ExitLoop WEnd If Not $LsnSignatureFound Then _DumpOutput("SlackSpace: LSN signature not found." & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) If $DoRebuildBrokenHeader And $CharsToMove >= $MinSizeBrokenTransaction Then $RecordOffset = "0x" & Hex(Int($Offset),8) _DumpOutput("Attempting a repair of possible broken header 2.." & @CRLF) $ClientData = _CheckAndRepairTransactionHeader(StringMid($InputData,$NextOffset,$CharsToMove)) If Not @Error Then $RebuiltLsn = StringMid($ClientData,1,16) $RebuiltLsn = Dec(_SwapEndian($RebuiltLsn),2) $IncompleteTransaction=1 _DecodeLSNRecord($ClientData,$RebuiltLsn) EndIf EndIf Return Else If $CharsToMove > 0 Then _DumpOutput("Unknown slack space found at record offset 0x" & Hex(Int($Offset+($NextOffset)/2),8) & " - 0x" & Hex(Int($Offset+($NextOffset+$CharsToMove)/2),8) & @CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData,$NextOffset,$CharsToMove)) & @CRLF) If $DoRebuildBrokenHeader And $CharsToMove >= $MinSizeBrokenTransaction Then $RecordOffset = "0x" & Hex(Int($Offset+($NextOffset)/2),8) _DumpOutput("Attempting a repair of possible broken header 3.." & @CRLF) $ClientData = _CheckAndRepairTransactionHeader(StringMid($InputData,$NextOffset,$CharsToMove)) If Not @Error Then $RebuiltLsn = StringMid($ClientData,1,16) $RebuiltLsn = Dec(_SwapEndian($RebuiltLsn),2) $IncompleteTransaction=1 _DecodeLSNRecord($ClientData,$RebuiltLsn) EndIf EndIf EndIf ; _DumpOutput(_HexEncode("0x"&StringMid($InputData,$NextOffset,$CharsToMove)) & @CRLF) _DumpOutput("SlackSpace: Found LSN signature match at record offset 0x"&Hex(Int($Offset+($NextOffset+$CharsToMove)/2),8) & @CRLF) $NextOffset += $CharsToMove EndIf EndIf Do If $NextOffset >= $TotalSizeOfRCRD Then Return EndIf $RecordOffset = Int(Dec(StringRight($Offset,8),2) + ($NextOffset/2)) $RecordOffset = "0x"&Hex($RecordOffset) $this_lsn_tmp = StringMid($InputData,$NextOffset,16) $this_lsn_tmp = Dec(_SwapEndian($this_lsn_tmp),2) $client_previous_lsn_tmp = StringMid($InputData,$NextOffset+16,16) $client_previous_lsn_tmp = Dec(_SwapEndian($client_previous_lsn_tmp),2) $client_undo_next_lsn_tmp = StringMid($InputData,$NextOffset+32,16) $client_undo_next_lsn_tmp = Dec(_SwapEndian($client_undo_next_lsn_tmp),2) ;We need some sanity checking on the next bytes If ($this_lsn_tmp > $last_lsn_tmp) Or ($client_previous_lsn_tmp > $last_lsn_tmp) Or ($client_undo_next_lsn_tmp > $last_lsn_tmp) Or ($this_lsn_tmp < $last_lsn_tmp_refdown) Or ($client_previous_lsn_tmp < $last_lsn_tmp_refdown And $client_previous_lsn_tmp <> 0) Or ($client_undo_next_lsn_tmp < $last_lsn_tmp_refdown And $client_undo_next_lsn_tmp <> 0) Then _DumpOutput("SlackSpace: Invalid record header at 0x" & Hex(Int($Offset+($NextOffset/2))) & @CRLF) _DumpOutput("SlackSpace: Rescanning for LSN signature." & @CRLF) If $SlackPerRCRDCounter < 1800 Then _TestSlackSpace(StringMid($InputData,$NextOffset),$last_lsn_tmp,$Offset+($NextOffset/2)) Return Else Return EndIf EndIf $SizeOfClientData = StringMid($InputData,$NextOffset+48,8) $SizeOfClientData = Dec(_SwapEndian($SizeOfClientData),2) $SizeOfClientData = $SizeOfClientData*2 If $SizeOfClientData = 0 Then ; MsgBox(0,"Info","$SizeOfClientData = 0 at " & $RecordOffset) _DumpOutput("SlackSpace: Error $SizeOfClientData = 0 at 0x" & Hex(Int($Offset+($NextOffset/2))) & @CRLF) ; _TestSlackSpace(StringMid($InputData,$NextOffset),$last_lsn_tmp,$Offset+($NextOffset/2)) ExitLoop EndIf $ClientData = StringMid($InputData,$NextOffset,96+$SizeOfClientData) If $NextOffset-1+96+$SizeOfClientData > $TotalSizeOfRCRD Then ; Or maybe we should attempt parsing incomplete records as this is record slack space.. _DumpOutput("SlackSpace: Warning incomplete record at 0x" & Hex(Int($Offset+($NextOffset/2))) & @CRLF) ; _DumpOutput("SlackSpace: $NextOffset: " & $NextOffset & @CRLF) ; _DumpOutput("SlackSpace: $SizeOfClientData: " & $SizeOfClientData & @CRLF) ; _DumpOutput("SlackSpace: Part 1: " & $NextOffset+96+$SizeOfClientData & @CRLF) ; _DumpOutput("SlackSpace: Part 2: " & $TotalSizeOfRCRD & @CRLF) ; _DumpOutput(_HexEncode("0x"&$ClientData) & @CRLF) _DecodeLSNRecord($ClientData,$this_lsn_tmp) Return EndIf _DumpOutput("SlackSpace: Parsing identified record at " & $RecordOffset & @CRLF) ; _DumpOutput("$RecordOffset: " & $RecordOffset & @CRLF) ; _DumpOutput(_HexEncode("0x"&$ClientData) & @CRLF) _DecodeLSNRecord($ClientData,$this_lsn_tmp) $NextOffset+=96+$SizeOfClientData Until $NextOffset >= $TotalSizeOfRCRD EndFunc Func _DecodeLSNRecord($InputData,$last_lsn_tmp) ;Local $target_lcn, $client_undo_next_lsn, $client_data_length, $client_index, $record_type, $flags, $redo_offset, $undo_offset, $target_attribute, $lcns_to_follow, $redo_operation_hex, $undo_operation_hex,$MftClusterIndex, $target_vcn Local $client_undo_next_lsn, $client_data_length, $redo_offset, $undo_offset, $redo_operation_hex, $undo_operation_hex Local $DecodeOk=False,$UsnOk=False,$TestAttributeType,$ResolvedAttributeOffset,$FoundInTable=0,$FoundInTableDummy=0,$AttrNameTmp,$last_lsn_tmp_refdown,$FoundInTableSlack=0,$FoundInTableSlackDummy=0 ;Local $last_lsn_tmp_refup $AttributeString="" ;_ClearVar() $this_lsn = StringMid($InputData,1,16) $this_lsn = Dec(_SwapEndian($this_lsn),2) ;$last_lsn_tmp_refup = $last_lsn_tmp*(1+$LsnValidationLevel) $last_lsn_tmp_refdown = $last_lsn_tmp*(1-$LsnValidationLevel) ;<Test for valid lsn> If ($this_lsn > $last_lsn_tmp) Or ($this_lsn < $last_lsn_tmp_refdown) Then _DumpOutput("Error: RCRD seems corrupt at offset: " & $RecordOffset & @CRLF) _DumpOutput("$last_lsn_tmp: " & $last_lsn_tmp & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData,1)) & @CRLF) _ClearVar() Return EndIf ;</Test for valid lsn> $client_previous_lsn = StringMid($InputData,17,16) $client_previous_lsn = Dec(_SwapEndian($client_previous_lsn),2) $client_undo_next_lsn = StringMid($InputData,33,16) $client_undo_next_lsn = Dec(_SwapEndian($client_undo_next_lsn),2) $client_data_length = StringMid($InputData,49,8) $client_data_length = Dec(_SwapEndian($client_data_length),2) $client_index = StringMid($InputData,57,8) $client_index = "0x"&_SwapEndian($client_index) $record_type = StringMid($InputData,65,8) $record_type = Dec(_SwapEndian($record_type),2) $transaction_id = StringMid($InputData,73,8) $transaction_id = "0x"&_SwapEndian($transaction_id) $lf_flags = StringMid($InputData,81,4) $lf_flags = "0x"&_SwapEndian($lf_flags) ;$alignment_or_reserved0 = StringMid($InputData,85,12) $redo_operation_hex = StringMid($InputData,97,4) $redo_operation = Dec(_SwapEndian($redo_operation_hex),2) $redo_operation = _SolveUndoRedoCodes($redo_operation) $undo_operation_hex = StringMid($InputData,101,4) $undo_operation = Dec(_SwapEndian($undo_operation_hex),2) $undo_operation = _SolveUndoRedoCodes($undo_operation) $redo_offset = StringMid($InputData,105,4) $redo_offset = Dec(_SwapEndian($redo_offset),2) $redo_length = StringMid($InputData,109,4) $redo_length = Dec(_SwapEndian($redo_length),2) $undo_offset = StringMid($InputData,113,4) $undo_offset = Dec(_SwapEndian($undo_offset),2) $undo_length = StringMid($InputData,117,4) $undo_length = Dec(_SwapEndian($undo_length),2) $target_attribute = StringMid($InputData,121,4) $target_attribute = "0x"&_SwapEndian($target_attribute) ;Align tmp sizes to 8 bytes $redo_length_tmp = $redo_length If Mod($redo_length_tmp,8) Then While 1 $redo_length_tmp+=1 If Mod($redo_length_tmp,8) = 0 Then ExitLoop WEnd EndIf $undo_length_tmp = $undo_length If Mod($undo_length_tmp,8) Then While 1 $undo_length_tmp+=1 If Mod($undo_length_tmp,8) = 0 Then ExitLoop WEnd EndIf ;Validation check of header values Local $ValidationTest1 = $redo_operation = "SetNewAttributeSizes" And $client_data_length < $undo_offset+$undo_length_tmp Local $ValidationTest2 = $client_data_length <> $undo_offset+$undo_length_tmp And $redo_operation <> "CompensationlogRecord" And $redo_operation <> "SetNewAttributeSizes" And $redo_operation <> "ForgetTransaction" And ($redo_operation <> "Noop" And $undo_operation <> "Noop") Local $ValidationTest3 = $client_data_length <> $redo_offset+$redo_length_tmp And $redo_operation <> "CompensationlogRecord" And $redo_operation <> "SetNewAttributeSizes" And $redo_operation <> "ForgetTransaction" And ($redo_operation <> "Noop" And $undo_operation <> "Noop") Local $ValidationTest4 = $redo_operation = "UNKNOWN" Local $ValidationTest5 = $undo_operation = "UNKNOWN" ;Local $ValidationTest6 = $client_data_length <> $redo_offset+$redo_length_tmp And $client_data_length <> $undo_offset+$undo_length_tmp And $redo_operation <> "CompensationlogRecord" And $redo_operation <> "SetNewAttributeSizes" If $ValidationTest1 Or ($ValidationTest2 And $ValidationTest3) Or ($ValidationTest4 And $ValidationTest5) Then ;If (($client_data_length <> $undo_offset+$undo_length_tmp And $redo_operation <> "CompensationlogRecord") And ($client_data_length <> $redo_offset+$redo_length_tmp And $redo_operation <> "CompensationlogRecord")) Or $redo_operation = "UNKNOWN" Or $undo_operation = "UNKNOWN" Then _DumpOutput("Error: Validation of header values failed at offset: " & $RecordOffset & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$client_data_length: 0x" & Hex($client_data_length) & @CRLF) _DumpOutput("$redo_offset: 0x" & Hex($redo_offset,4) & @CRLF) _DumpOutput("$redo_length_tmp: 0x" & Hex($redo_length_tmp,4) & @CRLF) _DumpOutput("$undo_offset: 0x" & Hex($undo_offset,4) & @CRLF) _DumpOutput("$undo_length_tmp: 0x" & Hex($undo_length_tmp,4) & @CRLF) _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData,1)) & @CRLF) _ClearVar() Return EndIf ;With broken format $LogFile, as from reconstructed RCRD's, chances are that we might hit transactions with mostly 00's, which can't be decoded. But we need to filter. If $BrokenLogFile Then If Not (($redo_operation = "ForgetTransaction" And $undo_operation = "CompensationlogRecord") Or ($redo_operation = "Noop" And $undo_operation = "Noop")) Then If Not StringRegExp(StringMid($InputData,145),$RegExPatternHexNotNull) Then _DumpOutput("Error at offset 0x" & $RecordOffset & @CRLF) _DumpOutput("There was only zero's after the transaction header, which means it was too corrupted to process properly" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData,1)) & @CRLF) Return EndIf EndIf EndIf ;Test for incomplete records grabbed from slack space Local $BytesMissing = Int((48 + $client_data_length) - (StringLen($InputData)/2)) If $BytesMissing > 0 Then _DumpOutput("Error: Incomplete record recovered at offset: " & $RecordOffset & @CRLF) _DumpOutput("From internal transaction offset: 0x" & Hex(Int(StringLen($InputData)/2)) & " there is 0x" & Hex($BytesMissing) & " bytes missing" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("Part 1: " & 48 + $client_data_length & " 0x" & Hex(Int(48 + $client_data_length)) & @CRLF) ; _DumpOutput("Part 2: " & StringLen($InputData)/2 & " 0x" & Hex(Int(StringLen($InputData)/2)) & @CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData,1)) & @CRLF) ; MsgBox(0,"Info","Check output") $TextInformation &= ";Incomplete record recovered. " & "0x" & Hex($BytesMissing,4) & " bytes missing from internal offset 0x" & Hex(Int(StringLen($InputData)/2),4) $IncompleteTransaction = 1 EndIf If Not $FromRcrdSlack Then If $this_lsn > $lsn_openattributestable Then If Not ($target_attribute = 0x0000 Or $target_attribute = 0x0017 Or $target_attribute = 0x0018) Then If Ubound($OpenAttributesArray) > 1 Then $FoundInTable = _ArraySearch($OpenAttributesArray,$target_attribute,0,0,0,2,1,0) ; ConsoleWrite("$FoundInTable: " & $FoundInTable & @CRLF) If Not $FoundInTable > 0 Then $InOpenAttributeTable=0 _DumpOutput("Could not find $target_attribute in $OpenAttributesArray: " & $target_attribute & " for $this_lsn: " & $this_lsn & @CRLF) _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") ; $FoundInTable = _ArraySearch($OpenAttributesArray2,$target_attribute,0,0,0,2,1,0) ; ConsoleWrite("Attempt 2 $FoundInTable: " & $FoundInTable & @CRLF) Else $InOpenAttributeTable=$lsn_openattributestable EndIf Else $InOpenAttributeTable=0 ; MsgBox(0,"Error","$target_attribute was not found because array is empty") EndIf EndIf EndIf Else ; If $this_lsn > $lsn_openattributestable Then If Not ($target_attribute = 0x0000 Or $target_attribute = 0x0017 Or $target_attribute = 0x0018) Then If Ubound($SlackOpenAttributesArray) > 1 Then $FoundInTableSlack = _ArraySearch($SlackOpenAttributesArray,$target_attribute,0,0,0,2,1,0) If Not $FoundInTableSlack > 0 Then $InOpenAttributeTable=0 _DumpOutput("Could not find $target_attribute in $SlackOpenAttributesArray: " & $target_attribute & " for $this_lsn: " & $this_lsn & @CRLF) _ArrayDisplay($SlackOpenAttributesArray,"$SlackOpenAttributesArray") Else $InOpenAttributeTable=0 ;$lsn_openattributestable EndIf Else $InOpenAttributeTable=0 EndIf EndIf ; EndIf EndIf ;If $this_lsn=102077767547 or $this_lsn=102093572805 Then ; ConsoleWrite("$target_attribute was not found in array: " & $target_attribute & @CRLF) ; _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") ;EndIf $lcns_to_follow = StringMid($InputData,125,4) $lcns_to_follow = "0x"&_SwapEndian($lcns_to_follow) $record_offset_in_mft = StringMid($InputData,129,4) $record_offset_in_mft = Dec(_SwapEndian($record_offset_in_mft),2) $attribute_offset = StringMid($InputData,133,4) $attribute_offset = Dec(_SwapEndian($attribute_offset),2) $MftClusterIndex = StringMid($InputData,137,4) $MftClusterIndex = _SwapEndian($MftClusterIndex) ;$alignment_or_reserved1 = StringMid($InputData,141,4) $target_vcn = StringMid($InputData,145,8) $target_vcn = _SwapEndian($target_vcn) ;$alignment_or_reserved2 = StringMid($InputData,153,8) $target_lcn = StringMid($InputData,161,8) $target_lcn = "0x"&_SwapEndian($target_lcn) ;$alignment_or_reserved3 = StringMid($InputData,169,8) $PredictedRefNumber = ((Dec($target_vcn,2)*$BytesPerCluster)/$MFT_Record_Size)+((Dec($MftClusterIndex,2)*512)/$MFT_Record_Size) ;ConsoleWrite("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) ;Need to research more on how to calculate correct MFT ref If ($redo_operation_hex = "0000" And $undo_operation_hex <> "0000") Or $redo_operation_hex = "0200" Or $redo_operation_hex = "0300" Or $redo_operation_hex = "0400" Or $redo_operation_hex = "0500" Or $redo_operation_hex = "0600" Or $redo_operation_hex = "0700" Or ($redo_operation_hex = "0800" And $PreviousRedoOp = "1c00") Or $redo_operation_hex = "0900" Or $redo_operation_hex = "0b00" Or $redo_operation_hex = "0c00" Or $redo_operation_hex = "0d00" Or $redo_operation_hex = "1100" Or $redo_operation_hex = "1300" Or $redo_operation_hex = "1c00" Then If Not $FromRcrdSlack Then $KeptRefTmp = $PredictedRefNumber $KeptRef = $PredictedRefNumber EndIf ElseIf $client_previous_lsn<>0 And ($redo_operation_hex = "0e00" Or $redo_operation_hex = "0f00" Or $redo_operation_hex = "1000" Or $redo_operation_hex = "1200" Or $redo_operation_hex = "1400" Or $redo_operation_hex = "2500" Or ($redo_operation_hex = "0800" And ($redo_operation_hex = "0800" Or $PreviousRedoOp = "0b00"))) Then If Not $FromRcrdSlack Then $PredictedRefNumber = $KeptRef ; $KeptRefTmp = $KeptRef Else $PredictedRefNumber = -1 ;Not possible from slack EndIf Else $PredictedRefNumber = -1 ;Not related to any particular MFT ref EndIf $target_vcn = "0x"&$target_vcn $MftClusterIndex = "0x"&$MftClusterIndex If Not $FromRcrdSlack Or $BrokenLogFile Then $ExcessDataSize = $client_data_length - ($redo_length_tmp + $undo_length_tmp) - $redo_offset FileWriteLine($LogFileTransactionHeaderCsv, $RecordOffset & $de & $this_lsn & $de & $client_previous_lsn & $de & $client_undo_next_lsn & $de & $client_index & $de & $record_type & $de & $transaction_id & $de & $lf_flags & $de & $redo_operation & $de & $undo_operation & $de & $redo_offset & $de & $redo_length_tmp & $de & $undo_offset & $de & $undo_length_tmp & $de & $client_data_length & $de & $target_attribute & $de & $lcns_to_follow & $de & $record_offset_in_mft & $de & $attribute_offset & $de & $MftClusterIndex & $de & $target_vcn & $de & $target_lcn & $de & $ExcessDataSize & @crlf) EndIf If Not $FromRcrdSlack Then If $FoundInTable > 0 Then ; ConsoleWrite("ubound($OpenAttributesArray): " & ubound($OpenAttributesArray) & @CRLF) $AttributeStringTmp = _ResolveAttributeType(StringMid($OpenAttributesArray[$FoundInTable][5],3,4)) If $AttributeStringTmp <> "UNKNOWN" And $OpenAttributesArray[$FoundInTable][9] <> 0 Then ;Why do these sometimes point to offsets in OpenAttributeTable containing invalid data? If $Is32bit=0 Or $OpenAttributesArray[$FoundInTable][7]>0 Then ;target_attribute is handled differently on nt5.x than nt6.x $AttributeString = $AttributeStringTmp If $OpenAttributesArray[$FoundInTable][12] <> "" Then $AttributeString &= ":"&$OpenAttributesArray[$FoundInTable][12] EndIf ; $PredictedRefNumber = $OpenAttributesArray[$FoundInTable][7] $RealMftRef = $OpenAttributesArray[$FoundInTable][7] If $redo_operation_hex = "0800" Then $PredictedRefNumber = $RealMftRef If $PredictedRefNumber = -1 Then $PredictedRefNumber = $RealMftRef EndIf Else $InOpenAttributeTable = "-" & $InOpenAttributeTable ;Will indicate an offset match in OpenAttributeTable that contains invalid data. EndIf EndIf If $PredictedRefNumber = 0 Then ; If $target_attribute = 0x0018 And Ubound($OpenAttributesArray) > 1 Then If Ubound($OpenAttributesArray) > 1 Then $FoundInTable = _ArraySearch($OpenAttributesArray,$target_attribute,0,0,0,2,1,0) ; ConsoleWrite("$FoundInTable: " & $FoundInTable & @CRLF) If $FoundInTable > 0 Then $AttributeStringTmp = _ResolveAttributeType(StringMid($OpenAttributesArray[$FoundInTable][5],3,4)) If $AttributeStringTmp <> "UNKNOWN" And $AttributeStringTmp <> "$DATA" Then $AttributeString = $AttributeStringTmp EndIf If $OpenAttributesArray[$FoundInTable][12] <> "" And $AttributeString <> "" Then $AttributeString &= ":"&$OpenAttributesArray[$FoundInTable][12] EndIf Else _DumpOutput("Error: $target_attribute was not found in array: " & $target_attribute & " at lsn " & $this_lsn & @CRLF & @CRLF) ; _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") EndIf EndIf EndIf Else If $FoundInTableSlack > 0 Then ; ConsoleWrite("ubound($OpenAttributesArray): " & ubound($OpenAttributesArray) & @CRLF) $AttributeStringTmp = _ResolveAttributeType(StringMid($SlackOpenAttributesArray[$FoundInTableSlack][5],3,4)) If $AttributeStringTmp <> "UNKNOWN" And $SlackOpenAttributesArray[$FoundInTableSlack][9] <> 0 Then ;Why do these sometimes point to offsets in OpenAttributeTable containing invalid data? $AttributeString = $AttributeStringTmp If $SlackOpenAttributesArray[$FoundInTableSlack][12] <> "" Then $AttributeString &= ":"&$SlackOpenAttributesArray[$FoundInTableSlack][12] EndIf ; $PredictedRefNumber = $OpenAttributesArray[$FoundInTable][7] ; $RealMftRef = $SlackOpenAttributesArray[$FoundInTableSlack][7] ; If $redo_operation_hex = "0800" Then $PredictedRefNumber = $RealMftRef ; If $PredictedRefNumber = -1 Then $PredictedRefNumber = $RealMftRef Else ; $InOpenAttributeTable = "-" & $InOpenAttributeTable ;Will indicate an offset match in OpenAttributeTable that contains invalid data. EndIf EndIf EndIf ;if $redo_operation_hex="1b00" Then ; MsgBox(0,"lsn: " & $this_lsn,"Ref: " & ((Dec($target_vcn,2)*$BytesPerCluster)/$MFT_Record_Size)+((Dec($MftClusterIndex,2)*512)/$MFT_Record_Size)) ; $PredictedRefNumber = ((Dec($target_vcn,2)*$BytesPerCluster)/$MFT_Record_Size)+((Dec($MftClusterIndex,2)*512)/$MFT_Record_Size) ;EndIf #cs If $redo_operation_hex="1500" or $redo_operation_hex="1600" Then $VerboseOn=1 Else $VerboseOn=0 EndIf #ce ;If $this_lsn=105054169 Or $this_lsn=105054288 Or $this_lsn=5693203315 Or $this_lsn=105061642 Or $this_lsn=100666594 Or $this_lsn= 100666924 Then ; $VerboseOn=1 ;Else ; $VerboseOn=0 ;EndIf ;If $this_lsn=7918867684 Or $this_lsn=7918867684 Or $this_lsn=7918867684 Then ; $VerboseOn=1 ;Else ; $VerboseOn=0 ;EndIf If IsArray($VerboseArr) Then $VerboseOn=0 For $i = 1 To $VerboseArr[0] If $this_lsn=$VerboseArr[$i] Then $VerboseOn=1 Next ; If ($redo_operation_hex = "1400" Or $redo_operation_hex = "1300") Then $VerboseOn=1 EndIf ;$VerboseOn=1 ;_DumpOutput("$this_lsn: " & $this_lsn & @CRLF) ;_DumpOutput(_HexEncode("0x"&StringMid($InputData,1)) & @CRLF) If $VerboseOn Then _DumpOutput("VerboseOn" & @CRLF) _DumpOutput("Calculated RefNumber: " & ((Dec($target_vcn,2)*$BytesPerCluster)/$MFT_Record_Size)+((Dec($MftClusterIndex,2)*512)/$MFT_Record_Size) & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$KeptRef: " & $KeptRef & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$client_previous_lsn: " & $client_previous_lsn & @CRLF) _DumpOutput("$client_undo_next_lsn: " & $client_undo_next_lsn & @CRLF) _DumpOutput("$client_data_length: 0x" & Hex($client_data_length,8) & @CRLF) _DumpOutput("$client_index: " & $client_index & @CRLF) _DumpOutput("$record_type: " & $record_type & @CRLF) _DumpOutput("$transaction_id: " & $transaction_id & @CRLF) _DumpOutput("$lf_flags: " & $lf_flags & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput("$redo_operation_hex: 0x" & $redo_operation_hex & @CRLF) _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) _DumpOutput("$undo_operation_hex: 0x" & $undo_operation_hex & @CRLF) _DumpOutput("$redo_offset: " & $redo_offset & @CRLF) _DumpOutput("$redo_length: " & $redo_length & @CRLF) _DumpOutput("$undo_offset: " & $undo_offset & @CRLF) _DumpOutput("$undo_length: " & $undo_length & @CRLF) _DumpOutput("$target_attribute: " & $target_attribute & @CRLF) _DumpOutput("$lcns_to_follow: " & $lcns_to_follow & @CRLF) _DumpOutput("$record_offset_in_mft: 0x" & Hex($record_offset_in_mft,8) & @CRLF) _DumpOutput("$attribute_offset: 0x" & Hex($attribute_offset,8) & @CRLF) _DumpOutput("$MftClusterIndex: " & $MftClusterIndex & @CRLF) _DumpOutput("$target_vcn: " & $target_vcn & @CRLF) _DumpOutput("$target_lcn: " & $target_lcn & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$FoundInTable: " & $FoundInTable & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) _DumpOutput(@CRLF) ; MsgBox(0,"Verbose","Check output") EndIf ;If $undo_operation_hex="0100" And (((Dec($target_vcn,2)*$BytesPerCluster)/$MFT_Record_Size)+((Dec($MftClusterIndex,2)*512)/$MFT_Record_Size) <> 0) Then MsgBox(0,"Info","Check CompensationlogRecord") ;ConsoleWrite("$this_lsn: " & $this_lsn & @CRLF) ;ConsoleWrite("$redo_operation: " & $redo_operation & @CRLF) If $record_type=2 Then _Decode_CheckpointRecord(StringMid($InputData,113)) $TextInformation &= ";See LogFile_CheckpointRecord.csv" EndIf If $redo_length > 0 Then $redo_chunk = StringMid($InputData,97+($redo_offset*2),$redo_length*2) If $VerboseOn Then _DumpOutput("Redo: " & $redo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) EndIf $RedoChunkSize = StringLen($redo_chunk)/2 Select Case $redo_operation_hex="0200" ;InitializeFileRecordSegment ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) ; _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) If $redo_length <= 60 Then $TextInformation &= ";Initializing empty record" Else _ParserCodeOldVersion($redo_chunk,1) If Not @error Then If Not $FromRcrdSlack Then _UpdateFileNameArray($PredictedRefNumber,$HDR_SequenceNo,$FN_Name,$this_lsn) EndIf EndIf EndIf Case $redo_operation_hex="0300" ;DeallocateFileRecordSegment _RemoveAllOffsetOfAttribute($PredictedRefNumber) Case $redo_operation_hex="0400" ;WriteEndOfFileRecordSegment _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) $TextInformation &= ";Search debug.log for " & $this_lsn Case $redo_operation_hex="0500" ; CreateAttribute $TestAttributeType = _Decode_AttributeType($redo_chunk) If $TestAttributeType <> '' Then _UpdateSingleOffsetOfAttribute($PredictedRefNumber, $record_offset_in_mft, $RedoChunkSize, $TestAttributeType) _Decode_CreateAttribute($redo_chunk,1) Case $redo_operation_hex="0600" ; DeleteAttribute ; $TestAttributeType = _Decode_AttributeType($undo_chunk) ; If $TestAttributeType <> '' Then _RemoveSingleOffsetOfAttribute($PredictedRefNumber, $record_offset_in_mft, $TestAttributeType) Case $redo_operation_hex="0700" ; UpdateResidentValue $ResolvedAttributeOffset = _CheckOffsetOfAttribute($PredictedRefNumber, $record_offset_in_mft) If Not @error Then ; $AttributeString&= '->('&$ResolvedAttributeOffset&')' $AttributeString = $ResolvedAttributeOffset EndIf _Decode_UpdateResidentValue($redo_chunk,1) Case $redo_operation_hex="0800" ; UpdateNonResidentValue If StringLeft($redo_chunk,8) = "494e4458" Then ;INDX $TextInformation &= ";INDX" If Not $FromRcrdSlack Then If $KeptRefTmp = 9 Or $PredictedRefNumber = 9 Or $RealMftRef = 9 Then If $KeptRefTmp = 9 Then If $FoundInTable < 1 Then $AttributeString = "$INDEX_ALLOCATION(??)" $PredictedRefNumber = $KeptRefTmp $KeptRef = $KeptRefTmp EndIf If ($AttributeString = "$INDEX_ALLOCATION:$SDH" Or $AttributeString = "UNKNOWN:$SDH") Then $Indx = _GetIndxWoFixup($redo_chunk) _DecodeIndxEntriesSDH($Indx,1) $TextInformation &= ";See LogFile_SecureSDH.csv" ElseIf ($AttributeString = "$INDEX_ALLOCATION:$SII" Or $AttributeString = "UNKNOWN:$SII") Then $Indx = _GetIndxWoFixup($redo_chunk) _DecodeIndxEntriesSII($Indx,1) $TextInformation &= ";See LogFile_SecureSII.csv" ElseIf StringMid($redo_chunk,217,8) = "49004900" Then $Indx = _GetIndxWoFixup($redo_chunk) _DecodeIndxEntriesSII($Indx,1) $AttributeString = "$INDEX_ALLOCATION:$SII" $TextInformation &= ";See LogFile_SecureSII.csv" Else _DumpOutput("Error: $Secure contained unidentified INDX at lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) EndIf EndIf If $KeptRefTmp = 24 Or $PredictedRefNumber = 24 Or $RealMftRef = 24 Then If $KeptRefTmp = 24 Then If $FoundInTable < 1 Then $AttributeString = "$INDEX_ALLOCATION($Quota?)" $PredictedRefNumber = $KeptRefTmp $KeptRef = $KeptRefTmp EndIf If ($AttributeString = "$INDEX_ALLOCATION:$O" Or $AttributeString = "$INDEX_ROOT:$O" Or $AttributeString = "UNKNOWN:$O") Then _Decode_Quota_O($redo_chunk,1) $TextInformation &= ";See LogFile_QuotaO.csv" EndIf If ($AttributeString = "$INDEX_ALLOCATION:$Q" Or $AttributeString = "$INDEX_ROOT:$Q" Or $AttributeString = "UNKNOWN:$Q") Then _Decode_Quota_Q($redo_chunk,1) $TextInformation &= ";See LogFile_QuotaO.csv" EndIf EndIf If $KeptRefTmp = 25 Or $PredictedRefNumber = 25 Or $RealMftRef = 25 Then If $KeptRefTmp = 25 Then If $FoundInTable < 1 Then $AttributeString = "$INDEX_ALLOCATION($ObjId?)" $PredictedRefNumber = $KeptRefTmp $KeptRef = $KeptRefTmp EndIf If ($AttributeString = "$INDEX_ALLOCATION:$O" Or $AttributeString = "$INDEX_ROOT:$O" Or $AttributeString = "UNKNOWN:$O") Then _Decode_ObjId_O($redo_chunk,1) $TextInformation &= ";See LogFile_ObjIdO.csv" EndIf EndIf If $KeptRefTmp = 26 Or $PredictedRefNumber = 26 Or $RealMftRef = 26 Then If $KeptRefTmp = 26 Then If $FoundInTable < 1 Then $AttributeString = "$INDEX_ALLOCATION($Reparse?)" $PredictedRefNumber = $KeptRefTmp $KeptRef = $KeptRefTmp EndIf If ($AttributeString = "$INDEX_ALLOCATION:$R" Or $AttributeString = "$INDEX_ROOT:$R" Or $AttributeString = "UNKNOWN:$R") Then _Decode_Reparse_R($redo_chunk,1) $TextInformation &= ";See LogFile_ReparseR.csv" EndIf EndIf Else $DecodeOk=0 $DecodeOk = _Decode_INDX($redo_chunk,1) If Not $DecodeOk Then ;Possibly $Secure:$SDH or $Secure:$SII ; ConsoleWrite("_Decode_INDX() failed for $this_lsn: " & $this_lsn & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$redo_chunk) & @CRLF) $Indx = _GetIndxWoFixup($redo_chunk) If StringMid($Indx,89,8) = "49004900" Then ;SDH signature _DecodeIndxEntriesSDH($Indx,1) $TextInformation &= ";See LogFile_SecureSDH.csv" Else _DecodeIndxEntriesSII($Indx,1) $TextInformation &= ";See LogFile_SecureSII.csv" EndIf Else $TextInformation &= ";See LogFile_INDX_I30.csv" EndIf EndIf If $PreviousRedoOp = "1c00" And Not $FromRcrdSlack Then If $FoundInTable < 1 Then $AttributeString = $PreviousAttribute $PredictedRefNumber = $KeptRef EndIf Else If $FoundInTable > 0 Or $FoundInTableSlack > 0 Then Select Case $AttributeString = "$ATTRIBUTE_LIST" _DecodeAttrList($redo_chunk,1) $TextInformation &= ";See LogFile_AttributeList.csv" Case $AttributeString = "$Data:$SDS" _MainSecure($redo_chunk,1) $TextInformation &= ";$Secure:$SDS;See LogFile_SecurityDescriptors.csv" Case $AttributeString = "$INDEX_ALLOCATION:$SII" $Indx = _GetIndxWoFixup($redo_chunk) _DecodeIndxEntriesSII($Indx,1) $TextInformation &= ";See LogFile_SecureSII.csv" Case $AttributeString = "$INDEX_ALLOCATION:$SDH" $Indx = _GetIndxWoFixup($redo_chunk) _DecodeIndxEntriesSDH($Indx,1) $TextInformation &= ";See LogFile_SecureSDH.csv" Case $AttributeString = "$EA" ; _DumpOutput("Verbose: Nonresident $EA caught at lsn " & $this_lsn & @CRLF) ; _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) $Test = _Get_Ea_NonResident($redo_chunk) If @error Then _DumpOutput("Error: _Get_Ea_NonResident returned: " & $Test & @CRLF) EndIf ; _ArrayDisplay($EaNonResidentArray,"$EaNonResidentArray") Case ($PredictedRefNumber = 24 Or $RealMftRef = 24) And ($AttributeString = "$INDEX_ALLOCATION:$O" Or $AttributeString = "$INDEX_ROOT:$O" Or $AttributeString = "UNKNOWN:$O") _Decode_Quota_O($redo_chunk,1) $TextInformation &= ";See LogFile_QuotaO.csv" Case ($PredictedRefNumber = 24 Or $RealMftRef = 24) And ($AttributeString = "$INDEX_ALLOCATION:$Q" Or $AttributeString = "$INDEX_ROOT:$Q" Or $AttributeString = "UNKNOWN:$Q") _Decode_Quota_Q($redo_chunk,1) $TextInformation &= ";See LogFile_QuotaQ.csv" Case ($PredictedRefNumber = 25 Or $RealMftRef = 25) And ($AttributeString = "$INDEX_ALLOCATION:$O" Or $AttributeString = "$INDEX_ROOT:$O" Or $AttributeString = "UNKNOWN:$O") _Decode_ObjId_O($redo_chunk,1) $TextInformation &= ";See LogFile_ObjIdO.csv" Case ($PredictedRefNumber = 26 Or $RealMftRef = 26) And ($AttributeString = "$INDEX_ALLOCATION:$R" Or $AttributeString = "$INDEX_ROOT:$R" Or $AttributeString = "UNKNOWN:$R") _Decode_Reparse_R($redo_chunk,1) $TextInformation &= ";See LogFile_ReparseR.csv" Case $AttributeString = "$DATA:$J" $UsnOk=0 $UsnOk = _UsnDecodeRecord2($redo_chunk) If $UsnOk Then If Not $FromRcrdSlack Then _UpdateFileNameArray($PredictedRefNumber,$HDR_SequenceNo,$FN_Name,$this_lsn) EndIf $TextInformation &= ";$UsnJrnl" Else _DumpOutput("_UsnDecodeRecord2() failed and probably not Filling of zeros to page boundary for $this_lsn: " & $this_lsn & " at offset " & $RecordOffset & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) EndIf Case $AttributeString = "$LOGGED_UTILITY_STREAM:$TXF_DATA" ;may only be resident.. _DumpOutput("Verbose: Not yet implemented for $LOGGED_UTILITY_STREAM:$TXF_DATA." & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @crlf) $TextInformation &= ";Search debug.log for " & $this_lsn ; MsgBox(0,"Error","This indicates an unexpected situation at LSN: " & $this_lsn) Case $AttributeString = "$LOGGED_UTILITY_STREAM:$EFS" _DumpOutput("Verbose: Not yet implemented for $LOGGED_UTILITY_STREAM:$EFS." & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @crlf) $TextInformation &= ";Search debug.log for " & $this_lsn ; MsgBox(0,"Error","This indicates an unexpected situation at LSN: " & $this_lsn) EndSelect Else $UsnOk=0 $UsnOk = _UsnDecodeRecord2($redo_chunk) If Not $UsnOk Then ; If $record_offset_in_mft + Int($redo_length) = 4096 Then If $PreviousRedoOp="0b00" Then ; SetNewAttributeSizes ; MsgBox(0,"Check refs","$PredictedRefNumber: " & $PredictedRefNumber & ", $KeptRef: " & $KeptRef & ", $KeptRefTmp: " & $KeptRefTmp) $PredictedRefNumber = $KeptRef If Int($undo_length) = 0 And $undo_operation_hex = "0000" And Int($record_offset_in_mft) + Int($redo_length) = 4096 Then $TextInformation &= ";$UsnJrnl;Filling of zeros to page boundary" $AttributeString = "$DATA:$J" ElseIf Int($undo_length) >= 32 And $undo_operation_hex="0800" Then _MainSecure($redo_chunk,1) $TextInformation &= ";$Secure:$SDS;See LogFile_SecurityDescriptors.csv" ElseIf Int($undo_length) > 0 And $undo_operation_hex="0800" Then $TextInformation &= ";$Secure" _DumpOutput("Error in UpdateNonResidentValue: unresolved $Secure: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) Else _DumpOutput("_UsnDecodeRecord2() failed and probably not Filling of zeros to page boundary for $this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) EndIf Else ;Likely $Secure:$SDS ; ConsoleWrite("_UsnDecodeRecord2() failed and $PreviousRedoOp <> 0b00 for $this_lsn: " & $this_lsn & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$redo_chunk) & @CRLF) _MainSecure($redo_chunk,1) $TextInformation &= ";$Secure:$SDS;See LogFile_SecurityDescriptors.csv" EndIf Else If Not $FromRcrdSlack Then _UpdateFileNameArray($PredictedRefNumber,$HDR_SequenceNo,$FN_Name,$this_lsn) EndIf $TextInformation &= ";$UsnJrnl" EndIf EndIf EndIf Case $redo_operation_hex="0900" ; UpdateMappingPairs _Decode_UpdateMappingPairs($redo_chunk) $AttributeString = "$DATA" $ResolvedAttributeOffset = _CheckOffsetOfAttribute($PredictedRefNumber, $record_offset_in_mft) If Not @error Then ; $AttributeString&= '->('&$ResolvedAttributeOffset&')' $AttributeString = $ResolvedAttributeOffset EndIf Case $redo_operation_hex="0a00" ;DeleteDirtyClusters _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) Case $redo_operation_hex="0b00" ; SetNewAttributeSizes _Decode_SetNewAttributeSize($redo_chunk) If ($RealMftRef = $UsnJrnlRef) And ($UsnJrnlRef <> "") Then $AttributeString = "$DATA" ;$UsnJrnl $TextInformation &= ";$UsnJrnl" ElseIf $record_offset_in_mft > 56 Then $AttributeString = "??" $ResolvedAttributeOffset = _CheckOffsetOfAttribute($PredictedRefNumber, $record_offset_in_mft) If Not @error Then ; $AttributeString&= '->('&$ResolvedAttributeOffset&')' $AttributeString = $ResolvedAttributeOffset EndIf Else ; _DumpOutput("Error at LSN: " & $this_lsn & @CRLF) ; _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) ; _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) EndIf Case $redo_operation_hex="0c00" Or $redo_operation_hex="0d00" Or $redo_operation_hex="0e00" Or $redo_operation_hex="0f00" ;AddindexEntryRoot,DeleteindexEntryRoot,AddIndexEntryAllocation,DeleteIndexEntryAllocation If ($redo_operation_hex="0c00" Or $redo_operation_hex="0d00") And $AttributeString="" Then $AttributeString = "$INDEX_ROOT" If ($redo_operation_hex="0e00" Or $redo_operation_hex="0f00") And $AttributeString="" Then $AttributeString = "$INDEX_ALLOCATION" If StringInStr($AttributeString,"$I30") Then $DecodeOk=0 $DecodeOk = _Decode_IndexEntry($redo_chunk,$redo_operation_hex,1) If Not $DecodeOk Then If $redo_operation_hex="0c00" Then _UpdateSingleOffsetOfAttribute($PredictedRefNumber, $record_offset_in_mft, $RedoChunkSize, '$INDEX_ROOT') _DumpOutput("_Decode_IndexEntry() failed for $this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) Else If $redo_operation_hex="0c00" Then _UpdateSingleOffsetOfAttribute($RealMftRef, $record_offset_in_mft, $RedoChunkSize, '$INDEX_ROOT') $TextInformation &= ";See LogFile_INDX_I30.csv" EndIf If $redo_operation_hex="0e00" Then $TextInformation &= ";See LogFile_INDX_I30.csv" EndIf Else Select Case $PredictedRefNumber = 9 Or $RealMftRef = 9 ;$Secure If $redo_length = 40 Then ;$SII _DecodeIndxEntriesSII($redo_chunk,1) $TextInformation &= ";$Secure:$SII;See LogFile_SecureSII.csv" $AttributeString &= ":$SII" ElseIf $redo_length = 48 Then ;$SDH _DecodeIndxEntriesSDH($redo_chunk,1) $TextInformation &= ";$Secure:$SDH;See LogFile_SecureSDH.csv" $AttributeString &= ":$SDH" EndIf Case $PredictedRefNumber = 24 Or $RealMftRef = 24 ;$Quota If $redo_length > 68 Then _Decode_Quota_Q($redo_chunk,1) $TextInformation &= ";See LogFile_QuotaQ.csv" Else _Decode_Quota_O($redo_chunk,1) $TextInformation &= ";See LogFile_QuotaO.csv" EndIf Case $PredictedRefNumber = 25 Or $RealMftRef = 25 ;$ObjId ; If $redo_length = 88 Then ;also 96.. _Decode_ObjId_O($redo_chunk,1) $TextInformation &= ";See LogFile_ObjIdO.csv" ; EndIf Case $PredictedRefNumber = 26 Or $RealMftRef = 26 ;$Reparse _Decode_Reparse_R($redo_chunk,1) $TextInformation &= ";See LogFile_ReparseR.csv" Case Else $DecodeOk=0 $DecodeOk = _Decode_IndexEntry($redo_chunk,$redo_operation_hex,1) If Not $DecodeOk Then If $redo_operation_hex="0c00" Then _UpdateSingleOffsetOfAttribute($PredictedRefNumber, $record_offset_in_mft, $RedoChunkSize, '$INDEX_ROOT') _DumpOutput("_Decode_IndexEntry() failed for $this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) Else If $redo_operation_hex="0c00" Then _UpdateSingleOffsetOfAttribute($RealMftRef, $record_offset_in_mft, $RedoChunkSize, '$INDEX_ROOT') $TextInformation &= ";See LogFile_INDX_I30.csv" EndIf If $redo_operation_hex="0e00" Then $TextInformation &= ";See LogFile_INDX_I30.csv" EndIf EndSelect EndIf Case $redo_operation_hex="1000" ; WriteEndOfIndexBuffer -> always 0 (on nt6x?) but check undo If $AttributeString="" Then $AttributeString = "$INDEX_ALLOCATION" ;_DumpOutput("$this_lsn: " & $this_lsn & @CRLF) ;_DumpOutput("$redo_operation: " & $redo_operation & @CRLF) ;_DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) ;_DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) Case $redo_operation_hex="1100" ; SetIndexEntryVcnRoot _Decode_SetIndexEntryVcn($redo_chunk) $AttributeString = "$INDEX_ROOT" ; ConsoleWrite("$this_lsn: " & $this_lsn & @CRLF) ; ConsoleWrite("$redo_operation_hex: " & $redo_operation_hex & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$redo_chunk) & @CRLF) Case $redo_operation_hex="1200" ; SetIndexEntryVcnAllocation _Decode_SetIndexEntryVcn($redo_chunk) $AttributeString = "$INDEX_ALLOCATION" ; ConsoleWrite("$this_lsn: " & $this_lsn & @CRLF) ; ConsoleWrite("$redo_operation: " & $redo_operation & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$redo_chunk) & @CRLF) Case $redo_operation_hex="1300" ; UpdateFileNameRoot _Decode_UpdateFileName($redo_chunk,1) If $PreviousRedoOp = "1c00" Then $AttributeString = $PreviousAttribute Else $AttributeString = "$INDEX_ROOT" $RealMftRef = $MftRefReplacement EndIf Case $redo_operation_hex="1400" ; UpdateFileNameAllocation ; _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) ; _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) ; _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) If Not $FromRcrdSlack Then If $KeptRefTmp > 0 And $client_previous_lsn = 0 Then $PredictedRefNumber = $KeptRefTmp $KeptRef = $KeptRefTmp EndIf EndIf _Decode_UpdateFileName($redo_chunk,1) If $PreviousRedoOp = "1c00" Then $AttributeString = $PreviousAttribute Else $AttributeString = "$INDEX_ALLOCATION" $RealMftRef = $MftRefReplacement EndIf Case $redo_operation_hex="1500" ;SetBitsInNonresidentBitMap _Decode_BitsInNonresidentBitMap2($redo_chunk) Case $redo_operation_hex="1600" ;ClearBitsInNonresidentBitMap _Decode_BitsInNonresidentBitMap2($redo_chunk) Case $redo_operation_hex="1700" ;HotFix _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) Case $redo_operation_hex="1800" ;EndTopLevelAction _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) Case $redo_operation_hex="1900" ;PrepareTransaction _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) Case $redo_operation_hex="1c00" ; OpenNonresidentAttribute If Not $FromRcrdSlack Then $FoundInTableDummy = _Decode_OpenNonresidentAttribute($redo_chunk) If $undo_length = 0 Then ;We inject an empty name in array since the undo part did not contain any name. If $FoundInTableDummy > 0 Then $OpenAttributesArray[$FoundInTableDummy][12] = "" FileWriteLine($LogFileOpenAttributeTableCsv, $RecordOffset&$de&$this_lsn&$de&$OpenAttributesArray[$FoundInTableDummy][0]&$de&$OpenAttributesArray[$FoundInTableDummy][12]&$de&$OpenAttributesArray[$FoundInTableDummy][1]&$de&$OpenAttributesArray[$FoundInTableDummy][2]&$de&$OpenAttributesArray[$FoundInTableDummy][3]&$de&$OpenAttributesArray[$FoundInTableDummy][4]&$de&$OpenAttributesArray[$FoundInTableDummy][5]&$de&_ResolveAttributeType(StringMid($OpenAttributesArray[$FoundInTableDummy][5],3,4))&$de&$OpenAttributesArray[$FoundInTableDummy][6]&$de&$OpenAttributesArray[$FoundInTableDummy][7]&$de&$OpenAttributesArray[$FoundInTableDummy][8]&$de&$OpenAttributesArray[$FoundInTableDummy][9]&$de&$OpenAttributesArray[$FoundInTableDummy][10]&$de&$OpenAttributesArray[$FoundInTableDummy][11]&$de&$OpenAttributesArray[$FoundInTableDummy][13]&@crlf) EndIf EndIf Else $FoundInTableSlackDummy = _Decode_SlackOpenNonresidentAttribute($redo_chunk) If $undo_length = 0 Then ;We inject an empty name in array since the undo part did not contain any name. If $FoundInTableSlackDummy > 0 Then $SlackOpenAttributesArray[$FoundInTableSlackDummy][12] = "" FileWriteLine($LogFileSlackOpenAttributeTableCsv, $RecordOffset&$de&$this_lsn&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][0]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][12]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][1]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][2]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][3]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][4]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][5]&$de&_ResolveAttributeType(StringMid($SlackOpenAttributesArray[$FoundInTableSlackDummy][5],3,4))&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][6]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][7]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][8]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][9]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][10]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][11]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][13]&@crlf) EndIf EndIf EndIf ; ConsoleWrite(_HexEncode("0x"&$redo_chunk) & @CRLF) Case $redo_operation_hex="1D00" ;OpenAttributeTableDump ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) ; _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) If Not $FromRcrdSlack Then $OpenAttributesArray = 0 Global $OpenAttributesArray[1][14] If $Is32bit Then _Decode_OpenAttributeTableDump32bit($redo_chunk,1) Else _Decode_OpenAttributeTableDump64bit($redo_chunk,1) EndIf $TextInformation &= ";See LogFile_OpenAttributeTable.csv" Else $SlackOpenAttributesArray = 0 Global $SlackOpenAttributesArray[1][14] If $Is32bit Then _Decode_SlackOpenAttributeTableDump32bit($redo_chunk,1) Else _Decode_SlackOpenAttributeTableDump64bit($redo_chunk,1) EndIf $TextInformation &= ";See LogFile_SlackOpenAttributeTable.csv" EndIf Case $redo_operation_hex="1E00" ;AttributeNamesDump ; ConsoleWrite("$this_lsn: " & $this_lsn & @CRLF) ; ConsoleWrite("$redo_operation: " & $redo_operation & @CRLF) ; ConsoleWrite("$redo_operation_hex: " & $redo_operation_hex & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$redo_chunk) & @CRLF) If Not $FromRcrdSlack Then _Decode_AttributeNamesDump($redo_chunk) Else _Decode_SlackAttributeNamesDump($redo_chunk) EndIf Case $redo_operation_hex="1F00" ;DirtyPageTableDump 0x2c per entry nt5.x ; _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) ; _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) If $Is32bit Then _Decode_DirtyPageTableDump32bit($redo_chunk,1) Else _Decode_DirtyPageTableDump64bit($redo_chunk,1) EndIf Case $redo_operation_hex="2000" ;TransactionTableDump ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) ; _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) _Decode_TransactionTableDump($redo_chunk) $TextInformation &= ";See LogFile_TransactionTable.csv" Case $redo_operation_hex="2100" ;UpdateRecordDataRoot ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) ; _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) _Decode_Quota_Q_SingleEntry($redo_chunk,1) $TextInformation &= ";See LogFile_QuotaQ.csv" Case $redo_operation_hex="2200" ;UpdateRecordDataAllocation ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) ; _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) _Decode_Quota_Q_SingleEntry($redo_chunk,1) $TextInformation &= ";See LogFile_QuotaQ.csv" Case $redo_operation_hex="2500" ;JS_NewEndOfRecord ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) ; _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) Case $redo_operation = "UNKNOWN" $TextInformation &= ";RedoOperation="&$redo_operation_hex _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) Case Else _DumpOutput("Missed transaction!" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput("$redo_operation_hex: " & $redo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$redo_chunk) & @CRLF) EndSelect Else $RedoChunkSize = 0 EndIf If $undo_length > 0 Then ; Not needed I guess $undo_chunk = StringMid($InputData,97+($undo_offset*2),$undo_length*2) If $VerboseOn Then _DumpOutput("Undo: " & $undo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) endif $UndoChunkSize = StringLen($undo_chunk)/2 Select Case $undo_operation_hex="0000" ; NoOp If Not $FromRcrdSlack Then If Int($undo_offset)+Int($undo_length) > StringLen($InputData) Then ; MsgBox(0,"Error","$undo_offset > StringLen($InputData) for LSN: " & $this_lsn) Else $AttrNameTmp = _Decode_AttributeName($undo_chunk) If $FoundInTableDummy > 0 Then ; MsgBox(0,"Info","Writing entry") $OpenAttributesArray[$FoundInTableDummy][12] = $AttrNameTmp FileWriteLine($LogFileOpenAttributeTableCsv, $RecordOffset&$de&$this_lsn&$de&$OpenAttributesArray[$FoundInTableDummy][0]&$de&$OpenAttributesArray[$FoundInTableDummy][12]&$de&$OpenAttributesArray[$FoundInTableDummy][1]&$de&$OpenAttributesArray[$FoundInTableDummy][2]&$de&$OpenAttributesArray[$FoundInTableDummy][3]&$de&$OpenAttributesArray[$FoundInTableDummy][4]&$de&$OpenAttributesArray[$FoundInTableDummy][5]&$de&_ResolveAttributeType(StringMid($OpenAttributesArray[$FoundInTableDummy][5],3,4))&$de&$OpenAttributesArray[$FoundInTableDummy][6]&$de&$OpenAttributesArray[$FoundInTableDummy][7]&$de&$OpenAttributesArray[$FoundInTableDummy][8]&$de&$OpenAttributesArray[$FoundInTableDummy][9]&$de&$OpenAttributesArray[$FoundInTableDummy][10]&$de&$OpenAttributesArray[$FoundInTableDummy][11]&$de&$OpenAttributesArray[$FoundInTableDummy][13]&@crlf) ; FileWriteLine($LogFileOpenAttributeTableCsv, $RecordOffset&$de&$this_lsn&$de&$OpenAttributesArray[$FoundInTableDummy][0]&$de&$OpenAttributesArray[$FoundInTableDummy][12]&$de&$OpenAttributesArray[$FoundInTableDummy][1]&$de&$OpenAttributesArray[$FoundInTableDummy][2]&$de&$OpenAttributesArray[$FoundInTableDummy][3]&$de&$OpenAttributesArray[$FoundInTableDummy][4]&$de&$OpenAttributesArray[$FoundInTableDummy][5]&$de&_ResolveAttributeType(StringMid($OpenAttributesArray[$FoundInTableDummy][5],3,4))&$de&$OpenAttributesArray[$FoundInTableDummy][6]&$de&$OpenAttributesArray[$FoundInTableDummy][7]&$de&$OpenAttributesArray[$FoundInTableDummy][8]&$de&$OpenAttributesArray[$FoundInTableDummy][9]&$de&$OpenAttributesArray[$FoundInTableDummy][10]&$de&"0xDEADBEEF"&@crlf) If $VerboseOn Then _DumpOutput("_Decode_AttributeName() returned: " & $AttrNameTmp & @CRLF) _DumpOutput("Updating $OpenAttributesArray at row: " & $FoundInTableDummy & @CRLF) _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") EndIf EndIf EndIf Else $AttrNameTmp = _Decode_AttributeName($undo_chunk) If $FoundInTableSlackDummy > 0 Then ; MsgBox(0,"Info","Writing entry") $SlackOpenAttributesArray[$FoundInTableSlackDummy][12] = $AttrNameTmp FileWriteLine($LogFileSlackOpenAttributeTableCsv, $RecordOffset&$de&$this_lsn&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][0]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][12]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][1]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][2]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][3]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][4]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][5]&$de&_ResolveAttributeType(StringMid($SlackOpenAttributesArray[$FoundInTableSlackDummy][5],3,4))&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][6]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][7]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][8]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][9]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][10]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][11]&$de&$SlackOpenAttributesArray[$FoundInTableSlackDummy][13]&@crlf) ; FileWriteLine($LogFileOpenAttributeTableCsv, $RecordOffset&$de&$this_lsn&$de&$OpenAttributesArray[$FoundInTableDummy][0]&$de&$OpenAttributesArray[$FoundInTableDummy][12]&$de&$OpenAttributesArray[$FoundInTableDummy][1]&$de&$OpenAttributesArray[$FoundInTableDummy][2]&$de&$OpenAttributesArray[$FoundInTableDummy][3]&$de&$OpenAttributesArray[$FoundInTableDummy][4]&$de&$OpenAttributesArray[$FoundInTableDummy][5]&$de&_ResolveAttributeType(StringMid($OpenAttributesArray[$FoundInTableDummy][5],3,4))&$de&$OpenAttributesArray[$FoundInTableDummy][6]&$de&$OpenAttributesArray[$FoundInTableDummy][7]&$de&$OpenAttributesArray[$FoundInTableDummy][8]&$de&$OpenAttributesArray[$FoundInTableDummy][9]&$de&$OpenAttributesArray[$FoundInTableDummy][10]&$de&"0xDEADBEEF"&@crlf) If $VerboseOn Then _DumpOutput("_Decode_AttributeName() returned: " & $AttrNameTmp & @CRLF) _DumpOutput("Updating $SlackOpenAttributesArray at row: " & $FoundInTableSlackDummy & @CRLF) _ArrayDisplay($SlackOpenAttributesArray,"$SlackOpenAttributesArray") EndIf EndIf EndIf Case $undo_operation_hex="0100" ;CompensationlogRecord Case $undo_operation_hex="0200" ;InitializeFileRecordSegment If $UndoChunkSize > 26 Then ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) ; _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) ; MsgBox(0,"Info","Check this one out") _ParserCodeOldVersion($undo_chunk,0) EndIf Case $undo_operation_hex="0300" ;DeallocateFileRecordSegment ;Just the FILE header from MFT records Case $undo_operation_hex="0400" ; WriteEndOfFileRecordSegment ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) ; _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation_hex="0500" ; CreateAttribute $TestAttributeType = _Decode_AttributeType($undo_chunk) If $TestAttributeType <> '' Then _RemoveSingleOffsetOfAttribute($PredictedRefNumber, $record_offset_in_mft, $UndoChunkSize, $TestAttributeType) _Decode_CreateAttribute($undo_chunk,0) Case $undo_operation_hex="0700" ; UpdateResidentValue _Decode_UpdateResidentValue($undo_chunk,0) Case $undo_operation_hex="0900" ; _Decode_UpdateMappingPairs($undo_chunk) Case $undo_operation_hex="0800" ; UpdateNonResidentValue If StringLeft($undo_chunk,8) = "494e4458" Then _Decode_INDX($undo_chunk,0) ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) ; _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) ; MsgBox(0,"Info","Check this one out") EndIf Case $undo_operation_hex="0b00" ; _Decode_SetNewAttributeSize($undo_chunk) Case $undo_operation_hex="0c00" Or $undo_operation_hex="0e00" #cs If $undo_length*2>168 Then $DecodeOk = _Decode_IndexEntry($undo_chunk,$undo_operation_hex,0) If Not $DecodeOk Then _DumpOutput("_Decode_IndexEntry() failed at undo for $this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) EndIf Else _DumpOutput(@CRLF & "Unresolved: " & $undo_operation & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) EndIf #ce Select Case $PredictedRefNumber = 9 Or $RealMftRef = 9 ;$Secure If $undo_length = 40 Then ;$SII _DecodeIndxEntriesSII($undo_chunk,0) $TextInformation &= ";$Secure:$SII;See LogFile_SecureSII.csv" $AttributeString &= ":$SII" ElseIf $undo_length = 48 Then ;$SDH _DecodeIndxEntriesSDH($undo_chunk,0) $TextInformation &= ";$Secure:$SDH;See LogFile_SecureSDH.csv" $AttributeString &= ":$SDH" EndIf Case $PredictedRefNumber = 24 Or $RealMftRef = 24 ;$Quota If $undo_length > 68 Then _Decode_Quota_Q($undo_chunk,0) $TextInformation &= ";See LogFile_QuotaQ.csv" Else _Decode_Quota_O($undo_chunk,0) $TextInformation &= ";See LogFile_QuotaO.csv" EndIf Case $PredictedRefNumber = 25 Or $RealMftRef = 25 ;$ObjId If $undo_length = 88 Then _Decode_ObjId_O($undo_chunk,0) $TextInformation &= ";See LogFile_ObjIdO.csv" EndIf Case Else If $undo_length*2>168 Then $DecodeOk=0 $DecodeOk = _Decode_IndexEntry($undo_chunk,$undo_operation_hex,0) If Not $DecodeOk Then ; If $undo_operation_hex="0c00" Then _UpdateSingleOffsetOfAttribute($PredictedRefNumber, $record_offset_in_mft, $UndoChunkSize, '$INDEX_ROOT') _DumpOutput("_Decode_IndexEntry() failed at undo for $this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) Else ; If $undo_operation_hex="0c00" Then _UpdateSingleOffsetOfAttribute($RealMftRef, $record_offset_in_mft, $UndoChunkSize, '$INDEX_ROOT') $TextInformation &= ";See LogFile_UndoWipe_INDX_I30.csv" EndIf Else _DumpOutput(@CRLF & "Error: Unresolved: " & $undo_operation & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) EndIf EndSelect Case $undo_operation_hex="1000" ; WriteEndOfIndexBuffer Select Case $AttributeString = "$ATTRIBUTE_LIST" _DecodeAttrList($undo_chunk,0) $TextInformation &= ";See LogFile_AttributeList.csv" Case $AttributeString = "$Data:$SDS" _MainSecure($undo_chunk,0) $TextInformation &= ";$Secure:$SDS;See LogFile_SecurityDescriptors.csv" Case $AttributeString = "$INDEX_ALLOCATION:$SII" $Indx = _GetIndxWoFixup($undo_chunk) _DecodeIndxEntriesSII($Indx,0) $TextInformation &= ";See LogFile_SecureSII.csv" Case $AttributeString = "$INDEX_ALLOCATION:$SDH" $Indx = _GetIndxWoFixup($undo_chunk) _DecodeIndxEntriesSDH($Indx,0) $TextInformation &= ";See LogFile_SecureSDH.csv" Case ($PredictedRefNumber = 24 Or $RealMftRef = 24) And ($AttributeString = "$INDEX_ALLOCATION:$O" Or $AttributeString = "$INDEX_ROOT:$O" Or $AttributeString = "UNKNOWN:$O") _Decode_Quota_O($undo_chunk,0) $TextInformation &= ";See LogFile_QuotaO.csv" Case ($PredictedRefNumber = 24 Or $RealMftRef = 24) And ($AttributeString = "$INDEX_ALLOCATION:$Q" Or $AttributeString = "$INDEX_ROOT:$Q" Or $AttributeString = "UNKNOWN:$Q") _Decode_Quota_Q($undo_chunk,0) $TextInformation &= ";See LogFile_QuotaQ.csv" Case ($PredictedRefNumber = 25 Or $RealMftRef = 25) And ($AttributeString = "$INDEX_ALLOCATION:$O" Or $AttributeString = "$INDEX_ROOT:$O" Or $AttributeString = "UNKNOWN:$O") _Decode_ObjId_O($undo_chunk,0) $TextInformation &= ";See LogFile_ObjIdO.csv" Case ($PredictedRefNumber = 26 Or $RealMftRef = 26) And ($AttributeString = "$INDEX_ALLOCATION:$R" Or $AttributeString = "$INDEX_ROOT:$R" Or $AttributeString = "UNKNOWN:$R") _Decode_Reparse_R($undo_chunk,0) $TextInformation &= ";See LogFile_ReparseR.csv" Case Not ($PredictedRefNumber = 9 Or $PredictedRefNumber = 24 Or $PredictedRefNumber = 25 Or $PredictedRefNumber = 26 Or $RealMftRef = 9 Or $RealMftRef = 24 Or $RealMftRef = 25 Or $RealMftRef = 26) And StringInStr($AttributeString,"$INDEX_ALLOCATION") $DecodeOk=0 $DecodeOk = _Decode_UndoWipeINDX($undo_chunk,0) If Not $DecodeOk Then _DumpOutput(@CRLF & "_Decode_UndoWipeINDX() failed for $this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) Else $TextInformation &= ";See LogFile_UndoWipe_INDX_I30.csv" EndIf Case Else _DumpOutput("Unresolved: " & $undo_operation & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) EndSelect ;-------------------------------------------- #cs If Not ($PredictedRefNumber = 9 Or $PredictedRefNumber = 24 Or $PredictedRefNumber = 25 Or $PredictedRefNumber = 26 Or $RealMftRef = 9 Or $RealMftRef = 24 Or $RealMftRef = 25 Or $RealMftRef = 26) Then ; If ($PredictedRefNumber <> 9 And $PredictedRefNumber <> 24 And $PredictedRefNumber <> 25 And $PredictedRefNumber <> 26) Or ($RealMftRef <> 9 And $RealMftRef <> 24 And $RealMftRef <> 25 And $RealMftRef <> 26) Then ; If $undo_length*2>168 Then $DecodeOk=0 $DecodeOk = _Decode_UndoWipeINDX($undo_chunk) If Not $DecodeOk Then _DumpOutput(@CRLF & "_Decode_UndoWipeINDX() failed for $this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) ; Else ; $TextInformation &= ";INDX" EndIf Else _DumpOutput("Unresolved: " & $undo_operation & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("Though it is probably ok to not bother with undo of indexes that are not of type $I30." & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) ; MsgBox(0,"Info","Check output of transaction with lsn: " & $this_lsn) EndIf #ce Case $undo_operation_hex="1100" ; SetIndexEntryVcnRoot ; ConsoleWrite("$this_lsn: " & $this_lsn & @CRLF) ; ConsoleWrite("$undo_operation_hex: " & $undo_operation_hex & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation_hex="1200" ; SetIndexEntryVcnAllocation Case $undo_operation_hex="1300" ; UpdateFileNameRoot _Decode_UpdateFileName($undo_chunk,0) Case $undo_operation_hex="1400" ; UpdateFileNameAllocation _Decode_UpdateFileName($undo_chunk,0) ; _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) ; _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation_hex="1500" ; SetBitsInNonresidentBitMap _Decode_BitsInNonresidentBitMap($redo_chunk,$redo_operation,$undo_chunk,$undo_operation) $TextInformation &= ";See LogFile_BitsInNonresidentBitMap.csv" Case $undo_operation_hex="1600" ; ClearBitsInNonresidentBitMap _Decode_BitsInNonresidentBitMap($redo_chunk,$redo_operation,$undo_chunk,$undo_operation) $TextInformation &= ";See LogFile_BitsInNonresidentBitMap.csv" Case $undo_operation_hex="1700" ;HotFix _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation_hex="1800" ;EndTopLevelAction _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation_hex="1900" ;PrepareTransaction _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation_hex="1D00" ;OpenAttributeTableDump ; ConsoleWrite("$this_lsn: " & $this_lsn & @CRLF) ; ConsoleWrite("$undo_operation: " & $undo_operation & @CRLF) ; ConsoleWrite("$undo_operation_hex: " & $undo_operation_hex & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation_hex="1E00" ;AttributeNamesDump ; ConsoleWrite("$this_lsn: " & $this_lsn & @CRLF) ; ConsoleWrite("$undo_operation: " & $undo_operation & @CRLF) ; ConsoleWrite("$undo_operation_hex: " & $undo_operation_hex & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation_hex="1F00" ;DirtyPageTableDump ; ConsoleWrite("$this_lsn: " & $this_lsn & @CRLF) ; ConsoleWrite("$undo_operation: " & $undo_operation & @CRLF) ; ConsoleWrite("$undo_operation_hex: " & $undo_operation_hex & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation_hex="2000" ;TransactionTableDump _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation_hex="2100" ;UpdateRecordDataRoot ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) ; _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) _Decode_Quota_Q_SingleEntry($undo_chunk,0) Case $undo_operation_hex="2200" ;UpdateRecordDataAllocation ; _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) ; _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) ; _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) _Decode_Quota_Q_SingleEntry($undo_chunk,0) Case $undo_operation_hex="2500" ;JS_NewEndOfRecord _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) Case $undo_operation = "UNKNOWN" _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$undo_operation: " & $undo_operation & @CRLF) _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) Case Else _DumpOutput("Missed transaction!" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$undo_operation_hex: " & $undo_operation_hex & @CRLF) _DumpOutput(_HexEncode("0x"&$undo_chunk) & @CRLF) EndSelect Else $UndoChunkSize = 0 EndIf If Not $FromRcrdSlack Then If $SI_USN = $PreviousUsn And $SI_USN <> "" Then ; MsgBox(0,"Usn:","$PreviousUsn: " & $PreviousUsn & ", $PreviousUsnFileName: " & $PreviousUsnFileName) $FN_Name = $PreviousUsnFileName EndIf If $client_previous_lsn=0 Then $PreviousRealRef="" EndIf If $undo_operation = "UNKNOWN" Then $TextInformation &= ";UndoOperation="&$undo_operation_hex $PreviousRedoOp = $redo_operation_hex $PreviousAttribute = $AttributeString If $UsnOk Then $PreviousUsn = $UsnJrnlUsn $PreviousUsnFileName = $UsnJrnlFileName $PreviousUsnReason = $UsnJrnlReason EndIf If $FoundInTable > 0 Then ; ConsoleWrite("ubound($OpenAttributesArray): " & ubound($OpenAttributesArray) & @CRLF) $AttributeStringTmp = _ResolveAttributeType(StringMid($OpenAttributesArray[$FoundInTable][5],3,4)) If $AttributeStringTmp <> "UNKNOWN" And $OpenAttributesArray[$FoundInTable][9] <> 0 Then ;Why do these sometimes point to offsets in OpenAttributeTable containing invalid data? If $Is32bit=0 Or $OpenAttributesArray[$FoundInTable][7]>0 Then ;target_attribute is handled differently on nt5.x than nt6.x $AttributeString = $AttributeStringTmp If $OpenAttributesArray[$FoundInTable][12] <> "" Then $AttributeString &= ":"&$OpenAttributesArray[$FoundInTable][12] EndIf ; $PredictedRefNumber = $OpenAttributesArray[$FoundInTable][7] $RealMftRef = $OpenAttributesArray[$FoundInTable][7] $PredictedRefNumber = $RealMftRef If $PredictedRefNumber = -1 Then $PredictedRefNumber = $RealMftRef EndIf Else $InOpenAttributeTable = "-" & $InOpenAttributeTable ;Will indicate an offset match in OpenAttributeTable that contains invalid data. EndIf EndIf If $PredictedRefNumber = 0 Then ; If $target_attribute = 0x0018 And Ubound($OpenAttributesArray) > 1 Then If Ubound($OpenAttributesArray) > 1 Then $FoundInTable = _ArraySearch($OpenAttributesArray,$target_attribute,0,0,0,2,1,0) ; ConsoleWrite("$FoundInTable: " & $FoundInTable & @CRLF) If $FoundInTable > 0 Then $AttributeStringTmp = _ResolveAttributeType(StringMid($OpenAttributesArray[$FoundInTable][5],3,4)) If $AttributeStringTmp <> "$DATA" And $AttributeStringTmp <> "UNKNOWN" Then $AttributeString = $AttributeStringTmp EndIf If $OpenAttributesArray[$FoundInTable][12] <> "" And $AttributeString <> "" Then $AttributeString &= ":"&$OpenAttributesArray[$FoundInTable][12] EndIf Else _DumpOutput("Error: $target_attribute was not found in array: " & $target_attribute & " at lsn " & $this_lsn & @CRLF) ; _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") EndIf ; Else ; $PredictedRefNumber = $RealMftRef EndIf EndIf EndIf If $PredictedRefNumber > 0 And $FN_Name="" Then $FN_Name = _GetFileNameFromArray($PredictedRefNumber,$this_lsn) EndIf If $FN_Name="" Then _SetNameOnSystemFiles() _WriteLogFileCsv() If $DoSplitCsv Then _WriteCSVExtra() If $VerboseOn Then _DumpOutput("End parsing transaction in verbose mode." & @CRLF) ; MsgBox(0,"VerboseOn","Check output of lsn: " & $this_lsn) ; Exit ; _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") ; _ArrayDisplay($AttrArray,"$AttrArray") EndIf _ClearVar() EndFunc Func _DecodeRSTR($RSTRRecord) Local $Startpos=3 If Not $SkipFixups Then $RSTRRecord = _DoFixup($RSTRRecord) EndIf If $RSTRRecord = "" then Return "" ;corrupt, failed fixup _DumpOutput("------------- RSTR -------------" & @CRLF) ;_DumpOutput(_HexEncode($RSTRRecord) & @CRLF) ;$usa_ofs = StringMid($RSTRRecord,$Startpos+8,4) ; 2 bytes ;$usa_count = StringMid($RSTRRecord,$Startpos+12,4) ; 2 bytes $chkdsk_lsn = StringMid($RSTRRecord,$Startpos+16,16) ; 8 bytes $chkdsk_lsn = _SwapEndian($chkdsk_lsn) $system_page_size = StringMid($RSTRRecord,$Startpos+32,8) ; 4 bytes $system_page_size = _SwapEndian($system_page_size) $log_page_size = StringMid($RSTRRecord,$Startpos+40,8) ; 4 bytes $log_page_size = _SwapEndian($log_page_size) $restart_area_offset = StringMid($RSTRRecord,$Startpos+48,4) ; 2 bytes $minor_ver = StringMid($RSTRRecord,$Startpos+52,4) ; 2 bytes $major_ver = StringMid($RSTRRecord,$Startpos+56,4) ; 2 bytes ;_DumpOutput("$usa_ofs: " & $usa_ofs & @CRLF) ;_DumpOutput("$usa_count: " & $usa_count & @CRLF) _DumpOutput("$chkdsk_lsn: " & Dec($chkdsk_lsn,2) & @CRLF) _DumpOutput("$system_page_size: 0x" & $system_page_size & @CRLF) _DumpOutput("$log_page_size: 0x" & $log_page_size & @CRLF) ;_DumpOutput("$restart_area_offset: " & $restart_area_offset & @CRLF) _DumpOutput("$minor_ver: 0x" & _SwapEndian($minor_ver) & @CRLF) _DumpOutput("$major_ver: 0x" & _SwapEndian($major_ver) & @CRLF) ; End -> size = 30 bytes ;---------------------------------- $restart_area_offset = $Startpos+(Dec(_SwapEndian($restart_area_offset),2)*2) ; Log file restart area record $current_lsn = StringMid($RSTRRecord,$restart_area_offset,16) $current_lsn = _SwapEndian($current_lsn) $log_clients = StringMid($RSTRRecord,$restart_area_offset+16,4) $log_clients = _SwapEndian($log_clients) $client_free_list = StringMid($RSTRRecord,$restart_area_offset+20,4) $client_free_list = _SwapEndian($client_free_list) $client_in_use_list = StringMid($RSTRRecord,$restart_area_offset+24,4) $client_in_use_list = _SwapEndian($client_in_use_list) $RESTART_AREA_FLAGS = StringMid($RSTRRecord,$restart_area_offset+28,4) $RESTART_AREA_FLAGS = _SwapEndian($RESTART_AREA_FLAGS) $seq_number_bits = StringMid($RSTRRecord,$restart_area_offset+32,8) $seq_number_bits = _SwapEndian($seq_number_bits) $restart_area_length = StringMid($RSTRRecord,$restart_area_offset+40,4) $restart_area_length = _SwapEndian($restart_area_length) $client_array_offset = StringMid($RSTRRecord,$restart_area_offset+44,4) $client_array_offset = Dec(_SwapEndian($client_array_offset),2)*2 $file_size = StringMid($RSTRRecord,$restart_area_offset+48,16) $file_size = _SwapEndian($file_size) $last_lsn_data_length = StringMid($RSTRRecord,$restart_area_offset+64,8) $last_lsn_data_length = _SwapEndian($last_lsn_data_length) $log_record_header_length = StringMid($RSTRRecord,$restart_area_offset+72,4) $log_record_header_length = _SwapEndian($log_record_header_length) $log_page_data_offset = StringMid($RSTRRecord,$restart_area_offset+76,4) $log_page_data_offset = _SwapEndian($log_page_data_offset) $restart_log_open_count = StringMid($RSTRRecord,$restart_area_offset+80,8) $restart_log_open_count = _SwapEndian($restart_log_open_count) ;$reserved = StringMid($RSTRRecord,$restart_area_offset+88,8) _DumpOutput("--- RSTR: Log file restart area record:" & @CRLF) If Dec($file_size,2) <> $InputFileSize Then _DumpOutput("Error: The size of the $LogFile as specified in RSTR is not the same as the filesize of input" & @CRLF) _DumpOutput("$restart_area_offset: " & $restart_area_offset & @CRLF) _DumpOutput("$current_lsn: " & Dec($current_lsn,2) & @CRLF) _DumpOutput("$log_clients: 0x" & $log_clients & @CRLF) _DumpOutput("$client_free_list: 0x" & $client_free_list & @CRLF) _DumpOutput("$client_in_use_list: 0x" & $client_in_use_list & @CRLF) _DumpOutput("$RESTART_AREA_FLAGS: 0x" & $RESTART_AREA_FLAGS & @CRLF) _DumpOutput("$seq_number_bits: 0x" & $seq_number_bits & @CRLF) _DumpOutput("$restart_area_length: 0x" & $restart_area_length & @CRLF) _DumpOutput("$client_array_offset: " & $client_array_offset & @CRLF) _DumpOutput("$file_size: 0x" & $file_size & @CRLF) _DumpOutput("$last_lsn_data_length: 0x" & $last_lsn_data_length & @CRLF) _DumpOutput("$log_record_header_length: 0x" & $log_record_header_length & @CRLF) _DumpOutput("$log_page_data_offset: 0x" & $log_page_data_offset & @CRLF) _DumpOutput("$restart_log_open_count: 0x" & $restart_log_open_count & @CRLF) ; End RESTART_AREA -> size = 48 bytes ;--------------------------- ; Log client record $ClientRecordOffset = $restart_area_offset+$client_array_offset $oldest_lsn = StringMid($RSTRRecord,$ClientRecordOffset,16) $oldest_lsn = _SwapEndian($oldest_lsn) $client_restart_lsn = StringMid($RSTRRecord,$ClientRecordOffset+16,16) $client_restart_lsn = _SwapEndian($client_restart_lsn) $prev_client = StringMid($RSTRRecord,$ClientRecordOffset+32,4) $prev_client = _SwapEndian($prev_client) $next_client = StringMid($RSTRRecord,$ClientRecordOffset+36,4) $next_client = _SwapEndian($next_client) $seq_number = StringMid($RSTRRecord,$ClientRecordOffset+40,4) $seq_number = _SwapEndian($seq_number) ;$reserved2 = StringMid($RSTRRecord,$ClientRecordOffset+44,12) $client_name_length = StringMid($RSTRRecord,$ClientRecordOffset+56,8) $client_name_length = Dec(_SwapEndian($client_name_length),2) $client_name = StringMid($RSTRRecord,$ClientRecordOffset+64,$client_name_length*2) ; Normally 8 bytes (NTFS in unicode) + 120 bytes of 00's _DumpOutput("--- RSTR: Log client record:" & @CRLF) _DumpOutput("$ClientRecordOffset: " & $ClientRecordOffset & @CRLF) _DumpOutput("$oldest_lsn: " & Dec($oldest_lsn,2) & @CRLF) _DumpOutput("$client_restart_lsn: " & Dec($client_restart_lsn,2) & @CRLF) _DumpOutput("$prev_client: 0x" & $prev_client & @CRLF) _DumpOutput("$next_client: 0x" & $next_client & @CRLF) _DumpOutput("$seq_number: 0x" & $seq_number & @CRLF) ;_DumpOutput("$reserved2: " & $reserved2 & @CRLF) _DumpOutput("$client_name_length (unicode): " & $client_name_length & @CRLF) _DumpOutput("$client_name: " & BinaryToString("0x"&$client_name,2) & @CRLF) ; End -> size = 160 bytes, 32 bytes + name (128) _DumpOutput("------------- END RSTR -------------" & @CRLF) EndFunc Func _DoFixup($record) $UpdSeqArrOffset = Dec(_SwapEndian(StringMid($record,11,4))) $UpdSeqArrSize = Dec(_SwapEndian(StringMid($record,15,4))) $UpdSeqArr = StringMid($record,3+($UpdSeqArrOffset*2),$UpdSeqArrSize*2*2) $UpdSeqArrPart0 = StringMid($UpdSeqArr,1,4) $UpdSeqArrPart1 = StringMid($UpdSeqArr,5,4) $UpdSeqArrPart2 = StringMid($UpdSeqArr,9,4) $UpdSeqArrPart3 = StringMid($UpdSeqArr,13,4) $UpdSeqArrPart4 = StringMid($UpdSeqArr,17,4) $UpdSeqArrPart5 = StringMid($UpdSeqArr,21,4) $UpdSeqArrPart6 = StringMid($UpdSeqArr,25,4) $UpdSeqArrPart7 = StringMid($UpdSeqArr,29,4) $UpdSeqArrPart8 = StringMid($UpdSeqArr,33,4) $RecordEnd1 = StringMid($record,1023,4) $RecordEnd2 = StringMid($record,2047,4) $RecordEnd3 = StringMid($record,3071,4) $RecordEnd4 = StringMid($record,4095,4) $RecordEnd5 = StringMid($record,5119,4) $RecordEnd6 = StringMid($record,6143,4) $RecordEnd7 = StringMid($record,7167,4) $RecordEnd8 = StringMid($record,8191,4) If $UpdSeqArrPart0 <> $RecordEnd1 OR $UpdSeqArrPart0 <> $RecordEnd2 OR $UpdSeqArrPart0 <> $RecordEnd3 OR $UpdSeqArrPart0 <> $RecordEnd4 OR $UpdSeqArrPart0 <> $RecordEnd5 OR $UpdSeqArrPart0 <> $RecordEnd6 OR $UpdSeqArrPart0 <> $RecordEnd7 OR $UpdSeqArrPart0 <> $RecordEnd8 Then ConsoleWrite("Error: Fixup failed at: 0x" & Hex($CurrentFileOffset) & @CRLF) Return "" EndIf $record = StringMid($record,1,1022) & $UpdSeqArrPart1 & StringMid($record,1027,1020) & $UpdSeqArrPart2 & StringMid($record,2051,1020) & $UpdSeqArrPart3 & StringMid($record,3075,1020) & $UpdSeqArrPart4 & StringMid($record,4099,1020) & $UpdSeqArrPart5 & StringMid($record,5123,1020) & $UpdSeqArrPart6 & StringMid($record,6147,1020) & $UpdSeqArrPart7 & StringMid($record,7171,1020) & $UpdSeqArrPart8 Return $record EndFunc Func _SolveUndoRedoCodes($OpCode) Local $InterpretedCode Select Case $OpCode = 0 ;"00" $InterpretedCode = "Noop" Case $OpCode = 1 ;"01" $InterpretedCode = "CompensationlogRecord" Case $OpCode = 2 ;"02" $InterpretedCode = "InitializeFileRecordSegment" Case $OpCode = 3 ;"03" $InterpretedCode = "DeallocateFileRecordSegment" Case $OpCode = 4 ;"04" $InterpretedCode = "WriteEndofFileRecordSegement" Case $OpCode = 5 ;"05" $InterpretedCode = "CreateAttribute" Case $OpCode = 6 ;"06" $InterpretedCode = "DeleteAttribute" Case $OpCode = 7 ;"07" $InterpretedCode = "UpdateResidentValue" Case $OpCode = 8 ;"08" $InterpretedCode = "UpdateNonResidentValue" Case $OpCode = 9 ;"09" $InterpretedCode = "UpdateMappingPairs" Case $OpCode = 10 ;"0a" $InterpretedCode = "DeleteDirtyClusters" Case $OpCode = 11 ;"0b" $InterpretedCode = "SetNewAttributeSizes" Case $OpCode = 12 ;"0c" $InterpretedCode = "AddindexEntryRoot" Case $OpCode = 13 ;"0d" $InterpretedCode = "DeleteindexEntryRoot" Case $OpCode = 14 ;"0e" $InterpretedCode = "AddIndexEntryAllocation" Case $OpCode = 15 ;"0f" $InterpretedCode = "DeleteIndexEntryAllocation" Case $OpCode = 16 ;"10" $InterpretedCode = "WriteEndOfIndexBuffer" Case $OpCode = 17 ;"11" $InterpretedCode = "SetIndexEntryVcnRoot" Case $OpCode = 18 ;"12" $InterpretedCode = "SetIndexEntryVcnAllocation" Case $OpCode = 19 ;"13" $InterpretedCode = "UpdateFileNameRoot" Case $OpCode = 20 ;"14" $InterpretedCode = "UpdateFileNameAllocation" Case $OpCode = 21 ;"15" $InterpretedCode = "SetBitsInNonresidentBitMap" Case $OpCode = 22 ;"16" $InterpretedCode = "ClearBitsInNonresidentBitMap" Case $OpCode = 23 ;"17" $InterpretedCode = "HotFix" Case $OpCode = 24 ;"18" $InterpretedCode = "EndTopLevelAction" Case $OpCode = 25 ;"19" $InterpretedCode = "PrepareTransaction" Case $OpCode = 26 ;"1a" $InterpretedCode = "CommitTransaction" Case $OpCode = 27 ;"1b" $InterpretedCode = "ForgetTransaction" Case $OpCode = 28 ;"1c" $InterpretedCode = "OpenNonresidentAttribute" Case $OpCode = 29 ;"1d" $InterpretedCode = "OpenAttributeTableDump" Case $OpCode = 30 ;"1e" $InterpretedCode = "AttributeNamesDump" Case $OpCode = 31 ;"1f" $InterpretedCode = "DirtyPageTableDump" Case $OpCode = 32 ;"20" $InterpretedCode = "TransactionTableDump" Case $OpCode = 33 ;"21" $InterpretedCode = "UpdateRecordDataRoot" Case $OpCode = 34 ;"22" $InterpretedCode = "UpdateRecordDataAllocation" Case $OpCode = 37 ;"25" $InterpretedCode = "JS_NewEndOfRecord" Case Else $InterpretedCode = "UNKNOWN" ; MsgBox(0,"$OpCode",$OpCode) EndSelect Return $InterpretedCode EndFunc ;Func _SetRecordType($RecordType) ;CheckPointRecord = 0x02 ;UpdateRecord = 0x01 ;CommitRecord = ;EndFunc Func _SwapEndian($iHex) Return StringMid(Binary(Dec($iHex,2)),3, StringLen($iHex)) EndFunc Func _HexEncode($bInput) Local $tInput = DllStructCreate("byte[" & BinaryLen($bInput) & "]") DllStructSetData($tInput, 1, $bInput) Local $a_iCall = DllCall("crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr($tInput), _ "dword", DllStructGetSize($tInput), _ "dword", 11, _ "ptr", 0, _ "dword*", 0) If @error Or Not $a_iCall[0] Then $tInput = 0 Return SetError(1, 0, "") EndIf Local $iSize = $a_iCall[5] Local $tOut = DllStructCreate("char[" & $iSize & "]") $a_iCall = DllCall("crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr($tInput), _ "dword", DllStructGetSize($tInput), _ "dword", 11, _ "ptr", DllStructGetPtr($tOut), _ "dword*", $iSize) If @error Or Not $a_iCall[0] Then $tInput = 0 Return SetError(2, 0, "") EndIf $tInput = 0 Return SetError(0, 0, DllStructGetData($tOut, 1)) EndFunc Func _ParserCodeOldVersion($MFTEntry,$IsRedo) Local $UpdSeqArrOffset, $HDR_LSN, $HDR_HardLinkCount, $HDR_Flags, $HDR_RecRealSize, $HDR_RecAllocSize, $HDR_BaseRecSeqNo, $HDR_NextAttribID, $NextAttributeOffset, $AttributeType, $AttributeSize, $RecordActive Local $AttributeArray[17][2], $TestAttributeString $AttributeArray[0][0] = "Attribute name" $AttributeArray[0][1] = "Number" $AttributeArray[1][0] = "$STANDARD_INFORMATION" $AttributeArray[2][0] = "$ATTRIBUTE_LIST" $AttributeArray[3][0] = "$FILE_NAME" $AttributeArray[4][0] = "$OBJECT_ID" $AttributeArray[5][0] = "$SECURITY_DESCRIPTOR" $AttributeArray[6][0] = "$VOLUME_NAME" $AttributeArray[7][0] = "$VOLUME_INFORMATION" $AttributeArray[8][0] = "$DATA" $AttributeArray[9][0] = "$INDEX_ROOT" $AttributeArray[10][0] = "$INDEX_ALLOCATION" $AttributeArray[11][0] = "$BITMAP" $AttributeArray[12][0] = "$REPARSE_POINT" $AttributeArray[13][0] = "$EA_INFORMATION" $AttributeArray[14][0] = "$EA" $AttributeArray[15][0] = "$PROPERTY_SET" $AttributeArray[16][0] = "$LOGGED_UTILITY_STREAM" $UpdSeqArrOffset = StringMid($MFTEntry, 9, 4) $UpdSeqArrOffset = Dec(_SwapEndian($UpdSeqArrOffset),2) $HDR_LSN = StringMid($MFTEntry, 17, 16) $HDR_LSN = Dec(_SwapEndian($HDR_LSN),2) $HDR_SequenceNo = StringMid($MFTEntry, 33, 4) $HDR_SequenceNo = Dec(_SwapEndian($HDR_SequenceNo),2) $HDR_HardLinkCount = StringMid($MFTEntry,37,4) $HDR_HardLinkCount = Dec(_SwapEndian($HDR_HardLinkCount),2) $HDR_Flags = StringMid($MFTEntry, 45, 4);00=deleted file,01=file,02=deleted folder,03=folder Select Case $HDR_Flags = '0000' $HDR_Flags = 'FILE' $RecordActive = 'DELETED' Case $HDR_Flags = '0100' $HDR_Flags = 'FILE' $RecordActive = 'ALLOCATED' Case $HDR_Flags = '0200' $HDR_Flags = 'FOLDER' $RecordActive = 'DELETED' Case $HDR_Flags = '0300' $HDR_Flags = 'FOLDER' $RecordActive = 'ALLOCATED' Case $HDR_Flags = '0900' $HDR_Flags = 'FILE+INDEX_SECURITY' $RecordActive = 'ALLOCATED' Case $HDR_Flags = '0D00' $HDR_Flags = 'FILE+INDEX_OTHER' $RecordActive = 'ALLOCATED' Case Else $HDR_Flags = 'UNKNOWN' $RecordActive = 'UNKNOWN' EndSelect $HDR_RecRealSize = StringMid($MFTEntry, 49, 8) $HDR_RecRealSize = Dec(_SwapEndian($HDR_RecRealSize),2) If StringLen($MFTEntry) < 98 Then ;The critical offset is where the mft record number is located. _DumpOutput("Error in _ParserCodeOldVersion()" & @CRLF) _DumpOutput("$MFT record was too damaged to process properly." & @CRLF) _DumpOutput("The size of record was expected to be " & $HDR_RecAllocSize & " bytes, but was only " & StringLen($MFTEntry)/2 & " bytes" & @CRLF) _DumpOutput(_HexEncode("0x" & $MFTEntry) & @CRLF) Return SetError(1) EndIf $HDR_RecAllocSize = StringMid($MFTEntry, 57, 8) $HDR_RecAllocSize = Dec(_SwapEndian($HDR_RecAllocSize),2) $HDR_BaseRecord = StringMid($MFTEntry, 65, 12) $HDR_BaseRecord = Dec(_SwapEndian($HDR_BaseRecord),2) $HDR_BaseRecSeqNo = StringMid($MFTEntry, 77, 4) $HDR_BaseRecSeqNo = Dec(_SwapEndian($HDR_BaseRecSeqNo),2) $HDR_NextAttribID = StringMid($MFTEntry, 81, 4) $HDR_NextAttribID = "0x"&_SwapEndian($HDR_NextAttribID) If $VerboseOn Then _DumpOutput("_ParserCodeOldVersion()" & @CRLF) _DumpOutput("$HDR_LSN: " & $HDR_LSN & @CRLF) _DumpOutput("$HDR_SequenceNo: " & $HDR_SequenceNo & @CRLF) _DumpOutput("$HDR_HardLinkCount: " & $HDR_HardLinkCount & @CRLF) _DumpOutput("$HDR_Flags: " & $HDR_Flags & @CRLF) _DumpOutput("$RecordActive: " & $RecordActive & @CRLF) _DumpOutput("$HDR_RecRealSize: " & $HDR_RecRealSize & @CRLF) _DumpOutput("$HDR_RecAllocSize: " & $HDR_RecAllocSize & @CRLF) _DumpOutput("$HDR_BaseRecord: " & $HDR_BaseRecord & @CRLF) _DumpOutput("$HDR_BaseRecSeqNo: " & $HDR_BaseRecSeqNo & @CRLF) _DumpOutput("$HDR_NextAttribID: " & $HDR_NextAttribID & @CRLF) EndIf If $UpdSeqArrOffset = 48 Then $HDR_MFTREcordNumber = StringMid($MFTEntry, 89, 8) $HDR_MFTREcordNumber = Dec(_SwapEndian($HDR_MFTREcordNumber),2) If $HDR_MFTREcordNumber <> $PredictedRefNumber And $redo_length > 24 And $undo_operation <> "CompensationlogRecord" Then _DumpOutput("Error with LSN " & $this_lsn & ". Predicted Reference number: " & $PredictedRefNumber & " do not match Reference found in $MFT: " & $HDR_MFTREcordNumber & ". SectorsPerCluster (" & $SectorsPerCluster & ") or MFT Record size configuration (" & $MFT_Record_Size & ") might be incorrect." & @CRLF) If $CommandlineMode Then Exit(2) If MsgBox(4,"Error with LSN " & $this_lsn,"Predicted Reference number: " & $PredictedRefNumber & " do not match Reference found in $MFT: " & $HDR_MFTREcordNumber & ". Are you sure your SectorsPerCluster (" & $SectorsPerCluster & ") or MFT Record size configuration (" & $MFT_Record_Size & ") is correct?") = 7 Then Exit EndIf Else $HDR_MFTREcordNumber = "NT style" EndIf If $VerboseOn Then _DumpOutput("$HDR_MFTREcordNumber: " & $HDR_MFTREcordNumber & @CRLF) EndIf $NextAttributeOffset = (Dec(StringMid($MFTEntry, 41, 2)) * 2)+1 ; ConsoleWrite("$NextAttributeOffset: " & $NextAttributeOffset & @CRLF) $AttributeType = StringMid($MFTEntry, $NextAttributeOffset, 8) ; ConsoleWrite("$AttributeType: " & $AttributeType & @CRLF) $AttributeSize = StringMid($MFTEntry, $NextAttributeOffset + 8, 8) $AttributeSize = Dec(_SwapEndian($AttributeSize),2) ; ConsoleWrite("$AttributeSize: " & $AttributeSize & @CRLF) $AttributeKnown = 1 While $AttributeKnown = 1 $NextAttributeType = StringMid($MFTEntry, $NextAttributeOffset, 8) $AttributeType = $NextAttributeType $AttributeSize = StringMid($MFTEntry, $NextAttributeOffset + 8, 8) $AttributeSize = Dec(_SwapEndian($AttributeSize),2) Select Case $AttributeType = $STANDARD_INFORMATION $AttributeKnown = 1 $AttributeArray[1][1] += 1 ; _Get_StandardInformation($MFTEntry, $NextAttributeOffset, $AttributeSize) _Get_StandardInformation(StringMid($MFTEntry,1,($NextAttributeOffset+($AttributeSize*2))-1), $NextAttributeOffset, $AttributeSize) $TestAttributeString &= '$STANDARD_INFORMATION?'&($NextAttributeOffset-1)/2&',' If $AttributeSize-24 <> 72 Then $TextInformation &= ";Non-standard size of $STANDARD_INFORMATION" Case $AttributeType = $ATTRIBUTE_LIST $AttributeKnown = 1 $AttributeArray[2][1] += 1 $TestAttributeString &= '$ATTRIBUTE_LIST?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $FILE_NAME $AttributeKnown = 1 $AttributeArray[3][1] += 1 _Get_FileName($MFTEntry, $NextAttributeOffset, $AttributeArray[3][1]) $TestAttributeString &= '$FILE_NAME?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $OBJECT_ID $AttributeKnown = 1 $AttributeArray[4][1] += 1 _Get_ObjectID($MFTEntry, $NextAttributeOffset, $AttributeSize, 1) $TestAttributeString &= '$OBJECT_ID?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $SECURITY_DESCRIPTOR $AttributeKnown = 1 $AttributeArray[5][1] += 1 $CoreAttr = _GetAttributeEntry(StringMid($MFTEntry,$NextAttributeOffset,$AttributeSize*2)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] ; ConsoleWrite("$SECURITY_DESCRIPTOR:" & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$CoreAttrChunk) & @CRLF) If $CoreAttrChunk <> "" Then _DecodeSecurityDescriptorAttribute($CoreAttrChunk) ;Write information to csv _WriteCsvSecureSDS(1) ;Make sure all global variables for csv are cleared _ClearVarSecureSDS() EndIf ; $TextInformation &= ";See LogFile_SecurityDescriptors.csv" ; $AttributeString = "$SECURITY_DESCRIPTOR" $TestAttributeString &= '$SECURITY_DESCRIPTOR?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $VOLUME_NAME $AttributeKnown = 1 $AttributeArray[6][1] += 1 _Get_VolumeName($MFTEntry, $NextAttributeOffset, $AttributeSize) $TestAttributeString &= '$VOLUME_NAME?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $VOLUME_INFORMATION $AttributeKnown = 1 $AttributeArray[7][1] += 1 _Get_VolumeInformation($MFTEntry, $NextAttributeOffset) $TestAttributeString &= '$VOLUME_INFORMATION?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $DATA $AttributeKnown = 1 $AttributeArray[8][1] += 1 $CoreAttr = _GetAttributeEntry(StringMid($MFTEntry,$NextAttributeOffset,$AttributeSize*2)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] _Get_Data($MFTEntry, $NextAttributeOffset, $AttributeArray[8][1],$IsRedo) $TestAttributeString &= '$DATA?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $INDEX_ROOT $AttributeKnown = 1 $AttributeArray[9][1] += 1 $CoreAttr = _GetAttributeEntry(StringMid($MFTEntry,$NextAttributeOffset,$AttributeSize*2)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] If $CoreAttrChunk <> "" Then If $CoreAttrName = "$I30" Then _Get_IndexRoot($CoreAttrChunk,$IsRedo) EndIf $TestAttributeString &= '$INDEX_ROOT?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $INDEX_ALLOCATION $AttributeKnown = 1 $AttributeArray[10][1] += 1 $TestAttributeString &= '$INDEX_ALLOCATION?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $BITMAP $AttributeKnown = 1 $AttributeArray[11][1] += 1 $CoreAttr = _GetAttributeEntry(StringMid($MFTEntry,$NextAttributeOffset,$AttributeSize*2)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $TestAttributeString &= '$BITMAP?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $REPARSE_POINT $AttributeKnown = 1 $AttributeArray[12][1] += 1 $CoreAttr = _GetAttributeEntry(StringMid($MFTEntry,$NextAttributeOffset,$AttributeSize*2)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] If $CoreAttrChunk <> "" Then _Get_ReparsePoint($CoreAttrChunk) EndIf $TestAttributeString &= '$REPARSE_POINT?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $EA_INFORMATION $AttributeKnown = 1 $AttributeArray[13][1] += 1 $CoreAttr = _GetAttributeEntry(StringMid($MFTEntry,$NextAttributeOffset,$AttributeSize*2)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] If $CoreAttrChunk <> "" Then _Get_EaInformation($CoreAttrChunk) EndIf $TestAttributeString &= '$EA_INFORMATION?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $EA $AttributeKnown = 1 $AttributeArray[14][1] += 1 $CoreAttr = _GetAttributeEntry(StringMid($MFTEntry,$NextAttributeOffset,$AttributeSize*2)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] If $CoreAttrChunk <> "" Then _Get_Ea($CoreAttrChunk) EndIf $TestAttributeString &= '$EA?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $PROPERTY_SET $AttributeKnown = 1 $AttributeArray[15][1] += 1 $CoreAttr = _GetAttributeEntry(StringMid($MFTEntry,$NextAttributeOffset,$AttributeSize*2)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $TestAttributeString &= '$PROPERTY_SET?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $LOGGED_UTILITY_STREAM $AttributeKnown = 1 $AttributeArray[16][1] += 1 $CoreAttr = _GetAttributeEntry(StringMid($MFTEntry,$NextAttributeOffset,$AttributeSize*2)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] If $CoreAttrChunk <> "" Then _Get_LoggedUtilityStream($CoreAttrChunk,$CoreAttrName) EndIf $TestAttributeString &= '$LOGGED_UTILITY_STREAM?'&($NextAttributeOffset-1)/2&',' Case $AttributeType = $ATTRIBUTE_END_MARKER $AttributeKnown = 0 ; ConsoleWrite("No more attributes in this record." & @CRLF) Case Else $AttributeKnown = 0 ; ConsoleWrite("Unknown attribute found in this record." & @CRLF) EndSelect $NextAttributeOffset = $NextAttributeOffset + ($AttributeSize * 2) WEnd For $CurrentAttribute = 1 To UBound($AttributeArray)-1 If $AttributeArray[$CurrentAttribute][1] <> "" Then $AttributeString &= $AttributeArray[$CurrentAttribute][0]&"("&$AttributeArray[$CurrentAttribute][1]&")+" Next If $AttributeString <> "" Then $AttributeString = StringTrimRight($AttributeString,1) _WriteOut_MFTrecord($MFTEntry) If $IsRedo Then _UpdateSeveralOffsetOfAttribute($HDR_MFTREcordNumber, $TestAttributeString) EndIf EndFunc Func _Get_StandardInformation($MFTEntry, $SI_Offset, $SI_Size) Local $SI_HEADER_Flags, $SI_CTime_tmp, $SI_ATime_tmp, $SI_MTime_tmp, $SI_RTime_tmp ; Local $SI_CTime_Core,$SI_CTime_Precision,$SI_ATime_Core,$SI_ATime_Precision,$SI_MTime_Core,$SI_MTime_Precision,$SI_RTime_Core,$SI_RTime_Precision $SI_HEADER_Flags = StringMid($MFTEntry, $SI_Offset + 24, 4) $SI_HEADER_Flags = _SwapEndian($SI_HEADER_Flags) $SI_HEADER_Flags = _AttribHeaderFlags("0x" & $SI_HEADER_Flags) ; $SI_CTime = StringMid($MFTEntry, $SI_Offset + 48, 16) $SI_CTime = _SwapEndian($SI_CTime) $SI_CTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_CTime) $SI_CTime = _WinTime_UTCFileTimeFormat(Dec($SI_CTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_CTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_CTime_Core = StringMid($SI_CTime,1,StringLen($SI_CTime)-4) $SI_CTime_Precision = StringRight($SI_CTime,3) ElseIf $TimestampPrecision = 3 Then $SI_CTime = $SI_CTime & $PrecisionSeparator2 & _FillZero(StringRight($SI_CTime_tmp, 4)) $SI_CTime_Core = StringMid($SI_CTime,1,StringLen($SI_CTime)-9) $SI_CTime_Precision = StringRight($SI_CTime,8) Else $SI_CTime_Core = $SI_CTime EndIf ; $SI_ATime = StringMid($MFTEntry, $SI_Offset + 64, 16) $SI_ATime = _SwapEndian($SI_ATime) $SI_ATime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_ATime) $SI_ATime = _WinTime_UTCFileTimeFormat(Dec($SI_ATime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_ATime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_ATime_Core = StringMid($SI_ATime,1,StringLen($SI_ATime)-4) $SI_ATime_Precision = StringRight($SI_ATime,3) ElseIf $TimestampPrecision = 3 Then $SI_ATime = $SI_ATime & $PrecisionSeparator2 & _FillZero(StringRight($SI_ATime_tmp, 4)) $SI_ATime_Core = StringMid($SI_ATime,1,StringLen($SI_ATime)-9) $SI_ATime_Precision = StringRight($SI_ATime,8) Else $SI_ATime_Core = $SI_ATime EndIf ; $SI_MTime = StringMid($MFTEntry, $SI_Offset + 80, 16) $SI_MTime = _SwapEndian($SI_MTime) $SI_MTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_MTime) $SI_MTime = _WinTime_UTCFileTimeFormat(Dec($SI_MTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_MTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_MTime_Core = StringMid($SI_MTime,1,StringLen($SI_MTime)-4) $SI_MTime_Precision = StringRight($SI_MTime,3) ElseIf $TimestampPrecision = 3 Then $SI_MTime = $SI_MTime & $PrecisionSeparator2 & _FillZero(StringRight($SI_MTime_tmp, 4)) $SI_MTime_Core = StringMid($SI_MTime,1,StringLen($SI_MTime)-9) $SI_MTime_Precision = StringRight($SI_MTime,8) Else $SI_MTime_Core = $SI_MTime EndIf ; $SI_RTime = StringMid($MFTEntry, $SI_Offset + 96, 16) $SI_RTime = _SwapEndian($SI_RTime) $SI_RTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_RTime) $SI_RTime = _WinTime_UTCFileTimeFormat(Dec($SI_RTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_RTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_RTime_Core = StringMid($SI_RTime,1,StringLen($SI_RTime)-4) $SI_RTime_Precision = StringRight($SI_RTime,3) ElseIf $TimestampPrecision = 3 Then $SI_RTime = $SI_RTime & $PrecisionSeparator2 & _FillZero(StringRight($SI_RTime_tmp, 4)) $SI_RTime_Core = StringMid($SI_RTime,1,StringLen($SI_RTime)-9) $SI_RTime_Precision = StringRight($SI_RTime,8) Else $SI_RTime_Core = $SI_RTime EndIf ; $SI_FilePermission = StringMid($MFTEntry, $SI_Offset + 112, 8) $SI_FilePermission = _SwapEndian($SI_FilePermission) $SI_FilePermission = _File_Attributes("0x" & $SI_FilePermission) $SI_MaxVersions = StringMid($MFTEntry, $SI_Offset + 120, 8) $SI_MaxVersions = Dec(_SwapEndian($SI_MaxVersions),2) $SI_VersionNumber = StringMid($MFTEntry, $SI_Offset + 128, 8) $SI_VersionNumber = Dec(_SwapEndian($SI_VersionNumber),2) $SI_ClassID = StringMid($MFTEntry, $SI_Offset + 136, 8) $SI_ClassID = Dec(_SwapEndian($SI_ClassID),2) $SI_OwnerID = StringMid($MFTEntry, $SI_Offset + 144, 8) $SI_OwnerID = Dec(_SwapEndian($SI_OwnerID),2) $SI_SecurityID = StringMid($MFTEntry, $SI_Offset + 152, 8) $SI_SecurityID = Dec(_SwapEndian($SI_SecurityID),2) $SI_QuotaCharged = StringMid($MFTEntry, $SI_Offset + 160, 16) $SI_QuotaCharged = Dec(_SwapEndian($SI_QuotaCharged),2) $SI_USN = StringMid($MFTEntry, $SI_Offset + 176, 16) $SI_USN = Dec(_SwapEndian($SI_USN),2) If $redo_operation="InitializeFileRecordSegment" Then $CurrentTimestamp = $SI_MTime ; $SI_RTime,$SI_MTime ; If $undo_operation_hex="0200" Then $CurrentTimestamp = $SI_MTime ; $SI_RTime,$SI_MTime ;Not needed If $VerboseOn Then _DumpOutput("_Get_StandardInformation()" & @CRLF) _DumpOutput("$SI_Offset: 0x" & Hex(Int(($SI_Offset-1)/2),4) & @CRLF) _DumpOutput("$SI_Size: 0x" & Hex(Int($SI_Size),4) & @CRLF) _DumpOutput(_HexEncode("0x"&$MFTEntry) & @CRLF) _DumpOutput("$SI_HEADER_Flags: " & $SI_HEADER_Flags & @CRLF) _DumpOutput("$SI_HEADER_Flags: " & $SI_HEADER_Flags & @CRLF) _DumpOutput("$SI_CTime: " & $SI_CTime & @CRLF) _DumpOutput("$SI_ATime: " & $SI_ATime & @CRLF) _DumpOutput("$SI_MTime: " & $SI_MTime & @CRLF) _DumpOutput("$SI_RTime: " & $SI_RTime & @CRLF) _DumpOutput("$SI_FilePermission: " & $SI_FilePermission & @CRLF) _DumpOutput("$SI_MaxVersions: " & $SI_MaxVersions & @CRLF) _DumpOutput("$SI_VersionNumber: " & $SI_VersionNumber & @CRLF) _DumpOutput("$SI_ClassID: " & $SI_ClassID & @CRLF) _DumpOutput("$SI_OwnerID: " & $SI_OwnerID & @CRLF) _DumpOutput("$SI_SecurityID: " & $SI_SecurityID & @CRLF) _DumpOutput("$SI_QuotaCharged: " & $SI_QuotaCharged & @CRLF) _DumpOutput("$SI_USN: " & $SI_USN & @CRLF) EndIf EndFunc ;==>_Get_StandardInformation Func _AttribHeaderFlags($AHinput) Local $AHoutput = "" If BitAND($AHinput, 0x0001) Then $AHoutput &= 'COMPRESSED+' If BitAND($AHinput, 0x4000) Then $AHoutput &= 'ENCRYPTED+' If BitAND($AHinput, 0x8000) Then $AHoutput &= 'SPARSE+' $AHoutput = StringTrimRight($AHoutput, 1) Return $AHoutput EndFunc ;==>_AttribHeaderFlags Func _FillZero($inp) Local $inplen, $out, $tmp = "" $inplen = StringLen($inp) For $i = 1 To 4 - $inplen $tmp &= "0" Next $out = $tmp & $inp Return $out EndFunc ;==>_FillZero ; start: by Ascend4nt ----------------------------- Func _WinTime_GetUTCToLocalFileTimeDelta() Local $iUTCFileTime=864000000000 ; exactly 24 hours from the origin (although 12 hours would be more appropriate (max variance = 12)) $iLocalFileTime=_WinTime_UTCFileTimeToLocalFileTime($iUTCFileTime) If @error Then Return SetError(@error,@extended,-1) Return $iLocalFileTime-$iUTCFileTime ; /36000000000 = # hours delta (effectively giving the offset in hours from UTC/GMT) EndFunc Func _WinTime_UTCFileTimeToLocalFileTime($iUTCFileTime) If $iUTCFileTime<0 Then Return SetError(1,0,-1) Local $aRet=DllCall($_COMMON_KERNEL32DLL,"bool","FileTimeToLocalFileTime","uint64*",$iUTCFileTime,"uint64*",0) If @error Then Return SetError(2,@error,-1) If Not $aRet[0] Then Return SetError(3,0,-1) Return $aRet[2] EndFunc Func _WinTime_UTCFileTimeFormat($iUTCFileTime,$iFormat=4,$iPrecision=0,$bAMPMConversion=False) ;~ If $iUTCFileTime<0 Then Return SetError(1,0,"") ; checked in below call ; First convert file time (UTC-based file time) to 'local file time' Local $iLocalFileTime=_WinTime_UTCFileTimeToLocalFileTime($iUTCFileTime) If @error Then Return SetError(@error,@extended,"") ; Rare occassion: a filetime near the origin (January 1, 1601!!) is used, ; causing a negative result (for some timezones). Return as invalid param. If $iLocalFileTime<0 Then Return SetError(1,0,"") ; Then convert file time to a system time array & format & return it Local $vReturn=_WinTime_LocalFileTimeFormat($iLocalFileTime,$iFormat,$iPrecision,$bAMPMConversion) Return SetError(@error,@extended,$vReturn) EndFunc Func _WinTime_LocalFileTimeFormat($iLocalFileTime,$iFormat=4,$iPrecision=0,$bAMPMConversion=False) ;~ If $iLocalFileTime<0 Then Return SetError(1,0,"") ; checked in below call ; Convert file time to a system time array & return result Local $aSysTime=_WinTime_LocalFileTimeToSystemTime($iLocalFileTime) If @error Then Return SetError(@error,@extended,"") ; Return only the SystemTime array? If $iFormat=0 Then Return $aSysTime Local $vReturn=_WinTime_FormatTime($aSysTime[0],$aSysTime[1],$aSysTime[2],$aSysTime[3], _ $aSysTime[4],$aSysTime[5],$aSysTime[6],$aSysTime[7],$iFormat,$iPrecision,$bAMPMConversion) Return SetError(@error,@extended,$vReturn) EndFunc Func _WinTime_LocalFileTimeToSystemTime($iLocalFileTime) Local $aRet,$stSysTime,$aSysTime[8]=[-1,-1,-1,-1,-1,-1,-1,-1] ; Negative values unacceptable If $iLocalFileTime<0 Then Return SetError(1,0,$aSysTime) ; SYSTEMTIME structure [Year,Month,DayOfWeek,Day,Hour,Min,Sec,Milliseconds] $stSysTime=DllStructCreate("ushort[8]") $aRet=DllCall($_COMMON_KERNEL32DLL,"bool","FileTimeToSystemTime","uint64*",$iLocalFileTime,"ptr",DllStructGetPtr($stSysTime)) If @error Then Return SetError(2,@error,$aSysTime) If Not $aRet[0] Then Return SetError(3,0,$aSysTime) Dim $aSysTime[8]=[DllStructGetData($stSysTime,1,1),DllStructGetData($stSysTime,1,2),DllStructGetData($stSysTime,1,4),DllStructGetData($stSysTime,1,5), _ DllStructGetData($stSysTime,1,6),DllStructGetData($stSysTime,1,7),DllStructGetData($stSysTime,1,8),DllStructGetData($stSysTime,1,3)] Return $aSysTime EndFunc Func _WinTime_FormatTime($iYear,$iMonth,$iDay,$iHour,$iMin,$iSec,$iMilSec,$iDayOfWeek,$iFormat=4,$iPrecision=0,$bAMPMConversion=False) Local Static $_WT_aMonths[12]=["January","February","March","April","May","June","July","August","September","October","November","December"] Local Static $_WT_aDays[7]=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"] If Not $iFormat Or $iMonth<1 Or $iMonth>12 Or $iDayOfWeek>6 Then Return SetError(1,0,"") ; Pad MM,DD,HH,MM,SS,MSMSMSMS as necessary Local $sMM=StringRight(0&$iMonth,2),$sDD=StringRight(0&$iDay,2),$sMin=StringRight(0&$iMin,2) ; $sYY = $iYear ; (no padding) ; [technically Year can be 1-x chars - but this is generally used for 4-digit years. And SystemTime only goes up to 30827/30828] Local $sHH,$sSS,$sMS,$sAMPM ; 'Extra precision 1': +SS (Seconds) If $iPrecision Then $sSS=StringRight(0&$iSec,2) ; 'Extra precision 2': +MSMSMSMS (Milliseconds) If $iPrecision>1 Then ; $sMS=StringRight('000'&$iMilSec,4) $sMS=StringRight('000'&$iMilSec,3);Fixed an erronous 0 in front of the milliseconds Else $sMS="" EndIf Else $sSS="" $sMS="" EndIf If $bAMPMConversion Then If $iHour>11 Then $sAMPM=" PM" ; 12 PM will cause 12-12 to equal 0, so avoid the calculation: If $iHour=12 Then $sHH="12" Else $sHH=StringRight(0&($iHour-12),2) EndIf Else $sAMPM=" AM" If $iHour Then $sHH=StringRight(0&$iHour,2) Else ; 00 military = 12 AM $sHH="12" EndIf EndIf Else $sAMPM="" $sHH=StringRight(0 & $iHour,2) EndIf Local $sDateTimeStr,$aReturnArray[3] ; Return an array? [formatted string + "Month" + "DayOfWeek"] If BitAND($iFormat,0x10) Then $aReturnArray[1]=$_WT_aMonths[$iMonth-1] If $iDayOfWeek>=0 Then $aReturnArray[2]=$_WT_aDays[$iDayOfWeek] Else $aReturnArray[2]="" EndIf ; Strip the 'array' bit off (array[1] will now indicate if an array is to be returned) $iFormat=BitAND($iFormat,0xF) Else ; Signal to below that the array isn't to be returned $aReturnArray[1]="" EndIf ; Prefix with "DayOfWeek "? If BitAND($iFormat,8) Then If $iDayOfWeek<0 Then Return SetError(1,0,"") ; invalid $sDateTimeStr=$_WT_aDays[$iDayOfWeek]&', ' ; Strip the 'DayOfWeek' bit off $iFormat=BitAND($iFormat,0x7) Else $sDateTimeStr="" EndIf If $iFormat<2 Then ; Basic String format: YYYYMMDDHHMM[SS[MSMSMSMS[ AM/PM]]] $sDateTimeStr&=$iYear&$sMM&$sDD&$sHH&$sMin&$sSS&$sMS&$sAMPM Else ; one of 4 formats which ends with " HH:MM[:SS[:MSMSMSMS[ AM/PM]]]" Switch $iFormat ; /, : Format - MM/DD/YYYY Case 2 $sDateTimeStr&=$sMM&'/'&$sDD&'/' ; /, : alt. Format - DD/MM/YYYY Case 3 $sDateTimeStr&=$sDD&'/'&$sMM&'/' ; "Month DD, YYYY" format Case 4 $sDateTimeStr&=$_WT_aMonths[$iMonth-1]&' '&$sDD&', ' ; "DD Month YYYY" format Case 5 $sDateTimeStr&=$sDD&' '&$_WT_aMonths[$iMonth-1]&' ' Case 6 $sDateTimeStr&=$iYear&'-'&$sMM&'-'&$sDD $iYear='' Case Else Return SetError(1,0,"") EndSwitch $sDateTimeStr&=$iYear&' '&$sHH&':'&$sMin If $iPrecision Then $sDateTimeStr&=':'&$sSS ; If $iPrecision>1 Then $sDateTimeStr&=':'&$sMS If $iPrecision>1 Then $sDateTimeStr&=$PrecisionSeparator&$sMS EndIf $sDateTimeStr&=$sAMPM EndIf If $aReturnArray[1]<>"" Then $aReturnArray[0]=$sDateTimeStr Return $aReturnArray EndIf Return $sDateTimeStr EndFunc ; end: by Ascend4nt ---------------------------- Func _Get_ObjectID($MFTEntry,$OBJECTID_Offset,$OBJECTID_Size,$IsRedo) ;FILE_OBJECTID_BUFFER structure ;https://msdn.microsoft.com/en-us/library/aa364393(v=vs.85).aspx Local $GUID_ObjectID,$GUID_ObjectID_Version,$GUID_ObjectID_Timestamp,$GUID_ObjectID_TimestampDec,$GUID_ObjectID_ClockSeq,$GUID_ObjectID_Node Local $GUID_BirthVolumeID,$GUID_BirthVolumeID_Version,$GUID_BirthVolumeID_Timestamp,$GUID_BirthVolumeID_TimestampDec,$GUID_BirthVolumeID_ClockSeq,$GUID_BirthVolumeID_Node Local $GUID_BirthObjectID,$GUID_BirthObjectID_Version,$GUID_BirthObjectID_Timestamp,$GUID_BirthObjectID_TimestampDec,$GUID_BirthObjectID_ClockSeq,$GUID_BirthObjectID_Node Local $GUID_DomainID,$GUID_DomainID_Version,$GUID_DomainID_Timestamp,$GUID_DomainID_TimestampDec,$GUID_DomainID_ClockSeq,$GUID_DomainID_Node $OBJECTID_Size = $OBJECTID_Size/2 ;ObjectID $GUID_ObjectID = StringMid($MFTEntry,$OBJECTID_Offset+48,32) ;Decode guid $GUID_ObjectID_Version = Dec(StringMid($GUID_ObjectID,15,1)) $GUID_ObjectID_Timestamp = StringMid($GUID_ObjectID,1,14) & "0" & StringMid($GUID_ObjectID,16,1) $GUID_ObjectID_TimestampDec = Dec(_SwapEndian($GUID_ObjectID_Timestamp),2) $GUID_ObjectID_Timestamp = _DecodeTimestampFromGuid($GUID_ObjectID_Timestamp) $GUID_ObjectID_ClockSeq = StringMid($GUID_ObjectID,17,4) $GUID_ObjectID_ClockSeq = Dec($GUID_ObjectID_ClockSeq) $GUID_ObjectID_Node = StringMid($GUID_ObjectID,21,12) $GUID_ObjectID_Node = _DecodeMacFromGuid($GUID_ObjectID_Node) $GUID_ObjectID = _HexToGuidStr($GUID_ObjectID,1) Select Case $OBJECTID_Size - 24 = 16 $GUID_BirthVolumeID = "NOT PRESENT" $GUID_BirthObjectID = "NOT PRESENT" $GUID_DomainID = "NOT PRESENT" Case $OBJECTID_Size - 24 = 32 $GUID_BirthVolumeID = StringMid($MFTEntry,$OBJECTID_Offset+80,32) ;Decode guid $GUID_BirthVolumeID_Version = Dec(StringMid($GUID_BirthVolumeID,15,1)) $GUID_BirthVolumeID_Timestamp = StringMid($GUID_BirthVolumeID,1,14) & "0" & StringMid($GUID_BirthVolumeID,16,1) $GUID_BirthVolumeID_TimestampDec = Dec(_SwapEndian($GUID_BirthVolumeID_Timestamp),2) $GUID_BirthVolumeID_Timestamp = _DecodeTimestampFromGuid($GUID_BirthVolumeID_Timestamp) $GUID_BirthVolumeID_ClockSeq = StringMid($GUID_BirthVolumeID,17,4) $GUID_BirthVolumeID_ClockSeq = Dec($GUID_BirthVolumeID_ClockSeq) $GUID_BirthVolumeID_Node = StringMid($GUID_BirthVolumeID,21,12) $GUID_BirthVolumeID_Node = _DecodeMacFromGuid($GUID_BirthVolumeID_Node) $GUID_BirthVolumeID = _HexToGuidStr($GUID_BirthVolumeID,1) $GUID_BirthObjectID = "NOT PRESENT" $GUID_DomainID = "NOT PRESENT" Case $OBJECTID_Size - 24 = 48 ;BirthVolumeID $GUID_BirthVolumeID = StringMid($MFTEntry,$OBJECTID_Offset+80,32) ;Decode guid $GUID_BirthVolumeID_Version = Dec(StringMid($GUID_BirthVolumeID,15,1)) $GUID_BirthVolumeID_Timestamp = StringMid($GUID_BirthVolumeID,1,14) & "0" & StringMid($GUID_BirthVolumeID,16,1) $GUID_BirthVolumeID_TimestampDec = Dec(_SwapEndian($GUID_BirthVolumeID_Timestamp),2) $GUID_BirthVolumeID_Timestamp = _DecodeTimestampFromGuid($GUID_BirthVolumeID_Timestamp) $GUID_BirthVolumeID_ClockSeq = StringMid($GUID_BirthVolumeID,17,4) $GUID_BirthVolumeID_ClockSeq = Dec($GUID_BirthVolumeID_ClockSeq) $GUID_BirthVolumeID_Node = StringMid($GUID_BirthVolumeID,21,12) $GUID_BirthVolumeID_Node = _DecodeMacFromGuid($GUID_BirthVolumeID_Node) $GUID_BirthVolumeID = _HexToGuidStr($GUID_BirthVolumeID,1) ;BirthObjectID $GUID_BirthObjectID = StringMid($MFTEntry,$OBJECTID_Offset+112,32) ;Decode guid $GUID_BirthObjectID_Version = Dec(StringMid($GUID_BirthObjectID,15,1)) $GUID_BirthObjectID_Timestamp = StringMid($GUID_BirthObjectID,1,14) & "0" & StringMid($GUID_BirthObjectID,16,1) $GUID_BirthObjectID_TimestampDec = Dec(_SwapEndian($GUID_BirthObjectID_Timestamp),2) $GUID_BirthObjectID_Timestamp = _DecodeTimestampFromGuid($GUID_BirthObjectID_Timestamp) $GUID_BirthObjectID_ClockSeq = StringMid($GUID_BirthObjectID,17,4) $GUID_BirthObjectID_ClockSeq = Dec($GUID_BirthObjectID_ClockSeq) $GUID_BirthObjectID_Node = StringMid($GUID_BirthObjectID,21,12) $GUID_BirthObjectID_Node = _DecodeMacFromGuid($GUID_BirthObjectID_Node) $GUID_BirthObjectID = _HexToGuidStr($GUID_BirthObjectID,1) $GUID_DomainID = "NOT PRESENT" Case $OBJECTID_Size - 24 = 64 ;BirthVolumeID $GUID_BirthVolumeID = StringMid($MFTEntry,$OBJECTID_Offset+80,32) ;Decode guid $GUID_BirthVolumeID_Version = Dec(StringMid($GUID_BirthVolumeID,15,1)) $GUID_BirthVolumeID_Timestamp = StringMid($GUID_BirthVolumeID,1,14) & "0" & StringMid($GUID_BirthVolumeID,16,1) $GUID_BirthVolumeID_TimestampDec = Dec(_SwapEndian($GUID_BirthVolumeID_Timestamp),2) $GUID_BirthVolumeID_Timestamp = _DecodeTimestampFromGuid($GUID_BirthVolumeID_Timestamp) $GUID_BirthVolumeID_ClockSeq = StringMid($GUID_BirthVolumeID,17,4) $GUID_BirthVolumeID_ClockSeq = Dec($GUID_BirthVolumeID_ClockSeq) $GUID_BirthVolumeID_Node = StringMid($GUID_BirthVolumeID,21,12) $GUID_BirthVolumeID_Node = _DecodeMacFromGuid($GUID_BirthVolumeID_Node) $GUID_BirthVolumeID = _HexToGuidStr($GUID_BirthVolumeID,1) ;BirthObjectID $GUID_BirthObjectID = StringMid($MFTEntry,$OBJECTID_Offset+112,32) ;Decode guid $GUID_BirthObjectID_Version = Dec(StringMid($GUID_BirthObjectID,15,1)) $GUID_BirthObjectID_Timestamp = StringMid($GUID_BirthObjectID,1,14) & "0" & StringMid($GUID_BirthObjectID,16,1) $GUID_BirthObjectID_TimestampDec = Dec(_SwapEndian($GUID_BirthObjectID_Timestamp),2) $GUID_BirthObjectID_Timestamp = _DecodeTimestampFromGuid($GUID_BirthObjectID_Timestamp) $GUID_BirthObjectID_ClockSeq = StringMid($GUID_BirthObjectID,17,4) $GUID_BirthObjectID_ClockSeq = Dec($GUID_BirthObjectID_ClockSeq) $GUID_BirthObjectID_Node = StringMid($GUID_BirthObjectID,21,12) $GUID_BirthObjectID_Node = _DecodeMacFromGuid($GUID_BirthObjectID_Node) $GUID_BirthObjectID = _HexToGuidStr($GUID_BirthObjectID,1) ;DomainID $GUID_DomainID = StringMid($MFTEntry,$OBJECTID_Offset+144,32) ;Decode guid $GUID_DomainID_Version = Dec(StringMid($GUID_DomainID,15,1)) $GUID_DomainID_Timestamp = StringMid($GUID_DomainID,1,14) & "0" & StringMid($GUID_DomainID,16,1) $GUID_DomainID_TimestampDec = Dec(_SwapEndian($GUID_DomainID_Timestamp),2) $GUID_DomainID_Timestamp = _DecodeTimestampFromGuid($GUID_DomainID_Timestamp) $GUID_DomainID_ClockSeq = StringMid($GUID_DomainID,17,4) $GUID_DomainID_ClockSeq = Dec($GUID_DomainID_ClockSeq) $GUID_DomainID_Node = StringMid($GUID_DomainID,21,12) $GUID_DomainID_Node = _DecodeMacFromGuid($GUID_DomainID_Node) $GUID_DomainID = _HexToGuidStr($GUID_DomainID,1) Case Else ;ExtendedInfo instead of DomainId? _DumpOutput("Error: The $OBJECT_ID size (" & $OBJECTID_Size - 24 & ") was unexpected for lsn " & $this_lsn & @crlf) _DumpOutput(_HexEncode("0x"&StringMid($MFTEntry,$OBJECTID_Offset,$OBJECTID_Size*2)) & @crlf) EndSelect ;$TextInformation &= ";GUID_ObjectID="&$GUID_ObjectID&";GUID_BirthVolumeID="&$GUID_BirthVolumeID&";GUID_BirthObjectID="&$GUID_BirthObjectID&";GUID_DomainID="&$GUID_DomainID $TextInformation &= ";See LogFile_Mft_ObjectId_Entries.csv" If $VerboseOn Then _DumpOutput("### $OBJECT_ID ATTRIBUTE ###" & @CRLF) _DumpOutput("$GUID_ObjectID: " & $GUID_ObjectID & @CRLF) _DumpOutput("$GUID_ObjectID_Version: " & $GUID_ObjectID_Version & @CRLF) _DumpOutput("$GUID_ObjectID_Timestamp: " & $GUID_ObjectID_Timestamp & @CRLF) _DumpOutput("$GUID_ObjectID_TimestampDec: " & $GUID_ObjectID_TimestampDec & @CRLF) _DumpOutput("$GUID_ObjectID_ClockSeq: " & $GUID_ObjectID_ClockSeq & @CRLF) _DumpOutput("$GUID_ObjectID_Node: " & $GUID_ObjectID_Node & @CRLF) _DumpOutput("$GUID_BirthVolumeID: " & $GUID_BirthVolumeID & @CRLF) _DumpOutput("$GUID_BirthVolumeID_Version: " & $GUID_BirthVolumeID_Version & @CRLF) _DumpOutput("$GUID_BirthVolumeID_Timestamp: " & $GUID_BirthVolumeID_Timestamp & @CRLF) _DumpOutput("$GUID_BirthVolumeID_TimestampDec: " & $GUID_BirthVolumeID_TimestampDec & @CRLF) _DumpOutput("$GUID_BirthVolumeID_ClockSeq: " & $GUID_BirthVolumeID_ClockSeq & @CRLF) _DumpOutput("$GUID_BirthVolumeID_Node: " & $GUID_BirthVolumeID_Node & @CRLF) _DumpOutput("$GUID_BirthObjectID: " & $GUID_BirthObjectID & @CRLF) _DumpOutput("$GUID_BirthObjectID_Version: " & $GUID_BirthObjectID_Version & @CRLF) _DumpOutput("$GUID_BirthObjectID_Timestamp: " & $GUID_BirthObjectID_Timestamp & @CRLF) _DumpOutput("$GUID_BirthObjectID_TimestampDec: " & $GUID_BirthObjectID_TimestampDec & @CRLF) _DumpOutput("$GUID_BirthObjectID_ClockSeq: " & $GUID_BirthObjectID_ClockSeq & @CRLF) _DumpOutput("$GUID_BirthObjectID_Node: " & $GUID_BirthObjectID_Node & @CRLF) _DumpOutput("$GUID_DomainID: " & $GUID_DomainID & @CRLF) _DumpOutput("$GUID_DomainID_Version: " & $GUID_DomainID_Version & @CRLF) _DumpOutput("$GUID_DomainID_Timestamp: " & $GUID_DomainID_Timestamp & @CRLF) _DumpOutput("$GUID_DomainID_TimestampDec: " & $GUID_DomainID_TimestampDec & @CRLF) _DumpOutput("$GUID_DomainID_ClockSeq: " & $GUID_DomainID_ClockSeq & @CRLF) _DumpOutput("$GUID_DomainID_Node: " & $GUID_DomainID_Node & @CRLF) EndIf ;Write the decoded guid info to a separate file FileWriteLine($LogFileEntriesObjectIdCsvFile, $HDR_MFTREcordNumber & $de & $HDR_SequenceNo & $de & $GUID_ObjectID & $de & $GUID_ObjectID_Version & $de & $GUID_ObjectID_Timestamp & $de & $GUID_ObjectID_TimestampDec & $de & $GUID_ObjectID_ClockSeq & $de & $GUID_ObjectID_Node & $de & $GUID_BirthVolumeID & $de & $GUID_BirthVolumeID_Version & $de & $GUID_BirthVolumeID_Timestamp & $de & $GUID_BirthVolumeID_TimestampDec & $de & $GUID_BirthVolumeID_ClockSeq & $de & $GUID_BirthVolumeID_Node & $de & $GUID_BirthObjectID & $de & $GUID_BirthObjectID_Version & $de & $GUID_BirthObjectID_Timestamp & $de & $GUID_BirthObjectID_TimestampDec & $de & $GUID_BirthObjectID_ClockSeq & $de & $GUID_BirthObjectID_Node & $de & $GUID_DomainID & $de & $GUID_DomainID_Version & $de & $GUID_DomainID_Timestamp & $de & $GUID_DomainID_TimestampDec & $de & $GUID_DomainID_ClockSeq & $de & $GUID_DomainID_Node & $de & $IsRedo & @crlf) EndFunc Func _Get_VolumeName($MFTEntry, $VOLUME_NAME_Offset, $VOLUME_NAME_Size) Local $VOLUME_NAME_NAME ConsoleWrite("### $VOLUME_NAME ATTRIBUTE ###" & @CRLF) If $VOLUME_NAME_Size - 24 > 0 Then $VOLUME_NAME_NAME = StringMid($MFTEntry, $VOLUME_NAME_Offset + 48, ($VOLUME_NAME_Size - 24) * 2) ; MsgBox(0,"$VOLUME_NAME_NAME",$VOLUME_NAME_NAME) $VOLUME_NAME_NAME = BinaryToString("0x"&$VOLUME_NAME_NAME,2) $TextInformation &= ";VOLUME_NAME="&$VOLUME_NAME_NAME Return EndIf $VOLUME_NAME_NAME = "EMPTY" $TextInformation &= ";VOLUME_NAME="&$VOLUME_NAME_NAME ConsoleWrite("$VOLUME_NAME_NAME: " & $VOLUME_NAME_NAME & @CRLF) Return EndFunc ;==>_Get_VolumeName ;Func _Get_VolumeInformation($MFTEntry, $VOLUME_INFO_Offset, $VOLUME_INFO_Size) Func _Get_VolumeInformation($MFTEntry, $VOLUME_INFO_Offset) Local $VOL_INFO_NTFS_VERSION, $VOL_INFO_FLAGS $VOL_INFO_NTFS_VERSION = Dec(StringMid($MFTEntry, $VOLUME_INFO_Offset + 64, 2)) & "," & Dec(StringMid($MFTEntry, $VOLUME_INFO_Offset + 66, 2)) $VOL_INFO_FLAGS = StringMid($MFTEntry, $VOLUME_INFO_Offset + 68, 4) $VOL_INFO_FLAGS = _SwapEndian($VOL_INFO_FLAGS) $VOL_INFO_FLAGS = _VolInfoFlag("0x" & $VOL_INFO_FLAGS) If $VerboseOn Then ConsoleWrite("### $VOLUME_INOFRMATION ATTRIBUTE ###" & @CRLF) ConsoleWrite("$VOL_INFO_NTFS_VERSION: " & $VOL_INFO_NTFS_VERSION & @CRLF) ConsoleWrite("$VOL_INFO_FLAGS: " & $VOL_INFO_FLAGS & @CRLF) EndIf $TextInformation &= ";VOL_INFO_NTFS_VERSION="&$VOL_INFO_NTFS_VERSION&";VOL_INFO_FLAGS="&$VOL_INFO_FLAGS Return EndFunc ;==>_Get_VolumeInformation Func _VolInfoFlag($VIFinput) Local $VIFoutput = "" If BitAND($VIFinput, 0x0001) Then $VIFoutput &= 'Dirty+' If BitAND($VIFinput, 0x0002) Then $VIFoutput &= 'Resize_LogFile+' If BitAND($VIFinput, 0x0004) Then $VIFoutput &= 'Upgrade_On_Mount+' If BitAND($VIFinput, 0x0008) Then $VIFoutput &= 'Mounted_On_NT4+' If BitAND($VIFinput, 0x0010) Then $VIFoutput &= 'Deleted_USN_Underway+' If BitAND($VIFinput, 0x0020) Then $VIFoutput &= 'Repair_ObjectIDs+' If BitAND($VIFinput, 0x8000) Then $VIFoutput &= 'Modified_By_CHKDSK+' $VIFoutput = StringTrimRight($VIFoutput, 1) Return $VIFoutput EndFunc ;==>_VolInfoFlag ;Func _Get_FileName($MFTEntry, $FN_Offset, $FN_Size, $FN_Number) Func _Get_FileName($MFTEntry, $FN_Offset, $FN_Number) Local $FN_ParentSeqNo, $FN_CTime_tmp, $FN_ATime_tmp, $FN_MTime_tmp, $FN_RTime_tmp, $FN_NameLen ; Local $FN_CTime_Core,$FN_CTime_Precision,$FN_ATime_Core,$FN_ATime_Precision,$FN_MTime_Core,$FN_MTime_Precision,$FN_RTime_Core,$FN_RTime_Precision $FN_ParentRefNo = StringMid($MFTEntry, $FN_Offset + 48, 12) $FN_ParentRefNo = Dec(_SwapEndian($FN_ParentRefNo),2) $FN_ParentSeqNo = StringMid($MFTEntry, $FN_Offset + 60, 4) $FN_ParentSeqNo = Dec(_SwapEndian($FN_ParentSeqNo),2) ; $FN_CTime = StringMid($MFTEntry, $FN_Offset + 64, 16) $FN_CTime = _SwapEndian($FN_CTime) $FN_CTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $FN_CTime) $FN_CTime = _WinTime_UTCFileTimeFormat(Dec($FN_CTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $FN_CTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $FN_CTime_Core = StringMid($FN_CTime,1,StringLen($FN_CTime)-4) $FN_CTime_Precision = StringRight($FN_CTime,3) ElseIf $TimestampPrecision = 3 Then $FN_CTime = $FN_CTime & $PrecisionSeparator2 & _FillZero(StringRight($FN_CTime_tmp, 4)) $FN_CTime_Core = StringMid($FN_CTime,1,StringLen($FN_CTime)-9) $FN_CTime_Precision = StringRight($FN_CTime,8) Else $FN_CTime_Core = $FN_CTime EndIf ; $FN_ATime = StringMid($MFTEntry, $FN_Offset + 80, 16) $FN_ATime = _SwapEndian($FN_ATime) $FN_ATime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $FN_ATime) $FN_ATime = _WinTime_UTCFileTimeFormat(Dec($FN_ATime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $FN_ATime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $FN_ATime_Core = StringMid($FN_ATime,1,StringLen($FN_ATime)-4) $FN_ATime_Precision = StringRight($FN_ATime,3) ElseIf $TimestampPrecision = 3 Then $FN_ATime = $FN_ATime & $PrecisionSeparator2 & _FillZero(StringRight($FN_ATime_tmp, 4)) $FN_ATime_Core = StringMid($FN_ATime,1,StringLen($FN_ATime)-9) $FN_ATime_Precision = StringRight($FN_ATime,8) Else $FN_ATime_Core = $FN_ATime EndIf ; $FN_MTime = StringMid($MFTEntry, $FN_Offset + 96, 16) $FN_MTime = _SwapEndian($FN_MTime) $FN_MTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $FN_MTime) $FN_MTime = _WinTime_UTCFileTimeFormat(Dec($FN_MTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $FN_MTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $FN_MTime_Core = StringMid($FN_MTime,1,StringLen($FN_MTime)-4) $FN_MTime_Precision = StringRight($FN_MTime,3) ElseIf $TimestampPrecision = 3 Then $FN_MTime = $FN_MTime & $PrecisionSeparator2 & _FillZero(StringRight($FN_MTime_tmp, 4)) $FN_MTime_Core = StringMid($FN_MTime,1,StringLen($FN_MTime)-9) $FN_MTime_Precision = StringRight($FN_MTime,8) Else $FN_MTime_Core = $FN_MTime EndIf ; $FN_RTime = StringMid($MFTEntry, $FN_Offset + 112, 16) $FN_RTime = _SwapEndian($FN_RTime) $FN_RTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $FN_RTime) $FN_RTime = _WinTime_UTCFileTimeFormat(Dec($FN_RTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $FN_RTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $FN_RTime_Core = StringMid($FN_RTime,1,StringLen($FN_RTime)-4) $FN_RTime_Precision = StringRight($FN_RTime,3) ElseIf $TimestampPrecision = 3 Then $FN_RTime = $FN_RTime & $PrecisionSeparator2 & _FillZero(StringRight($FN_RTime_tmp, 4)) $FN_RTime_Core = StringMid($FN_RTime,1,StringLen($FN_RTime)-9) $FN_RTime_Precision = StringRight($FN_RTime,8) Else $FN_RTime_Core = $FN_RTime EndIf ; If $redo_operation="InitializeFileRecordSegment" Then $CurrentTimestamp = $FN_MTime ; $FN_RTime,$FN_MTime $FN_AllocSize = StringMid($MFTEntry, $FN_Offset + 128, 16) $FN_AllocSize = Dec(_SwapEndian($FN_AllocSize),2) $FN_RealSize = StringMid($MFTEntry, $FN_Offset + 144, 16) $FN_RealSize = Dec(_SwapEndian($FN_RealSize),2) $FN_Flags = StringMid($MFTEntry, $FN_Offset + 160, 8) $FN_Flags = _SwapEndian($FN_Flags) $FN_Flags = _File_Attributes("0x" & $FN_Flags) $FN_NameLen = StringMid($MFTEntry, $FN_Offset + 176, 2) $FN_NameLen = Dec($FN_NameLen) $FN_NameType = StringMid($MFTEntry, $FN_Offset + 178, 2) Select Case $FN_NameType = '00' $FN_NameType = 'POSIX' Case $FN_NameType = '01' $FN_NameType = 'WIN32' Case $FN_NameType = '02' $FN_NameType = 'DOS' Case $FN_NameType = '03' $FN_NameType = 'DOS+WIN32' Case $FN_NameType <> '00' And $FN_NameType <> '01' And $FN_NameType <> '02' And $FN_NameType <> '03' $FN_NameType = 'UNKNOWN' EndSelect ;$FN_NameSpace = $FN_NameLen - 1 ;Not really $FN_Name = StringMid($MFTEntry, $FN_Offset + 180, $FN_NameLen*4) $FN_Name = BinaryToString("0x"&$FN_Name,2) $FN_Name = StringReplace($FN_Name,$de,$CharReplacement) $FileNameModified = @extended If $VerboseOn Then ConsoleWrite("### $FILE_NAME ATTRIBUTE " & $FN_Number & " ###" & @CRLF) ConsoleWrite("$FN_ParentRefNo: " & $FN_ParentRefNo & @CRLF) ConsoleWrite("$FN_ParentSeqNo: " & $FN_ParentSeqNo & @CRLF) ConsoleWrite("$FN_CTime: " & $FN_CTime & @CRLF) ConsoleWrite("$FN_ATime: " & $FN_ATime & @CRLF) ConsoleWrite("$FN_MTime: " & $FN_MTime & @CRLF) ConsoleWrite("$FN_RTime: " & $FN_RTime & @CRLF) ConsoleWrite("$FN_AllocSize: " & $FN_AllocSize & @CRLF) ConsoleWrite("$FN_RealSize: " & $FN_RealSize & @CRLF) ConsoleWrite("$FN_Flags: " & $FN_Flags & @CRLF) ConsoleWrite("$FN_NameLen: " & $FN_NameLen & @CRLF) ConsoleWrite("$FN_NameType: " & $FN_NameType & @CRLF) ConsoleWrite("$FN_Name: " & $FN_Name & @CRLF) EndIf EndFunc ;Func _Get_Data($MFTEntry, $DT_Offset, $DT_Size, $DT_Number, $IsRedo) Func _Get_Data($MFTEntry, $DT_Offset, $DT_Number, $IsRedo) Local $DT_NameLength, $DT_NameRelativeOffset, $DT_VCNs, $DT_LengthOfAttribute, $DT_OffsetToAttribute, $DT_IndexedFlag $DT_NonResidentFlag = StringMid($MFTEntry, $DT_Offset + 16, 2) $DT_NameLength = Dec(StringMid($MFTEntry, $DT_Offset + 18, 2)) $DT_NameRelativeOffset = StringMid($MFTEntry, $DT_Offset + 20, 4) $DT_NameRelativeOffset = Dec(_SwapEndian($DT_NameRelativeOffset),2) $DT_Flags = StringMid($MFTEntry, $DT_Offset + 24, 4) $DT_Flags = _SwapEndian($DT_Flags) $DT_Flags = _AttribHeaderFlags("0x" & $DT_Flags) If $VerboseOn Then _DumpOutput("### $DATA ATTRIBUTE " & $DT_Number & " ###" & @CRLF) _DumpOutput("$DT_Flags: " & $DT_Flags & @CRLF) _DumpOutput("$DT_NonResidentFlag: " & $DT_NonResidentFlag & @CRLF) _DumpOutput("$DT_NameLength: " & $DT_NameLength & @CRLF) _DumpOutput("$DT_NameRelativeOffset: " & $DT_NameRelativeOffset & @CRLF) _DumpOutput("$DT_Flags: " & $DT_Flags & @CRLF) EndIf If $DT_NameLength > 0 Then ;$DT_NameSpace = $DT_NameLength - 1 $DT_Name = StringMid($MFTEntry, $DT_Offset + ($DT_NameRelativeOffset * 2), $DT_NameLength*4) $DT_Name = BinaryToString("0x"&$DT_Name,2) $DT_Name = StringReplace($DT_Name,$de,$CharReplacement) $FileNameModified = @extended If $VerboseOn Then _DumpOutput("$DT_Name: " & $DT_Name & @CRLF) EndIf If $DT_NonResidentFlag = '01' Then $DT_StartVCN = StringMid($MFTEntry, $DT_Offset + 32, 16) $DT_StartVCN = Dec(_SwapEndian($DT_StartVCN),2) $DT_LastVCN = StringMid($MFTEntry, $DT_Offset + 48, 16) $DT_LastVCN = Dec(_SwapEndian($DT_LastVCN),2) $DT_VCNs = $DT_LastVCN - $DT_StartVCN $DT_OffsetToDataRuns = StringMid($MFTEntry, $DT_Offset + 64, 4) $DT_OffsetToDataRuns = Dec(_SwapEndian($DT_OffsetToDataRuns),2) $DT_ComprUnitSize = StringMid($MFTEntry, $DT_Offset + 68, 4) $DT_ComprUnitSize = Dec(_SwapEndian($DT_ComprUnitSize),2) $DT_AllocSize = StringMid($MFTEntry, $DT_Offset + 80, 16) $DT_AllocSize = Dec(_SwapEndian($DT_AllocSize),2) $DT_RealSize = StringMid($MFTEntry, $DT_Offset + 96, 16) $DT_RealSize = Dec(_SwapEndian($DT_RealSize),2) ;$FileSizeBytes = $DT_RealSize $DT_InitStreamSize = StringMid($MFTEntry, $DT_Offset + 112, 16) $DT_InitStreamSize = Dec(_SwapEndian($DT_InitStreamSize),2) $DT_DataRuns = StringMid($MFTEntry,$DT_Offset+($DT_OffsetToDataRuns*2),(StringLen($MFTEntry)-$DT_OffsetToDataRuns)*2) If $VerboseOn Then _DumpOutput("$DT_StartVCN: " & $DT_StartVCN & @CRLF) _DumpOutput("$DT_LastVCN: " & $DT_LastVCN & @CRLF) _DumpOutput("$DT_VCNs: " & $DT_VCNs & @CRLF) _DumpOutput("$DT_OffsetToDataRuns: " & $DT_OffsetToDataRuns & @CRLF) _DumpOutput("$DT_ComprUnitSize: " & $DT_ComprUnitSize & @CRLF) _DumpOutput("$DT_AllocSize: " & $DT_AllocSize & @CRLF) _DumpOutput("$DT_InitStreamSize: " & $DT_InitStreamSize & @CRLF) _DumpOutput("$DT_DataRuns: " & $DT_DataRuns & @CRLF) EndIf ElseIf $DT_NonResidentFlag = '00' Then $DT_LengthOfAttribute = StringMid($MFTEntry, $DT_Offset + 32, 8) $DT_LengthOfAttribute = Dec(_SwapEndian($DT_LengthOfAttribute),2) $DT_AllocSize = $DT_LengthOfAttribute $DT_InitStreamSize = $DT_LengthOfAttribute $DT_RealSize = $DT_LengthOfAttribute $DT_OffsetToAttribute = StringMid($MFTEntry, $DT_Offset + 40, 4) $DT_OffsetToAttribute = Dec(_SwapEndian($DT_OffsetToAttribute),2) $DT_IndexedFlag = Dec(StringMid($MFTEntry, $DT_Offset + 44, 2)) If $VerboseOn Then _DumpOutput("$DT_LengthOfAttribute: " & $DT_LengthOfAttribute & @CRLF) _DumpOutput("$DT_OffsetToAttribute: " & $DT_OffsetToAttribute & @CRLF) _DumpOutput("$DT_IndexedFlag: " & $DT_IndexedFlag & @CRLF) EndIf EndIf If $IsRedo Then _WriteLogFileDataRunsCsv() EndIf EndFunc Func _Decode_SetNewAttributeSize($input) ;Local $TestVar $DT_AllocSize = StringMid($input, 1, 16) $DT_AllocSize = Dec(_SwapEndian($DT_AllocSize),2) $DT_RealSize = StringMid($input, 17, 16) $DT_RealSize = Dec(_SwapEndian($DT_RealSize),2) ;$FileSizeBytes = $DT_RealSize $DT_InitStreamSize = StringMid($input, 33, 16) $DT_InitStreamSize = Dec(_SwapEndian($DT_InitStreamSize),2) If BinaryLen($input)=32 Then $DT_Flags = "COMPRESSED/SPARSE?" ; $TestVar = StringMid($input, 49, 16) ; $TestVar = Dec(_SwapEndian($TestVar),2) ; If $TestVar <> 17891328 Then ; If $TestVar <> "0000110100000000" Then ; MsgBox(0,"Info","SetNewAttributeSize got an unexpected val") ; EndIf EndIf If $VerboseOn Then _DumpOutput("_Decode_SetNewAttributeSize():" & @CRLF) _DumpOutput("$DT_AllocSize = " & $DT_AllocSize & @crlf) _DumpOutput("$DT_RealSize = " & $DT_RealSize & @crlf) _DumpOutput("$DT_InitStreamSize = " & $DT_InitStreamSize & @crlf) EndIf _WriteLogFileDataRunsCsv() EndFunc Func _Decode_UpdateMappingPairs($input) ;Tightly related to the setting of new attribute size. Actually these bytes are actual data runs and their relative location is determined by $attribute_offset. If we don't have any record history, this value is likely worthless. $DT_DataRuns = StringMid($input, 1) _WriteLogFileDataRunsCsv() EndFunc Func _Decode_INDX($Entry,$IsRedo) If $VerboseOn Then _DumpOutput("_Decode_INDX():" & @CRLF) Local $NewLocalAttributeOffset ;Local $LocalAttributeOffset = 1,$IndxHdrMagic,$IndxHdrUpdateSeqArrOffset,$IndxHdrUpdateSeqArrSize,$IndxHdrLogFileSequenceNo,$IndxHdrVCNOfIndx,$IndxHdrOffsetToIndexEntries,$IndxHdrSizeOfIndexEntries,$IndxHdrAllocatedSizeOfIndexEntries ;Local $IndxHdrFlag,$IndxHdrPadding,$IndxHdrUpdateSequence,$IndxHdrUpdSeqArr,$IndxHdrUpdSeqArrPart0,$IndxHdrUpdSeqArrPart1,$IndxHdrUpdSeqArrPart2,$IndxHdrUpdSeqArrPart3,$IndxRecordEnd4,$IndxRecordEnd1,$IndxRecordEnd2,$IndxRecordEnd3,$IndxRecordEnd4 Local $IndexEntryLength,$SubNodeVCN,$tmp0=0,$tmp1=0,$tmp2=0,$tmp3=0,$EntryCounter=1,$DecodeOk=False ;Local $FileReference,$StreamLength,$Flags,$Stream,$Padding2 ;Local $Indx_CTime_Core,$Indx_CTime_Precision,$Indx_ATime_Core,$Indx_ATime_Precision,$Indx_MTime_Core,$Indx_MTime_Precision,$Indx_RTime_Core,$Indx_RTime_Precision $NewLocalAttributeOffset = 1 ;$IndxRecordSize = Dec(_SwapEndian(StringMid($Entry,$NewLocalAttributeOffset+56,8)),2) $IndxHeaderSize = Dec(_SwapEndian(StringMid($Entry,$NewLocalAttributeOffset+48,8)),2) $NewLocalAttributeOffset = $NewLocalAttributeOffset+48+($IndxHeaderSize*2) $MFTReference = StringMid($Entry,$NewLocalAttributeOffset,12) $MFTReference = _SwapEndian($MFTReference) $MFTReference = Dec($MFTReference,2) $MFTReferenceSeqNo = StringMid($Entry,$NewLocalAttributeOffset+12,4) $MFTReferenceSeqNo = Dec(_SwapEndian($MFTReferenceSeqNo),2) $IndexEntryLength = StringMid($Entry,$NewLocalAttributeOffset+16,4) $IndexEntryLength = Dec(_SwapEndian($IndexEntryLength),2) $OffsetToFileName = StringMid($Entry,$NewLocalAttributeOffset+20,4) $OffsetToFileName = Dec(_SwapEndian($OffsetToFileName),2) $IndexFlags = StringMid($Entry,$NewLocalAttributeOffset+24,4) ;$Padding = StringMid($Entry,$NewLocalAttributeOffset+28,4) $MFTReferenceOfParent = StringMid($Entry,$NewLocalAttributeOffset+32,12) $MFTReferenceOfParent = _SwapEndian($MFTReferenceOfParent) $MFTReferenceOfParent = Dec($MFTReferenceOfParent,2) $MFTReferenceOfParentSeqNo = StringMid($Entry,$NewLocalAttributeOffset+44,4) $MFTReferenceOfParentSeqNo = Dec(_SwapEndian($MFTReferenceOfParentSeqNo),2) ; $Indx_CTime = StringMid($Entry, $NewLocalAttributeOffset + 48, 16) $Indx_CTime = _SwapEndian($Indx_CTime) $Indx_CTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_CTime) $Indx_CTime = _WinTime_UTCFileTimeFormat(Dec($Indx_CTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_CTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_CTime_Core = StringMid($Indx_CTime,1,StringLen($Indx_CTime)-4) ;$Indx_CTime_Precision = StringRight($Indx_CTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_CTime = $Indx_CTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_CTime_tmp, 4)) ;$Indx_CTime_Core = StringMid($Indx_CTime,1,StringLen($Indx_CTime)-9) ;$Indx_CTime_Precision = StringRight($Indx_CTime,8) Else ;$Indx_CTime_Core = $Indx_CTime EndIf ; $Indx_ATime = StringMid($Entry, $NewLocalAttributeOffset + 64, 16) $Indx_ATime = _SwapEndian($Indx_ATime) $Indx_ATime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_ATime) $Indx_ATime = _WinTime_UTCFileTimeFormat(Dec($Indx_ATime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_ATime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_ATime_Core = StringMid($Indx_ATime,1,StringLen($Indx_ATime)-4) ;$Indx_ATime_Precision = StringRight($Indx_ATime,3) ElseIf $TimestampPrecision = 3 Then $Indx_ATime = $Indx_ATime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_ATime_tmp, 4)) ;$Indx_ATime_Core = StringMid($Indx_ATime,1,StringLen($Indx_ATime)-9) ;$Indx_ATime_Precision = StringRight($Indx_ATime,8) Else ;$Indx_ATime_Core = $Indx_ATime EndIf ; $Indx_MTime = StringMid($Entry, $NewLocalAttributeOffset + 80, 16) $Indx_MTime = _SwapEndian($Indx_MTime) $Indx_MTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_MTime) $Indx_MTime = _WinTime_UTCFileTimeFormat(Dec($Indx_MTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_MTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_MTime_Core = StringMid($Indx_MTime,1,StringLen($Indx_MTime)-4) ;$Indx_MTime_Precision = StringRight($Indx_MTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_MTime = $Indx_MTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_MTime_tmp, 4)) ;$Indx_MTime_Core = StringMid($Indx_MTime,1,StringLen($Indx_MTime)-9) ;$Indx_MTime_Precision = StringRight($Indx_MTime,8) Else ;$Indx_MTime_Core = $Indx_MTime EndIf ; $Indx_RTime = StringMid($Entry, $NewLocalAttributeOffset + 96, 16) $Indx_RTime = _SwapEndian($Indx_RTime) $Indx_RTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_RTime) $Indx_RTime = _WinTime_UTCFileTimeFormat(Dec($Indx_RTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_RTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_RTime_Core = StringMid($Indx_RTime,1,StringLen($Indx_RTime)-4) ;$Indx_RTime_Precision = StringRight($Indx_RTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_RTime = $Indx_RTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_RTime_tmp, 4)) ;$Indx_RTime_Core = StringMid($Indx_RTime,1,StringLen($Indx_RTime)-9) ;$Indx_RTime_Precision = StringRight($Indx_RTime,8) Else ;$Indx_RTime_Core = $Indx_RTime EndIf ; $Indx_AllocSize = StringMid($Entry,$NewLocalAttributeOffset+112,16) $Indx_AllocSize = Dec(_SwapEndian($Indx_AllocSize),2) $Indx_RealSize = StringMid($Entry,$NewLocalAttributeOffset+128,16) $Indx_RealSize = Dec(_SwapEndian($Indx_RealSize),2) $Indx_File_Flags = StringMid($Entry,$NewLocalAttributeOffset+144,8) $Indx_File_Flags = _SwapEndian($Indx_File_Flags) $Indx_File_Flags = _File_Attributes("0x" & $Indx_File_Flags) $Indx_ReparseTag = StringMid($Entry,$NewLocalAttributeOffset+152,8) $Indx_ReparseTag = _SwapEndian($Indx_ReparseTag) $Indx_ReparseTag = _GetReparseType("0x"&$Indx_ReparseTag) $Indx_NameLength = StringMid($Entry,$NewLocalAttributeOffset+160,2) $Indx_NameLength = Dec($Indx_NameLength) $Indx_NameSpace = StringMid($Entry,$NewLocalAttributeOffset+162,2) Select Case $Indx_NameSpace = "00" ;POSIX $Indx_NameSpace = "POSIX" Case $Indx_NameSpace = "01" ;WIN32 $Indx_NameSpace = "WIN32" Case $Indx_NameSpace = "02" ;DOS $Indx_NameSpace = "DOS" Case $Indx_NameSpace = "03" ;DOS+WIN32 $Indx_NameSpace = "DOS+WIN32" EndSelect $Indx_FileName = StringMid($Entry,$NewLocalAttributeOffset+164,$Indx_NameLength*4) $Indx_FileName = BinaryToString("0x"&$Indx_FileName,2) $Indx_FileName = StringReplace($Indx_FileName,$de,$CharReplacement) $FileNameModified = @extended $tmp1 = 164+($Indx_NameLength*2*2) Do ; Calculate the length of the padding - 8 byte aligned $tmp2 = $tmp1/16 If Not IsInt($tmp2) Then $tmp0 = 2 $tmp1 += $tmp0 $tmp3 += $tmp0 EndIf Until IsInt($tmp2) $PaddingLength = $tmp3 ; $Padding2 = StringMid($Entry,$NewLocalAttributeOffset+164+($Indx_NameLength*2*2),$PaddingLength) If $IndexFlags <> "0000" Then $SubNodeVCN = StringMid($Entry,$NewLocalAttributeOffset+164+($Indx_NameLength*2*2)+$PaddingLength,16) $SubNodeVCN = Dec(_SwapEndian($SubNodeVCN),2) $SubNodeVCNLength = 16 Else $SubNodeVCN = "" $SubNodeVCNLength = 0 EndIf ; FileWriteLine($LogFileIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & @crlf) If $MFTReference > 0 And $MFTReferenceSeqNo > 0 And $MFTReferenceOfParent > 4 And $Indx_NameLength > 0 And $Indx_CTime<>$TimestampErrorVal And $Indx_ATime<>$TimestampErrorVal And $Indx_MTime<>$TimestampErrorVal And $Indx_RTime<>$TimestampErrorVal Then $DecodeOk=True FileWriteLine($LogFileIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_ReparseTag & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & $de & $IsRedo & @crlf) If $IsRedo Then $RealMftRef = $PredictedRefNumber $PredictedRefNumber = $MFTReferenceOfParent $KeptRef = $MFTReferenceOfParent $AttributeString = "$INDEX_ALLOCATION" If Not $FromRcrdSlack Then If $Indx_NameSpace <> "DOS" Then _UpdateFileNameArray($MFTReference,$MFTReferenceSeqNo,$Indx_FileName,$this_lsn) EndIf EndIf ; If $PreviousRedoOp = "1c00" Then ; $AttributeString = $PreviousAttribute ; Else ; $AttributeString = "$INDEX_ALLOCATION" ; EndIf EndIf ; $RealMftRef = $PredictedRefNumber ; Work through the rest of the index entries $NextEntryOffset = $NewLocalAttributeOffset+164+($Indx_NameLength*2*2)+$PaddingLength+$SubNodeVCNLength If $NextEntryOffset+64 >= StringLen($Entry) Then Return $DecodeOk Do $EntryCounter += 1 $MFTReference = StringMid($Entry,$NextEntryOffset,12) $MFTReference = _SwapEndian($MFTReference) $MFTReference = Dec($MFTReference,2) $MFTReferenceSeqNo = StringMid($Entry,$NextEntryOffset+12,4) $MFTReferenceSeqNo = Dec(_SwapEndian($MFTReferenceSeqNo),2) $IndexEntryLength = StringMid($Entry,$NextEntryOffset+16,4) $IndexEntryLength = Dec(_SwapEndian($IndexEntryLength),2) $OffsetToFileName = StringMid($Entry,$NextEntryOffset+20,4) $OffsetToFileName = Dec(StringMid($OffsetToFileName,3,2)&StringMid($OffsetToFileName,3,2)) $IndexFlags = StringMid($Entry,$NextEntryOffset+24,4) ;$Padding = StringMid($Entry,$NextEntryOffset+28,4) $MFTReferenceOfParent = StringMid($Entry,$NextEntryOffset+32,12) $MFTReferenceOfParent = _SwapEndian($MFTReferenceOfParent) $MFTReferenceOfParent = Dec($MFTReferenceOfParent,2) $MFTReferenceOfParentSeqNo = StringMid($Entry,$NextEntryOffset+44,4) $MFTReferenceOfParentSeqNo = Dec(_SwapEndian($MFTReferenceOfParentSeqNo),2) $Indx_CTime = StringMid($Entry, $NextEntryOffset + 48, 16) $Indx_CTime = _SwapEndian($Indx_CTime) $Indx_CTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_CTime) $Indx_CTime = _WinTime_UTCFileTimeFormat(Dec($Indx_CTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_CTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_CTime_Core = StringMid($Indx_CTime,1,StringLen($Indx_CTime)-4) ;$Indx_CTime_Precision = StringRight($Indx_CTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_CTime = $Indx_CTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_CTime_tmp, 4)) ;$Indx_CTime_Core = StringMid($Indx_CTime,1,StringLen($Indx_CTime)-9) ;$Indx_CTime_Precision = StringRight($Indx_CTime,8) Else ;$Indx_CTime_Core = $Indx_CTime EndIf ; $Indx_ATime = StringMid($Entry, $NextEntryOffset + 64, 16) $Indx_ATime = _SwapEndian($Indx_ATime) $Indx_ATime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_ATime) $Indx_ATime = _WinTime_UTCFileTimeFormat(Dec($Indx_ATime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_ATime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_ATime_Core = StringMid($Indx_ATime,1,StringLen($Indx_ATime)-4) ;$Indx_ATime_Precision = StringRight($Indx_ATime,3) ElseIf $TimestampPrecision = 3 Then $Indx_ATime = $Indx_ATime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_ATime_tmp, 4)) ;$Indx_ATime_Core = StringMid($Indx_ATime,1,StringLen($Indx_ATime)-9) ;$Indx_ATime_Precision = StringRight($Indx_ATime,8) Else ;$Indx_ATime_Core = $Indx_ATime EndIf ; $Indx_MTime = StringMid($Entry, $NextEntryOffset + 80, 16) $Indx_MTime = _SwapEndian($Indx_MTime) $Indx_MTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_MTime) $Indx_MTime = _WinTime_UTCFileTimeFormat(Dec($Indx_MTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_MTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_MTime_Core = StringMid($Indx_MTime,1,StringLen($Indx_MTime)-4) ;$Indx_MTime_Precision = StringRight($Indx_MTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_MTime = $Indx_MTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_MTime_tmp, 4)) ;$Indx_MTime_Core = StringMid($Indx_MTime,1,StringLen($Indx_MTime)-9) ;$Indx_MTime_Precision = StringRight($Indx_MTime,8) Else ;$Indx_MTime_Core = $Indx_MTime EndIf ; $Indx_RTime = StringMid($Entry, $NextEntryOffset + 96, 16) $Indx_RTime = _SwapEndian($Indx_RTime) $Indx_RTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_RTime) $Indx_RTime = _WinTime_UTCFileTimeFormat(Dec($Indx_RTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_RTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_RTime_Core = StringMid($Indx_RTime,1,StringLen($Indx_RTime)-4) ;$Indx_RTime_Precision = StringRight($Indx_RTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_RTime = $Indx_RTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_RTime_tmp, 4)) ;$Indx_RTime_Core = StringMid($Indx_RTime,1,StringLen($Indx_RTime)-9) ;$Indx_RTime_Precision = StringRight($Indx_RTime,8) Else ;$Indx_RTime_Core = $Indx_RTime EndIf ; $Indx_AllocSize = StringMid($Entry,$NextEntryOffset+112,16) $Indx_AllocSize = Dec(_SwapEndian($Indx_AllocSize),2) $Indx_RealSize = StringMid($Entry,$NextEntryOffset+128,16) $Indx_RealSize = Dec(_SwapEndian($Indx_RealSize),2) $Indx_File_Flags = StringMid($Entry,$NextEntryOffset+144,8) $Indx_File_Flags = _SwapEndian($Indx_File_Flags) $Indx_File_Flags = _File_Attributes("0x" & $Indx_File_Flags) $Indx_ReparseTag = StringMid($Entry,$NextEntryOffset+152,8) $Indx_ReparseTag = _SwapEndian($Indx_ReparseTag) $Indx_ReparseTag = _GetReparseType("0x"&$Indx_ReparseTag) $Indx_NameLength = StringMid($Entry,$NextEntryOffset+160,2) $Indx_NameLength = Dec($Indx_NameLength) $Indx_NameSpace = StringMid($Entry,$NextEntryOffset+162,2) Select Case $Indx_NameSpace = "00" ;POSIX $Indx_NameSpace = "POSIX" Case $Indx_NameSpace = "01" ;WIN32 $Indx_NameSpace = "WIN32" Case $Indx_NameSpace = "02" ;DOS $Indx_NameSpace = "DOS" Case $Indx_NameSpace = "03" ;DOS+WIN32 $Indx_NameSpace = "DOS+WIN32" EndSelect $Indx_FileName = StringMid($Entry,$NextEntryOffset+164,$Indx_NameLength*4) $Indx_FileName = BinaryToString("0x"&$Indx_FileName,2) $Indx_FileName = StringReplace($Indx_FileName,$de,$CharReplacement) $FileNameModified = @extended $tmp0 = 0 $tmp2 = 0 $tmp3 = 0 $tmp1 = 164+($Indx_NameLength*2*2) Do ; Calculate the length of the padding - 8 byte aligned $tmp2 = $tmp1/16 If Not IsInt($tmp2) Then $tmp0 = 2 $tmp1 += $tmp0 $tmp3 += $tmp0 EndIf Until IsInt($tmp2) $PaddingLength = $tmp3 ; $Padding = StringMid($Entry,$NextEntryOffset+164+($Indx_NameLength*2*2),$PaddingLength) If $IndexFlags <> "0000" Then $SubNodeVCN = StringMid($Entry,$NextEntryOffset+164+($Indx_NameLength*2*2)+$PaddingLength,16) $SubNodeVCN = Dec(_SwapEndian($SubNodeVCN),2) $SubNodeVCNLength = 16 Else $SubNodeVCN = "" $SubNodeVCNLength = 0 EndIf $NextEntryOffset = $NextEntryOffset+164+($Indx_NameLength*2*2)+$PaddingLength+$SubNodeVCNLength ; FileWriteLine($LogFileIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & @crlf) If $MFTReference > 0 And $MFTReferenceSeqNo > 0 And $MFTReferenceOfParent > 4 And $Indx_NameLength > 0 And $Indx_CTime<>$TimestampErrorVal And $Indx_ATime<>$TimestampErrorVal And $Indx_MTime<>$TimestampErrorVal And $Indx_RTime<>$TimestampErrorVal Then $DecodeOk=True FileWriteLine($LogFileIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_ReparseTag & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & $de & $IsRedo & @crlf) If $IsRedo Then $RealMftRef = $PredictedRefNumber $PredictedRefNumber = $MFTReferenceOfParent $KeptRef = $MFTReferenceOfParent $AttributeString = "$INDEX_ALLOCATION" If Not $FromRcrdSlack Then If $Indx_NameSpace <> "DOS" Then _UpdateFileNameArray($MFTReference,$MFTReferenceSeqNo,$Indx_FileName,$this_lsn) EndIf EndIf ; If $PreviousRedoOp = "1c00" Then ; $AttributeString = $PreviousAttribute ; Else ; $AttributeString = "$INDEX_ALLOCATION" ; EndIf EndIf ; _ArrayDisplay($IndxMFTReferenceOfParentArr,"$IndxMFTReferenceOfParentArr") Until $NextEntryOffset+32 >= StringLen($Entry) ; _ArrayDisplay($IndxMFTReferenceOfParentArr,"$IndxMFTReferenceOfParentArr") Return $DecodeOk EndFunc Func _Decode_IndexEntry($Entry,$AttrType,$IsRedo) ;Local $LocalAttributeOffset = 1 Local $NewLocalAttributeOffset;,$IndxHdrMagic,$IndxHdrUpdateSeqArrOffset,$IndxHdrUpdateSeqArrSize,$IndxHdrLogFileSequenceNo,$IndxHdrVCNOfIndx,$IndxHdrOffsetToIndexEntries,$IndxHdrSizeOfIndexEntries,$IndxHdrAllocatedSizeOfIndexEntries ; Local $IndxHdrFlag,$IndxHdrPadding,$IndxHdrUpdateSequence,$IndxHdrUpdSeqArr,$IndxHdrUpdSeqArrPart0,$IndxHdrUpdSeqArrPart1,$IndxHdrUpdSeqArrPart2,$IndxHdrUpdSeqArrPart3,$IndxRecordEnd4,$IndxRecordEnd1,$IndxRecordEnd2,$IndxRecordEnd3,$IndxRecordEnd4 Local $IndexEntryLength,$SubNodeVCN,$tmp0=0,$tmp1=0,$tmp2=0,$tmp3=0,$EntryCounter=1,$DecodeOk=False ;Local $FileReference,$StreamLength,$Flags,$Stream,$Padding2 ;Local $Indx_CTime_Core,$Indx_CTime_Precision,$Indx_ATime_Core,$Indx_ATime_Precision,$Indx_MTime_Core,$Indx_MTime_Precision,$Indx_RTime_Core,$Indx_RTime_Precision $NewLocalAttributeOffset = 1 $MFTReference = StringMid($Entry,$NewLocalAttributeOffset,12) $MFTReference = _SwapEndian($MFTReference) $MFTReference = Dec($MFTReference,2) $MFTReferenceSeqNo = StringMid($Entry,$NewLocalAttributeOffset+12,4) $MFTReferenceSeqNo = Dec(_SwapEndian($MFTReferenceSeqNo),2) $IndexEntryLength = StringMid($Entry,$NewLocalAttributeOffset+16,4) $IndexEntryLength = Dec(_SwapEndian($IndexEntryLength),2) $OffsetToFileName = StringMid($Entry,$NewLocalAttributeOffset+20,4) $OffsetToFileName = Dec(_SwapEndian($OffsetToFileName),2) $IndexFlags = StringMid($Entry,$NewLocalAttributeOffset+24,4) ; $Padding = StringMid($Entry,$NewLocalAttributeOffset+28,4) $MFTReferenceOfParent = StringMid($Entry,$NewLocalAttributeOffset+32,12) $MFTReferenceOfParent = _SwapEndian($MFTReferenceOfParent) $MFTReferenceOfParent = Dec($MFTReferenceOfParent,2) $MFTReferenceOfParentSeqNo = StringMid($Entry,$NewLocalAttributeOffset+44,4) $MFTReferenceOfParentSeqNo = Dec(_SwapEndian($MFTReferenceOfParentSeqNo),2) ; $Indx_CTime = StringMid($Entry, $NewLocalAttributeOffset + 48, 16) $Indx_CTime = _SwapEndian($Indx_CTime) $Indx_CTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_CTime) $Indx_CTime = _WinTime_UTCFileTimeFormat(Dec($Indx_CTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_CTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_CTime_Core = StringMid($Indx_CTime,1,StringLen($Indx_CTime)-4) ;$Indx_CTime_Precision = StringRight($Indx_CTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_CTime = $Indx_CTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_CTime_tmp, 4)) ;$Indx_CTime_Core = StringMid($Indx_CTime,1,StringLen($Indx_CTime)-9) ;$Indx_CTime_Precision = StringRight($Indx_CTime,8) Else ;$Indx_CTime_Core = $Indx_CTime EndIf ; $Indx_ATime = StringMid($Entry, $NewLocalAttributeOffset + 64, 16) $Indx_ATime = _SwapEndian($Indx_ATime) $Indx_ATime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_ATime) $Indx_ATime = _WinTime_UTCFileTimeFormat(Dec($Indx_ATime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_ATime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_ATime_Core = StringMid($Indx_ATime,1,StringLen($Indx_ATime)-4) ;$Indx_ATime_Precision = StringRight($Indx_ATime,3) ElseIf $TimestampPrecision = 3 Then $Indx_ATime = $Indx_ATime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_ATime_tmp, 4)) ;$Indx_ATime_Core = StringMid($Indx_ATime,1,StringLen($Indx_ATime)-9) ;$Indx_ATime_Precision = StringRight($Indx_ATime,8) Else ;$Indx_ATime_Core = $Indx_ATime EndIf ; $Indx_MTime = StringMid($Entry, $NewLocalAttributeOffset + 80, 16) $Indx_MTime = _SwapEndian($Indx_MTime) $Indx_MTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_MTime) $Indx_MTime = _WinTime_UTCFileTimeFormat(Dec($Indx_MTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_MTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_MTime_Core = StringMid($Indx_MTime,1,StringLen($Indx_MTime)-4) ;$Indx_MTime_Precision = StringRight($Indx_MTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_MTime = $Indx_MTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_MTime_tmp, 4)) ;$Indx_MTime_Core = StringMid($Indx_MTime,1,StringLen($Indx_MTime)-9) ;$Indx_MTime_Precision = StringRight($Indx_MTime,8) Else ;$Indx_MTime_Core = $Indx_MTime EndIf ; $Indx_RTime = StringMid($Entry, $NewLocalAttributeOffset + 96, 16) $Indx_RTime = _SwapEndian($Indx_RTime) $Indx_RTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_RTime) $Indx_RTime = _WinTime_UTCFileTimeFormat(Dec($Indx_RTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_RTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_RTime_Core = StringMid($Indx_RTime,1,StringLen($Indx_RTime)-4) ;$Indx_RTime_Precision = StringRight($Indx_RTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_RTime = $Indx_RTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_RTime_tmp, 4)) ;$Indx_RTime_Core = StringMid($Indx_RTime,1,StringLen($Indx_RTime)-9) ;$Indx_RTime_Precision = StringRight($Indx_RTime,8) Else ;$Indx_RTime_Core = $Indx_RTime EndIf ; $Indx_AllocSize = StringMid($Entry,$NewLocalAttributeOffset+112,16) $Indx_AllocSize = Dec(_SwapEndian($Indx_AllocSize),2) $Indx_RealSize = StringMid($Entry,$NewLocalAttributeOffset+128,16) $Indx_RealSize = Dec(_SwapEndian($Indx_RealSize),2) $Indx_File_Flags = StringMid($Entry,$NewLocalAttributeOffset+144,8) $Indx_File_Flags = _SwapEndian($Indx_File_Flags) $Indx_File_Flags = _File_Attributes("0x" & $Indx_File_Flags) $Indx_ReparseTag = StringMid($Entry,$NewLocalAttributeOffset+152,8) $Indx_ReparseTag = _SwapEndian($Indx_ReparseTag) $Indx_ReparseTag = _GetReparseType("0x"&$Indx_ReparseTag) $Indx_NameLength = StringMid($Entry,$NewLocalAttributeOffset+160,2) $Indx_NameLength = Dec($Indx_NameLength) $Indx_NameSpace = StringMid($Entry,$NewLocalAttributeOffset+162,2) Select Case $Indx_NameSpace = "00" ;POSIX $Indx_NameSpace = "POSIX" Case $Indx_NameSpace = "01" ;WIN32 $Indx_NameSpace = "WIN32" Case $Indx_NameSpace = "02" ;DOS $Indx_NameSpace = "DOS" Case $Indx_NameSpace = "03" ;DOS+WIN32 $Indx_NameSpace = "DOS+WIN32" EndSelect $Indx_FileName = StringMid($Entry,$NewLocalAttributeOffset+164,$Indx_NameLength*4) $Indx_FileName = BinaryToString("0x"&$Indx_FileName,2) $Indx_FileName = StringReplace($Indx_FileName,$de,$CharReplacement) $FileNameModified = @extended $tmp1 = 164+($Indx_NameLength*2*2) Do ; Calculate the length of the padding - 8 byte aligned $tmp2 = $tmp1/16 If Not IsInt($tmp2) Then $tmp0 = 2 $tmp1 += $tmp0 $tmp3 += $tmp0 EndIf Until IsInt($tmp2) $PaddingLength = $tmp3 ; $Padding2 = StringMid($Entry,$NewLocalAttributeOffset+164+($Indx_NameLength*2*2),$PaddingLength) If $IndexFlags <> "0000" Then $SubNodeVCN = StringMid($Entry,$NewLocalAttributeOffset+164+($Indx_NameLength*2*2)+$PaddingLength,16) $SubNodeVCN = Dec(_SwapEndian($SubNodeVCN),2) ;$SubNodeVCNLength = 16 Else $SubNodeVCN = "" ;$SubNodeVCNLength = 0 EndIf ;FileWriteLine($LogFileCsv, $RecordOffset & $de & $PredictedRefNumber & $de & $RealMftRef & $de & $HDR_BaseRecord & $de & $this_lsn & $de & $client_previous_lsn & $de & $redo_operation & $de & $undo_operation & $de & $record_offset_in_mft & $de & ;$FN_Name & $de & $AttributeString & $de & $UsnJrnlFileName & $de & $FileNameModified & $de & $UsnJrnlFileReferenceNumber & $de & $UsnJrnlParentFileReferenceNumber & $de & $UsnJrnlTimestamp & $de & $UsnJrnlReason & $de & $SI_CTime & $de & $SI_ATime & $de & ;$SI_MTime & $de & $SI_RTime & $de & $SI_FilePermission & $de & $SI_MaxVersions & $de & $SI_VersionNumber & $de & $SI_ClassID & $de & $SI_SecurityID & $de & $SI_QuotaCharged & $de & $SI_USN & $de & $SI_PartialValue & $de & $FN_CTime & $de & $FN_ATime & $de & ;$FN_MTime & $de & $FN_RTime & $de & $FN_AllocSize & $de & $FN_RealSize & $de & $FN_Flags & $de & $DT_StartVCN & $de & $DT_LastVCN & $de & $DT_ComprUnitSize & $de & $DT_AllocSize & $de & $DT_RealSize & $de & $DT_InitStreamSize & $de & $DT_DataRuns & $de & ;$DT_Name & $de & $TextInformation & $de & $RedoChunkSize & $de & $UndoChunkSize & @crlf) If $MFTReference > 0 And $MFTReferenceSeqNo > 0 And $MFTReferenceOfParent > 4 And $Indx_NameLength > 0 And $Indx_CTime<>$TimestampErrorVal And $Indx_ATime<>$TimestampErrorVal And $Indx_MTime<>$TimestampErrorVal And $Indx_RTime<>$TimestampErrorVal Then FileWriteLine($LogFileIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_ReparseTag & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & $de & $IsRedo & @crlf) If Not $FromRcrdSlack Then If $Indx_NameSpace <> "DOS" Then _UpdateFileNameArray($MFTReference,$MFTReferenceSeqNo,$Indx_FileName,$this_lsn) EndIf #cs if $IsRedo Then FileWriteLine($LogFileIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_ReparseTag & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & $de & $IsRedo & @crlf) If Not $FromRcrdSlack Then If $Indx_NameSpace <> "DOS" Then _UpdateFileNameArray($MFTReference,$MFTReferenceSeqNo,$Indx_FileName,$this_lsn) EndIf Else FileWriteLine($LogFileUndoWipeIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_ReparseTag & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & @crlf) If Not $FromRcrdSlack Then If $Indx_NameSpace <> "DOS" Then _UpdateFileNameArray($MFTReference,$MFTReferenceSeqNo,$Indx_FileName,$this_lsn) EndIf EndIf #ce $DecodeOk=True $RealMftRef = $MFTReferenceOfParent $PredictedRefNumber = $MFTReference $KeptRef = $MFTReference $FN_Name = $Indx_FileName $FN_NameType = $Indx_NameSpace $SI_CTime = $Indx_CTime $SI_ATime = $Indx_ATime $SI_MTime = $Indx_MTime $SI_RTime = $Indx_RTime $FN_AllocSize = $Indx_AllocSize $FN_RealSize = $Indx_RealSize $FN_Flags = $Indx_File_Flags $TextInformation &= ";MftRef="&$MFTReference&";MftSeqNo="&$MFTReferenceSeqNo if $AttrType = "0c00" Or $AttrType = "0d00" Then $AttributeString = "$INDEX_ROOT" if $AttrType = "0e00" Or $AttrType = "0f00" Then $AttributeString = "$INDEX_ALLOCATION" EndIf if $VerboseOn Then _DumpOutput("_Decode_IndexEntry():" & @CRLF) _DumpOutput("$MFTReference = " & $MFTReference & @crlf) _DumpOutput("$MFTReferenceSeqNo = " & $MFTReferenceSeqNo & @crlf) _DumpOutput("$IndexEntryLength = " & $IndexEntryLength & @crlf) _DumpOutput("$OffsetToFileName = " & $OffsetToFileName & @crlf) _DumpOutput("$IndexFlags = " & $IndexFlags & @crlf) _DumpOutput("$MFTReferenceOfParent = " & $MFTReferenceOfParent & @crlf) _DumpOutput("$Indx_CTime = " & $Indx_CTime & @crlf) _DumpOutput("$Indx_ATime = " & $Indx_ATime & @crlf) _DumpOutput("$Indx_MTime = " & $Indx_MTime & @crlf) _DumpOutput("$Indx_RTime = " & $Indx_RTime & @crlf) _DumpOutput("$Indx_AllocSize = " & $Indx_AllocSize & @crlf) _DumpOutput("$Indx_RealSize = " & $Indx_RealSize & @crlf) _DumpOutput("$Indx_File_Flags = " & $Indx_File_Flags & @crlf) _DumpOutput("$Indx_ReparseTag = " & $Indx_ReparseTag & @crlf) _DumpOutput("$Indx_NameLength = " & $Indx_NameLength & @crlf) _DumpOutput("$Indx_NameSpace = " & $Indx_NameSpace & @crlf) _DumpOutput("$Indx_FileName = " & $Indx_FileName & @crlf) _DumpOutput("$SubNodeVCN = " & $SubNodeVCN & @crlf) _DumpOutput(@crlf) EndIf Return $DecodeOk EndFunc ;Func _Get_IndexRoot($Entry,$CurrentAttributeName,$IsRedo) Func _Get_IndexRoot($Entry,$IsRedo) Local $LocalAttributeOffset = 1,$AttributeType,$CollationRule,$SizeOfIndexAllocationEntry,$ClustersPerIndexRoot,$DecodeOk=False $AttributeType = StringMid($Entry,$LocalAttributeOffset,8) ; $AttributeType = _SwapEndian($AttributeType) $CollationRule = StringMid($Entry,$LocalAttributeOffset+8,8) $CollationRule = _SwapEndian($CollationRule) $SizeOfIndexAllocationEntry = StringMid($Entry,$LocalAttributeOffset+16,8) $SizeOfIndexAllocationEntry = Dec(_SwapEndian($SizeOfIndexAllocationEntry),2) $ClustersPerIndexRoot = Dec(StringMid($Entry,$LocalAttributeOffset+24,2)) ; $IRPadding = StringMid($Entry,$LocalAttributeOffset+26,6) $OffsetToFirstEntry = StringMid($Entry,$LocalAttributeOffset+32,8) $OffsetToFirstEntry = Dec(_SwapEndian($OffsetToFirstEntry),2) $TotalSizeOfEntries = StringMid($Entry,$LocalAttributeOffset+40,8) $TotalSizeOfEntries = Dec(_SwapEndian($TotalSizeOfEntries),2) $AllocatedSizeOfEntries = StringMid($Entry,$LocalAttributeOffset+48,8) $AllocatedSizeOfEntries = Dec(_SwapEndian($AllocatedSizeOfEntries),2) $Flags = StringMid($Entry,$LocalAttributeOffset+56,2) If $Flags = "01" Then $Flags = "01 (Index Allocation needed)" $ResidentIndx = 0 Else $Flags = "00 (Fits in Index Root)" $ResidentIndx = 1 EndIf ; $IRPadding2 = StringMid($Entry,$LocalAttributeOffset+58,6) if $VerboseOn Then _DumpOutput("_Get_IndexRoot():" & @CRLF) _DumpOutput("$AttributeType = " & $AttributeType & @crlf) _DumpOutput("$CollationRule = " & $CollationRule & @crlf) _DumpOutput("$SizeOfIndexAllocationEntry = " & $SizeOfIndexAllocationEntry & @crlf) _DumpOutput("$ClustersPerIndexRoot = " & $ClustersPerIndexRoot & @crlf) ; _DumpOutput("$IRPadding = " & $IRPadding & @crlf) _DumpOutput("$OffsetToFirstEntry = " & $OffsetToFirstEntry & @crlf) _DumpOutput("$TotalSizeOfEntries = " & $TotalSizeOfEntries & @crlf) _DumpOutput("$AllocatedSizeOfEntries = " & $AllocatedSizeOfEntries & @crlf) _DumpOutput("$Flags = " & $Flags & @crlf) ; _DumpOutput("$IRPadding2 = " & $IRPadding2 & @crlf) EndIf ; If $ResidentIndx And $AttributeType=$FILE_NAME And $CurrentAttributeName="$I30" Then If $ResidentIndx And $AttributeType=$FILE_NAME Then $TheResidentIndexEntry = StringMid($Entry,$LocalAttributeOffset+64) $DecodeOk = _Decode_INDX($TheResidentIndexEntry,$IsRedo) EndIf Return $DecodeOk EndFunc Func _GetAttributeEntry($Entry) Local $CoreAttribute,$CoreAttributeArr[3] Local $ATTRIBUTE_HEADER_LengthOfAttribute,$ATTRIBUTE_HEADER_OffsetToAttribute,$ATTRIBUTE_HEADER_Length, $ATTRIBUTE_HEADER_NonResidentFlag, $ATTRIBUTE_HEADER_NameLength, $ATTRIBUTE_HEADER_NameRelativeOffset, $ATTRIBUTE_HEADER_Name $ATTRIBUTE_HEADER_Length = StringMid($Entry,9,8) $ATTRIBUTE_HEADER_Length = Dec(_SwapEndian($ATTRIBUTE_HEADER_Length),2) $ATTRIBUTE_HEADER_NonResidentFlag = Dec(StringMid($Entry,17,2)) $ATTRIBUTE_HEADER_NameLength = Dec(StringMid($Entry,19,2)) $ATTRIBUTE_HEADER_NameRelativeOffset = StringMid($Entry,21,4) $ATTRIBUTE_HEADER_NameRelativeOffset = Dec(_SwapEndian($ATTRIBUTE_HEADER_NameRelativeOffset)) If $ATTRIBUTE_HEADER_NameLength > 0 Then $ATTRIBUTE_HEADER_Name = BinaryToString("0x"&StringMid($Entry,$ATTRIBUTE_HEADER_NameRelativeOffset*2 + 1,$ATTRIBUTE_HEADER_NameLength*4),2) Else $ATTRIBUTE_HEADER_Name = "" EndIf If $ATTRIBUTE_HEADER_NonResidentFlag = 0 Then $ATTRIBUTE_HEADER_LengthOfAttribute = StringMid($Entry,33,8) $ATTRIBUTE_HEADER_LengthOfAttribute = Dec(_SwapEndian($ATTRIBUTE_HEADER_LengthOfAttribute),2) $ATTRIBUTE_HEADER_OffsetToAttribute = Dec(_SwapEndian(StringMid($Entry,41,4))) $CoreAttribute = StringMid($Entry,$ATTRIBUTE_HEADER_OffsetToAttribute*2+1,$ATTRIBUTE_HEADER_LengthOfAttribute*2) Else $CoreAttribute = "" EndIf $CoreAttributeArr[0] = $CoreAttribute $CoreAttributeArr[1] = $ATTRIBUTE_HEADER_Name $CoreAttributeArr[2] = $ATTRIBUTE_HEADER_NonResidentFlag If $ATTRIBUTE_HEADER_NameLength > 0 Then $TextInformation &= ";AttributeHeaderName="&$ATTRIBUTE_HEADER_Name Return $CoreAttributeArr EndFunc ;Func _Get_ReparsePoint($Entry,$CurrentAttributeName) Func _Get_ReparsePoint($Entry) Local $LocalAttributeOffset = 1,$GuidPresent=0,$ReparseType,$ReparseData,$ReparseDataLength,$ReparseGuid,$ReparseSubstititeNameOffset,$ReparseSubstituteNameLength,$ReparsePrintNameOffset,$ReparsePrintNameLength,$ReparseSubstititeName,$ReparsePrintName $ReparseType = StringMid($Entry,$LocalAttributeOffset,8) $ReparseType = _SwapEndian($ReparseType) If Dec(StringMid($ReparseType,1,2)) < 128 Then ;Non-Microsoft - GUID exist $GuidPresent = 1 EndIf $ReparseType = "0x" & $ReparseType $ReparseType = _GetReparseType($ReparseType) $ReparseDataLength = StringMid($Entry,$LocalAttributeOffset+8,4) $ReparseDataLength = Dec(_SwapEndian($ReparseDataLength),2) ; $ReparsePadding = StringMid($Entry,$LocalAttributeOffset+12,4) If $ReparseType = "WCI" Then $ReparseGuid = StringMid($Entry,$LocalAttributeOffset+32,32) $ReparseGuid = _HexToGuidStr($ReparseGuid,1) $ReparsePrintNameLength = StringMid($Entry,$LocalAttributeOffset+64,4) $ReparsePrintNameLength = Dec(_SwapEndian($ReparsePrintNameLength)) If $ReparsePrintNameLength > 0 Then $ReparsePrintName = StringMid($Entry,($LocalAttributeOffset+68),$ReparsePrintNameLength*2) $ReparsePrintName = BinaryToString("0x"&$ReparsePrintName,2) EndIf Else If $GuidPresent Then $ReparseGuid = StringMid($Entry,$LocalAttributeOffset+16,32) $ReparseGuid = _HexToGuidStr($ReparseGuid,1) $ReparseData = StringMid($Entry,$LocalAttributeOffset+48,$ReparseDataLength*2) Else $ReparseData = StringMid($Entry,$LocalAttributeOffset+16,$ReparseDataLength*2) EndIf ; $ReparseData = StringMid($Entry,$LocalAttributeOffset+16,$ReparseDataLength*2) $ReparseSubstititeNameOffset = StringMid($ReparseData,1,4) $ReparseSubstititeNameOffset = Dec(_SwapEndian($ReparseSubstititeNameOffset),2) $ReparseSubstituteNameLength = StringMid($ReparseData,5,4) $ReparseSubstituteNameLength = Dec(_SwapEndian($ReparseSubstituteNameLength),2) $ReparsePrintNameOffset = StringMid($ReparseData,9,4) $ReparsePrintNameOffset = Dec(_SwapEndian($ReparsePrintNameOffset),2) $ReparsePrintNameLength = StringMid($ReparseData,13,4) $ReparsePrintNameLength = Dec(_SwapEndian($ReparsePrintNameLength),2) ;-----if $ReparseSubstititeNameOffset<>0 then the order is reversed and parsed from end of $ReparseData ???????? If StringMid($ReparseData,1,4) <> "0000" Then $ReparseSubstititeName = StringMid($Entry,StringLen($Entry)+1-($ReparseSubstituteNameLength*2),$ReparseSubstituteNameLength*2) ; _DumpOutput("$ReparseSubstititeName = " & $ReparseSubstititeName & @crlf) $ReparseSubstititeName = BinaryToString("0x"&$ReparseSubstititeName,2) $ReparsePrintName = StringMid($Entry,StringLen($Entry)+1-($ReparseSubstituteNameLength*2)-($ReparsePrintNameLength*2),$ReparsePrintNameLength*2) ; _DumpOutput("$ReparsePrintName = " & $ReparsePrintName & @crlf) $ReparsePrintName = BinaryToString("0x"&$ReparsePrintName,2) Else $ReparseSubstititeName = StringMid($Entry,$LocalAttributeOffset+16+16,$ReparseSubstituteNameLength*2) ; _DumpOutput("$ReparseSubstititeName = " & $ReparseSubstititeName & @crlf) $ReparseSubstititeName = BinaryToString("0x"&$ReparseSubstititeName,2) $ReparsePrintName = StringMid($Entry,($LocalAttributeOffset+32)+($ReparsePrintNameOffset*2),$ReparsePrintNameLength*2) ; _DumpOutput("$ReparsePrintName = " & $ReparsePrintName & @crlf) $ReparsePrintName = BinaryToString("0x"&$ReparsePrintName,2) EndIf EndIf If $VerboseOn Then _DumpOutput("_Get_ReparsePoint():" & @CRLF) _DumpOutput(_HexEncode("0x"&$Entry) & @CRLF) _DumpOutput("$ReparseType = " & $ReparseType & @crlf) _DumpOutput("$ReparseDataLength = " & $ReparseDataLength & @crlf) ; _DumpOutput("$ReparsePadding = " & $ReparsePadding & @crlf) _DumpOutput("$ReparseGuid = " & $ReparseGuid & @crlf) _DumpOutput("$ReparseSubstititeNameOffset = " & $ReparseSubstititeNameOffset & @crlf) _DumpOutput("$ReparseSubstituteNameLength = " & $ReparseSubstituteNameLength & @crlf) _DumpOutput("$ReparsePrintNameOffset = " & $ReparsePrintNameOffset & @crlf) _DumpOutput("$ReparsePrintNameLength = " & $ReparsePrintNameLength & @crlf) _DumpOutput("$ReparseSubstititeName = " & $ReparseSubstititeName & @crlf) _DumpOutput("$ReparsePrintName = " & $ReparsePrintName & @crlf) EndIf If $GuidPresent Then $TextInformation &= ";ReparseTag="&$ReparseType&";ReparseGuid="&$ReparseGuid&";ReparseSubstititeName="&$ReparseSubstititeName&";ReparsePrintName="&$ReparsePrintName Else $TextInformation &= ";ReparseTag="&$ReparseType&";ReparseSubstititeName="&$ReparseSubstititeName&";ReparsePrintName="&$ReparsePrintName EndIf EndFunc Func _Get_EaInformation($Entry) Local $LocalAttributeOffset = 1,$TheEaInformation,$SizeOfPackedEas,$NumberOfEaWithFlagSet,$SizeOfUnpackedEas $TheEaInformation = StringMid($Entry,$LocalAttributeOffset) $SizeOfPackedEas = StringMid($Entry,$LocalAttributeOffset,4) $SizeOfPackedEas = Dec(_SwapEndian($SizeOfPackedEas),2) $NumberOfEaWithFlagSet = StringMid($Entry,$LocalAttributeOffset+4,4) $NumberOfEaWithFlagSet = Dec(_SwapEndian($NumberOfEaWithFlagSet),2) $SizeOfUnpackedEas = StringMid($Entry,$LocalAttributeOffset+8,8) $SizeOfUnpackedEas = Dec(_SwapEndian($SizeOfUnpackedEas),2) If $VerboseOn Then _DumpOutput("_Get_EaInformation():" & @CRLF) _DumpOutput(_HexEncode("0x"&$TheEaInformation) & @crlf) ; _DumpOutput("$TheEaInformation = " & $TheEaInformation & @crlf) _DumpOutput("$SizeOfPackedEas = " & $SizeOfPackedEas & @crlf) _DumpOutput("$NumberOfEaWithFlagSet = " & $NumberOfEaWithFlagSet & @crlf) _DumpOutput("$SizeOfUnpackedEas = " & $SizeOfUnpackedEas & @crlf) EndIf $TextInformation &= ";SizeOfPackedEas="&$SizeOfPackedEas&";NumberOfEaWithFlagSet="&$NumberOfEaWithFlagSet&";SizeOfUnpackedEas="&$SizeOfUnpackedEas EndFunc Func _Get_Ea($Entry) Local $LocalAttributeOffset = 1,$OffsetToNextEa,$EaNameLength,$EaValueLength,$EaCounter=1 $StringLengthInput = StringLen($Entry) _DumpOutput("$EA detected" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @crlf) _DumpOutput(_HexEncode("0x"&$Entry) & @crlf) $OffsetToNextEa = StringMid($Entry,$LocalAttributeOffset,8) $OffsetToNextEa = Dec(_SwapEndian($OffsetToNextEa),2) ;$EaFlags = StringMid($Entry,$LocalAttributeOffset+8,2) $EaNameLength = Dec(StringMid($Entry,$LocalAttributeOffset+10,2)) $EaValueLength = StringMid($Entry,$LocalAttributeOffset+12,4) $EaValueLength = Dec(_SwapEndian($EaValueLength),2) $EaName = StringMid($Entry,$LocalAttributeOffset+16,$EaNameLength*2) $EaName = _HexToString($EaName) $EaValue = StringMid($Entry,$LocalAttributeOffset+16+($EaNameLength*2)+2,$EaValueLength*2) #cs If $VerboseOn Then _DumpOutput("_Get_Ea():" & @CRLF) _DumpOutput(_HexEncode("0x"&$Entry) & @crlf) _DumpOutput("$OffsetToNextEa = " & $OffsetToNextEa & @crlf) _DumpOutput("$EaFlags = " & $EaFlags & @crlf) _DumpOutput("$EaNameLength = " & $EaNameLength & @crlf) _DumpOutput("$EaValueLength = " & $EaValueLength & @crlf) _DumpOutput("$EaName = " & $EaName & @crlf) _DumpOutput("$EaValue:" & @crlf) _DumpOutput(_HexEncode("0x"&$EaValue) & @crlf) EndIf #ce _DumpOutput("EaName("&$EaCounter&"): " & $EaName & @crlf) _DumpOutput(_HexEncode("0x"&$EaValue) & @crlf) $TextInformation &= ";EaName("&$EaCounter&")="&$EaName If $DoExtractResidentUpdates Then _ExtractResidentUpdatesEa($EaValue,$EaName) EndIf If $OffsetToNextEa*2 >= $StringLengthInput Then Return EndIf Do $LocalAttributeOffset += $OffsetToNextEa*2 If $LocalAttributeOffset >= $StringLengthInput Then ExitLoop $EaCounter+=1 $OffsetToNextEa = StringMid($Entry,$LocalAttributeOffset,8) $OffsetToNextEa = Dec(_SwapEndian($OffsetToNextEa),2) ;$EaFlags = StringMid($Entry,$LocalAttributeOffset+8,2) $EaNameLength = Dec(StringMid($Entry,$LocalAttributeOffset+10,2)) $EaValueLength = StringMid($Entry,$LocalAttributeOffset+12,4) $EaValueLength = Dec(StringMid($EaValueLength,3,2) & StringMid($EaValueLength,1,2)) $EaName = StringMid($Entry,$LocalAttributeOffset+16,$EaNameLength*2) $EaName = _HexToString($EaName) $EaValue = StringMid($Entry,$LocalAttributeOffset+16+($EaNameLength*2),$EaValueLength*2) If $EaNameLength Or $EaValueLength Then ExitLoop #cs If $VerboseOn Then _DumpOutput("$EaFlags = " & $EaFlags & @crlf) _DumpOutput("$EaNameLength = " & $EaNameLength & @crlf) _DumpOutput("$EaValueLength = " & $EaValueLength & @crlf) _DumpOutput("$EaName = " & $EaName & @crlf) _DumpOutput("$EaValue: " & @crlf) _DumpOutput(_HexEncode("0x"&$EaValue) & @crlf) EndIf #ce _DumpOutput("EaName("&$EaCounter&"): " & $EaName & @crlf) _DumpOutput(_HexEncode("0x"&$EaValue) & @crlf) $TextInformation &= ";EaName("&$EaCounter&")="&$EaName If $DoExtractResidentUpdates Then _ExtractResidentUpdatesEa($EaValue,$EaName) EndIf Until $LocalAttributeOffset >= $StringLengthInput $TextInformation &= ";Search debug.log for " & $this_lsn EndFunc Func _Get_LoggedUtilityStream($Entry,$CurrentAttributeName) Local $LocalAttributeOffset = 1 $TheLoggedUtilityStream = StringMid($Entry,$LocalAttributeOffset) If $VerboseOn Then _DumpOutput("_Get_LoggedUtilityStream():" & @CRLF) _DumpOutput("$TheLoggedUtilityStream = " & $TheLoggedUtilityStream & @crlf) EndIf $TextInformation &= ";LoggedUtilityStream="&$TheLoggedUtilityStream If $CurrentAttributeName = "$TXF_DATA" Then _Decode_TXF_DATA($TheLoggedUtilityStream) EndIf EndFunc Func _Decode_UpdateResidentValue($record,$IsRedo) If $VerboseOn Then _DumpOutput("_Decode_UpdateResidentValue():" & @CRLF) If $IsRedo Then Select Case $record_offset_in_mft = 56 Or $AttributeString = "$STANDARD_INFORMATION" _Decode_StandardInformation($record) $AttributeString = "$STANDARD_INFORMATION" Case $AttributeString = "$LOGGED_UTILITY_STREAM" And $undo_length > 0 _Decode_TXF_DATA($record) Case $AttributeString = "$EA" And $undo_length > 0 _Get_Ea($record) Case $AttributeString = "$BITMAP" And $undo_length > 0 ; Case $DoExtractResidentUpdates And $MinSizeResidentExtraction > 0 And $redo_length >= $MinSizeResidentExtraction And $undo_length > 0 And $redo_length=$undo_length Case $DoExtractResidentUpdates And $redo_length >= $MinSizeResidentExtraction And $undo_length > 0 ;Assume $DATA _ExtractResidentUpdates($record,$IsRedo) Case $client_previous_lsn=0 And $undo_length=0 $TextInformation &= ";Initializing with zeros" Case $PredictedRefNumber = 31 ;Updates to $Tops:$DATA _DumpOutput("Verbose: Possible update to $Tops:$DATA" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @crlf) _DumpOutput(_HexEncode("0x"&$record) & @crlf) Case Else _DumpOutput("Error in _Decode_UpdateResidentValue():" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$record) & @crlf) ; MsgBox(0,"Error","This indicates an unexpected situation at LSN: " & $this_lsn) EndSelect Else Select Case $record_offset_in_mft = 56 Or $AttributeString = "$STANDARD_INFORMATION" Case $AttributeString = "$LOGGED_UTILITY_STREAM" Case $AttributeString = "$BITMAP" ; Case $record_offset_in_mft <> 56 And $DoExtractResidentUpdates And $MinSizeResidentExtraction > 0 And $redo_length >= $MinSizeResidentExtraction And $undo_length > 0 And $redo_length=$undo_length ;Assume $DATA Case $record_offset_in_mft <> 56 And $DoExtractResidentUpdates And $redo_length >= $MinSizeResidentExtraction _ExtractResidentUpdates($record,$IsRedo) EndSelect EndIf EndFunc Func _ResolveAttributeFromUsnReason($data) Select Case StringInStr($data,"DATA") $ret = "$DATA" Case StringInStr($data,"DATA") $ret = "$DATA" Case StringInStr($data,"DATA") $ret = "$DATA" Case Else $ret = "Unknown" EndSelect Return $ret EndFunc Func _Decode_CreateAttribute($record,$IsRedo) Local $RecordSize,$DecodeOk=False,$CoreAttr,$CoreAttrName,$CoreAttrChunk, $LocalStreamName Global $CurrentAttribute $AttributeTypeCheck = StringMid($record,1,4) If $VerboseOn Then ConsoleWrite("########### CreateAttribute ###########" & @CRLF) ConsoleWrite("$AttributeTypeCheck: " & $AttributeTypeCheck & @CRLF) EndIf $RecordSize = StringLen($record) if $IsRedo Then Select Case $AttributeTypeCheck = "1000" _Get_StandardInformation($record, 1, $RecordSize) $AttributeString = "$STANDARD_INFORMATION" Case $AttributeTypeCheck = "2000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] _DecodeAttrList($record,$IsRedo) $AttributeString = "$ATTRIBUTE_LIST" $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag&";See LogFile_AttributeList.csv" Case $AttributeTypeCheck = "3000" _Get_FileName($record, 1, 1) $AttributeString = "$FILE_NAME" If $FN_NameType <> "DOS" Then _UpdateFileNameArray($PredictedRefNumber,"",$FN_Name,$this_lsn) Case $AttributeTypeCheck = "4000" _Get_ObjectID($record, 1, $RecordSize, 1) $AttributeString = "$OBJECT_ID" Case $AttributeTypeCheck = "5000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] ; ConsoleWrite("$SECURITY_DESCRIPTOR:" & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$CoreAttrChunk) & @CRLF) If $CoreAttrChunk <> "" Then _DecodeSecurityDescriptorAttribute($CoreAttrChunk) ;Write information to csv _WriteCsvSecureSDS($IsRedo) ;Make sure all global variables for csv are cleared _ClearVarSecureSDS() EndIf $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag&";See LogFile_SecurityDescriptors.csv" $AttributeString = "$SECURITY_DESCRIPTOR" Case $AttributeTypeCheck = "6000" _Get_VolumeName($record, 1, $RecordSize) $AttributeString = "$VOLUME_NAME" Case $AttributeTypeCheck = "7000" _Get_VolumeInformation($record, 1) $AttributeString = "$VOLUME_INFORMATION" Case $AttributeTypeCheck = "8000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] _Get_Data($record, 1, 1, $IsRedo) If $DT_Name <> "" Then $AttributeString = "$DATA:"&$DT_Name Else $AttributeString = "$DATA" EndIf $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag Case $AttributeTypeCheck = "9000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] If $CoreAttrName = "$I30" Then $DecodeOk = _Get_IndexRoot($CoreAttrChunk,$IsRedo) $AttributeString = "$INDEX_ROOT" $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag Case $AttributeTypeCheck = "A000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] If $CoreAttrChunk <> "" Then ;Will never occur? If $CoreAttrName = "$I30" Then $DecodeOk = _Decode_INDX($CoreAttrChunk,$IsRedo) EndIf $AttributeString = "$INDEX_ALLOCATION" $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag Case $AttributeTypeCheck = "B000" ; ConsoleWrite("Bitmap:" & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$record) & @CRLF) $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] $AttributeString = "$BITMAP" $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag Case $AttributeTypeCheck = "C000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] If $CoreAttrChunk <> "" Then _Get_ReparsePoint($CoreAttrChunk) EndIf $AttributeString = "$REPARSE_POINT" $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag Case $AttributeTypeCheck = "D000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] If $CoreAttrChunk <> "" Then _Get_EaInformation($CoreAttrChunk) EndIf $AttributeString = "$EA_INFORMATION" $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag Case $AttributeTypeCheck = "E000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] If $CoreAttrChunk <> "" Then _Get_Ea($CoreAttrChunk) EndIf $AttributeString = "$EA" $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag Case $AttributeTypeCheck = "F000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] $AttributeString = "$PROPERTY_SET" $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag Case $AttributeTypeCheck = "0001" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] If $CoreAttrChunk <> "" Then _Get_LoggedUtilityStream($CoreAttrChunk,$CoreAttrName) EndIf If $CoreAttrName <> "" Then $AttributeString = "$LOGGED_UTILITY_STREAM:" & $CoreAttrName Else $AttributeString = "$LOGGED_UTILITY_STREAM" EndIf $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag EndSelect Else Select Case $AttributeTypeCheck = "1000" $AttributeString = "$STANDARD_INFORMATION" Case $AttributeTypeCheck = "2000" $AttributeString = "$ATTRIBUTE_LIST" _DecodeAttrList($record,$IsRedo) $AttributeString = "$ATTRIBUTE_LIST" $TextInformation &= ";See LogFile_AttributeList.csv" Case $AttributeTypeCheck = "3000" _Get_FileName($record, 1, 1) $AttributeString = "$FILE_NAME" Case $AttributeTypeCheck = "4000" _Get_ObjectID($record, 1, $RecordSize, 0) $AttributeString = "$OBJECT_ID" Case $AttributeTypeCheck = "5000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] ; ConsoleWrite("$SECURITY_DESCRIPTOR:" & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$CoreAttrChunk) & @CRLF) If $CoreAttrChunk <> "" Then _DecodeSecurityDescriptorAttribute($CoreAttrChunk) ;Write information to csv _WriteCsvSecureSDS($IsRedo) ;Make sure all global variables for csv are cleared _ClearVarSecureSDS() EndIf $TextInformation &= ";See LogFile_SecurityDescriptors.csv" $AttributeString = "$SECURITY_DESCRIPTOR" Case $AttributeTypeCheck = "6000" _Get_VolumeName($record, 1, $RecordSize) $AttributeString = "$VOLUME_NAME" Case $AttributeTypeCheck = "7000" _Get_VolumeInformation($record, 1) $AttributeString = "$VOLUME_INFORMATION" Case $AttributeTypeCheck = "8000" $AttributeString = "$DATA" $LocalStreamName = _Get_DataName($record) If $LocalStreamName <> "" Then $AttributeString = "$DATA:"&$LocalStreamName Else $AttributeString = "$DATA" EndIf Case $AttributeTypeCheck = "9000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] If $CoreAttrName = "$I30" Then $DecodeOk = _Get_IndexRoot($CoreAttrChunk,$IsRedo) $AttributeString = "$INDEX_ROOT" $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag Case $AttributeTypeCheck = "A000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $CoreAttrNonResidentFlag = $CoreAttr[2] If $CoreAttrChunk <> "" Then ;Will never occur? If $CoreAttrName = "$I30" Then $DecodeOk = _Decode_INDX($CoreAttrChunk,$IsRedo) EndIf $AttributeString = "$INDEX_ALLOCATION" $TextInformation &= ";NonResidentFlag="&$CoreAttrNonResidentFlag Case $AttributeTypeCheck = "B000" ; ConsoleWrite("Bitmap:" & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$record) & @CRLF) $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] $AttributeString = "$BITMAP" Case $AttributeTypeCheck = "C000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] If $CoreAttrChunk <> "" Then ; _Get_ReparsePoint($CoreAttrChunk,1,$CoreAttrName) EndIf $AttributeString = "$REPARSE_POINT" Case $AttributeTypeCheck = "D000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] If $CoreAttrChunk <> "" Then ; _Get_EaInformation($CoreAttrChunk,1,$CoreAttrName) EndIf $AttributeString = "$EA_INFORMATION" Case $AttributeTypeCheck = "E000" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] If $CoreAttrChunk <> "" Then ; _Get_Ea($CoreAttrChunk,1,$CoreAttrName) EndIf $AttributeString = "$EA" Case $AttributeTypeCheck = "F000" $AttributeString = "$PROPERTY_SET" Case $AttributeTypeCheck = "0001" $CoreAttr = _GetAttributeEntry(StringMid($record,1,$RecordSize)) $CoreAttrChunk = $CoreAttr[0] $CoreAttrName = $CoreAttr[1] If $CoreAttrChunk <> "" Then ; _Get_LoggedUtilityStream($CoreAttrChunk,1,$CoreAttrName) EndIf If $CoreAttrName <> "" Then $AttributeString = "$LOGGED_UTILITY_STREAM:" & $CoreAttrName Else $AttributeString = "$LOGGED_UTILITY_STREAM" EndIf EndSelect EndIf If $CoreAttrName <> "" And StringInStr($AttributeString,":")=0 Then $AttributeString &= ":"&$CoreAttrName EndIf Return $DecodeOk EndFunc ;Func _WriteOut_MFTrecord($MFTref, $content) Func _WriteOut_MFTrecord($content) Local $nBytes = "", $rBuffer, $Written2;, $hFileOut, $OutFile, $Written If Mod(StringLen($content)/2,$MFT_Record_Size) Then Do $content &= "00" Until Mod(StringLen($content)/2,$MFT_Record_Size)=0 EndIf ; Writing each record into 1 dummy $MFT with all found records $rBuffer = DllStructCreate("byte ["&$MFT_Record_Size&"]") DllStructSetData($rBuffer,1,"0x"&$content) $Written2 = _WinAPI_WriteFile($hOutFileMFT, DllStructGetPtr($rBuffer), DllStructGetSize($rBuffer), $nBytes) If $Written2 = 0 Then ConsoleWrite("Error: WriteFile returned: " & _WinAPI_GetLastErrorMessage() & @CRLF) EndIf $rBuffer=0 EndFunc Func _UpdateDataRunInformation($TargetRedoOperation, $TargetAttributeOffset, $TargetOffsetToDatarun, $TargetDatarun, $PreviousDatarun) ; This function is never called if current datarun is empty Local $Prepended, $DatarunTmp If $VerboseOn Then ConsoleWrite("--------------------_UpdateDataRunInformation()-------------------------" & @CRLF) ConsoleWrite("$TargetRedoOperation: " & $TargetRedoOperation & @CRLF) ConsoleWrite("$TargetAttributeOffset: " & $TargetAttributeOffset & @CRLF) ConsoleWrite("$TargetOffsetToDatarun: " & $TargetOffsetToDatarun & @CRLF) ConsoleWrite("$TargetDatarun: " & $TargetDatarun & @CRLF) ConsoleWrite("$PreviousDatarun: " & $PreviousDatarun & @CRLF) EndIf If StringLen($TargetDatarun) < 2 Then Return $PreviousDatarun If $TargetOffsetToDatarun = "" Then $TargetOffsetToDatarun = 0 If ($TargetAttributeOffset = "" Or $TargetAttributeOffset = 0) And ($TargetRedoOperation="InitializeFileRecordSegment" Or $TargetRedoOperation="CreateAttribute") Then $TargetAttributeOffset = $TargetOffsetToDatarun If $TargetAttributeOffset < 72 And $TargetOffsetToDatarun = 0 Then $TargetOffsetToDatarun = 64 If $TargetAttributeOffset >= 72 And $TargetOffsetToDatarun = 0 Then $TargetOffsetToDatarun = 72 $ResolvedOffset = $TargetAttributeOffset-$TargetOffsetToDatarun If $VerboseOn Then ConsoleWrite("$ResolvedOffset: " & $ResolvedOffset & @CRLF) If $PreviousDatarun = "" Then ;First processing time for target ref If StringInStr($PreviousDatarun,"?")=0 And StringInStr($PreviousDatarun,"!")=0 And ($TargetRedoOperation="UpdateMappingPairs" Or $TargetRedoOperation="SetNewAttributeSizes") Then For $k = 1 To $ResolvedOffset $Prepended&="**" Next $DatarunTmp = "?"&$Prepended&$TargetDatarun ElseIf StringInStr($PreviousDatarun,"?")=0 And StringInStr($PreviousDatarun,"!")=0 And ($TargetRedoOperation="InitializeFileRecordSegment" Or $TargetRedoOperation="CreateAttribute") Then $DatarunTmp = "!"&$TargetDatarun EndIf If $VerboseOn Then ConsoleWrite("$DatarunTmp: " & $DatarunTmp & @CRLF) Return $DatarunTmp EndIf If $TargetDatarun = "" Then Return ;? ;Second processing time for given ref. Will prepend ** equivalent to unknown first bytes. "?" is mmising first bytes and "|" is all bytes in run list known. If StringInStr($PreviousDatarun,"?")=0 And StringInStr($PreviousDatarun,"!")=0 And ($TargetRedoOperation="UpdateMappingPairs" Or $TargetRedoOperation="SetNewAttributeSizes") Then For $k = 1 To $ResolvedOffset $Prepended&="**" Next $DatarunTmp = "?"&$Prepended&$TargetDatarun ElseIf StringInStr($PreviousDatarun,"?")=0 And StringInStr($PreviousDatarun,"!")=0 And ($TargetRedoOperation="InitializeFileRecordSegment" Or $TargetRedoOperation="CreateAttribute") Then $DatarunTmp = "!"&$TargetDatarun Else $DatarunTmp = $PreviousDatarun EndIf $OffsetOfPrepended = StringInStr($DatarunTmp,"*",0,-1) If $ResolvedOffset=0 Then $DatarunTmp = StringReplace($DatarunTmp,"?","!") $FirstPart = StringMid($DatarunTmp,1,1+($ResolvedOffset*2)) $ReassembledDatarun = $FirstPart&$TargetDatarun If $VerboseOn Then ConsoleWrite("$DatarunTmp: " & $DatarunTmp & @CRLF) ConsoleWrite("$OffsetOfPrepended: " & $OffsetOfPrepended & @CRLF) ConsoleWrite("$FirstPart: " & $FirstPart & @CRLF) ConsoleWrite("$ReassembledDatarun: " & $ReassembledDatarun & @CRLF) EndIf Return $ReassembledDatarun EndFunc Func _SQLite_SQLiteExe2($sDatabaseFile, $sInput, ByRef $sOutput, $sSQLiteExeFilename = -1, $fDebug = False) If $sSQLiteExeFilename = -1 Or (IsKeyword($sSQLiteExeFilename) And $sSQLiteExeFilename = Default) Then $sSQLiteExeFilename = @ScriptDir & "\SQLite3.exe" If Not FileExists($sSQLiteExeFilename) Then Local $aTemp = StringSplit(@AutoItExe, "\") $sSQLiteExeFilename = "" For $i = 1 To $aTemp[0] - 1 $sSQLiteExeFilename &= $aTemp[$i] & "\" Next $sSQLiteExeFilename &= "Extras\SQLite\SQLite3.exe" EndIf EndIf If Not FileExists($sDatabaseFile) Then Local $hNewFile = FileOpen($sDatabaseFile, 2 + 8) If $hNewFile = -1 Then Return SetError(1, 0, $SQLITE_CANTOPEN) ; Can't Create new Database EndIf FileClose($hNewFile) EndIf Local $sInputFile = _TempFile(), $sOutputFile = _TempFile(), $iRval = $SQLITE_OK ;Local $BatchFile = _TempFile(@ScriptDir,"~",".bat") Local $hInputFile = FileOpen($sInputFile, 2) If $hInputFile > -1 Then $sInput = ".output stdout" & @CRLF & $sInput FileWrite($hInputFile, $sInput) FileClose($hInputFile) ;$hBatchFile = FileOpen($BatchFile,2) If Not FileExists($sInputFile) Then MsgBox(0,"Error: File not found",$sInputFile) Local $sCmd = @ComSpec & " /c " & '""' & FileGetShortName($sSQLiteExeFilename) & '"' & ' "' _ & FileGetShortName($sDatabaseFile) _ & '" > "' & FileGetShortName($sOutputFile) _ & '" < "' & FileGetShortName($sInputFile) & '""' ;FileWrite($hBatchFile,$sCmd) ;FileClose($hBatchFile) Local $nErrorLevel = RunWait($sCmd, @ScriptDir, @SW_HIDE) ;Local $nErrorLevel = RunWait(@ScriptDir&"\RunWait.exe " & $BatchFile, @ScriptDir, @SW_HIDE) If $fDebug = True Then Local $nErrorTemp = @error __SQLite_Print('@@ Debug(_SQLite_SQLiteExe) : $sCmd = ' & $sCmd & @CRLF & '>ErrorLevel: ' & $nErrorLevel & @CRLF) SetError($nErrorTemp) EndIf If @error = 1 Or $nErrorLevel = 1 Then $iRval = $SQLITE_MISUSE ; SQLite.exe not found Else $sOutput = FileRead($sOutputFile, FileGetSize($sOutputFile)) If StringInStr($sOutput, "SQL error:", 1) > 0 Or StringInStr($sOutput, "Incomplete SQL:", 1) > 0 Then $iRval = $SQLITE_ERROR ; SQL error / Incomplete SQL EndIf Else $iRval = $SQLITE_CANTOPEN ; Can't open Input File EndIf If FileExists($sInputFile) Then FileDelete($sInputFile) ;If FileExists($BatchFile) Then FileDelete($BatchFile) Switch $iRval Case $SQLITE_MISUSE SetError(2) Case $SQLITE_ERROR SetError(3) Case $SQLITE_CANTOPEN SetError(4) EndSwitch Return $iRval EndFunc Func _Decode_StandardInformation($Attribute) Local $SI_Offset = 1-48, $Add="", $f=0, $SI_Size, $SI_CTime_tmp, $SI_ATime_tmp, $SI_MTime_tmp, $SI_RTime_tmp If $attribute_offset < 24 Then $Attribute = StringTrimLeft($Attribute,24-$attribute_offset) ;For now just strip the attribute header. $SI_Size = StringLen($Attribute) Select Case $attribute_offset <= 48 Local $LoopCounter = 0 Do If StringLen($Attribute) >= 144 Then ExitLoop $LoopCounter += 1 $Attribute = "00"&$Attribute Until StringLen($Attribute) >= 144 Local $SI_XTime_Fragment = "" Select Case $LoopCounter > 0 And $LoopCounter < 8 $TextInformation &= ";CTime in $SI is incomplete. Search debug.log for " & $this_lsn $BytesMissing = 8-$LoopCounter $BytesMissing = $LoopCounter _DumpOutput("Error in UpdateResidentValue for lsn " & $this_lsn & @CRLF) _DumpOutput("CTime in $SI was incomplete as " & $BytesMissing & " bytes was missing." & @CRLF) $SI_XTime_Fragment = StringMid($Attribute, $SI_Offset + 48 + ($BytesMissing*2), 16 - ($BytesMissing*2)) Case $LoopCounter > 8 And $LoopCounter < 16 $TextInformation &= ";ATime in $SI is incomplete. Search debug.log for " & $this_lsn $BytesMissing = 16-$LoopCounter ;9 $BytesMissing = $LoopCounter-8 _DumpOutput("Error in UpdateResidentValue for lsn " & $this_lsn & @CRLF) _DumpOutput("ATime in $SI was incomplete as " & $BytesMissing & " bytes was missing." & @CRLF) $SI_XTime_Fragment = StringMid($Attribute, $SI_Offset + 64 + ($BytesMissing*2), 16 - ($BytesMissing*2)) Case $LoopCounter > 16 And $LoopCounter < 24 $TextInformation &= ";MTime in $SI is incomplete. Search debug.log for " & $this_lsn $BytesMissing = 24-$LoopCounter ;17 $BytesMissing = $LoopCounter-16 _DumpOutput("Error in UpdateResidentValue for lsn " & $this_lsn & @CRLF) _DumpOutput("MTime in $SI was incomplete as " & $BytesMissing & " bytes was missing." & @CRLF) $SI_XTime_Fragment = StringMid($Attribute, $SI_Offset + 80 + ($BytesMissing*2), 16 - ($BytesMissing*2)) Case $LoopCounter > 24 And $LoopCounter < 32 $TextInformation &= ";RTime in $SI is incomplete. Search debug.log for " & $this_lsn $BytesMissing = 32-$LoopCounter $BytesMissing = $LoopCounter-24 _DumpOutput("Error in UpdateResidentValue for lsn " & $this_lsn & @CRLF) _DumpOutput("RTime in $SI was incomplete as " & $BytesMissing & " bytes was missing." & @CRLF) $SI_XTime_Fragment = StringMid($Attribute, $SI_Offset + 96 + ($BytesMissing*2), 16 - ($BytesMissing*2)) EndSelect ; _DumpOutput("$TextInformation: " & $TextInformation & @CRLF) If $SI_XTime_Fragment Then $UnknownBytes = "" $LowBytes = "" $HighBytes = "" For $Byte1=1 To $BytesMissing $UnknownBytes &= "XX" $LowBytes &= "00" $HighBytes &= "FF" Next _DumpOutput("The timestamp fragment in little endian: (" & $UnknownBytes & ")" & $SI_XTime_Fragment & @CRLF) _DumpOutput("The XX's are the substitute for the unknown and unchanged bytes." & @CRLF) _DumpOutput("The theoretical possible range the timstamp can cover for is thus " & $LowBytes & $SI_XTime_Fragment & " - " & $HighBytes & $SI_XTime_Fragment & @CRLF) ;Decode the low end timestamp of range $LowEnd_SI_XTime_Fragment = _SwapEndian($LowBytes & $SI_XTime_Fragment) $LowEnd_SI_XTime_Fragment_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $LowEnd_SI_XTime_Fragment) $LowEnd_SI_XTime_Fragment = _WinTime_UTCFileTimeFormat(Dec($LowEnd_SI_XTime_Fragment,2) - $tDelta, $DateTimeFormat, 3) If @error Then $LowEnd_SI_XTime_Fragment = $TimestampErrorVal Else $LowEnd_SI_XTime_Fragment = $LowEnd_SI_XTime_Fragment & $PrecisionSeparator2 & _FillZero(StringRight($LowEnd_SI_XTime_Fragment_tmp, 4)) EndIf ;Decode the high end timestamp of range $HighEnd_SI_XTime_Fragment = _SwapEndian($HighBytes & $SI_XTime_Fragment) $HighEnd_SI_XTime_Fragment_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $HighEnd_SI_XTime_Fragment) $HighEnd_SI_XTime_Fragment = _WinTime_UTCFileTimeFormat(Dec($HighEnd_SI_XTime_Fragment,2) - $tDelta, $DateTimeFormat, 3) If @error Then $HighEnd_SI_XTime_Fragment = $TimestampErrorVal Else $HighEnd_SI_XTime_Fragment = $HighEnd_SI_XTime_Fragment & $PrecisionSeparator2 & _FillZero(StringRight($HighEnd_SI_XTime_Fragment_tmp, 4)) EndIf _DumpOutput("The decoded timestamps for the above range " & $LowEnd_SI_XTime_Fragment & " - " & $HighEnd_SI_XTime_Fragment & @CRLF) _DumpOutput("The replacement values are always 00's. That is the timestamp in the low end of the range." & @CRLF) _DumpOutput("This is not a parsing error, but a consequence of that these specific bytes did not change from the previous timestamp." & @CRLF) _DumpOutput("If there is an earlier UpdateResidentValue for this MFT ref, you may be able to resolve the missing byte(s)." & @CRLF & @CRLF) EndIf $SI_CTime = StringMid($Attribute, $SI_Offset + 48, 16) ; $SI_CTime = _SwapEndian($SI_CTime) ; $SI_CTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_CTime) ; $SI_CTime = _WinTime_UTCFileTimeFormat(Dec($SI_CTime,2) - $tDelta, $DateTimeFormat, 2) ; If @error Then ; $SI_CTime = "-" ; Else ; $SI_CTime = $SI_CTime & ":" & _FillZero(StringRight($SI_CTime_tmp, 4)) ; EndIf ; $SI_CTime = _SwapEndian($SI_CTime) $SI_CTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_CTime) $SI_CTime = _WinTime_UTCFileTimeFormat(Dec($SI_CTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_CTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_CTime_Core = StringMid($SI_CTime,1,StringLen($SI_CTime)-4) $SI_CTime_Precision = StringRight($SI_CTime,3) ElseIf $TimestampPrecision = 3 Then $SI_CTime = $SI_CTime & $PrecisionSeparator2 & _FillZero(StringRight($SI_CTime_tmp, 4)) $SI_CTime_Core = StringMid($SI_CTime,1,StringLen($SI_CTime)-9) $SI_CTime_Precision = StringRight($SI_CTime,8) Else $SI_CTime_Core = $SI_CTime EndIf ; $SI_ATime = StringMid($Attribute, $SI_Offset + 64, 16) ; $SI_ATime = _SwapEndian($SI_ATime) ; $SI_ATime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_ATime) ; $SI_ATime = _WinTime_UTCFileTimeFormat(Dec($SI_ATime,2) - $tDelta, $DateTimeFormat, 2) ; If @error Then ; $SI_ATime = "-" ; Else ; $SI_ATime = $SI_ATime & ":" & _FillZero(StringRight($SI_ATime_tmp, 4)) ; EndIf ; $SI_ATime = _SwapEndian($SI_ATime) $SI_ATime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_ATime) $SI_ATime = _WinTime_UTCFileTimeFormat(Dec($SI_ATime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_ATime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_ATime_Core = StringMid($SI_ATime,1,StringLen($SI_ATime)-4) $SI_ATime_Precision = StringRight($SI_ATime,3) ElseIf $TimestampPrecision = 3 Then $SI_ATime = $SI_ATime & $PrecisionSeparator2 & _FillZero(StringRight($SI_ATime_tmp, 4)) $SI_ATime_Core = StringMid($SI_ATime,1,StringLen($SI_ATime)-9) $SI_ATime_Precision = StringRight($SI_ATime,8) Else $SI_ATime_Core = $SI_ATime EndIf ; $SI_MTime = StringMid($Attribute, $SI_Offset + 80, 16) ; $SI_MTime = _SwapEndian($SI_MTime) ; $SI_MTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_MTime) ; $SI_MTime = _WinTime_UTCFileTimeFormat(Dec($SI_MTime,2) - $tDelta, $DateTimeFormat, 2) ; If @error Then ; $SI_MTime = "-" ; Else ; $SI_MTime = $SI_MTime & ":" & _FillZero(StringRight($SI_MTime_tmp, 4)) ; EndIf ; $SI_MTime = _SwapEndian($SI_MTime) $SI_MTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_MTime) $SI_MTime = _WinTime_UTCFileTimeFormat(Dec($SI_MTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_MTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_MTime_Core = StringMid($SI_MTime,1,StringLen($SI_MTime)-4) $SI_MTime_Precision = StringRight($SI_MTime,3) ElseIf $TimestampPrecision = 3 Then $SI_MTime = $SI_MTime & $PrecisionSeparator2 & _FillZero(StringRight($SI_MTime_tmp, 4)) $SI_MTime_Core = StringMid($SI_MTime,1,StringLen($SI_MTime)-9) $SI_MTime_Precision = StringRight($SI_MTime,8) Else $SI_MTime_Core = $SI_MTime EndIf ; $SI_RTime = StringMid($Attribute, $SI_Offset + 96, 16) ; $SI_RTime = _SwapEndian($SI_RTime) ; $SI_RTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_RTime) ; $SI_RTime = _WinTime_UTCFileTimeFormat(Dec($SI_RTime,2) - $tDelta, $DateTimeFormat, 2) ; If @error Then ; $SI_RTime = "-" ; Else ; $SI_RTime = $SI_RTime & ":" & _FillZero(StringRight($SI_RTime_tmp, 4)) ; EndIf ; $SI_RTime = _SwapEndian($SI_RTime) $SI_RTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_RTime) $SI_RTime = _WinTime_UTCFileTimeFormat(Dec($SI_RTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_RTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_RTime_Core = StringMid($SI_RTime,1,StringLen($SI_RTime)-4) $SI_RTime_Precision = StringRight($SI_RTime,3) ElseIf $TimestampPrecision = 3 Then $SI_RTime = $SI_RTime & $PrecisionSeparator2 & _FillZero(StringRight($SI_RTime_tmp, 4)) $SI_RTime_Core = StringMid($SI_RTime,1,StringLen($SI_RTime)-9) $SI_RTime_Precision = StringRight($SI_RTime,8) Else $SI_RTime_Core = $SI_RTime EndIf ; ; 16 * 4 = 64 If $SI_Size >= 72 Then $SI_FilePermission = StringMid($Attribute, $SI_Offset + 112, 8) $SI_FilePermission = _SwapEndian($SI_FilePermission) $SI_FilePermission = _File_Attributes("0x" & $SI_FilePermission) Else $SI_FilePermission = "-" EndIf If $SI_Size >= 80 Then $SI_MaxVersions = StringMid($Attribute, $SI_Offset + 120, 8) $SI_MaxVersions = Dec(_SwapEndian($SI_MaxVersions),2) Else $SI_MaxVersions = $IntegerErrorVal EndIf If $SI_Size >= 88 Then $SI_VersionNumber = StringMid($Attribute, $SI_Offset + 128, 8) $SI_VersionNumber = Dec(_SwapEndian($SI_VersionNumber),2) Else $SI_VersionNumber = $IntegerErrorVal EndIf If $SI_Size >= 96 Then $SI_ClassID = StringMid($Attribute, $SI_Offset + 136, 8) $SI_ClassID = Dec(_SwapEndian($SI_ClassID),2) Else $SI_ClassID = $IntegerErrorVal EndIf If $SI_Size >= 104 Then $SI_OwnerID = StringMid($Attribute, $SI_Offset + 144, 8) $SI_OwnerID = Dec(_SwapEndian($SI_OwnerID),2) Else $SI_OwnerID = $IntegerErrorVal EndIf If $SI_Size >= 112 Then $SI_SecurityID = StringMid($Attribute, $SI_Offset + 152, 8) $SI_SecurityID = Dec(_SwapEndian($SI_SecurityID),2) Else $SI_SecurityID = $IntegerErrorVal EndIf If $SI_Size >= 128 Then $SI_QuotaCharged = StringMid($Attribute, $SI_Offset + 160, 16) $SI_QuotaCharged = Dec(_SwapEndian($SI_QuotaCharged),2) Else $SI_QuotaCharged = $IntegerErrorVal EndIf If $SI_Size >= 144 Then $SI_USN = StringMid($Attribute, $SI_Offset + 176, 16) $SI_USN = Dec(_SwapEndian($SI_USN),2) Else $SI_USN = $IntegerErrorVal EndIf Case $attribute_offset >= 56 And $attribute_offset < 60 $SI_Offset = 1-112 $SI_CTime = $TimestampErrorVal $SI_ATime = $TimestampErrorVal $SI_MTime = $TimestampErrorVal $SI_RTime = $TimestampErrorVal If $attribute_offset = 56 Then $SI_FilePermission = StringMid($Attribute, $SI_Offset + 112, 8) $SI_FilePermission = _SwapEndian($SI_FilePermission) $SI_FilePermission = _File_Attributes("0x" & $SI_FilePermission) Else $SI_FilePermission = "PARTIAL VALUE" $SI_PartialValue = StringMid($Attribute, $SI_Offset + 112, 8 - ($attribute_offset-56)*2) EndIf ;Adjust the rest of the attribute For $f = 1 To $attribute_offset-56 $Add &= "00" Next $Attribute = $Add&$Attribute $SI_Size = StringLen($Attribute) If $SI_Size >= 16 Then $SI_MaxVersions = StringMid($Attribute, $SI_Offset + 120, 8) $SI_MaxVersions = Dec(_SwapEndian($SI_MaxVersions),2) Else $SI_MaxVersions = $IntegerErrorVal EndIf If $SI_Size >= 24 Then $SI_VersionNumber = StringMid($Attribute, $SI_Offset + 128, 8) $SI_VersionNumber = Dec(_SwapEndian($SI_VersionNumber),2) Else $SI_VersionNumber = $IntegerErrorVal EndIf If $SI_Size >= 32 Then $SI_ClassID = StringMid($Attribute, $SI_Offset + 136, 8) $SI_ClassID = Dec(_SwapEndian($SI_ClassID),2) Else $SI_ClassID = $IntegerErrorVal EndIf If $SI_Size >= 40 Then $SI_OwnerID = StringMid($Attribute, $SI_Offset + 144, 8) $SI_OwnerID = Dec(_SwapEndian($SI_OwnerID),2) Else $SI_OwnerID = $IntegerErrorVal EndIf If $SI_Size >= 48 Then $SI_SecurityID = StringMid($Attribute, $SI_Offset + 152, 8) $SI_SecurityID = Dec(_SwapEndian($SI_SecurityID),2) Else $SI_SecurityID = $IntegerErrorVal EndIf If $SI_Size >= 64 Then $SI_QuotaCharged = StringMid($Attribute, $SI_Offset + 160, 16) $SI_QuotaCharged = Dec(_SwapEndian($SI_QuotaCharged),2) Else $SI_QuotaCharged = $IntegerErrorVal EndIf If $SI_Size >= 80 Then $SI_USN = StringMid($Attribute, $SI_Offset + 176, 16) $SI_USN = Dec(_SwapEndian($SI_USN),2) Else $SI_USN = $IntegerErrorVal EndIf Case $attribute_offset >= 60 And $attribute_offset < 64 $SI_Offset = 1-120 $SI_CTime = $TimestampErrorVal $SI_ATime = $TimestampErrorVal $SI_MTime = $TimestampErrorVal $SI_RTime = $TimestampErrorVal $SI_FilePermission = "-" If $attribute_offset = 60 Then $SI_MaxVersions = StringMid($Attribute, $SI_Offset + 120, 8) $SI_MaxVersions = Dec(_SwapEndian($SI_MaxVersions),2) Else $SI_MaxVersions = $IntegerPartialValReplacement $SI_PartialValue = StringMid($Attribute, $SI_Offset + 120, 8 - ($attribute_offset-60)*2) EndIf For $f = 1 To $attribute_offset-60 $Add &= "00" Next $Attribute = $Add&$Attribute $SI_Size = StringLen($Attribute) If $SI_Size >= 16 Then $SI_VersionNumber = StringMid($Attribute, $SI_Offset + 128, 8) $SI_VersionNumber = Dec(_SwapEndian($SI_VersionNumber),2) Else $SI_VersionNumber = $IntegerErrorVal EndIf If $SI_Size >= 24 Then $SI_ClassID = StringMid($Attribute, $SI_Offset + 136, 8) $SI_ClassID = Dec(_SwapEndian($SI_ClassID),2) Else $SI_ClassID = $IntegerErrorVal EndIf If $SI_Size >= 32 Then $SI_OwnerID = StringMid($Attribute, $SI_Offset + 144, 8) $SI_OwnerID = Dec(_SwapEndian($SI_OwnerID),2) Else $SI_OwnerID = $IntegerErrorVal EndIf If $SI_Size >= 40 Then $SI_SecurityID = StringMid($Attribute, $SI_Offset + 152, 8) $SI_SecurityID = Dec(_SwapEndian($SI_SecurityID),2) Else $SI_SecurityID = $IntegerErrorVal EndIf If $SI_Size >= 56 Then $SI_QuotaCharged = StringMid($Attribute, $SI_Offset + 160, 16) $SI_QuotaCharged = Dec(_SwapEndian($SI_QuotaCharged),2) Else $SI_QuotaCharged = $IntegerErrorVal EndIf If $SI_Size >= 80 Then $SI_USN = StringMid($Attribute, $SI_Offset + 176, 16) $SI_USN = Dec(_SwapEndian($SI_USN),2) Else $SI_USN = $IntegerErrorVal EndIf Case $attribute_offset >= 64 And $attribute_offset < 68 $SI_Offset = 1-128 $SI_CTime = $TimestampErrorVal $SI_ATime = $TimestampErrorVal $SI_MTime = $TimestampErrorVal $SI_RTime = $TimestampErrorVal $SI_FilePermission = "-" $SI_MaxVersions = $IntegerErrorVal If $attribute_offset = 64 Then $SI_VersionNumber = StringMid($Attribute, $SI_Offset + 128, 8) $SI_VersionNumber = Dec(_SwapEndian($SI_VersionNumber),2) Else $SI_VersionNumber = $IntegerPartialValReplacement $SI_PartialValue = StringMid($Attribute, $SI_Offset + 128, 8 - ($attribute_offset-64)*2) EndIf For $f = 1 To $attribute_offset-64 $Add &= "00" Next $Attribute = $Add&$Attribute $SI_Size = StringLen($Attribute) If $SI_Size >= 16 Then $SI_ClassID = StringMid($Attribute, $SI_Offset + 136, 8) $SI_ClassID = Dec(_SwapEndian($SI_ClassID),2) Else $SI_ClassID = $IntegerErrorVal EndIf If $SI_Size >= 24 Then $SI_OwnerID = StringMid($Attribute, $SI_Offset + 144, 8) $SI_OwnerID = Dec(_SwapEndian($SI_OwnerID),2) Else $SI_OwnerID = $IntegerErrorVal EndIf If $SI_Size >= 32 Then $SI_SecurityID = StringMid($Attribute, $SI_Offset + 152, 8) $SI_SecurityID = Dec(_SwapEndian($SI_SecurityID),2) Else $SI_SecurityID = $IntegerErrorVal EndIf If $SI_Size >= 48 Then $SI_QuotaCharged = StringMid($Attribute, $SI_Offset + 160, 16) $SI_QuotaCharged = Dec(_SwapEndian($SI_QuotaCharged),2) Else $SI_QuotaCharged = $IntegerErrorVal EndIf If $SI_Size >= 64 Then $SI_USN = StringMid($Attribute, $SI_Offset + 176, 16) $SI_USN = Dec(_SwapEndian($SI_USN),2) Else $SI_USN = $IntegerErrorVal EndIf Case $attribute_offset >= 68 And $attribute_offset < 72 $SI_Offset = 1-136 $SI_CTime = $TimestampErrorVal $SI_ATime = $TimestampErrorVal $SI_MTime = $TimestampErrorVal $SI_RTime = $TimestampErrorVal $SI_FilePermission = "-" $SI_MaxVersions = $IntegerErrorVal $SI_VersionNumber = $IntegerErrorVal If $attribute_offset = 68 Then $SI_ClassID = StringMid($Attribute, $SI_Offset + 136, 8) $SI_ClassID = Dec(_SwapEndian($SI_ClassID),2) Else $SI_ClassID = $IntegerPartialValReplacement $SI_PartialValue = StringMid($Attribute, $SI_Offset + 136, 8 - ($attribute_offset-68)*2) EndIf For $f = 1 To $attribute_offset-68 $Add &= "00" Next $Attribute = $Add&$Attribute $SI_Size = StringLen($Attribute) If $SI_Size >= 16 Then $SI_OwnerID = StringMid($Attribute, $SI_Offset + 144, 8) $SI_OwnerID = Dec(_SwapEndian($SI_OwnerID),2) Else $SI_OwnerID = $IntegerErrorVal EndIf If $SI_Size >= 24 Then $SI_SecurityID = StringMid($Attribute, $SI_Offset + 152, 8) $SI_SecurityID = Dec(_SwapEndian($SI_SecurityID),2) Else $SI_SecurityID = $IntegerErrorVal EndIf If $SI_Size >= 40 Then $SI_QuotaCharged = StringMid($Attribute, $SI_Offset + 160, 16) $SI_QuotaCharged = Dec(_SwapEndian($SI_QuotaCharged),2) Else $SI_QuotaCharged = $IntegerErrorVal EndIf If $SI_Size >= 56 Then $SI_USN = StringMid($Attribute, $SI_Offset + 176, 16) $SI_USN = Dec(_SwapEndian($SI_USN),2) Else $SI_USN = $IntegerErrorVal EndIf Case $attribute_offset >= 72 And $attribute_offset < 76 $SI_Offset = 1-144 $SI_CTime = $TimestampErrorVal $SI_ATime = $TimestampErrorVal $SI_MTime = $TimestampErrorVal $SI_RTime = $TimestampErrorVal $SI_FilePermission = "-" $SI_MaxVersions = $IntegerErrorVal $SI_VersionNumber = $IntegerErrorVal $SI_ClassID = $IntegerErrorVal If $attribute_offset = 72 Then $SI_OwnerID = StringMid($Attribute, $SI_Offset + 144, 8) $SI_OwnerID = Dec(_SwapEndian($SI_OwnerID),2) Else $SI_OwnerID = $IntegerPartialValReplacement $SI_PartialValue = StringMid($Attribute, $SI_Offset + 144, 8 - ($attribute_offset-72)*2) EndIf For $f = 1 To $attribute_offset-72 $Add &= "00" Next $Attribute = $Add&$Attribute $SI_Size = StringLen($Attribute) If $SI_Size >= 16 Then $SI_SecurityID = StringMid($Attribute, $SI_Offset + 152, 8) $SI_SecurityID = Dec(_SwapEndian($SI_SecurityID),2) Else $SI_SecurityID = $IntegerErrorVal EndIf If $SI_Size >= 32 Then $SI_QuotaCharged = StringMid($Attribute, $SI_Offset + 160, 16) $SI_QuotaCharged = Dec(_SwapEndian($SI_QuotaCharged),2) Else $SI_QuotaCharged = $IntegerErrorVal EndIf If $SI_Size >= 48 Then $SI_USN = StringMid($Attribute, $SI_Offset + 176, 16) $SI_USN = Dec(_SwapEndian($SI_USN),2) Else $SI_USN = $IntegerErrorVal EndIf Case $attribute_offset >= 76 And $attribute_offset < 80 $SI_Offset = 1-152 $SI_CTime = $TimestampErrorVal $SI_ATime = $TimestampErrorVal $SI_MTime = $TimestampErrorVal $SI_RTime = $TimestampErrorVal $SI_FilePermission = "-" $SI_MaxVersions = $IntegerErrorVal $SI_VersionNumber = $IntegerErrorVal $SI_ClassID = $IntegerErrorVal $SI_OwnerID = $IntegerErrorVal If $attribute_offset = 76 Then $SI_SecurityID = StringMid($Attribute, $SI_Offset + 152, 8) $SI_SecurityID = Dec(_SwapEndian($SI_SecurityID),2) Else $SI_SecurityID = $IntegerPartialValReplacement $SI_PartialValue = StringMid($Attribute, $SI_Offset + 152, 8 - ($attribute_offset-76)*2) EndIf For $f = 1 To $attribute_offset-76 $Add &= "00" Next $Attribute = $Add&$Attribute $SI_Size = StringLen($Attribute) If $SI_Size >= 24 Then $SI_QuotaCharged = StringMid($Attribute, $SI_Offset + 160, 16) $SI_QuotaCharged = Dec(_SwapEndian($SI_QuotaCharged),2) Else $SI_QuotaCharged = $IntegerErrorVal EndIf If $SI_Size >= 40 Then $SI_USN = StringMid($Attribute, $SI_Offset + 176, 16) $SI_USN = Dec(_SwapEndian($SI_USN),2) Else $SI_USN = $IntegerErrorVal EndIf Case $attribute_offset >= 80 And $attribute_offset < 88 $SI_Offset = 1-160 $SI_CTime = $TimestampErrorVal $SI_ATime = $TimestampErrorVal $SI_MTime = $TimestampErrorVal $SI_RTime = $TimestampErrorVal $SI_FilePermission = "-" $SI_MaxVersions = $IntegerErrorVal $SI_VersionNumber = $IntegerErrorVal $SI_ClassID = $IntegerErrorVal $SI_OwnerID = $IntegerErrorVal $SI_SecurityID = $IntegerErrorVal If $attribute_offset = 80 Then $SI_QuotaCharged = StringMid($Attribute, $SI_Offset + 160, 16) $SI_QuotaCharged = Dec(_SwapEndian($SI_QuotaCharged),2) Else $SI_QuotaCharged = $IntegerPartialValReplacement $SI_PartialValue = StringMid($Attribute, $SI_Offset + 160, 16 - ($attribute_offset-80)*2) EndIf For $f = 1 To $attribute_offset-80 $Add &= "00" Next $Attribute = $Add&$Attribute $SI_Size = StringLen($Attribute) If $SI_Size = 16 Then $SI_USN = StringMid($Attribute, $SI_Offset + 176, 16) $SI_USN = Dec(_SwapEndian($SI_USN),2) Else $SI_USN = $IntegerErrorVal EndIf Case $attribute_offset >= 88 And $attribute_offset < 95 $SI_Offset = 1-176 $SI_CTime = $TimestampErrorVal $SI_ATime = $TimestampErrorVal $SI_MTime = $TimestampErrorVal $SI_RTime = $TimestampErrorVal $SI_FilePermission = "-" $SI_MaxVersions = $IntegerErrorVal $SI_VersionNumber = $IntegerErrorVal $SI_ClassID = $IntegerErrorVal $SI_OwnerID = $IntegerErrorVal $SI_SecurityID = $IntegerErrorVal $SI_QuotaCharged = $IntegerErrorVal If $attribute_offset = 88 Then $SI_USN = StringMid($Attribute, $SI_Offset + 176, 16) $SI_USN = Dec(_SwapEndian($SI_USN),2) Else $SI_USN = $IntegerPartialValReplacement $SI_PartialValue = StringMid($Attribute, $SI_Offset + 176, 16 - ($attribute_offset-88)*2) EndIf EndSelect If $SI_USN <> $IntegerErrorVal Then _WriteLogFileDataRunsCsv() If $VerboseOn Then _DumpOutput("The rebuilt $STANDARD_INFORMATION: " & @CRLF) _DumpOutput(_HexEncode("0x"&$Attribute) & @CRLF) ; _DumpOutput("$SI_HEADER_Flags: " & $SI_HEADER_Flags & @CRLF) _DumpOutput("$SI_CTime: " & $SI_CTime & @CRLF) _DumpOutput("$SI_ATime: " & $SI_ATime & @CRLF) _DumpOutput("$SI_MTime: " & $SI_MTime & @CRLF) _DumpOutput("$SI_RTime: " & $SI_RTime & @CRLF) _DumpOutput("$SI_FilePermission: " & $SI_FilePermission & @CRLF) _DumpOutput("$SI_MaxVersions: " & $SI_MaxVersions & @CRLF) _DumpOutput("$SI_VersionNumber: " & $SI_VersionNumber & @CRLF) _DumpOutput("$SI_ClassID: " & $SI_ClassID & @CRLF) _DumpOutput("$SI_OwnerID: " & $SI_OwnerID & @CRLF) _DumpOutput("$SI_SecurityID: " & $SI_SecurityID & @CRLF) _DumpOutput("$SI_QuotaCharged: " & $SI_QuotaCharged & @CRLF) _DumpOutput("$SI_USN: " & $SI_USN & @CRLF) _DumpOutput("$SI_PartialValue: " & $SI_PartialValue & @CRLF) EndIf EndFunc Func _DecodeSourceInfoFlag($input) Select Case $input = 0x00000001 $ret = "USN_SOURCE_DATA_MANAGEMENT" Case $input = 0x00000002 $ret = "USN_SOURCE_AUXILIARY_DATA" Case $input = 0x00000004 $ret = "USN_SOURCE_REPLICATION_MANAGEMENT" Case $input = 0x00000008 $ret = "USN_SOURCE_CLIENT_REPLICATION_MANAGEMENT" Case Else $ret = "EMPTY" EndSelect Return $ret EndFunc Func _DecodeTimestamp($StampDecode) $StampDecode = _SwapEndian($StampDecode) $StampDecode_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $StampDecode) $StampDecode = _WinTime_UTCFileTimeFormat(Dec($StampDecode,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $StampDecode = $TimestampErrorVal ElseIf $TimestampPrecision = 3 Then $StampDecode = $StampDecode & $PrecisionSeparator2 & _FillZero(StringRight($StampDecode_tmp, 4)) EndIf Return $StampDecode EndFunc Func _DecodeReasonCodes($USNReasonInput) Local $USNReasonOutput = "" If BitAND($USNReasonInput, 0x00000100) Then $USNReasonOutput &= 'FILE_CREATE+' ;The file or directory is created for the first time. If BitAND($USNReasonInput, 0x00001000) Then $USNReasonOutput &= 'RENAME_OLD_NAME+' ;The file or directory is renamed, and the file name in the USN_RECORD_V2 structure is the previous name. If BitAND($USNReasonInput, 0x00002000) Then $USNReasonOutput &= 'RENAME_NEW_NAME+' ;A file or directory is renamed, and the file name in the USN_RECORD_V2 structure is the new name. If BitAND($USNReasonInput, 0x00008000) Then $USNReasonOutput &= 'BASIC_INFO_CHANGE+' ;A user has either changed one or more file or directory attributes (for example, the read-only, hidden, system, archive, or sparse attribute), or one or more time stamps. If BitAND($USNReasonInput, 0x00000400) Then $USNReasonOutput &= 'EA_CHANGE+' ;The user made a change to the extended attributes of a file or directory. ;These NTFS file system attributes are not accessible to Windows-based applications. If BitAND($USNReasonInput, 0x00000800) Then $USNReasonOutput &= 'SECURITY_CHANGE+' ;A change is made in the access rights to a file or directory. If BitAND($USNReasonInput, 0x00004000) Then $USNReasonOutput &= 'INDEXABLE_CHANGE+' ;A user changes the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED attribute. ;That is, the user changes the file or directory from one where content can be indexed to one where content cannot be indexed, or vice versa. Content indexing permits rapid searching of data by building a database of selected content. If BitAND($USNReasonInput, 0x00010000) Then $USNReasonOutput &= 'HARD_LINK_CHANGE+' ;An NTFS file system hard link is added to or removed from the file or directory. ;An NTFS file system hard link, similar to a POSIX hard link, is one of several directory entries that see the same file or directory. If BitAND($USNReasonInput, 0x00020000) Then $USNReasonOutput &= 'COMPRESSION_CHANGE+' ;The compression state of the file or directory is changed from or to compressed. If BitAND($USNReasonInput, 0x00040000) Then $USNReasonOutput &= 'ENCRYPTION_CHANGE+' ;The file or directory is encrypted or decrypted. If BitAND($USNReasonInput, 0x00080000) Then $USNReasonOutput &= 'OBJECT_ID_CHANGE+' ;The object identifier of a file or directory is changed. If BitAND($USNReasonInput, 0x00100000) Then $USNReasonOutput &= 'REPARSE_POINT_CHANGE+' ;The reparse point that is contained in a file or directory is changed, or a reparse point is added to or deleted from a file or directory. If BitAND($USNReasonInput, 0x00800000) Then $USNReasonOutput &= 'INTEGRITY_CHANGE+' If BitAND($USNReasonInput, 0x00000004) Then $USNReasonOutput &= 'DATA_TRUNCATION+' ;The file or directory is truncated. If BitAND($USNReasonInput, 0x00000002) Then $USNReasonOutput &= 'DATA_EXTEND+' ;The file or directory is extended (added to). If BitAND($USNReasonInput, 0x00000001) Then $USNReasonOutput &= 'DATA_OVERWRITE+' ;The data in the file or directory is overwritten. If BitAND($USNReasonInput, 0x00200000) Then $USNReasonOutput &= 'STREAM_CHANGE+' ;A named stream is added to or removed from a file, or a named stream is renamed. If BitAND($USNReasonInput, 0x00400000) Then $USNReasonOutput &= 'TRANSACTED_CHANGE+' ;Transactional NTFS (TxF) change. If BitAND($USNReasonInput, 0x00000040) Then $USNReasonOutput &= 'NAMED_DATA_TRUNCATION+' ;The one or more named data streams for a file is truncated. If BitAND($USNReasonInput, 0x00000020) Then $USNReasonOutput &= 'NAMED_DATA_EXTEND+' ;The one or more named data streams for a file are extended (added to). If BitAND($USNReasonInput, 0x00000010) Then $USNReasonOutput &= 'NAMED_DATA_OVERWRITE+' ;The data in one or more named data streams for a file is overwritten. If BitAND($USNReasonInput, 0x01000000) Then $USNReasonOutput &= 'DESIRED_STORAGE_CLASS_CHANGE+' ; If BitAND($USNReasonInput, 0x00000200) Then $USNReasonOutput &= 'FILE_DELETE+' ;The file or directory is deleted. If BitAND($USNReasonInput, 0x80000000) Then $USNReasonOutput &= 'CLOSE+' ;The file or directory is closed. $USNReasonOutput = StringTrimRight($USNReasonOutput, 1) Return $USNReasonOutput EndFunc Func _File_Attributes($FAInput) Local $FAOutput = "" If BitAND($FAInput, 0x0001) Then $FAOutput &= 'read_only+' If BitAND($FAInput, 0x0002) Then $FAOutput &= 'hidden+' If BitAND($FAInput, 0x0004) Then $FAOutput &= 'system+' If BitAND($FAInput, 0x0010) Then $FAOutput &= 'directory1+' If BitAND($FAInput, 0x0020) Then $FAOutput &= 'archive+' If BitAND($FAInput, 0x0040) Then $FAOutput &= 'device+' If BitAND($FAInput, 0x0080) Then $FAOutput &= 'normal+' If BitAND($FAInput, 0x0100) Then $FAOutput &= 'temporary+' If BitAND($FAInput, 0x0200) Then $FAOutput &= 'sparse_file+' If BitAND($FAInput, 0x0400) Then $FAOutput &= 'reparse_point+' If BitAND($FAInput, 0x0800) Then $FAOutput &= 'compressed+' If BitAND($FAInput, 0x1000) Then $FAOutput &= 'offline+' If BitAND($FAInput, 0x2000) Then $FAOutput &= 'not_indexed+' If BitAND($FAInput, 0x4000) Then $FAOutput &= 'encrypted+' If BitAND($FAInput, 0x8000) Then $FAOutput &= 'integrity_stream+' If BitAND($FAInput, 0x10000) Then $FAOutput &= 'virtual+' If BitAND($FAInput, 0x20000) Then $FAOutput &= 'no_scrub_data+' If BitAND($FAInput, 0x40000) Then $FAOutput &= 'ea+' If BitAND($FAInput, 0x10000000) Then $FAOutput &= 'directory2+' If BitAND($FAInput, 0x20000000) Then $FAOutput &= 'index_view+' $FAOutput = StringTrimRight($FAOutput, 1) Return $FAOutput EndFunc Func _UsnProcessPage($TargetPage) Local $NextOffset = 1, $TotalSizeOfPage = StringLen($TargetPage) Do ;$LocalUsnPart+=1 $SizeOfNextUsnRecord = StringMid($TargetPage,$NextOffset,8) $SizeOfNextUsnRecord = Dec(_SwapEndian($SizeOfNextUsnRecord),2) If $SizeOfNextUsnRecord = 0 Then ExitLoop $SizeOfNextUsnRecord = $SizeOfNextUsnRecord*2 $NextUsnRecord = StringMid($TargetPage,$NextOffset,$SizeOfNextUsnRecord) $FileNameLength = StringMid($TargetPage,$NextOffset+112,4) $FileNameLength = Dec(_SwapEndian($FileNameLength),2) ; $TestOffset = $FileNameOffset+$FileNameLength ;$TestOffset = 60+$FileNameLength If $NextOffset+$SizeOfNextUsnRecord >= $TotalSizeOfPage Then Return ; ConsoleWrite(" - - - - - - - - - - - - - - - - - - - - - - - - - - " & @CRLF) ; ConsoleWrite("Part: " & $LocalUsnPart & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$NextUsnRecord) & @CRLF) _UsnDecodeRecord($NextUsnRecord) $NextOffset+=$SizeOfNextUsnRecord Until $NextOffset >= $TotalSizeOfPage Return EndFunc Func _UsnDecodeRecord($Record) $UsnJrnlRecordLength = StringMid($Record,1,8) $UsnJrnlRecordLength = Dec(_SwapEndian($UsnJrnlRecordLength),2) ; $UsnJrnlMajorVersion = StringMid($Record,9,4) ; $UsnJrnlMinorVersion = StringMid($Record,13,4) $UsnJrnlFileReferenceNumber = StringMid($Record,17,12) $UsnJrnlFileReferenceNumber = Dec(_SwapEndian($UsnJrnlFileReferenceNumber),2) $UsnJrnlParentFileReferenceNumber = StringMid($Record,33,12) $UsnJrnlParentFileReferenceNumber = Dec(_SwapEndian($UsnJrnlParentFileReferenceNumber),2) $UsnJrnlUsn = StringMid($Record,49,16) $UsnJrnlUsn = Dec(_SwapEndian($UsnJrnlUsn),2) $UsnJrnlTimestamp = StringMid($Record,65,16) $UsnJrnlTimestamp = _DecodeTimestamp($UsnJrnlTimestamp) $UsnJrnlReason = StringMid($Record,81,8) $UsnJrnlReason = _DecodeReasonCodes("0x"&_SwapEndian($UsnJrnlReason)) $UsnJrnlSourceInfo = StringMid($Record,89,8) ; $UsnJrnlSourceInfo = _DecodeSourceInfoFlag("0x"&_SwapEndian($UsnJrnlSourceInfo)) $UsnJrnlSourceInfo = "0x"&_SwapEndian($UsnJrnlSourceInfo) ; $UsnJrnlSecurityId = StringMid($Record,97,8) $UsnJrnlFileAttributes = StringMid($Record,105,8) $UsnJrnlFileAttributes = _File_Attributes("0x"&_SwapEndian($UsnJrnlFileAttributes)) $UsnJrnlFileNameLength = StringMid($Record,113,4) $UsnJrnlFileNameLength = Dec(_SwapEndian($UsnJrnlFileNameLength),2) $UsnJrnlFileNameOffset = StringMid($Record,117,4) $UsnJrnlFileNameOffset = Dec(_SwapEndian($UsnJrnlFileNameOffset),2) $UsnJrnlFileName = StringMid($Record,121,$UsnJrnlFileNameLength*2) $UsnJrnlFileName = BinaryToString("0x"&$UsnJrnlFileName,2) $UsnJrnlFileName = StringReplace($UsnJrnlFileName,$de,$CharReplacement) $FileNameModified = @extended If $VerboseOn Then ConsoleWrite("$UsnJrnlFileReferenceNumber: " & $UsnJrnlFileReferenceNumber & @CRLF) ConsoleWrite("$UsnJrnlParentFileReferenceNumber: " & $UsnJrnlParentFileReferenceNumber & @CRLF) ConsoleWrite("$UsnJrnlUsn: " & $UsnJrnlUsn & @CRLF) ConsoleWrite("$UsnJrnlTimestamp: " & $UsnJrnlTimestamp & @CRLF) ConsoleWrite("$UsnJrnlReason: " & $UsnJrnlReason & @CRLF) ConsoleWrite("$UsnJrnlSourceInfo: " & $UsnJrnlSourceInfo & @CRLF) ConsoleWrite("$UsnJrnlFileAttributes: " & $UsnJrnlFileAttributes & @CRLF) ConsoleWrite("$UsnJrnlFileName: " & $UsnJrnlFileName & @CRLF) EndIf FileWriteLine($UsnJrnlCsv, $UsnJrnlFileReferenceNumber&$de&$UsnJrnlParentFileReferenceNumber&$de&$UsnJrnlUsn&$de&$UsnJrnlTimestamp&$de&$UsnJrnlReason&$de&$UsnJrnlSourceInfo&$de&$UsnJrnlFileAttributes&$de&$UsnJrnlFileName&$de&$FileNameModified&@crlf) EndFunc Func _ClearVar() ; $RecordOffset="" $PredictedRefNumber="" $this_lsn="" $client_previous_lsn="" $redo_operation="" $undo_operation="" $record_offset_in_mft="" $attribute_offset="" $record_type="" $transaction_id="" $lf_flags="" $target_attribute="" $lcns_to_follow="" $MftClusterIndex="" $target_vcn="" $target_lcn="" $InOpenAttributeTable=-1 $IncompleteTransaction=0 $DT_Flags="" $DT_NonResidentFlag="" $DT_ComprUnitSize="" $DT_AllocSize="" $DT_RealSize="" ; $FileSizeBytes="" $DT_InitStreamSize="" $DT_DataRuns="" $DT_StartVCN="" $DT_LastVCN="" $DT_AllocSize="" $DT_Name="" $FN_Name="" $DT_OffsetToDataRuns="" $SI_CTime="" $SI_ATime="" $SI_MTime="" $SI_RTime="" $SI_RTime="" $SI_FilePermission="" $SI_MaxVersions="" $SI_VersionNumber="" $SI_ClassID="" $SI_SecurityID="" $SI_QuotaCharged="" $SI_USN="" $SI_PartialValue="" $FN_CTime="" $FN_ATime="" $FN_MTime="" $FN_RTime="" $FN_AllocSize="" $FN_RealSize="" $FN_Flags="" $FN_Name="" $FN_NameType="" $UsnJrnlFileName="" $FileNameModified="" $UsnJrnlFileReferenceNumber="" $UsnJrnlParentFileReferenceNumber="" $UsnJrnlTimestamp="" $UsnJrnlReason="" $UsnJrnlUsn="" $AttributeString="" $HDR_BaseRecord="" $HDR_SequenceNo="" $TextInformation="" $RedoChunkSize="" $UndoChunkSize="" $CurrentTimestamp="" $RealMftRef="" $undo_length="" $redo_length="" If $DoSplitCsv Then $SI_CTime_Core = "" $SI_ATime_Core = "" $SI_MTime_Core = "" $SI_RTime_Core = "" $SI_CTime_Precision = "" $SI_ATime_Precision = "" $SI_MTime_Precision = "" $SI_RTime_Precision = "" $FN_CTime_Core = "" $FN_ATime_Core = "" $FN_MTime_Core = "" $FN_RTime_Core = "" $FN_CTime_Precision = "" $FN_ATime_Precision = "" $FN_MTime_Precision = "" $FN_RTime_Precision = "" EndIf EndFunc Func _PrepareOutput($OutputDir) $TimestampStart = @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "-" & @MIN & "-" & @SEC $ParserOutDir = $OutputDir&"\LogFile_"&$TimestampStart If DirCreate($ParserOutDir) = 0 Then ConsoleWrite("Error creating: " & $ParserOutDir & @CRLF) Exit EndIf ConsoleWrite("Output directory: " & $ParserOutDir & @CRLF) $debuglogfile = FileOpen($ParserOutDir & "\debug.log",$EncodingWhenOpen) If @error Then MsgBox(0,"Error","Could not create debug.log") Exit EndIf $LogFileCsvFile = $ParserOutDir & "\LogFile.csv" $LogFileCsv = FileOpen($LogFileCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileCsvFile) $LogFileSqlFile = $ParserOutDir & "\LogFile.sql" FileInstall(".\import-sql\import-csv-logfile.sql", $LogFileSqlFile) _DebugOut("Created output file: " & $LogFileSqlFile) $LogFileUpdateFilenameI30SqlFile = $ParserOutDir & "\LogFile_UpdateFileName_I30.sql" FileInstall(".\import-sql\import-csv-logfile-updatefilename-I30.sql", $LogFileUpdateFilenameI30SqlFile) _DebugOut("Created output file: " & $LogFileUpdateFilenameI30SqlFile) $LogFileINDXI30SqlFile = $ParserOutDir & "\LogFile_INDX_I30.sql" FileInstall(".\import-sql\import-csv-logfile-INDX-I30.sql", $LogFileINDXI30SqlFile) _DebugOut("Created output file: " & $LogFileINDXI30SqlFile) $LogFileIndxCsvfile = $ParserOutDir & "\LogFile_INDX_I30.csv" $LogFileIndxCsv = FileOpen($LogFileIndxCsvfile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileIndxCsvfile) Exit EndIf _DebugOut("Created output file: " & $LogFileIndxCsvfile) #cs $LogFileUndoWipeIndxCsvfile = $ParserOutDir & "\LogFile_UndoWipe_INDX_I30.csv" $LogFileUndoWipeIndxCsv = FileOpen($LogFileUndoWipeIndxCsvfile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileUndoWipeIndxCsvfile) Exit EndIf _DebugOut("Created output file: " & $LogFileUndoWipeIndxCsvfile) #ce $LogFileUsnJrnlCsvFile = $ParserOutDir & "\LogFile_lfUsnJrnl.csv" $LogFileUsnJrnlCsv = FileOpen($LogFileUsnJrnlCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileUsnJrnlCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileUsnJrnlCsvFile) If $DoReconstructDataRuns Then $LogFileDataRunsCsvfile = $ParserOutDir & "\LogFile_DataRuns.csv" $LogFileDataRunsCsv = FileOpen($LogFileDataRunsCsvfile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileDataRunsCsvfile) Exit EndIf _DebugOut("Created output file: " & $LogFileDataRunsCsvfile) $LogFileDataRunsModCsvfile = $ParserOutDir & "\LogFile_DataRunsResolved.csv" $LogFileDataRunsModCsv = FileOpen($LogFileDataRunsModCsvfile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileDataRunsCsvfile) Exit EndIf _DebugOut("Created output file: " & $LogFileDataRunsModCsvfile) EndIf $NtfsDbFile = $ParserOutDir & "\ntfs.db" _DebugOut("Output DB file: " & $NtfsDbFile) $tBuffer = DllStructCreate("byte [1024]") $OutFileMFT = $ParserOutDir&"\MFTrecords.bin" $hOutFileMFT = _WinAPI_CreateFile("\\.\" & $OutFileMFT,3,6,7) If $hOutFileMFT = 0 Then _DebugOut("Error: CreateFile returned: " & _WinAPI_GetLastErrorMessage()) Return EndIf _DebugOut("Created output file: " & $OutFileMFT) If $DoSplitCsv Then $csvextra = $ParserOutDir&"\LogFileExtra.csv" _DebugOut("Created output file: " & $csvextra) EndIf $LogFileSecureSDSCsvFile = $ParserOutDir & "\LogFile_SecurityDescriptors.csv" $LogFileSecureSDSCsv = FileOpen($LogFileSecureSDSCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileSecureSDSCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileSecureSDSCsvFile) $LogFileSecureSDHCsvFile = $ParserOutDir & "\LogFile_SecureSDH.csv" $LogFileSecureSDHCsv = FileOpen($LogFileSecureSDHCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileSecureSDHCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileSecureSDHCsvFile) $LogFileSecureSIICsvFile = $ParserOutDir & "\LogFile_SecureSII.csv" $LogFileSecureSIICsv = FileOpen($LogFileSecureSIICsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileSecureSIICsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileSecureSIICsvFile) $LogFileOpenAttributeTableCsvFile = $ParserOutDir & "\LogFile_OpenAttributeTable.csv" $LogFileOpenAttributeTableCsv = FileOpen($LogFileOpenAttributeTableCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileOpenAttributeTableCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileOpenAttributeTableCsvFile) $LogFileDirtyPageTable32bitCsvFile = $ParserOutDir & "\LogFile_DirtyPageTable32bit.csv" $LogFileDirtyPageTable32bitCsv = FileOpen($LogFileDirtyPageTable32bitCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileDirtyPageTable32bitCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileDirtyPageTable32bitCsvFile) $LogFileDirtyPageTable64bitCsvFile = $ParserOutDir & "\LogFile_DirtyPageTable64bit.csv" $LogFileDirtyPageTable64bitCsv = FileOpen($LogFileDirtyPageTable64bitCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileDirtyPageTable64bitCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileDirtyPageTable64bitCsvFile) $LogFileBitsInNonresidentBitMapCsvFile = $ParserOutDir & "\LogFile_BitsInNonresidentBitMap.csv" $LogFileBitsInNonresidentBitMapCsv = FileOpen($LogFileBitsInNonresidentBitMapCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileBitsInNonresidentBitMapCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileBitsInNonresidentBitMapCsvFile) $LogFileObjIdOCsvFile = $ParserOutDir & "\LogFile_ObjIdO.csv" $LogFileObjIdOCsv = FileOpen($LogFileObjIdOCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileObjIdOCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileObjIdOCsvFile) $LogFileQuotaOCsvFile = $ParserOutDir & "\LogFile_QuotaO.csv" $LogFileQuotaOCsv = FileOpen($LogFileQuotaOCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileQuotaOCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileQuotaOCsvFile) $LogFileQuotaQCsvFile = $ParserOutDir & "\LogFile_QuotaQ.csv" $LogFileQuotaQCsv = FileOpen($LogFileQuotaQCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileQuotaQCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileQuotaQCsvFile) $LogFileReparseRCsvFile = $ParserOutDir & "\LogFile_ReparseR.csv" $LogFileReparseRCsv = FileOpen($LogFileReparseRCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileReparseRCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileReparseRCsvFile) $LogFileTransactionTableCsvFile = $ParserOutDir & "\LogFile_TransactionTable.csv" $LogFileTransactionTableCsv = FileOpen($LogFileTransactionTableCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileTransactionTableCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileTransactionTableCsvFile) $LogFileRCRDCsvFile = $ParserOutDir & "\LogFile_RCRD.csv" $LogFileRCRDCsv = FileOpen($LogFileRCRDCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileRCRDCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileRCRDCsvFile) $LogFileTransactionHeaderCsvFile = $ParserOutDir & "\LogFile_AllTransactionHeaders.csv" $LogFileTransactionHeaderCsv = FileOpen($LogFileTransactionHeaderCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileTransactionHeaderCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileTransactionHeaderCsvFile) $LogFileSlackOpenAttributeTableCsvFile = $ParserOutDir & "\LogFile_SlackOpenAttributeTable.csv" $LogFileSlackOpenAttributeTableCsv = FileOpen($LogFileSlackOpenAttributeTableCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileSlackOpenAttributeTableCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileSlackOpenAttributeTableCsvFile) $LogFileSlackAttributeNamesDumpCsvFile = $ParserOutDir & "\LogFile_SlackAttributeNamesDump.csv" $LogFileSlackAttributeNamesDumpCsv = FileOpen($LogFileSlackAttributeNamesDumpCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileSlackAttributeNamesDumpCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileSlackAttributeNamesDumpCsvFile) $LogFileAttributeListCsvFile = $ParserOutDir & "\LogFile_AttributeList.csv" $LogFileAttributeListCsv = FileOpen($LogFileAttributeListCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileAttributeListCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileAttributeListCsvFile) $LogFileFileNamesCsvFile = $ParserOutDir & "\LogFile_FileNames.csv" $LogFileFilenamesCsv = FileOpen($LogFileFileNamesCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileFileNamesCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileFileNamesCsvFile) $LogFileTxfDataCsvFile = $ParserOutDir & "\LogFile_TxfData.csv" $LogFileTxfDataCsv = FileOpen($LogFileTxfDataCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileTxfDataCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileTxfDataCsvFile) $LogFileUpdateFileNameCsvFile = $ParserOutDir & "\LogFile_UpdateFileName_I30.csv" $LogFileUpdateFileNameCsv = FileOpen($LogFileUpdateFileNameCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileUpdateFileNameCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileUpdateFileNameCsvFile) $LogFileCheckpointRecordCsvFile = $ParserOutDir & "\LogFile_CheckpointRecord.csv" $LogFileCheckpointRecordCsv = FileOpen($LogFileCheckpointRecordCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileCheckpointRecordCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileCheckpointRecordCsvFile) $LogFileEntriesObjectIdCsvFile = $ParserOutDir & "\LogFile_Mft_ObjectId_Entries.csv" $LogFileEntriesObjectIdCsv = FileOpen($LogFileEntriesObjectIdCsvFile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileEntriesObjectIdCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileEntriesObjectIdCsvFile) EndFunc Func _PrepareOutput2($OutputDir) $TimestampStart = @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "-" & @MIN & "-" & @SEC $ParserOutDir = '"' & $OutputDir & "\LogFile_" & $TimestampStart & '"' ConsoleWrite("Trying to create: " & $ParserOutDir & @CRLF) If DirCreate($ParserOutDir) = 0 Then ConsoleWrite("Error creating: " & $ParserOutDir & @CRLF) Exit EndIf ConsoleWrite("Output directory: " & $ParserOutDir & @CRLF) $debuglogfile = FileOpen("'" & $ParserOutDir & "\debug.log" & "'",$EncodingWhenOpen) If @error Then MsgBox(0,"Error","Could not create debug.log") Exit EndIf $LogFileCsvFile = $ParserOutDir & "\LogFile.csv" $LogFileCsv = FileOpen("'" & $LogFileCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileCsvFile) $LogFileSqlFile = $ParserOutDir & "\LogFile.sql" FileInstall(".\import-sql\import-csv-logfile.sql", $LogFileSqlFile) _DebugOut("Created output file: " & $LogFileSqlFile) $LogFileUpdateFilenameI30SqlFile = $ParserOutDir & "\LogFile_UpdateFileName_I30.sql" FileInstall(".\import-sql\import-csv-logfile-updatefilename-I30.sql", $LogFileUpdateFilenameI30SqlFile) _DebugOut("Created output file: " & $LogFileUpdateFilenameI30SqlFile) $LogFileINDXI30SqlFile = $ParserOutDir & "\LogFile_INDX_I30.sql" FileInstall(".\import-sql\import-csv-logfile-INDX-I30.sql", $LogFileINDXI30SqlFile) _DebugOut("Created output file: " & $LogFileINDXI30SqlFile) $LogFileIndxCsvfile = $ParserOutDir & "\LogFile_INDX_I30.csv" $LogFileIndxCsv = FileOpen("'" & $LogFileIndxCsvfile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileIndxCsvfile) Exit EndIf _DebugOut("Created output file: " & $LogFileIndxCsvfile) #cs $LogFileUndoWipeIndxCsvfile = $ParserOutDir & "\LogFile_UndoWipe_INDX_I30.csv" $LogFileUndoWipeIndxCsv = FileOpen($LogFileUndoWipeIndxCsvfile, $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileUndoWipeIndxCsvfile) Exit EndIf _DebugOut("Created output file: " & $LogFileUndoWipeIndxCsvfile) #ce $LogFileUsnJrnlCsvFile = $ParserOutDir & "\LogFile_lfUsnJrnl.csv" $LogFileUsnJrnlCsv = FileOpen("'" & $LogFileUsnJrnlCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileUsnJrnlCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileUsnJrnlCsvFile) If $DoReconstructDataRuns Then $LogFileDataRunsCsvfile = $ParserOutDir & "\LogFile_DataRuns.csv" $LogFileDataRunsCsv = FileOpen("'" & $LogFileDataRunsCsvfile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileDataRunsCsvfile) Exit EndIf _DebugOut("Created output file: " & $LogFileDataRunsCsvfile) $LogFileDataRunsModCsvfile = $ParserOutDir & "\LogFile_DataRunsResolved.csv" $LogFileDataRunsModCsv = FileOpen("'" & $LogFileDataRunsModCsvfile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileDataRunsCsvfile) Exit EndIf _DebugOut("Created output file: " & $LogFileDataRunsModCsvfile) EndIf $NtfsDbFile = $ParserOutDir & "\ntfs.db" _DebugOut("Output DB file: " & $NtfsDbFile) $tBuffer = DllStructCreate("byte [1024]") $OutFileMFT = $ParserOutDir&"\MFTrecords.bin" $hOutFileMFT = _WinAPI_CreateFile("\\.\" & $OutFileMFT,3,6,7) If $hOutFileMFT = 0 Then _DebugOut("Error: CreateFile returned: " & _WinAPI_GetLastErrorMessage()) Return EndIf _DebugOut("Created output file: " & $OutFileMFT) If $DoSplitCsv Then $csvextra = $ParserOutDir&"\LogFileExtra.csv" _DebugOut("Created output file: " & $csvextra) EndIf $LogFileSecureSDSCsvFile = $ParserOutDir & "\LogFile_SecurityDescriptors.csv" $LogFileSecureSDSCsv = FileOpen("'" & $LogFileSecureSDSCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileSecureSDSCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileSecureSDSCsvFile) $LogFileSecureSDHCsvFile = $ParserOutDir & "\LogFile_SecureSDH.csv" $LogFileSecureSDHCsv = FileOpen("'" & $LogFileSecureSDHCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileSecureSDHCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileSecureSDHCsvFile) $LogFileSecureSIICsvFile = $ParserOutDir & "\LogFile_SecureSII.csv" $LogFileSecureSIICsv = FileOpen("'" & $LogFileSecureSIICsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileSecureSIICsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileSecureSIICsvFile) $LogFileOpenAttributeTableCsvFile = $ParserOutDir & "\LogFile_OpenAttributeTable.csv" $LogFileOpenAttributeTableCsv = FileOpen("'" & $LogFileOpenAttributeTableCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileOpenAttributeTableCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileOpenAttributeTableCsvFile) $LogFileDirtyPageTable32bitCsvFile = $ParserOutDir & "\LogFile_DirtyPageTable32bit.csv" $LogFileDirtyPageTable32bitCsv = FileOpen("'" & $LogFileDirtyPageTable32bitCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileDirtyPageTable32bitCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileDirtyPageTable32bitCsvFile) $LogFileDirtyPageTable64bitCsvFile = $ParserOutDir & "\LogFile_DirtyPageTable64bit.csv" $LogFileDirtyPageTable64bitCsv = FileOpen("'" & $LogFileDirtyPageTable64bitCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileDirtyPageTable64bitCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileDirtyPageTable64bitCsvFile) $LogFileBitsInNonresidentBitMapCsvFile = $ParserOutDir & "\LogFile_BitsInNonresidentBitMap.csv" $LogFileBitsInNonresidentBitMapCsv = FileOpen("'" & $LogFileBitsInNonresidentBitMapCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileBitsInNonresidentBitMapCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileBitsInNonresidentBitMapCsvFile) $LogFileObjIdOCsvFile = $ParserOutDir & "\LogFile_ObjIdO.csv" $LogFileObjIdOCsv = FileOpen("'" & $LogFileObjIdOCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileObjIdOCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileObjIdOCsvFile) $LogFileQuotaOCsvFile = $ParserOutDir & "\LogFile_QuotaO.csv" $LogFileQuotaOCsv = FileOpen("'" & $LogFileQuotaOCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileQuotaOCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileQuotaOCsvFile) $LogFileQuotaQCsvFile = $ParserOutDir & "\LogFile_QuotaQ.csv" $LogFileQuotaQCsv = FileOpen("'" & $LogFileQuotaQCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileQuotaQCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileQuotaQCsvFile) $LogFileReparseRCsvFile = $ParserOutDir & "\LogFile_ReparseR.csv" $LogFileReparseRCsv = FileOpen("'" & $LogFileReparseRCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileReparseRCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileReparseRCsvFile) $LogFileTransactionTableCsvFile = $ParserOutDir & "\LogFile_TransactionTable.csv" $LogFileTransactionTableCsv = FileOpen("'" & $LogFileTransactionTableCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileTransactionTableCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileTransactionTableCsvFile) $LogFileRCRDCsvFile = $ParserOutDir & "\LogFile_RCRD.csv" $LogFileRCRDCsv = FileOpen("'"& $LogFileRCRDCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileRCRDCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileRCRDCsvFile) $LogFileTransactionHeaderCsvFile = $ParserOutDir & "\LogFile_AllTransactionHeaders.csv" $LogFileTransactionHeaderCsv = FileOpen("'" & $LogFileTransactionHeaderCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileTransactionHeaderCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileTransactionHeaderCsvFile) $LogFileSlackOpenAttributeTableCsvFile = $ParserOutDir & "\LogFile_SlackOpenAttributeTable.csv" $LogFileSlackOpenAttributeTableCsv = FileOpen("'" & $LogFileSlackOpenAttributeTableCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileSlackOpenAttributeTableCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileSlackOpenAttributeTableCsvFile) $LogFileSlackAttributeNamesDumpCsvFile = $ParserOutDir & "\LogFile_SlackAttributeNamesDump.csv" $LogFileSlackAttributeNamesDumpCsv = FileOpen("'" & $LogFileSlackAttributeNamesDumpCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileSlackAttributeNamesDumpCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileSlackAttributeNamesDumpCsvFile) $LogFileAttributeListCsvFile = $ParserOutDir & "\LogFile_AttributeList.csv" $LogFileAttributeListCsv = FileOpen("'" & $LogFileAttributeListCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileAttributeListCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileAttributeListCsvFile) $LogFileFileNamesCsvFile = $ParserOutDir & "\LogFile_FileNames.csv" $LogFileFilenamesCsv = FileOpen("'" & $LogFileFileNamesCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileFileNamesCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileFileNamesCsvFile) $LogFileTxfDataCsvFile = $ParserOutDir & "\LogFile_TxfData.csv" $LogFileTxfDataCsv = FileOpen("'" & $LogFileTxfDataCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileTxfDataCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileTxfDataCsvFile) $LogFileUpdateFileNameCsvFile = $ParserOutDir & "\LogFile_UpdateFileName_I30.csv" $LogFileUpdateFileNameCsv = FileOpen("'" & $LogFileUpdateFileNameCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileUpdateFileNameCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileUpdateFileNameCsvFile) $LogFileCheckpointRecordCsvFile = $ParserOutDir & "\LogFile_CheckpointRecord.csv" $LogFileCheckpointRecordCsv = FileOpen("'" & $LogFileCheckpointRecordCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileCheckpointRecordCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileCheckpointRecordCsvFile) $LogFileEntriesObjectIdCsvFile = $ParserOutDir & "\LogFile_Mft_ObjectId_Entries.csv" $LogFileEntriesObjectIdCsv = FileOpen("'" & $LogFileEntriesObjectIdCsvFile & "'", $EncodingWhenOpen) If @error Then _DebugOut("Error creating: " & $LogFileEntriesObjectIdCsvFile) Exit EndIf _DebugOut("Created output file: " & $LogFileEntriesObjectIdCsvFile) EndFunc Func _WriteCSVExtraHeader() Local $csv_extra_header $csv_extra_header = "lf_LSN"&$de&"SI_CTime_Core"&$de&"SI_CTime_Precision"&$de&"SI_ATime_Core"&$de&"SI_ATime_Precision"&$de&"SI_MTime_Core"&$de&"SI_MTime_Precision"&$de&"SI_RTime_Core"&$de&"SI_RTime_Precision"&$de $csv_extra_header &= "FN_CTime_Core"&$de&"FN_CTime_Precision"&$de&"FN_ATime_Core"&$de&"FN_ATime_Precision"&$de&"FN_MTime_Core"&$de&"FN_MTime_Precision"&$de&"FN_RTime_Core"&$de&"FN_RTime_Precision" FileWriteLine($csvextra, $csv_extra_header & @CRLF) EndFunc Func _WriteCSVHeader() ; $LogFile_Csv_Header = "lf_Offset"&$de&"lf_MFTReference"&$de&"lf_RealMFTReference"&$de&"lf_MFTBaseRecRef"&$de&"lf_LSN"&$de&"lf_LSNPrevious"&$de&"lf_RedoOperation"&$de&"lf_UndoOperation"&$de&"lf_OffsetInMft"&$de&"lf_FileName"&$de&"lf_CurrentAttribute"&$de&"lf_TextInformation"&$de&"lf_UsnJrnlFileName"&$de&"lf_UsnJrnlMFTReference"&$de&"lf_UsnJrnlMFTParentReference"&$de&"lf_UsnJrnlTimestamp"&$de&"lf_UsnJrnlReason"&$de&"lf_UsnJrnlUsn"&$de&"lf_SI_CTime"&$de&"lf_SI_ATime"&$de&"lf_SI_MTime"&$de&"lf_SI_RTime"&$de&"lf_SI_FilePermission"&$de&"lf_SI_MaxVersions"&$de&"lf_SI_VersionNumber"&$de&"lf_SI_ClassID"&$de&"lf_SI_SecurityID"&$de&"lf_SI_QuotaCharged"&$de&"lf_SI_USN"&$de&"lf_SI_PartialValue"&$de&"lf_FN_CTime"&$de&"lf_FN_ATime"&$de&"lf_FN_MTime"&$de&"lf_FN_RTime"&$de&"lf_FN_AllocSize"&$de&"lf_FN_RealSize"&$de&"lf_FN_Flags"&$de&"lf_FN_Namespace"&$de&"lf_DT_StartVCN"&$de&"lf_DT_LastVCN"&$de&"lf_DT_ComprUnitSize"&$de&"lf_DT_AllocSize"&$de&"lf_DT_RealSize"&$de&"lf_DT_InitStreamSize"&$de&"lf_DT_DataRuns"&$de&"lf_DT_Name"&$de&"lf_FileNameModified"&$de&"lf_RedoChunkSize"&$de&"lf_UndoChunkSize" $LogFile_Csv_Header = "lf_Offset"&$de&"lf_MFTReference"&$de&"lf_RealMFTReference"&$de&"lf_MFTBaseRecRef"&$de&"lf_LSN"&$de&"lf_LSNPrevious"&$de&"lf_RedoOperation"&$de&"lf_UndoOperation"&$de&"lf_OffsetInMft"&$de&"lf_FileName"&$de&"lf_CurrentAttribute"&$de&"lf_TextInformation"&$de&"lf_UsnJrnlFileName"&$de&"lf_UsnJrnlMFTReference"&$de&"lf_UsnJrnlMFTParentReference"&$de&"lf_UsnJrnlTimestamp"&$de&"lf_UsnJrnlReason"&$de&"lf_UsnJrnlUsn"&$de&"lf_SI_CTime"&$de&"lf_SI_ATime"&$de&"lf_SI_MTime"&$de&"lf_SI_RTime"&$de&"lf_SI_FilePermission"&$de&"lf_SI_MaxVersions"&$de&"lf_SI_VersionNumber"&$de&"lf_SI_ClassID"&$de&"lf_SI_SecurityID"&$de&"lf_SI_QuotaCharged"&$de&"lf_SI_USN"&$de&"lf_SI_PartialValue"&$de&"lf_FN_CTime"&$de&"lf_FN_ATime"&$de&"lf_FN_MTime"&$de&"lf_FN_RTime"&$de&"lf_FN_AllocSize"&$de&"lf_FN_RealSize"&$de&"lf_FN_Flags"&$de&"lf_FN_Namespace"&$de&"lf_DT_StartVCN"&$de&"lf_DT_LastVCN"&$de&"lf_DT_ComprUnitSize"&$de&"lf_DT_AllocSize"&$de&"lf_DT_RealSize"&$de&"lf_DT_InitStreamSize"&$de&"lf_DT_DataRuns"&$de&"lf_DT_Name"&$de&"lf_FileNameModified"&$de&"lf_RedoChunkSize"&$de&"lf_UndoChunkSize"&$de&"lf_client_index"&$de&"lf_record_type"&$de&"lf_transaction_id"&$de&"lf_flags"&$de&"lf_target_attribute"&$de&"lf_lcns_to_follow"&$de&"lf_attribute_offset"&$de&"lf_MftClusterIndex"&$de&"lf_target_vcn"&$de&"lf_target_lcn"&$de&"InOpenAttributeTable"&$de&"FromRcrdSlack"&$de&"IncompleteTransaction" FileWriteLine($LogFileCsv, $LogFile_Csv_Header & @CRLF) $LogFile_Indx_Csv_Header = "lf_Offset"&$de&"lf_LSN"&$de&"lf_EntryNumber"&$de&"lf_MFTReference"&$de&"lf_MFTReferenceSeqNo"&$de&"lf_IndexFlags"&$de&"lf_MFTParentReference"&$de&"lf_MFTParentReferenceSeqNo"&$de&"lf_CTime"&$de&"lf_ATime"&$de&"lf_MTime"&$de&"lf_RTime"&$de&"lf_AllocSize"&$de&"lf_RealSize"&$de&"lf_FileFlags"&$de&"lf_ReparseTag"&$de&"lf_FileName"&$de&"lf_FileNameModified"&$de&"lf_NameSpace"&$de&"lf_SubNodeVCN"&$de&"IsRedo" FileWriteLine($LogFileIndxCsv, $LogFile_Indx_Csv_Header & @CRLF) ;$LogFile_UndoWipe_Indx_Csv_Header = "lf_uw_Offset"&$de&"lf_uw_LSN"&$de&"lf_uw_EntryNumber"&$de&"lf_uw_MFTReference"&$de&"lf_uw_MFTReferenceSeqNo"&$de&"lf_uw_IndexFlags"&$de&"lf_uw_MFTParentReference"&$de&"lf_uw_MFTParentReferenceSeqNo"&$de&"lf_uw_CTime"&$de&"lf_uw_ATime"&$de&"lf_uw_MTime"&$de&"lf_uw_RTime"&$de&"lf_uw_AllocSize"&$de&"lf_uw_RealSize"&$de&"lf_uw_FileFlags"&$de&"lf_uw_ReparseTag"&$de&"lf_uw_FileName"&$de&"lf_uw_FileNameModified"&$de&"lf_uw_NameSpace"&$de&"lf_uw_SubNodeVCN" ;FileWriteLine($LogFileUndoWipeIndxCsv, $LogFile_UndoWipe_Indx_Csv_Header & @CRLF) $LogFile_DataRuns_Csv_Header = "lf_Offset"&$de&"lf_MFTReference"&$de&"lf_MFTBaseRecRef"&$de&"lf_FileName"&$de&"lf_LSN"&$de&"lf_RedoOperation"&$de&"lf_UndoOperation"&$de&"lf_OffsetInMft"&$de&"lf_AttributeOffset"&$de&"lf_SI_USN"&$de&"lf_DataName"&$de&"lf_Flags"&$de&"lf_NonResident"&$de&"lf_CompressionUnitSize"&$de&"lf_FileSize"&$de&"lf_InitializedStreamSize"&$de&"lf_OffsetToDataRuns"&$de&"lf_DataRuns" FileWriteLine($LogFileDataRunsCsv, $LogFile_DataRuns_Csv_Header & @CRLF) $LogFile_DataRunsResolved_Csv_Header = "lf_MFTReference"&$de&"lf_MFTBaseRecRef"&$de&"lf_FileName"&$de&"lf_LSN"&$de&"lf_OffsetInMft"&$de&"lf_DataName"&$de&"lf_Flags"&$de&"lf_NonResident"&$de&"lf_FileSize"&$de&"lf_InitializedStreamSize"&$de&"lf_DataRuns" FileWriteLine($LogFileDataRunsModCsv, $LogFile_DataRunsResolved_Csv_Header & @CRLF) ; $LogFile_UsnJrnl_Csv_Header = "MFTReference"&$de&"MFTParentReference"&$de&"USN"&$de&"Timestamp"&$de&"Reason"&$de&"SourceInfo"&$de&"FileAttributes"&$de&"FileName"&$de&"FileNameModified" $LogFile_UsnJrnl_Csv_Header = "FileName"&$de&"USN"&$de&"Timestamp"&$de&"Reason"&$de&"MFTReference"&$de&"MFTReferenceSeqNo"&$de&"MFTParentReference"&$de&"ParentReferenceSeqNo"&$de&"FileAttributes"&$de&"MajorVersion"&$de&"MinorVersion"&$de&"SourceInfo"&$de&"SecurityId" FileWriteLine($LogFileUsnJrnlCsv, $LogFile_UsnJrnl_Csv_Header & @CRLF) $LogFile_UpdateFileName_Csv_Header = "lf_Offset"&$de&"lf_LSN"&$de&"lf_CTime"&$de&"lf_ATime"&$de&"lf_MTime"&$de&"lf_RTime"&$de&"lf_AllocSize"&$de&"lf_RealSize"&$de&"lf_FileFlags"&$de&"lf_ReparseTag"&$de&"lf_IsRedo" FileWriteLine($LogFileUpdateFileNameCsv, $LogFile_UpdateFileName_Csv_Header & @CRLF) EndFunc Func _WriteCSVExtra() FileWriteLine($csvextra, $this_lsn & $de & $SI_CTime_Core & $de & $SI_CTime_Precision & $de & $SI_ATime_Core & $de & $SI_ATime_Precision & $de & $SI_MTime_Core & $de & $SI_MTime_Precision & $de & $SI_RTime_Core & $de & $SI_RTime_Precision & $de & _ $FN_CTime_Core & $de & $FN_CTime_Precision & $de & $FN_ATime_Core & $de & $FN_ATime_Precision & $de & $FN_MTime_Core & $de & $FN_MTime_Precision & $de & $FN_RTime_Core & $de & $FN_RTime_Precision & @CRLF) EndFunc Func _WriteLogFileCsv() ; FileWriteLine($LogFileCsv, $RecordOffset & $de & $PredictedRefNumber & $de & $RealMftRef & $de & $HDR_BaseRecord & $de & $this_lsn & $de & $client_previous_lsn & $de & $redo_operation & $de & $undo_operation & $de & $record_offset_in_mft & $de & $FN_Name & $de & $AttributeString & $de & $TextInformation & $de & $UsnJrnlFileName & $de & $UsnJrnlFileReferenceNumber & $de & $UsnJrnlParentFileReferenceNumber & $de & $UsnJrnlTimestamp & $de & $UsnJrnlReason & $de & $UsnJrnlUsn & $de & $SI_CTime & $de & $SI_ATime & $de & $SI_MTime & $de & $SI_RTime & $de & $SI_FilePermission & $de & $SI_MaxVersions & $de & $SI_VersionNumber & $de & $SI_ClassID & $de & $SI_SecurityID & $de & $SI_QuotaCharged & $de & $SI_USN & $de & $SI_PartialValue & $de & $FN_CTime & $de & $FN_ATime & $de & $FN_MTime & $de & $FN_RTime & $de & $FN_AllocSize & $de & $FN_RealSize & $de & $FN_Flags & $de & $FN_NameType & $de & $DT_StartVCN & $de & $DT_LastVCN & $de & $DT_ComprUnitSize & $de & $DT_AllocSize & $de & $DT_RealSize & $de & $DT_InitStreamSize & $de & $DT_DataRuns & $de & $DT_Name & $de & $FileNameModified & $de & $RedoChunkSize & $de & $UndoChunkSize & @crlf) FileWriteLine($LogFileCsv, $RecordOffset & $de & $PredictedRefNumber & $de & $RealMftRef & $de & $HDR_BaseRecord & $de & $this_lsn & $de & $client_previous_lsn & $de & $redo_operation & $de & $undo_operation & $de & $record_offset_in_mft & $de & $FN_Name & $de & $AttributeString & $de & $TextInformation & $de & $UsnJrnlFileName & $de & $UsnJrnlFileReferenceNumber & $de & $UsnJrnlParentFileReferenceNumber & $de & $UsnJrnlTimestamp & $de & $UsnJrnlReason & $de & $UsnJrnlUsn & $de & $SI_CTime & $de & $SI_ATime & $de & $SI_MTime & $de & $SI_RTime & $de & $SI_FilePermission & $de & $SI_MaxVersions & $de & $SI_VersionNumber & $de & $SI_ClassID & $de & $SI_SecurityID & $de & $SI_QuotaCharged & $de & $SI_USN & $de & $SI_PartialValue & $de & $FN_CTime & $de & $FN_ATime & $de & $FN_MTime & $de & $FN_RTime & $de & $FN_AllocSize & $de & $FN_RealSize & $de & $FN_Flags & $de & $FN_NameType & $de & $DT_StartVCN & $de & $DT_LastVCN & $de & $DT_ComprUnitSize & $de & $DT_AllocSize & $de & $DT_RealSize & $de & $DT_InitStreamSize & $de & $DT_DataRuns & $de & $DT_Name & $de & $FileNameModified & $de & $RedoChunkSize & $de & $UndoChunkSize & $de & $client_index & $de &$record_type & $de & $transaction_id & $de & $lf_flags & $de & $target_attribute & $de & $lcns_to_follow & $de & $attribute_offset & $de & $MftClusterIndex & $de & $target_vcn & $de & $target_lcn & $de & $InOpenAttributeTable & $de & $FromRcrdSlack & $de & $IncompleteTransaction & @crlf) EndFunc Func _WriteLogFileDataRunsCsv() If $PredictedRefNumber > 0 And $FN_Name="" Then $FN_Name = _GetFileNameFromArray($PredictedRefNumber,$this_lsn) EndIf FileWriteLine($LogFileDataRunsCsv, $RecordOffset & $de & $PredictedRefNumber & $de & $HDR_BaseRecord & $de & $FN_Name & $de & $this_lsn & $de & $redo_operation & $de & $undo_operation & $de & $record_offset_in_mft & $de & $attribute_offset & $de & $SI_USN & $de & $DT_Name & $de & $DT_Flags & $de & $DT_NonResidentFlag & $de & $DT_ComprUnitSize & $de & $DT_RealSize & $de & $DT_InitStreamSize & $de & $DT_OffsetToDataRuns & $de & $DT_DataRuns & @crlf) EndFunc Func _ResolveAttributeType($input) Select Case $input = "1000" Return "$STANDARD_INFORMATION" Case $input = "2000" Return "$ATTRIBUTE_LIST" Case $input = "3000" Return "$FILE_NAME" Case $input = "4000" Return "$OBJECT_ID" Case $input = "5000" Return "$SECURITY_DESCRIPTOR" Case $input = "6000" Return "$VOLUME_NAME" Case $input = "7000" Return "$VOLUME_INFORMATION" Case $input = "8000" Return "$DATA" Case $input = "9000" Return "$INDEX_ROOT" Case $input = "a000" Return "$INDEX_ALLOCATION" Case $input = "b000" Return "$BITMAP" Case $input = "c000" Return "$REPARSE_POINT" Case $input = "d000" Return "$EA_INFORMATION" Case $input = "e000" Return "$EA" Case $input = "0001" Return "$LOGGED_UTILITY_STREAM" Case Else Return "UNKNOWN" EndSelect EndFunc Func _Decode_SetIndexEntryVcn($data) Local $VCN $VCN = "0x"&_SwapEndian(StringMid($data,1,16)) ; $VCN = Dec(_SwapEndian(StringMid($data,1,16)),2) $TextInformation &= ";VCN="&$VCN EndFunc Func _InjectTimeZoneInfo() $Regions = "UTC: -12.00|" & _ "UTC: -11.00|" & _ "UTC: -10.00|" & _ "UTC: -9.30|" & _ "UTC: -9.00|" & _ "UTC: -8.00|" & _ "UTC: -7.00|" & _ "UTC: -6.00|" & _ "UTC: -5.00|" & _ "UTC: -4.30|" & _ "UTC: -4.00|" & _ "UTC: -3.30|" & _ "UTC: -3.00|" & _ "UTC: -2.00|" & _ "UTC: -1.00|" & _ "UTC: 0.00|" & _ "UTC: 1.00|" & _ "UTC: 2.00|" & _ "UTC: 3.00|" & _ "UTC: 3.30|" & _ "UTC: 4.00|" & _ "UTC: 4.30|" & _ "UTC: 5.00|" & _ "UTC: 5.30|" & _ "UTC: 5.45|" & _ "UTC: 6.00|" & _ "UTC: 6.30|" & _ "UTC: 7.00|" & _ "UTC: 8.00|" & _ "UTC: 8.45|" & _ "UTC: 9.00|" & _ "UTC: 9.30|" & _ "UTC: 10.00|" & _ "UTC: 10.30|" & _ "UTC: 11.00|" & _ "UTC: 11.30|" & _ "UTC: 12.00|" & _ "UTC: 12.45|" & _ "UTC: 13.00|" & _ "UTC: 14.00|" GUICtrlSetData($Combo2,$Regions,"UTC: 0.00") EndFunc Func _GetUTCRegion($UTCRegion) If $UTCRegion = "" Then Return SetError(1,0,0) If StringInStr($UTCRegion,"UTC:") Then $part1 = StringMid($UTCRegion,StringInStr($UTCRegion," ")+1) Else $part1 = $UTCRegion EndIf $UTCconfig = $part1 If StringRight($part1,2) = "15" Then $part1 = StringReplace($part1,".15",".25") If StringRight($part1,2) = "30" Then $part1 = StringReplace($part1,".30",".50") If StringRight($part1,2) = "45" Then $part1 = StringReplace($part1,".45",".75") $DeltaTest = $part1*36000000000 Return $DeltaTest EndFunc Func _TranslateSeparator() ; Or do it the other way around to allow setting other trickier separators, like specifying it in hex GUICtrlSetData($SaparatorInput,StringLeft(GUICtrlRead($SaparatorInput),1)) GUICtrlSetData($SaparatorInput2,"0x"&Hex(Asc(GUICtrlRead($SaparatorInput)),2)) EndFunc Func _InjectTimestampFormat() Local $Formats = "1|" & _ "2|" & _ "3|" & _ "4|" & _ "5|" & _ "6|" GUICtrlSetData($ComboTimestampFormat,$Formats,"6") EndFunc Func _InjectTimestampPrecision() Local $Precision = "None|" & _ "MilliSec|" & _ "NanoSec|" GUICtrlSetData($ComboTimestampPrecision,$Precision,"NanoSec") EndFunc Func _TranslateTimestamp() Local $lPrecision,$lTimestamp,$lTimestampTmp $DateTimeFormat = StringLeft(GUICtrlRead($ComboTimestampFormat),1) $lPrecision = GUICtrlRead($ComboTimestampPrecision) Select Case $lPrecision = "None" $TimestampPrecision = 1 Case $lPrecision = "MilliSec" $TimestampPrecision = 2 Case $lPrecision = "NanoSec" $TimestampPrecision = 3 EndSelect $lTimestampTmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $ExampleTimestampVal) $lTimestamp = _WinTime_UTCFileTimeFormat(Dec($ExampleTimestampVal,2), $DateTimeFormat, $TimestampPrecision) If @error Then $lTimestamp = $TimestampErrorVal ElseIf $TimestampPrecision = 3 Then $lTimestamp = $lTimestamp & $PrecisionSeparator2 & _FillZero(StringRight($lTimestampTmp, 4)) EndIf GUICtrlSetData($InputExampleTimestamp,$lTimestamp) EndFunc Func _TranslateErrorLevel() $ErrorLevel = GUICtrlRead($InputErrorLevel) $LsnValidationLevel = Number($ErrorLevel) $TextString = $LsnValidationLevel*100 & " % (up/down)" GUICtrlSetData($InputErrorLevelTranslated,$TextString) EndFunc Func _DisplayInfo($DebugInfo) GUICtrlSetData($myctredit, $DebugInfo, 1) EndFunc Func _SelectLogFile() $InputLogFile = FileOpenDialog("Select $LogFile",@ScriptDir,"All (*.*)") If @error Then Return ; _DisplayInfo("Selected $LogFile: " & $InputLogFile & @CRLF) GUICtrlSetData($LogFileField,$InputLogFile) $FragmentMode=0 EndFunc #cs Func _SelectUsnJrnl() $UsnJrnlFile = FileOpenDialog("Select $UsnJrnl",@ScriptDir,"All (*.*)") If @error Then _DisplayInfo("Error getting $UsnJrnl: " & $UsnJrnlFile & @CRLF) GUICtrlSetData($UsnJrnlField,"Error getting $UsnJrnl") Else ; _DisplayInfo("Selected $UsnJrnl: " & $UsnJrnlFile & @CRLF) GUICtrlSetData($UsnJrnlField,$UsnJrnlFile) EndIf EndFunc #ce Func _SelectMftCsv() $TargetMftCsvFile = FileOpenDialog("Select MFT csv file",@ScriptDir,"All (*.*)") If @error then Return ; _DisplayInfo("Selected MFT csv file: " & $TargetMftCsvFile & @CRLF) GUICtrlSetData($MFTField,$TargetMftCsvFile) EndFunc Func _LogFileProgress() GUICtrlSetData($ProgressStatus, "Processing LogFile RCRD record " & $CurrentRecord & " of " & $MaxRecords) GUICtrlSetData($ElapsedTime, "Elapsed time = " & _WinAPI_StrFromTimeInterval(TimerDiff($begin))) GUICtrlSetData($ProgressLogFile, 100 * $CurrentRecord / $MaxRecords) EndFunc Func _UsnJrnlProgress() GUICtrlSetData($ProgressStatus, "Processing UsnJrnl record " & $CurrentRecord & " of " & $MaxRecords) GUICtrlSetData($ElapsedTime, "Elapsed time = " & _WinAPI_StrFromTimeInterval(TimerDiff($begin))) GUICtrlSetData($ProgressUsnJrnl, 100 * $CurrentRecord / $MaxRecords) EndFunc Func _DataRunReconstructProgress() GUICtrlSetData($ProgressStatus, "Reconstructing dataruns at row " & $RowsProcessed & " of " & $MaxRows) GUICtrlSetData($ElapsedTime, "Elapsed time = " & _WinAPI_StrFromTimeInterval(TimerDiff($begin))) GUICtrlSetData($ProgressReconstruct, 100 * $RowsProcessed / $MaxRows) EndFunc Func _DebugOut($text, $var="") If $var Then $var = _HexEncode($var) & @CRLF $text &= @CRLF & $var ConsoleWrite($text) If $debuglogfile Then FileWrite($debuglogfile, $text) EndFunc Func _Decode_UndoWipeINDX($Entry,$IsRedo) If $VerboseOn Then _DumpOutput("_Decode_UndoWipeINDX()" & @CRLF) Local $NewLocalAttributeOffset ;Local $LocalAttributeOffset = 1,$IndxHdrMagic,$IndxHdrUpdateSeqArrOffset,$IndxHdrUpdateSeqArrSize,$IndxHdrLogFileSequenceNo,$IndxHdrVCNOfIndx,$IndxHdrOffsetToIndexEntries,$IndxHdrSizeOfIndexEntries,$IndxHdrAllocatedSizeOfIndexEntries ;Local $IndxHdrFlag,$IndxHdrPadding,$IndxHdrUpdateSequence,$IndxHdrUpdSeqArr,$IndxHdrUpdSeqArrPart0,$IndxHdrUpdSeqArrPart1,$IndxHdrUpdSeqArrPart2,$IndxHdrUpdSeqArrPart3,$IndxRecordEnd4,$IndxRecordEnd1,$IndxRecordEnd2,$IndxRecordEnd3,$IndxRecordEnd4 Local $IndexEntryLength,$SubNodeVCN,$tmp0=0,$tmp1=0,$tmp2=0,$tmp3=0,$EntryCounter=1,$DecodeOk=False ;Local $FileReference,$StreamLength,$Flags,$Stream,$Padding2 ;Local $Indx_CTime_Core,$Indx_CTime_Precision,$Indx_ATime_Core,$Indx_ATime_Precision,$Indx_MTime_Core,$Indx_MTime_Precision,$Indx_RTime_Core,$Indx_RTime_Precision $NewLocalAttributeOffset = 1 ; $IndxRecordSize = Dec(_SwapEndian(StringMid($Entry,$NewLocalAttributeOffset+56,8)),2) ; $IndxHeaderSize = Dec(_SwapEndian(StringMid($Entry,$NewLocalAttributeOffset+48,8)),2) ; $NewLocalAttributeOffset = $NewLocalAttributeOffset+48+($IndxHeaderSize*2) $MFTReference = StringMid($Entry,$NewLocalAttributeOffset,12) $MFTReference = _SwapEndian($MFTReference) $MFTReference = Dec($MFTReference,2) $MFTReferenceSeqNo = StringMid($Entry,$NewLocalAttributeOffset+12,4) $MFTReferenceSeqNo = Dec(_SwapEndian($MFTReferenceSeqNo),2) $IndexEntryLength = StringMid($Entry,$NewLocalAttributeOffset+16,4) $IndexEntryLength = Dec(_SwapEndian($IndexEntryLength),2) $OffsetToFileName = StringMid($Entry,$NewLocalAttributeOffset+20,4) $OffsetToFileName = Dec(_SwapEndian($OffsetToFileName),2) $IndexFlags = StringMid($Entry,$NewLocalAttributeOffset+24,4) ;$Padding = StringMid($Entry,$NewLocalAttributeOffset+28,4) $MFTReferenceOfParent = StringMid($Entry,$NewLocalAttributeOffset+32,12) $MFTReferenceOfParent = _SwapEndian($MFTReferenceOfParent) $MFTReferenceOfParent = Dec($MFTReferenceOfParent,2) $MFTReferenceOfParentSeqNo = StringMid($Entry,$NewLocalAttributeOffset+44,4) $MFTReferenceOfParentSeqNo = Dec(_SwapEndian($MFTReferenceOfParentSeqNo),2) ; $Indx_CTime = StringMid($Entry, $NewLocalAttributeOffset + 48, 16) $Indx_CTime = _SwapEndian($Indx_CTime) $Indx_CTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_CTime) $Indx_CTime = _WinTime_UTCFileTimeFormat(Dec($Indx_CTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_CTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_CTime_Core = StringMid($Indx_CTime,1,StringLen($Indx_CTime)-4) ;$Indx_CTime_Precision = StringRight($Indx_CTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_CTime = $Indx_CTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_CTime_tmp, 4)) ;$Indx_CTime_Core = StringMid($Indx_CTime,1,StringLen($Indx_CTime)-9) ;$Indx_CTime_Precision = StringRight($Indx_CTime,8) Else ;$Indx_CTime_Core = $Indx_CTime EndIf ; $Indx_ATime = StringMid($Entry, $NewLocalAttributeOffset + 64, 16) $Indx_ATime = _SwapEndian($Indx_ATime) $Indx_ATime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_ATime) $Indx_ATime = _WinTime_UTCFileTimeFormat(Dec($Indx_ATime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_ATime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_ATime_Core = StringMid($Indx_ATime,1,StringLen($Indx_ATime)-4) ;$Indx_ATime_Precision = StringRight($Indx_ATime,3) ElseIf $TimestampPrecision = 3 Then $Indx_ATime = $Indx_ATime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_ATime_tmp, 4)) ;$Indx_ATime_Core = StringMid($Indx_ATime,1,StringLen($Indx_ATime)-9) ;$Indx_ATime_Precision = StringRight($Indx_ATime,8) Else ;$Indx_ATime_Core = $Indx_ATime EndIf ; $Indx_MTime = StringMid($Entry, $NewLocalAttributeOffset + 80, 16) $Indx_MTime = _SwapEndian($Indx_MTime) $Indx_MTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_MTime) $Indx_MTime = _WinTime_UTCFileTimeFormat(Dec($Indx_MTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_MTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_MTime_Core = StringMid($Indx_MTime,1,StringLen($Indx_MTime)-4) ;$Indx_MTime_Precision = StringRight($Indx_MTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_MTime = $Indx_MTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_MTime_tmp, 4)) ;$Indx_MTime_Core = StringMid($Indx_MTime,1,StringLen($Indx_MTime)-9) ;$Indx_MTime_Precision = StringRight($Indx_MTime,8) Else ;$Indx_MTime_Core = $Indx_MTime EndIf ; $Indx_RTime = StringMid($Entry, $NewLocalAttributeOffset + 96, 16) $Indx_RTime = _SwapEndian($Indx_RTime) $Indx_RTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_RTime) $Indx_RTime = _WinTime_UTCFileTimeFormat(Dec($Indx_RTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_RTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_RTime_Core = StringMid($Indx_RTime,1,StringLen($Indx_RTime)-4) ;$Indx_RTime_Precision = StringRight($Indx_RTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_RTime = $Indx_RTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_RTime_tmp, 4)) ;$Indx_RTime_Core = StringMid($Indx_RTime,1,StringLen($Indx_RTime)-9) ;$Indx_RTime_Precision = StringRight($Indx_RTime,8) Else ;$Indx_RTime_Core = $Indx_RTime EndIf ; $Indx_AllocSize = StringMid($Entry,$NewLocalAttributeOffset+112,16) $Indx_AllocSize = Dec(_SwapEndian($Indx_AllocSize),2) $Indx_RealSize = StringMid($Entry,$NewLocalAttributeOffset+128,16) $Indx_RealSize = Dec(_SwapEndian($Indx_RealSize),2) $Indx_File_Flags = StringMid($Entry,$NewLocalAttributeOffset+144,8) $Indx_File_Flags = _SwapEndian($Indx_File_Flags) $Indx_File_Flags = _File_Attributes("0x" & $Indx_File_Flags) $Indx_ReparseTag = StringMid($Entry,$NewLocalAttributeOffset+152,8) $Indx_ReparseTag = _SwapEndian($Indx_ReparseTag) $Indx_ReparseTag = _GetReparseType("0x"&$Indx_ReparseTag) $Indx_NameLength = StringMid($Entry,$NewLocalAttributeOffset+160,2) $Indx_NameLength = Dec($Indx_NameLength) $Indx_NameSpace = StringMid($Entry,$NewLocalAttributeOffset+162,2) Select Case $Indx_NameSpace = "00" ;POSIX $Indx_NameSpace = "POSIX" Case $Indx_NameSpace = "01" ;WIN32 $Indx_NameSpace = "WIN32" Case $Indx_NameSpace = "02" ;DOS $Indx_NameSpace = "DOS" Case $Indx_NameSpace = "03" ;DOS+WIN32 $Indx_NameSpace = "DOS+WIN32" EndSelect $Indx_FileName = StringMid($Entry,$NewLocalAttributeOffset+164,$Indx_NameLength*4) $Indx_FileName = BinaryToString("0x"&$Indx_FileName,2) $Indx_FileName = StringReplace($Indx_FileName,$de,$CharReplacement) $FileNameModified = @extended $tmp1 = 164+($Indx_NameLength*2*2) Do ; Calculate the length of the padding - 8 byte aligned $tmp2 = $tmp1/16 If Not IsInt($tmp2) Then $tmp0 = 2 $tmp1 += $tmp0 $tmp3 += $tmp0 EndIf Until IsInt($tmp2) $PaddingLength = $tmp3 ; $Padding2 = StringMid($Entry,$NewLocalAttributeOffset+164+($Indx_NameLength*2*2),$PaddingLength) If $IndexFlags <> "0000" Then $SubNodeVCN = StringMid($Entry,$NewLocalAttributeOffset+164+($Indx_NameLength*2*2)+$PaddingLength,16) $SubNodeVCN = Dec(_SwapEndian($SubNodeVCN),2) $SubNodeVCNLength = 16 Else $SubNodeVCN = "" $SubNodeVCNLength = 0 EndIf ; FileWriteLine($LogFileIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & @crlf) If $MFTReference > 0 And $MFTReferenceSeqNo > 0 And $MFTReferenceOfParent > 4 And $Indx_NameLength > 0 And $Indx_CTime<>$TimestampErrorVal And $Indx_ATime<>$TimestampErrorVal And $Indx_MTime<>$TimestampErrorVal And $Indx_RTime<>$TimestampErrorVal Then $DecodeOk=True ;FileWriteLine($LogFileUndoWipeIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_ReparseTag & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & @crlf) FileWriteLine($LogFileIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_ReparseTag & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & $de & $IsRedo & @crlf) $PredictedRefNumber = $MFTReferenceOfParent $KeptRef = $MFTReferenceOfParent $AttributeString = "$INDEX_ALLOCATION" If Not $FromRcrdSlack Then If $Indx_NameSpace <> "DOS" Then _UpdateFileNameArray($MFTReference,$MFTReferenceSeqNo,$Indx_FileName,$this_lsn) EndIf EndIf ; Work through the rest of the index entries $NextEntryOffset = $NewLocalAttributeOffset+164+($Indx_NameLength*2*2)+$PaddingLength+$SubNodeVCNLength If $NextEntryOffset+64 >= StringLen($Entry) Then Return $DecodeOk Do $EntryCounter += 1 $MFTReference = StringMid($Entry,$NextEntryOffset,12) $MFTReference = _SwapEndian($MFTReference) $MFTReference = Dec($MFTReference,2) $MFTReferenceSeqNo = StringMid($Entry,$NextEntryOffset+12,4) $MFTReferenceSeqNo = Dec(_SwapEndian($MFTReferenceSeqNo),2) $IndexEntryLength = StringMid($Entry,$NextEntryOffset+16,4) $IndexEntryLength = Dec(_SwapEndian($IndexEntryLength),2) $OffsetToFileName = StringMid($Entry,$NextEntryOffset+20,4) $OffsetToFileName = Dec(_SwapEndian($OffsetToFileName),2) $IndexFlags = StringMid($Entry,$NextEntryOffset+24,4) ;$Padding = StringMid($Entry,$NextEntryOffset+28,4) $MFTReferenceOfParent = StringMid($Entry,$NextEntryOffset+32,12) $MFTReferenceOfParent = _SwapEndian($MFTReferenceOfParent) $MFTReferenceOfParent = Dec($MFTReferenceOfParent,2) $MFTReferenceOfParentSeqNo = StringMid($Entry,$NextEntryOffset+44,4) $MFTReferenceOfParentSeqNo = Dec(_SwapEndian($MFTReferenceOfParentSeqNo),2) $Indx_CTime = StringMid($Entry, $NextEntryOffset + 48, 16) $Indx_CTime = _SwapEndian($Indx_CTime) $Indx_CTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_CTime) $Indx_CTime = _WinTime_UTCFileTimeFormat(Dec($Indx_CTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_CTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_CTime_Core = StringMid($Indx_CTime,1,StringLen($Indx_CTime)-4) ;$Indx_CTime_Precision = StringRight($Indx_CTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_CTime = $Indx_CTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_CTime_tmp, 4)) ;$Indx_CTime_Core = StringMid($Indx_CTime,1,StringLen($Indx_CTime)-9) ;$Indx_CTime_Precision = StringRight($Indx_CTime,8) Else ;$Indx_CTime_Core = $Indx_CTime EndIf ; $Indx_ATime = StringMid($Entry, $NextEntryOffset + 64, 16) $Indx_ATime = _SwapEndian($Indx_ATime) $Indx_ATime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_ATime) $Indx_ATime = _WinTime_UTCFileTimeFormat(Dec($Indx_ATime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_ATime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_ATime_Core = StringMid($Indx_ATime,1,StringLen($Indx_ATime)-4) ;$Indx_ATime_Precision = StringRight($Indx_ATime,3) ElseIf $TimestampPrecision = 3 Then $Indx_ATime = $Indx_ATime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_ATime_tmp, 4)) ;$Indx_ATime_Core = StringMid($Indx_ATime,1,StringLen($Indx_ATime)-9) ;$Indx_ATime_Precision = StringRight($Indx_ATime,8) Else ;$Indx_ATime_Core = $Indx_ATime EndIf ; $Indx_MTime = StringMid($Entry, $NextEntryOffset + 80, 16) $Indx_MTime = _SwapEndian($Indx_MTime) $Indx_MTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_MTime) $Indx_MTime = _WinTime_UTCFileTimeFormat(Dec($Indx_MTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_MTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_MTime_Core = StringMid($Indx_MTime,1,StringLen($Indx_MTime)-4) ;$Indx_MTime_Precision = StringRight($Indx_MTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_MTime = $Indx_MTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_MTime_tmp, 4)) ;$Indx_MTime_Core = StringMid($Indx_MTime,1,StringLen($Indx_MTime)-9) ;$Indx_MTime_Precision = StringRight($Indx_MTime,8) Else ;$Indx_MTime_Core = $Indx_MTime EndIf ; $Indx_RTime = StringMid($Entry, $NextEntryOffset + 96, 16) $Indx_RTime = _SwapEndian($Indx_RTime) $Indx_RTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $Indx_RTime) $Indx_RTime = _WinTime_UTCFileTimeFormat(Dec($Indx_RTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $Indx_RTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$Indx_RTime_Core = StringMid($Indx_RTime,1,StringLen($Indx_RTime)-4) ;$Indx_RTime_Precision = StringRight($Indx_RTime,3) ElseIf $TimestampPrecision = 3 Then $Indx_RTime = $Indx_RTime & $PrecisionSeparator2 & _FillZero(StringRight($Indx_RTime_tmp, 4)) ;$Indx_RTime_Core = StringMid($Indx_RTime,1,StringLen($Indx_RTime)-9) ;$Indx_RTime_Precision = StringRight($Indx_RTime,8) Else ;$Indx_RTime_Core = $Indx_RTime EndIf ; $Indx_AllocSize = StringMid($Entry,$NextEntryOffset+112,16) $Indx_AllocSize = Dec(_SwapEndian($Indx_AllocSize),2) $Indx_RealSize = StringMid($Entry,$NextEntryOffset+128,16) $Indx_RealSize = Dec(_SwapEndian($Indx_RealSize),2) $Indx_File_Flags = StringMid($Entry,$NextEntryOffset+144,8) $Indx_File_Flags = _SwapEndian($Indx_File_Flags) $Indx_File_Flags = _File_Attributes("0x" & $Indx_File_Flags) $Indx_ReparseTag = StringMid($Entry,$NextEntryOffset+152,8) $Indx_ReparseTag = _SwapEndian($Indx_ReparseTag) $Indx_ReparseTag = _GetReparseType("0x"&$Indx_ReparseTag) $Indx_NameLength = StringMid($Entry,$NextEntryOffset+160,2) $Indx_NameLength = Dec($Indx_NameLength) $Indx_NameSpace = StringMid($Entry,$NextEntryOffset+162,2) Select Case $Indx_NameSpace = "00" ;POSIX $Indx_NameSpace = "POSIX" Case $Indx_NameSpace = "01" ;WIN32 $Indx_NameSpace = "WIN32" Case $Indx_NameSpace = "02" ;DOS $Indx_NameSpace = "DOS" Case $Indx_NameSpace = "03" ;DOS+WIN32 $Indx_NameSpace = "DOS+WIN32" EndSelect $Indx_FileName = StringMid($Entry,$NextEntryOffset+164,$Indx_NameLength*4) $Indx_FileName = BinaryToString("0x"&$Indx_FileName,2) $Indx_FileName = StringReplace($Indx_FileName,$de,$CharReplacement) $FileNameModified = @extended $tmp0 = 0 $tmp2 = 0 $tmp3 = 0 $tmp1 = 164+($Indx_NameLength*2*2) Do ; Calculate the length of the padding - 8 byte aligned $tmp2 = $tmp1/16 If Not IsInt($tmp2) Then $tmp0 = 2 $tmp1 += $tmp0 $tmp3 += $tmp0 EndIf Until IsInt($tmp2) $PaddingLength = $tmp3 ; $Padding = StringMid($Entry,$NextEntryOffset+164+($Indx_NameLength*2*2),$PaddingLength) If $IndexFlags <> "0000" Then $SubNodeVCN = StringMid($Entry,$NextEntryOffset+164+($Indx_NameLength*2*2)+$PaddingLength,16) $SubNodeVCN = Dec(_SwapEndian($SubNodeVCN),2) $SubNodeVCNLength = 16 Else $SubNodeVCN = "" $SubNodeVCNLength = 0 EndIf $NextEntryOffset = $NextEntryOffset+164+($Indx_NameLength*2*2)+$PaddingLength+$SubNodeVCNLength ; FileWriteLine($LogFileIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & @crlf) If $MFTReference > 0 And $MFTReferenceSeqNo > 0 And $MFTReferenceOfParent > 4 And $Indx_NameLength > 0 And $Indx_CTime<>$TimestampErrorVal And $Indx_ATime<>$TimestampErrorVal And $Indx_MTime<>$TimestampErrorVal And $Indx_RTime<>$TimestampErrorVal Then $DecodeOk=True ;FileWriteLine($LogFileUndoWipeIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_ReparseTag & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & @crlf) FileWriteLine($LogFileIndxCsv, $RecordOffset & $de & $this_lsn & $de & $EntryCounter & $de & $MFTReference & $de & $MFTReferenceSeqNo & $de & $IndexFlags & $de & $MFTReferenceOfParent & $de & $MFTReferenceOfParentSeqNo & $de & $Indx_CTime & $de & $Indx_ATime & $de & $Indx_MTime & $de & $Indx_RTime & $de & $Indx_AllocSize & $de & $Indx_RealSize & $de & $Indx_File_Flags & $de & $Indx_ReparseTag & $de & $Indx_FileName & $de & $FileNameModified & $de & $Indx_NameSpace & $de & $SubNodeVCN & $de & $IsRedo & @crlf) $PredictedRefNumber = $MFTReferenceOfParent $KeptRef = $MFTReferenceOfParent $AttributeString = "$INDEX_ALLOCATION" If Not $FromRcrdSlack Then If $Indx_NameSpace <> "DOS" Then _UpdateFileNameArray($MFTReference,$MFTReferenceSeqNo,$Indx_FileName,$this_lsn) EndIf EndIf ; _ArrayDisplay($IndxMFTReferenceOfParentArr,"$IndxMFTReferenceOfParentArr") Until $NextEntryOffset+32 >= StringLen($Entry) ; _ArrayDisplay($IndxMFTReferenceOfParentArr,"$IndxMFTReferenceOfParentArr") Return $DecodeOk EndFunc Func _UsnDecodeRecord2($Record) Local $UsnJrnlMajorVersion,$UsnJrnlMFTReferenceSeqNo,$UsnJrnlParentReferenceSeqNo Local $UsnJrnlSourceInfo,$UsnJrnlSecurityId,$UsnJrnlFileAttributes,$UsnJrnlFileNameLength,$DecodeOk=False ; $UsnJrnlRecordLength = StringMid($Record,1,8) ; $UsnJrnlRecordLength = Dec(_SwapEndian($UsnJrnlRecordLength),2) $UsnJrnlMajorVersion = StringMid($Record,9,4) $UsnJrnlMajorVersion = Dec(_SwapEndian($UsnJrnlMajorVersion),2) $UsnJrnlMinorVersion = StringMid($Record,13,4) $UsnJrnlMinorVersion = Dec(_SwapEndian($UsnJrnlMinorVersion),2) $UsnJrnlFileReferenceNumber = StringMid($Record,17,12) $UsnJrnlFileReferenceNumber = Dec(_SwapEndian($UsnJrnlFileReferenceNumber),2) $UsnJrnlMFTReferenceSeqNo = StringMid($Record,29,4) $UsnJrnlMFTReferenceSeqNo = Dec(_SwapEndian($UsnJrnlMFTReferenceSeqNo),2) $UsnJrnlParentFileReferenceNumber = StringMid($Record,33,12) $UsnJrnlParentFileReferenceNumber = Dec(_SwapEndian($UsnJrnlParentFileReferenceNumber),2) $UsnJrnlParentReferenceSeqNo = StringMid($Record,45,4) $UsnJrnlParentReferenceSeqNo = Dec(_SwapEndian($UsnJrnlParentReferenceSeqNo),2) $UsnJrnlUsn = StringMid($Record,49,16) $UsnJrnlUsn = Dec(_SwapEndian($UsnJrnlUsn),2) $UsnJrnlTimestamp = StringMid($Record,65,16) $UsnJrnlTimestamp = _DecodeTimestamp($UsnJrnlTimestamp) $UsnJrnlReason = StringMid($Record,81,8) $UsnJrnlReason = _DecodeReasonCodes("0x"&_SwapEndian($UsnJrnlReason)) $UsnJrnlSourceInfo = StringMid($Record,89,8) ; $UsnJrnlSourceInfo = _DecodeSourceInfoFlag("0x"&_SwapEndian($UsnJrnlSourceInfo)) $UsnJrnlSourceInfo = "0x"&_SwapEndian($UsnJrnlSourceInfo) $UsnJrnlSecurityId = StringMid($Record,97,8) $UsnJrnlSecurityId = Dec(_SwapEndian($UsnJrnlSecurityId),2) $UsnJrnlFileAttributes = StringMid($Record,105,8) $UsnJrnlFileAttributes = _File_Attributes("0x"&_SwapEndian($UsnJrnlFileAttributes)) $UsnJrnlFileNameLength = StringMid($Record,113,4) $UsnJrnlFileNameLength = Dec(_SwapEndian($UsnJrnlFileNameLength),2) ; $UsnJrnlFileNameOffset = StringMid($Record,117,4) ; $UsnJrnlFileNameOffset = Dec(_SwapEndian($UsnJrnlFileNameOffset),2) $UsnJrnlFileName = StringMid($Record,121,$UsnJrnlFileNameLength*2) $UsnJrnlFileName = BinaryToString("0x"&$UsnJrnlFileName,2) If $VerboseOn Then _DumpOutput("_UsnDecodeRecord2(): " & @CRLF) _DumpOutput("$UsnJrnlFileReferenceNumber: " & $UsnJrnlFileReferenceNumber & @CRLF) _DumpOutput("$UsnJrnlMFTReferenceSeqNo: " & $UsnJrnlMFTReferenceSeqNo & @CRLF) _DumpOutput("$UsnJrnlParentFileReferenceNumber: " & $UsnJrnlParentFileReferenceNumber & @CRLF) _DumpOutput("$UsnJrnlParentReferenceSeqNo: " & $UsnJrnlParentReferenceSeqNo & @CRLF) _DumpOutput("$UsnJrnlUsn: " & $UsnJrnlUsn & @CRLF) _DumpOutput("$UsnJrnlTimestamp: " & $UsnJrnlTimestamp & @CRLF) _DumpOutput("$UsnJrnlReason: " & $UsnJrnlReason & @CRLF) ; _DumpOutput("$UsnJrnlSourceInfo: " & $UsnJrnlSourceInfo & @CRLF) ; _DumpOutput("$UsnJrnlSecurityId: " & $UsnJrnlSecurityId & @CRLF) _DumpOutput("$UsnJrnlFileAttributes: " & $UsnJrnlFileAttributes & @CRLF) _DumpOutput("$UsnJrnlFileName: " & $UsnJrnlFileName & @CRLF) EndIf ; If Int($UsnJrnlFileReferenceNumber) > 0 And Int($UsnJrnlMFTReferenceSeqNo) > 0 And Int($UsnJrnlParentFileReferenceNumber) > 4 And $UsnJrnlFileNameLength > 0 And $UsnJrnlTimestamp<>"-" And StringInStr($UsnJrnlTimestamp,"1601")=0 Then If Int($UsnJrnlFileReferenceNumber) > 0 And Int($UsnJrnlMFTReferenceSeqNo) > 0 And Int($UsnJrnlParentFileReferenceNumber) > 4 And $UsnJrnlFileNameLength > 0 And $UsnJrnlTimestamp<>$TimestampErrorVal Then $DecodeOk=True FileWriteLine($LogFileUsnJrnlCsv, $UsnJrnlFileName&$de&$UsnJrnlUsn&$de&$UsnJrnlTimestamp&$de&$UsnJrnlReason&$de&$UsnJrnlFileReferenceNumber&$de&$UsnJrnlMFTReferenceSeqNo&$de&$UsnJrnlParentFileReferenceNumber&$de&$UsnJrnlParentReferenceSeqNo&$de&$UsnJrnlFileAttributes&$de&$UsnJrnlMajorVersion&$de&$UsnJrnlMinorVersion&$de&$UsnJrnlSourceInfo&$de&$UsnJrnlSecurityId&@crlf) $RealMftRef = $PredictedRefNumber $UsnJrnlRef = $PredictedRefNumber $PredictedRefNumber = $UsnJrnlFileReferenceNumber $KeptRef = $UsnJrnlFileReferenceNumber $FN_Name = $UsnJrnlFileName $HDR_SequenceNo = $UsnJrnlMFTReferenceSeqNo $AttributeString = "$DATA:$J" Else #cs _DumpOutput("Error in _UsnDecodeRecord2(): " & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$UsnJrnlFileReferenceNumber: " & $UsnJrnlFileReferenceNumber & @CRLF) _DumpOutput("$UsnJrnlMFTReferenceSeqNo: " & $UsnJrnlMFTReferenceSeqNo & @CRLF) _DumpOutput("$UsnJrnlParentFileReferenceNumber: " & $UsnJrnlParentFileReferenceNumber & @CRLF) _DumpOutput("$UsnJrnlParentReferenceSeqNo: " & $UsnJrnlParentReferenceSeqNo & @CRLF) _DumpOutput("$UsnJrnlUsn: " & $UsnJrnlUsn & @CRLF) _DumpOutput("$UsnJrnlTimestamp: " & $UsnJrnlTimestamp & @CRLF) _DumpOutput("$UsnJrnlReason: " & $UsnJrnlReason & @CRLF) _DumpOutput("$UsnJrnlFileAttributes: " & $UsnJrnlFileAttributes & @CRLF) _DumpOutput("$UsnJrnlFileName: " & $UsnJrnlFileName & @CRLF) #ce $UsnJrnlFileReferenceNumber="" $UsnJrnlParentFileReferenceNumber="" $UsnJrnlUsn="" $UsnJrnlTimestamp="" $UsnJrnlReason="" $UsnJrnlFileName="" EndIf Return $DecodeOk EndFunc Func _Decode_AttributeName($data) Local $TmpName $TmpName = BinaryToString("0x"&$data,2) $AttributeString &= ":"&$TmpName Return $TmpName EndFunc Func _SetNameOnSystemFiles() Local $LocalRef = $PredictedRefNumber If $PredictedRefNumber = 0 And $RealMftRef <> 0 Then $LocalRef = $RealMftRef Select Case $LocalRef = 0 $FN_Name = "$MFT" Case $LocalRef = 1 $FN_Name = "$MFTMirr" Case $LocalRef = 2 $FN_Name = "$LogFile" Case $LocalRef = 3 $FN_Name = "$Volume" Case $LocalRef = 4 $FN_Name = "$AttrDef" Case $LocalRef = 5 $FN_Name = "." Case $LocalRef = 6 $FN_Name = "$Bitmap" Case $LocalRef = 7 $FN_Name = "$Boot" Case $LocalRef = 8 $FN_Name = "$BadClus" ; Case $LocalRef = 9 ; $FN_Name = "$Secure" Case $LocalRef = 10 $FN_Name = "$UpCase" Case $LocalRef = 11 $FN_Name = "$Extend" Case $LocalRef = 24 $FN_Name = "$Quota" Case $LocalRef = 25 $FN_Name = "$ObjId" Case $LocalRef = 26 $FN_Name = "$Reparse" #cs Case $LocalRef = 27 If Not $Is32bit Then $FN_Name = "$RmMetadata" Case $LocalRef = 28 If Not $Is32bit Then $FN_Name = "$Repair" Case $LocalRef = 29 If Not $Is32bit Then $FN_Name = "TxfLog" Case $LocalRef = 30 If Not $Is32bit Then $FN_Name = "$Txf" Case $LocalRef = 31 If Not $Is32bit Then $FN_Name = "$Tops" #ce EndSelect EndFunc Func _RemoveSingleOffsetOfAttribute($TestRef, $TestOffsetAttr, $TestSize, $TestString) Local $RefIndex,$AttrArraySplit,$ConcatString If $VerboseOn Then ConsoleWrite("_RemoveSingleOffsetOfAttribute()" & @CRLF) ConsoleWrite("$TestOffsetAttr: " & $TestOffsetAttr & @CRLF) ConsoleWrite("$TestSize: " & $TestSize & @CRLF) ConsoleWrite("$TestString: " & $TestString & @CRLF) EndIf $RefIndex = _ArraySearch($AttrArray, $TestRef) If $RefIndex <> -1 Or Not @error Then ; ConsoleWrite("Ref already exist in array" & @CRLF) $AttrArraySplit = StringSplit($AttrArray[$RefIndex][1], ',') For $i = 1 To $AttrArraySplit[0]-1 If $AttrArraySplit[$i] = '' Then ContinueLoop $TestOffset2 = StringInStr($AttrArraySplit[$i], '?') $FoundAttr = StringMid($AttrArraySplit[$i], 1, $TestOffset2-1) $FoundOffset = StringMid($AttrArraySplit[$i], $TestOffset2+1) If $VerboseOn Then ConsoleWrite("$AttrArraySplit[$i]: " & $AttrArraySplit[$i] & @CRLF) ConsoleWrite("$TestOffset2: " & $TestOffset2 & @CRLF) ConsoleWrite("$FoundAttr: " & $FoundAttr & @CRLF) ConsoleWrite("$FoundOffset: " & $FoundOffset & @CRLF) EndIf $TestOffset = StringInStr($AttrArraySplit[$i], $TestOffsetAttr) If $TestOffset Then ; ConsoleWrite("Found offset: " & $TestOffset & @CRLF) ;$check=1 EndIf ; If Not $check Then ContinueLoop If Not StringIsDigit($FoundOffset) Then _DumpOutput("Not number: " & $FoundOffset & " at lsn " & $this_lsn & @CRLF) If Int($TestOffsetAttr) > Int($FoundOffset) Then ContinueLoop If $TestOffset Then $AttrArraySplit[$i] = '' Else If $AttrArraySplit[$i] = '' Then ContinueLoop If Int($TestOffsetAttr) < Int($FoundOffset) Then $AttrArraySplit[$i] = $FoundAttr&'?'&Int($FoundOffset)-Int($TestSize) ConsoleWrite("Modified entry: " & $FoundAttr&'?'&Int($FoundOffset)-Int($TestSize) & @CRLF) If Int($FoundOffset)-Int($TestSize) < 0 Then _DumpOutput("Error in _RemoveSingleOffsetOfAttribute() with " & $this_lsn & @CRLF) EndIf EndIf Next For $i = 1 To $AttrArraySplit[0]-1 If $AttrArraySplit[$i] = '' Then ContinueLoop $ConcatString &= $AttrArraySplit[$i]&',' Next $AttrArray[$RefIndex][1] = $ConcatString Else ; ConsoleWrite("Error: Ref not found" & @CRLF) EndIf EndFunc Func _RemoveAllOffsetOfAttribute($TestRef) Local $RefIndex $RefIndex = _ArraySearch($AttrArray, $TestRef) If $RefIndex <> -1 Or Not @error Then ConsoleWrite("Ref already exist in array" & @CRLF) $AttrArray[$RefIndex][1] = '' Else ; ConsoleWrite("Error: Ref not found" & @CRLF) EndIf EndFunc Func _UpdateSingleOffsetOfAttribute($TestRef, $TestOffsetAttr, $TestSize, $TestString) Local $RefIndex,$AttrArraySplit,$ConcatString If $VerboseOn Then ConsoleWrite("_UpdateSingleOffsetOfAttribute()" & @CRLF) ConsoleWrite("$TestOffsetAttr: " & $TestOffsetAttr & @CRLF) ConsoleWrite("$TestSize: " & $TestSize & @CRLF) ConsoleWrite("$TestString: " & $TestString & @CRLF) EndIf $RefIndex = _ArraySearch($AttrArray, $TestRef) If $RefIndex <> -1 Or Not @error Then ; ConsoleWrite("Ref already exist in array" & @CRLF) $AttrArraySplit = StringSplit($AttrArray[$RefIndex][1], ',') $HighestOffset = 0 For $i = 1 To $AttrArraySplit[0]-1 If $AttrArraySplit[$i] = '' Then ContinueLoop $TestOffset2 = StringInStr($AttrArraySplit[$i], '?') $FoundAttr = StringMid($AttrArraySplit[$i], 1, $TestOffset2-1) $FoundOffset = StringMid($AttrArraySplit[$i], $TestOffset2+1) If Int($FoundOffset) > $HighestOffset Then $HighestOffset=Int($FoundOffset) If $VerboseOn Then ConsoleWrite("$AttrArraySplit[$i]: " & $AttrArraySplit[$i] & @CRLF) ConsoleWrite("$TestOffset2: " & $TestOffset2 & @CRLF) ConsoleWrite("$FoundAttr: " & $FoundAttr & @CRLF) ConsoleWrite("$FoundOffset: " & $FoundOffset & @CRLF) EndIf $TestOffset = StringInStr($AttrArraySplit[$i], $TestOffsetAttr) If $TestOffset Then ; ConsoleWrite("Found offset: " & $TestOffset & @CRLF) EndIf If Not StringIsDigit($FoundOffset) Then _DumpOutput("Not number: " & $FoundOffset & " at lsn " & $this_lsn) If Int($TestOffsetAttr) > Int($FoundOffset) Then ContinueLoop If $AttrArraySplit[$i] = '' Then ContinueLoop If Int($TestOffsetAttr) = Int($FoundOffset) Then $AttrArraySplit[$i] = $TestString&'?'&$TestOffsetAttr ;$check=1 ElseIf Int($TestOffsetAttr) < Int($FoundOffset) Then $AttrArraySplit[$i] = $FoundAttr&'?'&Int($FoundOffset)+Int($TestSize) ConsoleWrite("Modified entry: " & $FoundAttr&'?'&Int($FoundOffset)+Int($TestSize) & @CRLF) If Int($FoundOffset)-Int($TestSize) < 0 Then _DebugOut("Error in _UpdateSingleOffsetOfAttribute() with " & $this_lsn) ;$check=1 EndIf Next If Int($TestOffsetAttr) > $HighestOffset Then $NewLimit = $AttrArraySplit[0] ReDim $AttrArraySplit[$NewLimit+1] $AttrArraySplit[$NewLimit] = $TestString&'?'&$TestOffsetAttr EndIf For $i = 1 To Ubound($AttrArraySplit)-1 If $AttrArraySplit[$i] = '' Then ContinueLoop $ConcatString &= $AttrArraySplit[$i]&',' Next $AttrArray[$RefIndex][1] = $ConcatString Else ; ConsoleWrite("Adding new row for new ref" & @CRLF) $GlobalCounter += 1 ReDim $AttrArray[$GlobalCounter][2] $AttrArray[$GlobalCounter-1][0] = $TestRef $AttrArray[$GlobalCounter-1][1] = $TestString&'?'&$TestOffsetAttr&',' EndIf EndFunc Func _UpdateSeveralOffsetOfAttribute($TestRef, $TestString) Local $RefIndex If $VerboseOn Then ConsoleWrite("_UpdateSeveralOffsetOfAttribute()" & @CRLF) ConsoleWrite("$TestString: " & $TestString & @CRLF) EndIf $RefIndex = _ArraySearch($AttrArray, $TestRef) If $RefIndex <> -1 Or Not @error Then ; ConsoleWrite("Ref already exist in array" & @CRLF) $AttrArray[$RefIndex][0] = $TestRef $AttrArray[$RefIndex][1] = $TestString&',' Else ; ConsoleWrite("Adding new row for new ref" & @CRLF) $GlobalCounter += 1 ReDim $AttrArray[$GlobalCounter][2] $AttrArray[$GlobalCounter - 1][0] = $TestRef $AttrArray[$GlobalCounter - 1][1] = $TestString&',' EndIf EndFunc Func _CheckOffsetOfAttribute($TestRef, $TestString) Local $RefIndex,$FoundAttr,$AttrArraySplit,$TestOffset If $VerboseOn Then ConsoleWrite("_CheckOffsetOfAttribute()" & @CRLF) ConsoleWrite("$TestString: " & $TestString & @CRLF) ; _ArrayDisplay($AttrArraySplit,"$AttrArraySplit") EndIf $RefIndex = _ArraySearch($AttrArray, $TestRef) If $RefIndex <> -1 Or Not @error Then $AttrArraySplit = StringSplit($AttrArray[$RefIndex][1], ',') If $VerboseOn Then ; _ArrayDisplay($AttrArraySplit,"$AttrArraySplit") EndIf For $i = 1 To $AttrArraySplit[0] $TestOffset = StringInStr($AttrArraySplit[$i], $TestString) If $VerboseOn Then ConsoleWrite("$AttrArraySplit[$i]: " & $AttrArraySplit[$i] & @CRLF) ConsoleWrite("$TestOffset: " & $TestOffset & @CRLF) EndIf If $TestOffset Then If Not StringIsDigit(StringMid($AttrArraySplit[$i],$TestOffset-1,1)) Then If StringMid($AttrArraySplit[$i],$TestOffset-1,1) <> '?' Then _DebugOut("Error in _CheckOffsetOfAttribute()",$AttrArraySplit[$i] & " -> " & StringMid($AttrArraySplit[$i] & " at offset " & $TestOffset-1,1)) $FoundAttr = StringMid($AttrArraySplit[$i], 1, $TestOffset-2) ; ConsoleWrite("$FoundAttr: " & $FoundAttr & @CRLF) Return $FoundAttr EndIf EndIf Next ; ConsoleWrite("Error: Attribute offset not found" & @CRLF) Return SetError(1,0,$FoundAttr) Else ; ConsoleWrite("Error: Ref not found" & @CRLF) Return SetError(1,0,$FoundAttr) EndIf EndFunc Func _Decode_AttributeType($record) ; Local $RecordSize,$DecodeOk=False $CurrentAttribute="" $AttributeTypeCheck = StringMid($record,1,4) If $VerboseOn Then ConsoleWrite("########### _Decode_AttributeType() ###########" & @CRLF) ConsoleWrite("$AttributeTypeCheck: " & $AttributeTypeCheck & @CRLF) EndIf ; $RecordSize = StringLen($record) Select Case $AttributeTypeCheck = "1000" $AttributeString = "$STANDARD_INFORMATION" Case $AttributeTypeCheck = "2000" $AttributeString = "$ATTRIBUTE_LIST" Case $AttributeTypeCheck = "3000" $AttributeString = "$FILE_NAME" Case $AttributeTypeCheck = "4000" $AttributeString = "$OBJECT_ID" Case $AttributeTypeCheck = "5000" $AttributeString = "$SECURITY_DESCRIPTOR" Case $AttributeTypeCheck = "6000" $AttributeString = "$VOLUME_NAME" Case $AttributeTypeCheck = "7000" $AttributeString = "$VOLUME_INFORMATION" Case $AttributeTypeCheck = "8000" $AttributeString = "$DATA" Case $AttributeTypeCheck = "9000" $AttributeString = "$INDEX_ROOT" Case $AttributeTypeCheck = "A000" $AttributeString = "$INDEX_ALLOCATION" Case $AttributeTypeCheck = "B000" $AttributeString = "$BITMAP" Case $AttributeTypeCheck = "C000" $AttributeString = "$REPARSE_POINT" Case $AttributeTypeCheck = "D000" $AttributeString = "$EA_INFORMATION" Case $AttributeTypeCheck = "E000" $AttributeString = "$EA" Case $AttributeTypeCheck = "F000" $AttributeString = "$PROPERTY_SET" Case $AttributeTypeCheck = "0001" $AttributeString = "$LOGGED_UTILITY_STREAM" EndSelect Return $AttributeString EndFunc ;--------------Security------------------ Func _IsSmallAceStruct($input) Select Case $input=$ACCESS_ALLOWED_ACE_TYPE Or $input=$ACCESS_DENIED_ACE_TYPE Or $input=$SYSTEM_AUDIT_ACE_TYPE Return 1 Case $input=$ACCESS_ALLOWED_CALLBACK_ACE_TYPE Or $input=$ACCESS_DENIED_CALLBACK_ACE_TYPE Or $input=$SYSTEM_AUDIT_CALLBACK_ACE_TYPE Return 1 Case $input=$SYSTEM_MANDATORY_LABEL_ACE_TYPE Or $input=$SYSTEM_RESOURCE_ATTRIBUTE_ACE_TYPE Or $input=$SYSTEM_SCOPED_POLICY_ID_ACE_TYPE Or $input=$SYSTEM_PROCESS_TRUST_LABEL_ACE_TYPE Return 1 Case $input=$ACCESS_ALLOWED_OBJECT_ACE_TYPE Or $input=$ACCESS_DENIED_OBJECT_ACE_TYPE Or $input=$SYSTEM_AUDIT_OBJECT_ACE_TYPE Return 0 Case $input=$ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE Or $input=$ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE Or $input=$SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE Return 0 EndSelect EndFunc Func _DecodeAceFlags($input) Local $output = "" If $input = 0x00 Then Return 'ZERO' If BitAND($input, $CONTAINER_INHERIT_ACE) Then $output &= 'CONTAINER_INHERIT_ACE+' If BitAND($input, $FAILED_ACCESS_ACE_FLAG) Then $output &= 'FAILED_ACCESS_ACE_FLAG+' If BitAND($input, $INHERIT_ONLY_ACE) Then $output &= 'INHERIT_ONLY_ACE+' If BitAND($input, $INHERITED_ACE) Then $output &= 'INHERITED_ACE+' If BitAND($input, $NO_PROPAGATE_INHERIT_ACE) Then $output &= 'NO_PROPAGATE_INHERIT_ACE+' If BitAND($input, $OBJECT_INHERIT_ACE) Then $output &= 'OBJECT_INHERIT_ACE+' If BitAND($input, $SUCCESSFUL_ACCESS_ACE_FLAG) Then $output &= 'SUCCESSFUL_ACCESS_ACE_FLAG+' $output = StringTrimRight($output, 1) Return $output EndFunc Func _DecodeAceType($input) ;Local $output = "" If $input = $ACCESS_ALLOWED_ACE_TYPE Then Return 'ACCESS_ALLOWED_ACE_TYPE' If $input = $ACCESS_DENIED_ACE_TYPE Then Return 'ACCESS_DENIED_ACE_TYPE' If $input = $SYSTEM_AUDIT_ACE_TYPE Then Return 'SYSTEM_AUDIT_ACE_TYPE' If $input = $SYSTEM_ALARM_ACE_TYPE Then Return 'SYSTEM_ALARM_ACE_TYPE' If $input = $ACCESS_ALLOWED_COMPOUND_ACE_TYPE Then Return 'ACCESS_ALLOWED_COMPOUND_ACE_TYPE' If $input = $ACCESS_ALLOWED_OBJECT_ACE_TYPE Then Return 'ACCESS_ALLOWED_OBJECT_ACE_TYPE' If $input = $ACCESS_DENIED_OBJECT_ACE_TYPE Then Return 'ACCESS_DENIED_OBJECT_ACE_TYPE' If $input = $SYSTEM_AUDIT_OBJECT_ACE_TYPE Then Return 'SYSTEM_AUDIT_OBJECT_ACE_TYPE' If $input = $SYSTEM_ALARM_OBJECT_ACE_TYPE Then Return 'SYSTEM_ALARM_OBJECT_ACE_TYPE' If $input = $ACCESS_ALLOWED_CALLBACK_ACE_TYPE Then Return 'ACCESS_ALLOWED_CALLBACK_ACE_TYPE' If $input = $ACCESS_DENIED_CALLBACK_ACE_TYPE Then Return 'ACCESS_DENIED_CALLBACK_ACE_TYPE' If $input = $ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE Then Return 'ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE' If $input = $ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE Then Return 'ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE' If $input = $SYSTEM_AUDIT_CALLBACK_ACE_TYPE Then Return 'SYSTEM_AUDIT_CALLBACK_ACE_TYPE' If $input = $SYSTEM_ALARM_CALLBACK_ACE_TYPE Then Return 'SYSTEM_ALARM_CALLBACK_ACE_TYPE' If $input = $SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE Then Return 'SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE' If $input = $SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE Then Return 'SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE' If $input = $SYSTEM_MANDATORY_LABEL_ACE_TYPE Then Return 'SYSTEM_MANDATORY_LABEL_ACE_TYPE' If $input = $SYSTEM_RESOURCE_ATTRIBUTE_ACE_TYPE Then Return 'SYSTEM_RESOURCE_ATTRIBUTE_ACE_TYPE' If $input = $SYSTEM_SCOPED_POLICY_ID_ACE_TYPE Then Return 'SYSTEM_SCOPED_POLICY_ID_ACE_TYPE' If $input = $SYSTEM_PROCESS_TRUST_LABEL_ACE_TYPE Then Return 'SYSTEM_PROCESS_TRUST_LABEL_ACE_TYPE' ; $output = StringTrimRight($output, 1) Return "UNKNOWN" EndFunc Func _SecurityDescriptorControl($input) Local $output = "" If BitAND($input, $SE_OWNER_DEFAULTED) Then $output &= 'SE_OWNER_DEFAULTED+' If BitAND($input, $SE_GROUP_DEFAULTED) Then $output &= 'SE_GROUP_DEFAULTED+' If BitAND($input, $SE_DACL_PRESENT) Then $output &= 'SE_DACL_PRESENT+' If BitAND($input, $SE_DACL_DEFAULTED) Then $output &= 'SE_DACL_DEFAULTED+' If BitAND($input, $SE_SACL_PRESENT) Then $output &= 'SE_SACL_PRESENT+' If BitAND($input, $SE_SACL_DEFAULTED) Then $output &= 'SE_SACL_DEFAULTED+' If BitAND($input, $SE_DACL_UNTRUSTED) Then $output &= 'SE_DACL_UNTRUSTED+' If BitAND($input, $SE_SERVER_SECURITY) Then $output &= 'SE_SERVER_SECURITY+' If BitAND($input, $SE_DACL_AUTO_INHERIT_REQ) Then $output &= 'SE_DACL_AUTO_INHERIT_REQ+' If BitAND($input, $SE_SACL_AUTO_INHERIT_REQ) Then $output &= 'SE_SACL_AUTO_INHERIT_REQ+' If BitAND($input, $SE_DACL_AUTO_INHERITED) Then $output &= 'SE_DACL_AUTO_INHERITED+' If BitAND($input, $SE_SACL_AUTO_INHERITED) Then $output &= 'SE_SACL_AUTO_INHERITED+' If BitAND($input, $SE_DACL_PROTECTED) Then $output &= 'SE_DACL_PROTECTED+' If BitAND($input, $SE_SACL_PROTECTED) Then $output &= 'SE_SACL_PROTECTED+' If BitAND($input, $SE_RM_CONTROL_VALID) Then $output &= 'SE_RM_CONTROL_VALID+' If BitAND($input, $SE_SELF_RELATIVE) Then $output &= 'SE_SELF_RELATIVE+' $output = StringTrimRight($output, 1) Return $output EndFunc Func _DecodeAceObjectFlag($input) ;Local $output = "" If $input = $ACE_NO_VALID_OBJECT_TYPE_PRESENT Then Return 'ACE_NO_VALID_OBJECT_TYPE_PRESENT' If $input = $ACE_OBJECT_TYPE_PRESENT Then Return 'ACE_OBJECT_TYPE_PRESENT' If $input = $ACE_INHERITED_OBJECT_TYPE_PRESENT Then Return 'ACE_INHERITED_OBJECT_TYPE_PRESENT' Return "UNKNOWN" ; If BitAND($input, $ACE_OBJECT_TYPE_PRESENT) Then $output &= 'ACE_OBJECT_TYPE_PRESENT+' ; If BitAND($input, $ACE_INHERITED_OBJECT_TYPE_PRESENT) Then $output &= 'ACE_INHERITED_OBJECT_TYPE_PRESENT+' ; $output = StringTrimRight($output, 1) ; Return $output EndFunc Func _DecodeSecurityDescriptorAttribute($InputData) ;http://0cch.net/ntfsdoc/attributes/security_descriptor.html Local $StartOffset = 1 $SecurityDescriptorHash="" $SecurityId="" $ControlText="" $SidOwner="" $SidGroup="" ; ConsoleWrite("_DecodeSDSChunk() " & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$InputData)) ; Start SelfrelativeSecurityDescriptor $Revision = StringMid($InputData, $StartOffset, 2) $Revision = Dec($Revision) If $Revision <> 1 Then ; ConsoleWrite("Error: Revision invalid: " & $Revision & @CRLF) ; Return EndIf ;$Sbz1 = StringMid($InputData, $StartOffset + 2, 2) $SECURITY_DESCRIPTOR_CONTROL = StringMid($InputData, $StartOffset + 4, 4) $SECURITY_DESCRIPTOR_CONTROL = _SwapEndian($SECURITY_DESCRIPTOR_CONTROL) $ControlText = _SecurityDescriptorControl("0x"&$SECURITY_DESCRIPTOR_CONTROL) If Not BitAND("0x"&$SECURITY_DESCRIPTOR_CONTROL, $SE_SELF_RELATIVE) Then ConsoleWrite("Error: Descriptor not self relative. Nothing to do" & @CRLF) Return EndIf $PSidOwner = StringMid($InputData, $StartOffset + 8, 8) $PSidOwner = _SwapEndian($PSidOwner) $PSidOwner = Dec($PSidOwner) $PSidGroup = StringMid($InputData, $StartOffset + 16, 8) $PSidGroup = _SwapEndian($PSidGroup) $PSidGroup = Dec($PSidGroup) $PSacl = StringMid($InputData, $StartOffset + 24, 8) $PSacl = _SwapEndian($PSacl) $PSacl = Dec($PSacl) $PDacl = StringMid($InputData, $StartOffset + 32, 8) $PDacl = _SwapEndian($PDacl) $PDacl = Dec($PDacl) If $PSidOwner > 0 Then $SidOwner = _DecodeSID(StringMid($InputData,$StartOffset+$PSidOwner*2)) EndIf If $PSidGroup > 0 Then $SidGroup = _DecodeSID(StringMid($InputData,$StartOffset+$PSidGroup*2)) EndIf If $PSacl > 0 Then _DecodeAcl_S(StringMid($InputData,$StartOffset+$PSacl*2)) EndIf If $PDacl > 0 Then _DecodeAcl_D(StringMid($InputData,$StartOffset+$PDacl*2)) EndIf #cs ConsoleWrite("$SecurityDescriptorHash: " & $SecurityDescriptorHash & @CRLF) ConsoleWrite("$SecurityId: " & $SecurityId & @CRLF) ConsoleWrite("$EntryOffset: " & $EntryOffset & @CRLF) ConsoleWrite("$EntrySize: " & $EntrySize & @CRLF) ConsoleWrite("$Revision: " & $Revision & @CRLF) ConsoleWrite("$Sbz1: " & $Sbz1 & @CRLF) ConsoleWrite("$SECURITY_DESCRIPTOR_CONTROL: " & $SECURITY_DESCRIPTOR_CONTROL & @CRLF) ConsoleWrite("$ControlText: " & $ControlText & @CRLF) ConsoleWrite("$PSidOwner: " & $PSidOwner & @CRLF) ConsoleWrite("$PSidGroup: " & $PSidGroup & @CRLF) ConsoleWrite("$PSacl: " & $PSacl & @CRLF) ConsoleWrite("$PDacl: " & $PDacl & @CRLF) #ce EndFunc Func _DecodeSDSChunk($InputData, $Hash) ;https://msdn.microsoft.com/en-us/library/cc230366.aspx Local $StartOffset = 1 $SecurityDescriptorHash="" $SecurityId="" $ControlText="" $SidOwner="" $SidGroup="" ; ConsoleWrite("_DecodeSDSChunk() " & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$InputData)) $SecurityDescriptorHash = StringMid($InputData, $StartOffset, 8) ; $SecurityDescriptorHash = _SwapEndian($SecurityDescriptorHash) If $SecurityDescriptorHash <> $Hash Then ConsoleWrite("Error: Hash mismatch" & @CRLF) Return EndIf $SecurityDescriptorHash = "0x" & $SecurityDescriptorHash $SecurityId = StringMid($InputData, $StartOffset + 8, 8) $SecurityId = _SwapEndian($SecurityId) $SecurityId = Dec($SecurityId,2) $EntryOffset = StringMid($InputData, $StartOffset + 16, 16) $EntryOffset = _SwapEndian($EntryOffset) $EntrySize = StringMid($InputData, $StartOffset + 32, 8) $EntrySize = _SwapEndian($EntrySize) ; Start SelfrelativeSecurityDescriptor $Revision = StringMid($InputData, $StartOffset + 40, 2) $Revision = Dec($Revision) If $Revision <> 1 Then ; ConsoleWrite("Error: Revision invalid: " & $Revision & @CRLF) ; Return EndIf $Sbz1 = StringMid($InputData, $StartOffset + 42, 2) $SECURITY_DESCRIPTOR_CONTROL = StringMid($InputData, $StartOffset + 44, 4) $SECURITY_DESCRIPTOR_CONTROL = _SwapEndian($SECURITY_DESCRIPTOR_CONTROL) $ControlText = _SecurityDescriptorControl("0x"&$SECURITY_DESCRIPTOR_CONTROL) If Not BitAND("0x"&$SECURITY_DESCRIPTOR_CONTROL, $SE_SELF_RELATIVE) Then ConsoleWrite("Error: Descriptor not self relative. Nothing to do" & @CRLF) Return EndIf $PSidOwner = StringMid($InputData, $StartOffset + 48, 8) $PSidOwner = _SwapEndian($PSidOwner) $PSidOwner = Dec($PSidOwner) $PSidGroup = StringMid($InputData, $StartOffset + 56, 8) $PSidGroup = _SwapEndian($PSidGroup) $PSidGroup = Dec($PSidGroup) $PSacl = StringMid($InputData, $StartOffset + 64, 8) $PSacl = _SwapEndian($PSacl) $PSacl = Dec($PSacl) $PDacl = StringMid($InputData, $StartOffset + 72, 8) $PDacl = _SwapEndian($PDacl) $PDacl = Dec($PDacl) If $PSidOwner > 0 Then $SidOwner = _DecodeSID(StringMid($InputData,$StartOffset+40+$PSidOwner*2)) EndIf If $PSidGroup > 0 Then $SidGroup = _DecodeSID(StringMid($InputData,$StartOffset+40+$PSidGroup*2)) EndIf If $PSacl > 0 Then _DecodeAcl_S(StringMid($InputData,$StartOffset+40+$PSacl*2)) EndIf If $PDacl > 0 Then _DecodeAcl_D(StringMid($InputData,$StartOffset+40+$PDacl*2)) EndIf If $VerboseOn Then _DumpOutput("_DecodeSDSChunk(): " & @CRLF) _DumpOutput("$SecurityDescriptorHash: " & $SecurityDescriptorHash & @CRLF) _DumpOutput("$SecurityId: " & $SecurityId & @CRLF) _DumpOutput("$EntryOffset: " & $EntryOffset & @CRLF) _DumpOutput("$EntrySize: " & $EntrySize & @CRLF) _DumpOutput("$Revision: " & $Revision & @CRLF) _DumpOutput("$Sbz1: " & $Sbz1 & @CRLF) _DumpOutput("$SECURITY_DESCRIPTOR_CONTROL: " & $SECURITY_DESCRIPTOR_CONTROL & @CRLF) _DumpOutput("$ControlText: " & $ControlText & @CRLF) _DumpOutput("$PSidOwner: " & $PSidOwner & @CRLF) _DumpOutput("$PSidGroup: " & $PSidGroup & @CRLF) _DumpOutput("$PSacl: " & $PSacl & @CRLF) _DumpOutput("$PDacl: " & $PDacl & @CRLF) EndIf EndFunc Func _DecodeAcl_S($InputData) ;https://msdn.microsoft.com/en-us/library/cc230297.aspx Local $StartOffset = 1, $AceDataCounter = 0 $SAclRevision="" $SAceCount="" $SAceTypeText="" $SAceFlagsText="" $SAceMask="" $SAceObjectFlagsText="" $SAceObjectType="" $SAceInheritedObjectType="" $SAceSIDString="" ; ConsoleWrite("_DecodeAcl_S() " & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$InputData)) ; ACL header 8 bytes $SAclRevision = StringMid($InputData, $StartOffset, 2) If $SAclRevision <> "02" And $SAclRevision <> "04" Then ConsoleWrite("Error: Invalid SAclRevision: " & $SAclRevision & @CRLF) EndIf ;$Sbz1 = StringMid($InputData, $StartOffset + 2, 2) $AclSize = StringMid($InputData, $StartOffset + 4, 4) $AclSize = _SwapEndian($AclSize) $AclSize = Dec($AclSize) $SAceCount = StringMid($InputData, $StartOffset + 8, 4) $SAceCount = _SwapEndian($SAceCount) $SAceCount = Dec($SAceCount) ;$Sbz2 = StringMid($InputData, $StartOffset + 12, 4) #cs ConsoleWrite("$SAclRevision: " & $SAclRevision & @CRLF) ConsoleWrite("$Sbz1: " & $Sbz1 & @CRLF) ConsoleWrite("$AclSize: " & $AclSize & @CRLF) ConsoleWrite("$SAceCount: " & $SAceCount & @CRLF) ConsoleWrite("$Sbz2: " & $Sbz2 & @CRLF) #ce If $SAceCount < 1 Then Return For $j = 1 To $SAceCount ;ACE_HEADER 4 bytes ;https://msdn.microsoft.com/en-us/library/cc230296.aspx $AceType = StringMid($InputData, $StartOffset + $AceDataCounter + 16, 2) $AceTypeText = _DecodeAceType(Number("0x"&$AceType)) If $AceTypeText = "" Then ConsoleWrite("Error: AceType invalid" & @CRLF) ; ContinueLoop EndIf If $AceTypeText = "UNKNOWN" Then ConsoleWrite("Unknown ace flags: " & $AceType & @CRLF) $AceFlags = StringMid($InputData, $StartOffset + $AceDataCounter + 18, 2) $AceFlagsText = _DecodeAceFlags(Number("0x"&$AceFlags)) If $j > 1 Then $SAceTypeText &= $de2 & $AceTypeText $SAceFlagsText &= $de2 & $AceFlagsText Else $SAceTypeText = $AceTypeText $SAceFlagsText = $AceFlagsText EndIf $AceSize = StringMid($InputData, $StartOffset + $AceDataCounter + 20, 4) $AceSize = _SwapEndian($AceSize) $AceSize = Dec($AceSize) ;Remaining bytes of ACE depends on AceType $Mask="" ;$Flags="" $ObjectType="" $InheritedObjectType="" $SIDString="" If _IsSmallAceStruct("0x"&$AceType) Then ; ConsoleWrite("Small struct " & @CRLF) ;"dword Mask;dword SidStart" ;https://msdn.microsoft.com/en-us/library/windows/desktop/aa374902(v=vs.85).aspx $Mask = StringMid($InputData, $StartOffset + $AceDataCounter + 24, 8) $Mask = "0x"&_SwapEndian($Mask) $SIDString = _DecodeSID(StringMid($InputData,$StartOffset + $AceDataCounter + 32, $AceSize*2)) If $j > 1 Then $SAceMask &= $de2 & $Mask $SAceSIDString &= $de2 & $SIDString Else $SAceMask = $Mask $SAceSIDString = $SIDString EndIf Else ; ConsoleWrite("Big struct " & @CRLF) ;"dword Mask;dword Flags;GUID ObjectType;GUID InheritedObjectType;dword SidStart" $Mask = StringMid($InputData, $StartOffset + $AceDataCounter + 24, 8) $Mask = "0x"&_SwapEndian($Mask) $ObjectFlags = StringMid($InputData, $StartOffset + $AceDataCounter + 32, 8) $ObjectFlags = _SwapEndian($ObjectFlags) $ObjectFlagsText = _DecodeAceObjectFlag($ObjectFlags) $ObjectType = StringMid($InputData, $StartOffset + $AceDataCounter + 40, 32) $ObjectType = _HexToGuidStr($ObjectType,1) $InheritedObjectType = StringMid($InputData, $StartOffset + $AceDataCounter + 72, 32) $InheritedObjectType = _HexToGuidStr($InheritedObjectType,1) $SIDString = _DecodeSID(StringMid($InputData,$StartOffset + $AceDataCounter + 104, $AceSize*2)) If $j > 1 Then $SAceMask &= $de2 & $Mask $SAceObjectFlagsText &= $de2 & $ObjectFlagsText $SAceObjectType &= $de2 & $ObjectType $SAceInheritedObjectType &= $de2 & $InheritedObjectType $SAceSIDString &= $de2 & $SIDString Else $SAceMask = $Mask $SAceObjectFlagsText = $ObjectFlagsText $SAceObjectType = $ObjectType $SAceInheritedObjectType = $InheritedObjectType $SAceSIDString = $SIDString EndIf EndIf #cs ConsoleWrite(@CRLF & "Ace number: " & $j & @CRLF) ConsoleWrite("$AceType: " & $AceType & @CRLF) ConsoleWrite("$AceTypeText: " & $AceTypeText & @CRLF) ConsoleWrite("$AceFlags: " & $AceFlags & @CRLF) ConsoleWrite("$AceFlagsText: " & $AceFlagsText & @CRLF) ConsoleWrite("$AceSize: " & $AceSize & @CRLF) ConsoleWrite("$Mask: " & $Mask & @CRLF) ConsoleWrite("$Flags: " & $Flags & @CRLF) ConsoleWrite("$ObjectType: " & $ObjectType & @CRLF) ConsoleWrite("$InheritedObjectType: " & $InheritedObjectType & @CRLF) ConsoleWrite("$SIDString: " & $SIDString & @CRLF) #ce $AceDataCounter += $AceSize*2 Next EndFunc Func _DecodeAcl_D($InputData) ;https://msdn.microsoft.com/en-us/library/cc230297.aspx Local $StartOffset = 1, $AceDataCounter = 0 $DAclRevision="" $DAceCount="" $DAceTypeText="" $DAceFlagsText="" $DAceMask="" $DAceObjectFlagsText="" $DAceObjectType="" $DAceInheritedObjectType="" $DAceSIDString="" ; ConsoleWrite("_DecodeAcl_D() " & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$InputData)) ; ACL header 8 bytes $DAclRevision = StringMid($InputData, $StartOffset, 2) If $DAclRevision <> "02" And $DAclRevision <> "04" Then ConsoleWrite("Error: Invalid DAclRevision: " & $DAclRevision & @CRLF) EndIf ;$Sbz1 = StringMid($InputData, $StartOffset + 2, 2) $AclSize = StringMid($InputData, $StartOffset + 4, 4) $AclSize = _SwapEndian($AclSize) $AclSize = Dec($AclSize) $DAceCount = StringMid($InputData, $StartOffset + 8, 4) $DAceCount = _SwapEndian($DAceCount) $DAceCount = Dec($DAceCount) ;$Sbz2 = StringMid($InputData, $StartOffset + 12, 4) #cs ConsoleWrite("$DAclRevision: " & $DAclRevision & @CRLF) ConsoleWrite("$Sbz1: " & $Sbz1 & @CRLF) ConsoleWrite("$AclSize: " & $AclSize & @CRLF) ConsoleWrite("$DAceCount: " & $DAceCount & @CRLF) ConsoleWrite("$Sbz2: " & $Sbz2 & @CRLF) #ce If $DAceCount < 1 Then Return For $j = 1 To $DAceCount ;ACE_HEADER 4 bytes ;https://msdn.microsoft.com/en-us/library/cc230296.aspx $AceType = StringMid($InputData, $StartOffset + $AceDataCounter + 16, 2) $AceTypeText = _DecodeAceType(Number("0x"&$AceType)) If $AceTypeText = "" Then ConsoleWrite("Error: AceType invalid" & @CRLF) ; ContinueLoop EndIf $AceFlags = StringMid($InputData, $StartOffset + $AceDataCounter + 18, 2) $AceFlagsText = _DecodeAceFlags(Number("0x"&$AceFlags)) If $j > 1 Then $DAceTypeText &= $de2 & $AceTypeText $DAceFlagsText &= $de2 & $AceFlagsText Else $DAceTypeText = $AceTypeText $DAceFlagsText = $AceFlagsText EndIf $AceSize = StringMid($InputData, $StartOffset + $AceDataCounter + 20, 4) $AceSize = _SwapEndian($AceSize) $AceSize = Dec($AceSize) ;Remaining bytes of ACE depends on AceType $Mask="" ;$Flags="" $ObjectType="" $InheritedObjectType="" $SIDString="" If _IsSmallAceStruct("0x"&$AceType) Then ; ConsoleWrite("Small struct " & @CRLF) ;"dword Mask;dword SidStart" ;https://msdn.microsoft.com/en-us/library/windows/desktop/aa374902(v=vs.85).aspx $Mask = StringMid($InputData, $StartOffset + $AceDataCounter + 24, 8) $Mask = "0x"&_SwapEndian($Mask) $SIDString = _DecodeSID(StringMid($InputData,$StartOffset + $AceDataCounter + 32, $AceSize*2)) If $j > 1 Then $DAceMask &= $de2 & $Mask $DAceSIDString &= $de2 & $SIDString Else $DAceMask = $Mask $DAceSIDString = $SIDString EndIf Else ; ConsoleWrite("Big struct " & @CRLF) ;"dword Mask;dword Flags;GUID ObjectType;GUID InheritedObjectType;dword SidStart" $Mask = StringMid($InputData, $StartOffset + $AceDataCounter + 24, 8) $Mask = "0x"&_SwapEndian($Mask) $ObjectFlags = StringMid($InputData, $StartOffset + $AceDataCounter + 32, 8) $ObjectFlags = _SwapEndian($ObjectFlags) $ObjectFlagsText = _DecodeAceObjectFlag($ObjectFlags) $ObjectType = StringMid($InputData, $StartOffset + $AceDataCounter + 40, 32) $ObjectType = _HexToGuidStr($ObjectType,1) $InheritedObjectType = StringMid($InputData, $StartOffset + $AceDataCounter + 72, 32) $InheritedObjectType = _HexToGuidStr($InheritedObjectType,1) $SIDString = _DecodeSID(StringMid($InputData,$StartOffset + $AceDataCounter + 104, $AceSize*2)) If $j > 1 Then $DAceMask &= $de2 & $Mask $DAceObjectFlagsText &= $de2 & $ObjectFlagsText $DAceObjectType &= $de2 & $ObjectType $DAceInheritedObjectType &= $de2 & $InheritedObjectType $DAceSIDString &= $de2 & $SIDString Else $DAceMask = $Mask $DAceObjectFlagsText = $ObjectFlagsText $DAceObjectType = $ObjectType $DAceInheritedObjectType = $InheritedObjectType $DAceSIDString = $SIDString EndIf EndIf #cs ConsoleWrite(@CRLF & "Ace number: " & $j & @CRLF) ConsoleWrite("$AceType: " & $AceType & @CRLF) ConsoleWrite("$AceTypeText: " & $AceTypeText & @CRLF) ConsoleWrite("$AceFlags: " & $AceFlags & @CRLF) ConsoleWrite("$AceFlagsText: " & $AceFlagsText & @CRLF) ConsoleWrite("$AceSize: " & $AceSize & @CRLF) ConsoleWrite("$Mask: " & $Mask & @CRLF) ConsoleWrite("$Flags: " & $Flags & @CRLF) ConsoleWrite("$ObjectType: " & $ObjectType & @CRLF) ConsoleWrite("$InheritedObjectType: " & $InheritedObjectType & @CRLF) ConsoleWrite("$SIDString: " & $SIDString & @CRLF) #ce $AceDataCounter += $AceSize*2 Next EndFunc Func _DecodeSID($InputData) ;https://msdn.microsoft.com/en-us/library/cc230371.aspx Local $StartOffset = 1, $SIDString = "S" ; ConsoleWrite("_DecodeSID() " & @CRLF) $Revision = StringMid($InputData, $StartOffset, 2) $Revision = Dec($Revision) If $Revision <> 1 Then ConsoleWrite("Error: Revision invalid: " & $Revision & @CRLF) Return SetError(1,0,0) EndIf $SIDString &= "-" & $Revision $SubAuthorityCount = StringMid($InputData, $StartOffset + 2, 2) $SubAuthorityCount = Dec($SubAuthorityCount) If $SubAuthorityCount > 15 Then ConsoleWrite("Error: SubAuthorityCount invalid: " & $SubAuthorityCount & @CRLF) Return SetError(1,0,0) EndIf ;SID_IDENTIFIER_AUTHORITY $IdentifierAuthority = StringMid($InputData, $StartOffset + 4, 12) ; ConsoleWrite("$IdentifierAuthority: " & $IdentifierAuthority & @CRLF) ;$IdentifierAuthorityString = _DecodeSidIdentifierAuthorityString($IdentifierAuthority) $IdentifierAuthority = _DecodeSidIdentifierAuthority($IdentifierAuthority) $SIDString &= "-" & $IdentifierAuthority ;SubAuthority (variable) If $SubAuthorityCount < 1 Or $SubAuthorityCount > 15 Then ConsoleWrite("Error: $SubAuthorityCount seems invalid: " & $SubAuthorityCount & @CRLF) Return SetError(1,0,0) EndIf For $j = 1 To $SubAuthorityCount $SubAuthority = StringMid($InputData, $StartOffset + (($j-1)*8) + 16, 8) ; ConsoleWrite("$SubAuthority: " & $SubAuthority & @CRLF) $SIDString &= "-" & Dec(_SwapEndian($SubAuthority),2) Next #cs ConsoleWrite("$Revision: " & $Revision & @CRLF) ConsoleWrite("$SubAuthorityCount: " & $SubAuthorityCount & @CRLF) ConsoleWrite("$IdentifierAuthorityString: " & $IdentifierAuthorityString & @CRLF) ConsoleWrite("$IdentifierAuthority: " & $IdentifierAuthority & @CRLF) ConsoleWrite("$SIDString: " & $SIDString & @CRLF) #ce Return $SIDString EndFunc Func _DecodeSidIdentifierAuthority($InputData) ; ConsoleWrite("_DecodeSidIdentifierAuthority() " & @CRLF) Select Case $InputData = "000000000000" Return Dec($InputData) ; Return "0" Case $InputData = "000000000001" Return Dec($InputData) ; Return "1" Case $InputData = "000000000002" Return Dec($InputData) ; Return "2" Case $InputData = "000000000003" Return Dec($InputData) ; Return "3" Case $InputData = "000000000004" Return Dec($InputData) ; Return "4" Case $InputData = "000000000005" Return Dec($InputData) ; Return "5" Case $InputData = "00000000000F" Return Dec($InputData) ; Return "F" Case $InputData = "000000000010" Return Dec($InputData) ; Return "10" Case $InputData = "000000000011" Return Dec($InputData) ; Return "11" Case $InputData = "000000000012" Return Dec($InputData) ; Return "12" Case $InputData = "000000000013" Return Dec($InputData) ; Return "13" Case Else Return "UNKNOWN" EndSelect EndFunc Func _DecodeSidIdentifierAuthorityString($InputData) ; ConsoleWrite("_DecodeSidIdentifierAuthorityString() " & @CRLF) Select Case $InputData = "000000000000" Return "NULL_SID_AUTHORITY" Case $InputData = "000000000001" Return "WORLD_SID_AUTHORITY" Case $InputData = "000000000002" Return "LOCAL_SID_AUTHORITY" Case $InputData = "000000000003" Return "CREATOR_SID_AUTHORITY" Case $InputData = "000000000004" Return "NON_UNIQUE_AUTHORITY" Case $InputData = "000000000005" Return "SECURITY_NT_AUTHORITY" Case $InputData = "00000000000F" Return "SECURITY_APP_PACKAGE_AUTHORITY" Case $InputData = "000000000010" Return "SECURITY_MANDATORY_LABEL_AUTHORITY" Case $InputData = "000000000011" Return "SECURITY_SCOPED_POLICY_ID_AUTHORITY" Case $InputData = "000000000012" Return "SECURITY_AUTHENTICATION_AUTHORITY" Case $InputData = "000000000013" Return "SECURITY_PROCESS_TRUST_AUTHORITY" Case Else Return "UNKNOWN" EndSelect EndFunc Func _DecodeIndxEntriesSDH($InputData,$IsRedo) Local $StartOffset = 1, $Counter = 0 Local $InputDataSize = BinaryLen("0x"&$InputData) ReDim $SDHArray[100+1+$InputDataSize/48][6] $SDHArray[0][0] = "OffsetInSDS" $SDHArray[0][1] = "SizeInSDS" $SDHArray[0][2] = "SecurityDescriptorHashKey" $SDHArray[0][3] = "SecurityIdKey" $SDHArray[0][4] = "SecurityDescriptorHashData" $SDHArray[0][5] = "SecurityIdData" ; _ArrayDisplay($SDHArray,"$SDHArray") ; ConsoleWrite("_DecodeIndxEntriesSDH() " & @CRLF) ; ConsoleWrite("Input size: " & $InputDataSize & @CRLF) ; ConsoleWrite("$InputData: " & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$InputData)) #cs $MaxDescriptors=UBound($SDHArray)-101 $begin = TimerInit() AdlibRegister("_SDHProgress", 500) #ce While 1 If $StartOffset >= $InputDataSize*2 Then ExitLoop $Counter+=1 ;$CurrentDescriptor=$Counter $DataOffset = StringMid($InputData, $StartOffset, 4) $DataOffset = _SwapEndian($DataOffset) $DataSize = StringMid($InputData, $StartOffset + 4, 4) $DataSize = _SwapEndian($DataSize) If $DataOffset = 0 Or $DataSize = 0 Then $StartOffset+=16 ;Padding 4 bytes $IndexEntrySize = StringMid($InputData, $StartOffset + 16, 4) $IndexEntrySize = _SwapEndian($IndexEntrySize) $IndexKeySize = StringMid($InputData, $StartOffset + 20, 4) $IndexKeySize = _SwapEndian($IndexKeySize) $Flags = StringMid($InputData, $StartOffset + 24, 4) $Flags = "0x" & _SwapEndian($Flags) ;Padding 2 bytes ;Start of SDH index entry ; $StartOffset = $StartOffset+24 $SecurityDescriptorHashKey = "0x" & StringMid($InputData, $StartOffset + 32, 8) ; $SecurityDescriptorHashKey = _SwapEndian($SecurityDescriptorHashKey) $SecurityIdKey = StringMid($InputData, $StartOffset + 40, 8) $SecurityIdKey = _SwapEndian($SecurityIdKey) $SecurityIdKey = Dec($SecurityIdKey,2) $SecurityDescriptorHashData = "0x" & StringMid($InputData, $StartOffset + 48, 8) ; $SecurityDescriptorHashData = _SwapEndian($SecurityDescriptorHashData) $SecurityIdData = StringMid($InputData, $StartOffset + 56, 8) $SecurityIdData = _SwapEndian($SecurityIdData) $SecurityIdData = Dec($SecurityIdData,2) $OffsetInSDS = StringMid($InputData, $StartOffset + 64, 16) $OffsetInSDS = "0x" & _SwapEndian($OffsetInSDS) $SizeInSDS = StringMid($InputData, $StartOffset + 80, 8) $SizeInSDS = "0x" & _SwapEndian($SizeInSDS) $EndPadding = StringMid($InputData, $StartOffset + 88, 8) If $EndPadding <> "49004900" Then ConsoleWrite("Wrong end padding (49004900): " & $EndPadding & @CRLF) Return 0 EndIf FileWriteLine($LogFileSecureSDHCsv, $RecordOffset&$de&$this_lsn&$de&$Flags&$de&$SecurityDescriptorHashKey&$de&$SecurityIdKey&$de&$SecurityDescriptorHashData&$de&$SecurityIdData&$de&$OffsetInSDS&$de&$SizeInSDS&$de&$IsRedo&@crlf) $SDHArray[$Counter][0] = $OffsetInSDS $SDHArray[$Counter][1] = $SizeInSDS $SDHArray[$Counter][2] = $SecurityDescriptorHashKey $SDHArray[$Counter][3] = $SecurityIdKey $SDHArray[$Counter][4] = $SecurityDescriptorHashData $SDHArray[$Counter][5] = $SecurityIdData #cs ConsoleWrite(@CRLF) ConsoleWrite("$DataOffset: " & $DataOffset & @CRLF) ConsoleWrite("$DataSize: " & $DataSize & @CRLF) ConsoleWrite("$IndexEntrySize: " & $IndexEntrySize & @CRLF) ConsoleWrite("$IndexKeySize: " & $IndexKeySize & @CRLF) ConsoleWrite("$Flags: " & $Flags & @CRLF) ConsoleWrite("$SecurityDescriptorHashKey: " & $SecurityDescriptorHashKey & @CRLF) ConsoleWrite("$SecurityIdKey: " & $SecurityIdKey & @CRLF) ConsoleWrite("$SecurityDescriptorHashData: " & $SecurityDescriptorHashData & @CRLF) ConsoleWrite("$SecurityIdData: " & $SecurityIdData & @CRLF) ConsoleWrite("$OffsetInSDS: " & $OffsetInSDS & @CRLF) ConsoleWrite("$SizeInSDS: " & $SizeInSDS & @CRLF) #ce $StartOffset += 96 WEnd #cs $MaxDescriptors = $CurrentDescriptor AdlibUnRegister("_SDHProgress") GUICtrlSetData($ProgressStatus, "[$SDH] Processing security descriptor index entry " & $CurrentDescriptor & " of " & $MaxDescriptors) GUICtrlSetData($ElapsedTime, "Elapsed time = " & _WinAPI_StrFromTimeInterval(TimerDiff($begin))) GUICtrlSetData($ProgressSDH, 100 * $CurrentDescriptor / $MaxDescriptors) _DisplayInfo("$SDH processing finished in " & _WinAPI_StrFromTimeInterval(TimerDiff($begin)) & @CRLF) #ce ReDim $SDHArray[$Counter+1][6] EndFunc Func _DecodeIndxEntriesSII($InputData,$IsRedo) Local $StartOffset = 1, $Counter = 0 Local $InputDataSize = BinaryLen("0x"&$InputData) ReDim $SIIArray[100+1+$InputDataSize/40][5] $SIIArray[0][0] = "OffsetInSDS" $SIIArray[0][1] = "SizeInSDS" $SIIArray[0][2] = "SecurityIdKey" $SIIArray[0][3] = "SecurityDescriptorHashData" $SIIArray[0][4] = "SecurityIdData" ; ConsoleWrite("_DecodeIndxEntriesSII() " & @CRLF) ; ConsoleWrite("Input size: " & BinaryLen("0x"&$InputData) & @CRLF) ; ConsoleWrite("$InputData: " & @CRLF) ; ConsoleWrite(_HexEncode("0x"&$InputData)) #cs $MaxDescriptors=UBound($SIIArray)-101 $begin = TimerInit() AdlibRegister("_SIIProgress", 500) #ce While 1 If $StartOffset >= BinaryLen("0x"&$InputData)*2 Then ExitLoop $Counter+=1 ;$CurrentDescriptor=$Counter $DataOffset = StringMid($InputData, $StartOffset, 4) $DataOffset = _SwapEndian($DataOffset) $DataSize = StringMid($InputData, $StartOffset + 4, 4) $DataSize = _SwapEndian($DataSize) If $DataOffset = 0 Or $DataSize = 0 Then $StartOffset+=16 ;Padding 4 bytes $IndexEntrySize = StringMid($InputData, $StartOffset + 16, 4) $IndexEntrySize = _SwapEndian($IndexEntrySize) $IndexKeySize = StringMid($InputData, $StartOffset + 20, 4) $IndexKeySize = _SwapEndian($IndexKeySize) $Flags = StringMid($InputData, $StartOffset + 24, 4) $Flags = "0x" & _SwapEndian($Flags) ;Padding 2 bytes $SecurityIdKey = StringMid($InputData, $StartOffset + 32, 8) $SecurityIdKey = _SwapEndian($SecurityIdKey) $SecurityIdKey = Dec($SecurityIdKey,2) $SecurityDescriptorHashData = "0x" & StringMid($InputData, $StartOffset + 40, 8) ; $SecurityDescriptorHashData = _SwapEndian($SecurityDescriptorHashData) $SecurityIdData = StringMid($InputData, $StartOffset + 48, 8) $SecurityIdData = _SwapEndian($SecurityIdData) $SecurityIdData = Dec($SecurityIdData,2) $OffsetInSDS = StringMid($InputData, $StartOffset + 56, 16) $OffsetInSDS = "0x" & _SwapEndian($OffsetInSDS) $SizeInSDS = StringMid($InputData, $StartOffset + 72, 8) $SizeInSDS = "0x" & _SwapEndian($SizeInSDS) FileWriteLine($LogFileSecureSIICsv, $RecordOffset&$de&$this_lsn&$de&$Flags&$de&$SecurityIdKey&$de&$SecurityDescriptorHashData&$de&$SecurityIdData&$de&$OffsetInSDS&$de&$SizeInSDS&$de&$IsRedo&@crlf) $SIIArray[$Counter][0] = $OffsetInSDS $SIIArray[$Counter][1] = $SizeInSDS $SIIArray[$Counter][2] = $SecurityIdKey $SIIArray[$Counter][3] = $SecurityDescriptorHashData $SIIArray[$Counter][4] = $SecurityIdData #cs ConsoleWrite(@CRLF) ConsoleWrite("$DataOffset: " & $DataOffset & @CRLF) ConsoleWrite("$DataSize: " & $DataSize & @CRLF) ConsoleWrite("$IndexEntrySize: " & $IndexEntrySize & @CRLF) ConsoleWrite("$IndexKeySize: " & $IndexKeySize & @CRLF) ConsoleWrite("$Flags: " & $Flags & @CRLF) ConsoleWrite("$SecurityIdKey: " & $SecurityIdKey & @CRLF) ConsoleWrite("$SecurityDescriptorHashData: " & $SecurityDescriptorHashData & @CRLF) ConsoleWrite("$SecurityIdData: " & $SecurityIdData & @CRLF) ConsoleWrite("$OffsetInSDS: " & $OffsetInSDS & @CRLF) ConsoleWrite("$SizeInSDS: " & $SizeInSDS & @CRLF) #ce $StartOffset += 80 WEnd #cs $MaxDescriptors = $CurrentDescriptor AdlibUnRegister("_SIIProgress") GUICtrlSetData($ProgressStatus, "[$SII] Processing security descriptor index entry " & $CurrentDescriptor & " of " & $MaxDescriptors) GUICtrlSetData($ElapsedTime, "Elapsed time = " & _WinAPI_StrFromTimeInterval(TimerDiff($begin))) GUICtrlSetData($ProgressSII, 100 * $CurrentDescriptor / $MaxDescriptors) _DisplayInfo("$SII processing finished in " & _WinAPI_StrFromTimeInterval(TimerDiff($begin)) & @CRLF) #ce ReDim $SIIArray[$Counter+1][5] EndFunc Func _GetIndx($Entry) ; ConsoleWrite("Starting function _Get_IndexAllocation()" & @crlf) Local $NextPosition = 3,$IndxHdrMagic,$IndxEntries,$TotalIndxEntries ; ConsoleWrite("StringLen of chunk = " & StringLen($Entry) & @crlf) ; ConsoleWrite("Expected records = " & StringLen($Entry)/8192 & @crlf) ; $NextPosition = 1 Do $IndxHdrMagic = StringMid($Entry,$NextPosition,8) ; ConsoleWrite("$IndxHdrMagic = " & $IndxHdrMagic & @crlf) $IndxHdrMagic = _HexToString($IndxHdrMagic) ; ConsoleWrite("$IndxHdrMagic = " & $IndxHdrMagic & @crlf) If $IndxHdrMagic <> "INDX" Then ; ConsoleWrite("$IndxHdrMagic: " & $IndxHdrMagic & @crlf) ConsoleWrite("Error: Record is not of type INDX, and this was not expected.." & @crlf) $NextPosition += 8192 ContinueLoop EndIf $IndxEntries = _StripIndxRecord(StringMid($Entry,$NextPosition,8192)) $TotalIndxEntries &= $IndxEntries $NextPosition += 8192 Until $NextPosition >= StringLen($Entry)+32 ; ConsoleWrite("INDX record:" & @crlf) ; ConsoleWrite(_HexEncode("0x"& StringMid($Entry,1)) & @crlf) ; ConsoleWrite("Total chunk of stripped INDX entries:" & @crlf) ; ConsoleWrite(_HexEncode("0x"& StringMid($TotalIndxEntries,1)) & @crlf) ; _DecodeIndxEntriesSDH($TotalIndxEntries) Return $TotalIndxEntries EndFunc Func _GetIndxWoFixup($Entry) ; ConsoleWrite("Starting function _Get_IndexAllocation()" & @crlf) Local $NextPosition = 1,$IndxHdrMagic,$IndxEntries,$TotalIndxEntries ; ConsoleWrite("StringLen of chunk = " & StringLen($Entry) & @crlf) ; ConsoleWrite("Expected records = " & StringLen($Entry)/8192 & @crlf) ; $NextPosition = 1 Do $IndxHdrMagic = StringMid($Entry,$NextPosition,8) ; ConsoleWrite("$IndxHdrMagic = " & $IndxHdrMagic & @crlf) $IndxHdrMagic = _HexToString($IndxHdrMagic) ; ConsoleWrite("$IndxHdrMagic = " & $IndxHdrMagic & @crlf) If $IndxHdrMagic <> "INDX" Then ; ConsoleWrite("$IndxHdrMagic: " & $IndxHdrMagic & @crlf) ConsoleWrite("Error: Record is not of type INDX, and this was not expected.." & @crlf) $NextPosition += 8192 ContinueLoop EndIf $IndxEntries = _StripIndxRecordWoFixup(StringMid($Entry,$NextPosition,8192)) $TotalIndxEntries &= $IndxEntries $NextPosition += 8192 Until $NextPosition >= StringLen($Entry)+32 ; ConsoleWrite("INDX record:" & @crlf) ; ConsoleWrite(_HexEncode("0x"& StringMid($Entry,1)) & @crlf) ; ConsoleWrite("Total chunk of stripped INDX entries:" & @crlf) ; ConsoleWrite(_HexEncode("0x"& StringMid($TotalIndxEntries,1)) & @crlf) ; _DecodeIndxEntriesSDH($TotalIndxEntries) Return $TotalIndxEntries EndFunc Func _StripIndxRecordWoFixup($Entry) ; ConsoleWrite("Starting function _StripIndxRecord()" & @crlf) Local $LocalAttributeOffset = 1 ;Local $IndxHdrUpdateSeqArrOffset,$IndxHdrUpdateSeqArrSize,$IndxHdrUpdSeqArr,$IndxHdrUpdSeqArrPart0,$IndxHdrUpdSeqArrPart1,$IndxHdrUpdSeqArrPart2,$IndxHdrUpdSeqArrPart3,$IndxHdrUpdSeqArrPart4,$IndxHdrUpdSeqArrPart5,$IndxHdrUpdSeqArrPart6,$IndxHdrUpdSeqArrPart7,$IndxHdrUpdSeqArrPart8 ;Local $IndxRecordEnd1,$IndxRecordEnd2,$IndxRecordEnd3,$IndxRecordEnd4,$IndxRecordEnd5,$IndxRecordEnd6,$IndxRecordEnd7,$IndxRecordEnd8 Local $IndxRecordSize,$IndxHeaderSize,$IsNotLeafNode ; ConsoleWrite("Unfixed INDX record:" & @crlf) ; ConsoleWrite(_HexEncode("0x"&$Entry) & @crlf) ; ConsoleWrite(_HexEncode("0x" & StringMid($Entry,1,4096)) & @crlf) #cs $IndxHdrUpdateSeqArrOffset = Dec(_SwapEndian(StringMid($Entry,$LocalAttributeOffset+8,4))) ; ConsoleWrite("$IndxHdrUpdateSeqArrOffset = " & $IndxHdrUpdateSeqArrOffset & @crlf) $IndxHdrUpdateSeqArrSize = Dec(_SwapEndian(StringMid($Entry,$LocalAttributeOffset+12,4))) ; ConsoleWrite("$IndxHdrUpdateSeqArrSize = " & $IndxHdrUpdateSeqArrSize & @crlf) $IndxHdrUpdSeqArr = StringMid($Entry,1+($IndxHdrUpdateSeqArrOffset*2),$IndxHdrUpdateSeqArrSize*2*2) ; ConsoleWrite("$IndxHdrUpdSeqArr = " & $IndxHdrUpdSeqArr & @crlf) $IndxHdrUpdSeqArrPart0 = StringMid($IndxHdrUpdSeqArr,1,4) $IndxHdrUpdSeqArrPart1 = StringMid($IndxHdrUpdSeqArr,5,4) $IndxHdrUpdSeqArrPart2 = StringMid($IndxHdrUpdSeqArr,9,4) $IndxHdrUpdSeqArrPart3 = StringMid($IndxHdrUpdSeqArr,13,4) $IndxHdrUpdSeqArrPart4 = StringMid($IndxHdrUpdSeqArr,17,4) $IndxHdrUpdSeqArrPart5 = StringMid($IndxHdrUpdSeqArr,21,4) $IndxHdrUpdSeqArrPart6 = StringMid($IndxHdrUpdSeqArr,25,4) $IndxHdrUpdSeqArrPart7 = StringMid($IndxHdrUpdSeqArr,29,4) $IndxHdrUpdSeqArrPart8 = StringMid($IndxHdrUpdSeqArr,33,4) $IndxRecordEnd1 = StringMid($Entry,1021,4) $IndxRecordEnd2 = StringMid($Entry,2045,4) $IndxRecordEnd3 = StringMid($Entry,3069,4) $IndxRecordEnd4 = StringMid($Entry,4093,4) $IndxRecordEnd5 = StringMid($Entry,5117,4) $IndxRecordEnd6 = StringMid($Entry,6141,4) $IndxRecordEnd7 = StringMid($Entry,7165,4) $IndxRecordEnd8 = StringMid($Entry,8189,4) If $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd1 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd2 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd3 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd4 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd5 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd6 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd7 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd8 Then ConsoleWrite("Error the INDX record is corrupt" & @CRLF) Return ; Not really correct because I think in theory chunks of 1024 bytes can be invalid and not just everything or nothing for the given INDX record. Else $Entry = StringMid($Entry,1,1020) & $IndxHdrUpdSeqArrPart1 & StringMid($Entry,1025,1020) & $IndxHdrUpdSeqArrPart2 & StringMid($Entry,2049,1020) & $IndxHdrUpdSeqArrPart3 & StringMid($Entry,3073,1020) & $IndxHdrUpdSeqArrPart4 & StringMid($Entry,4097,1020) & $IndxHdrUpdSeqArrPart5 & StringMid($Entry,5121,1020) & $IndxHdrUpdSeqArrPart6 & StringMid($Entry,6145,1020) & $IndxHdrUpdSeqArrPart7 & StringMid($Entry,7169,1020) EndIf #ce $IndxRecordSize = Dec(_SwapEndian(StringMid($Entry,$LocalAttributeOffset+56,8)),2) ; ConsoleWrite("$IndxRecordSize = " & $IndxRecordSize & @crlf) $IndxHeaderSize = Dec(_SwapEndian(StringMid($Entry,$LocalAttributeOffset+48,8)),2) ; ConsoleWrite("$IndxHeaderSize = " & $IndxHeaderSize & @crlf) $IsNotLeafNode = StringMid($Entry,$LocalAttributeOffset+72,2) ;1 if not leaf node $Entry = StringMid($Entry,$LocalAttributeOffset+48+($IndxHeaderSize*2),($IndxRecordSize-$IndxHeaderSize-16)*2) If $IsNotLeafNode = "01" Then ; This flag leads to the entry being 8 bytes of 00's longer than the others. Can be stripped I think. $Entry = StringTrimRight($Entry,16) ; ConsoleWrite("Is not leaf node..." & @crlf) EndIf Return $Entry EndFunc Func _StripIndxRecord($Entry) ; ConsoleWrite("Starting function _StripIndxRecord()" & @crlf) Local $LocalAttributeOffset = 1,$IndxHdrUpdateSeqArrOffset,$IndxHdrUpdateSeqArrSize,$IndxHdrUpdSeqArr,$IndxHdrUpdSeqArrPart0,$IndxHdrUpdSeqArrPart1,$IndxHdrUpdSeqArrPart2,$IndxHdrUpdSeqArrPart3,$IndxHdrUpdSeqArrPart4,$IndxHdrUpdSeqArrPart5,$IndxHdrUpdSeqArrPart6,$IndxHdrUpdSeqArrPart7 Local $IndxRecordEnd1,$IndxRecordEnd2,$IndxRecordEnd3,$IndxRecordEnd4,$IndxRecordEnd5,$IndxRecordEnd6,$IndxRecordEnd7,$IndxRecordEnd8,$IndxRecordSize,$IndxHeaderSize,$IsNotLeafNode ; ConsoleWrite("Unfixed INDX record:" & @crlf) ; ConsoleWrite(_HexEncode("0x"&$Entry) & @crlf) ; ConsoleWrite(_HexEncode("0x" & StringMid($Entry,1,4096)) & @crlf) $IndxHdrUpdateSeqArrOffset = Dec(_SwapEndian(StringMid($Entry,$LocalAttributeOffset+8,4))) ; ConsoleWrite("$IndxHdrUpdateSeqArrOffset = " & $IndxHdrUpdateSeqArrOffset & @crlf) $IndxHdrUpdateSeqArrSize = Dec(_SwapEndian(StringMid($Entry,$LocalAttributeOffset+12,4))) ; ConsoleWrite("$IndxHdrUpdateSeqArrSize = " & $IndxHdrUpdateSeqArrSize & @crlf) $IndxHdrUpdSeqArr = StringMid($Entry,1+($IndxHdrUpdateSeqArrOffset*2),$IndxHdrUpdateSeqArrSize*2*2) ; ConsoleWrite("$IndxHdrUpdSeqArr = " & $IndxHdrUpdSeqArr & @crlf) $IndxHdrUpdSeqArrPart0 = StringMid($IndxHdrUpdSeqArr,1,4) $IndxHdrUpdSeqArrPart1 = StringMid($IndxHdrUpdSeqArr,5,4) $IndxHdrUpdSeqArrPart2 = StringMid($IndxHdrUpdSeqArr,9,4) $IndxHdrUpdSeqArrPart3 = StringMid($IndxHdrUpdSeqArr,13,4) $IndxHdrUpdSeqArrPart4 = StringMid($IndxHdrUpdSeqArr,17,4) $IndxHdrUpdSeqArrPart5 = StringMid($IndxHdrUpdSeqArr,21,4) $IndxHdrUpdSeqArrPart6 = StringMid($IndxHdrUpdSeqArr,25,4) $IndxHdrUpdSeqArrPart7 = StringMid($IndxHdrUpdSeqArr,29,4) ;$IndxHdrUpdSeqArrPart8 = StringMid($IndxHdrUpdSeqArr,33,4) $IndxRecordEnd1 = StringMid($Entry,1021,4) $IndxRecordEnd2 = StringMid($Entry,2045,4) $IndxRecordEnd3 = StringMid($Entry,3069,4) $IndxRecordEnd4 = StringMid($Entry,4093,4) $IndxRecordEnd5 = StringMid($Entry,5117,4) $IndxRecordEnd6 = StringMid($Entry,6141,4) $IndxRecordEnd7 = StringMid($Entry,7165,4) $IndxRecordEnd8 = StringMid($Entry,8189,4) If $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd1 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd2 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd3 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd4 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd5 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd6 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd7 OR $IndxHdrUpdSeqArrPart0 <> $IndxRecordEnd8 Then ConsoleWrite("Error the INDX record is corrupt" & @CRLF) Return ; Not really correct because I think in theory chunks of 1024 bytes can be invalid and not just everything or nothing for the given INDX record. Else $Entry = StringMid($Entry,1,1020) & $IndxHdrUpdSeqArrPart1 & StringMid($Entry,1025,1020) & $IndxHdrUpdSeqArrPart2 & StringMid($Entry,2049,1020) & $IndxHdrUpdSeqArrPart3 & StringMid($Entry,3073,1020) & $IndxHdrUpdSeqArrPart4 & StringMid($Entry,4097,1020) & $IndxHdrUpdSeqArrPart5 & StringMid($Entry,5121,1020) & $IndxHdrUpdSeqArrPart6 & StringMid($Entry,6145,1020) & $IndxHdrUpdSeqArrPart7 & StringMid($Entry,7169,1020) EndIf $IndxRecordSize = Dec(_SwapEndian(StringMid($Entry,$LocalAttributeOffset+56,8)),2) ; ConsoleWrite("$IndxRecordSize = " & $IndxRecordSize & @crlf) $IndxHeaderSize = Dec(_SwapEndian(StringMid($Entry,$LocalAttributeOffset+48,8)),2) ; ConsoleWrite("$IndxHeaderSize = " & $IndxHeaderSize & @crlf) $IsNotLeafNode = StringMid($Entry,$LocalAttributeOffset+72,2) ;1 if not leaf node $Entry = StringMid($Entry,$LocalAttributeOffset+48+($IndxHeaderSize*2),($IndxRecordSize-$IndxHeaderSize-16)*2) If $IsNotLeafNode = "01" Then ; This flag leads to the entry being 8 bytes of 00's longer than the others. Can be stripped I think. $Entry = StringTrimRight($Entry,16) ; ConsoleWrite("Is not leaf node..." & @crlf) EndIf Return $Entry EndFunc Func _HexToGuidStr($input,$mode) ;{4b-2b-2b-2b-6b} Local $OutStr If Not StringLen($input) = 32 Then Return $input If $mode Then $OutStr = "{" $OutStr &= _SwapEndian(StringMid($input,1,8)) & "-" $OutStr &= _SwapEndian(StringMid($input,9,4)) & "-" $OutStr &= _SwapEndian(StringMid($input,13,4)) & "-" $OutStr &= StringMid($input,17,4) & "-" $OutStr &= StringMid($input,21,12) If $mode Then $OutStr &= "}" Return $OutStr EndFunc Func _MainSecure($RawContentSDS,$IsRedo) $SizeSDS = StringLen($RawContentSDS)/2 $StartOffset = 1 $BytesProcessed = 0 ;$CurrentDescriptor = 0 If $VerboseOn Then _DumpOutput("_MainSecure(): " & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$SizeSDS: " & $SizeSDS & @CRLF) _DumpOutput(_HexEncode("0x"&$RawContentSDS) & @CRLF) EndIf While 1 ;$CurrentDescriptor += 1 If $BytesProcessed >= $SizeSDS Then ; _DumpOutput("End of $SDS reached 1" & @CRLF) ; _DumpOutput("$BytesProcessed: " & $BytesProcessed & @CRLF) ExitLoop EndIf $TargetSDSOffset = StringMid($RawContentSDS,$StartOffset + 16, 16) ; $TargetSDSOffset = Dec(_SwapEndian($TargetSDSOffset),2) $TargetSDSOffset = $BytesProcessed $TargetSDSSize = StringMid($RawContentSDS,$StartOffset + 32, 8) $TargetSDSSize = Dec(_SwapEndian($TargetSDSSize),2) If $TargetSDSOffset >= $SizeSDS Then ; _DumpOutput("End of $SDS reached 2" & @CRLF) ; _DumpOutput("$TargetSDSOffset: " & $TargetSDSOffset & @CRLF) ExitLoop EndIf $TargetSDSOffsetHex = "0x"&Hex(Int(($StartOffset-3)/2),8) If $TargetSDSOffset = 0 And $TargetSDSSize = 0 Then If Mod(($StartOffset-$StartOffset)/2,262144) Then ; Align 0x40000 Do $StartOffset+=2 Until Mod(($StartOffset-$StartOffset)/2,262144)=0 ContinueLoop ;Move to next block Else ExitLoop ;We are at end EndIf EndIf If Mod($TargetSDSSize,16) Then ; Align SDS size to 16 bytes Do $TargetSDSSize+=1 Until Mod($TargetSDSSize,16)=0 EndIf $TargetSDSHash = StringMid($RawContentSDS,$StartOffset, 8) $TargetSDSChunk = StringMid($RawContentSDS,$StartOffset+($TargetSDSOffset*2), $TargetSDSSize*2) If $VerboseOn Then _DumpOutput("$StartOffset: " & $StartOffset & @CRLF) _DumpOutput("$TargetSDSSize: " & $TargetSDSSize & @CRLF) _DumpOutput("$TargetSDSOffset: " & $TargetSDSOffset & @CRLF) _DumpOutput("$SizeSDS: " & $SizeSDS & @CRLF) EndIf _DecodeSDSChunk($TargetSDSChunk, $TargetSDSHash) ;Write information to csv _WriteCsvSecureSDS($IsRedo) ;Make sure all global variables for csv are cleared _ClearVarSecureSDS() $BytesProcessed+=$TargetSDSSize $StartOffset+=$TargetSDSSize*2 WEnd EndFunc Func _ClearVarSecureSDS() $TargetSDSOffsetHex = "" $SecurityDescriptorHash = "" $SecurityId = "" $ControlText = "" $SidOwner = "" $SidGroup = "" $SAclRevision = "" $SAceCount = "" $SAceTypeText = "" $SAceFlagsText = "" $SAceMask = "" $SAceObjectType = "" $SAceInheritedObjectType = "" $SAceSIDString = "" $SAceObjectFlagsText = "" $DAclRevision = "" $DAceCount = "" $DAceTypeText = "" $DAceFlagsText = "" $DAceMask = "" $DAceObjectType = "" $DAceInheritedObjectType = "" $DAceSIDString = "" $DAceObjectFlagsText = "" EndFunc Func _WriteCsvSecureSDS($IsRedo) FileWriteLine($LogFileSecureSDSCsv, $RecordOffset&$de&$this_lsn&$de&$SecurityDescriptorHash&$de&$SecurityId&$de&$ControlText&$de&$SidOwner&$de&$SidGroup&$de&$SAclRevision&$de&$SAceCount&$de&$SAceTypeText&$de&$SAceFlagsText&$de&$SAceMask&$de&$SAceObjectFlagsText&$de&$SAceObjectType&$de&$SAceInheritedObjectType&$de&$SAceSIDString&$de&$DAclRevision&$de&$DAceCount&$de&$DAceTypeText&$de&$DAceFlagsText&$de&$DAceMask&$de&$DAceObjectFlagsText&$de&$DAceObjectType&$de&$DAceInheritedObjectType&$de&$DAceSIDString&$de&$IsRedo&@crlf) EndFunc Func _WriteCSVHeaderSecureSDS() $SecureSDS_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"SecurityDescriptorHash"&$de&"SecurityId"&$de&"Control"&$de&"SidOwner"&$de&"SidGroup"&$de&"SAclRevision"&$de&"SAceCount"&$de&"SAceType"&$de&"SAceFlags"&$de&"SAceMask"&$de&"SAceObjectFlags"&$de&"SAceObjectType"&$de&"SAceInheritedObjectType"&$de&"SAceSIDofTrustee"&$de&"DAclRevision"&$de&"DAceCount"&$de&"DAceType"&$de&"DAceFlags"&$de&"DAceMask"&$de&"DAceObjectFlags"&$de&"DAceObjectType"&$de&"DAceInheritedObjectType"&$de&"DAceSIDofTrustee"&$de&"IsRedo" FileWriteLine($LogFileSecureSDSCsv, $SecureSDS_Csv_Header & @CRLF) EndFunc Func _WriteCSVHeaderSecureSDH() $SecureSDH_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"sdh_flags"&$de&"sdh_SecurityDescriptorHashKey"&$de&"sdh_SecurityIdKey"&$de&"sdh_SecurityDescriptorHashData"&$de&"sdh_SecurityIdData"&$de&"sdh_OffsetInSDS"&$de&"sdh_SizeInSDS"&$de&"IsRedo" FileWriteLine($LogFileSecureSDHCsv, $SecureSDH_Csv_Header & @CRLF) EndFunc Func _WriteCSVHeaderSecureSII() $SecureSII_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"sdh_flags"&$de&"sdh_SecurityIdKey"&$de&"sdh_SecurityDescriptorHashData"&$de&"sdh_SecurityIdData"&$de&"sdh_OffsetInSDS"&$de&"sdh_SizeInSDS"&$de&"IsRedo" FileWriteLine($LogFileSecureSIICsv, $SecureSII_Csv_Header & @CRLF) EndFunc ;-----------/Security------------------ Func _Decode_ObjId_O($InputData,$IsRedo) Local $Counter=1 Local $GUID_ObjectID_Version,$GUID_ObjectID_Timestamp,$GUID_ObjectID_TimestampDec,$GUID_ObjectID_ClockSeq,$GUID_ObjectID_Node Local $GUID_BirthVolumeID_Version,$GUID_BirthVolumeID_Timestamp,$GUID_BirthVolumeID_TimestampDec,$GUID_BirthVolumeID_ClockSeq,$GUID_BirthVolumeID_Node Local $GUID_BirthObjectID_Version,$GUID_BirthObjectID_Timestamp,$GUID_BirthObjectID_TimestampDec,$GUID_BirthObjectID_ClockSeq,$GUID_BirthObjectID_Node Local $GUID_DomainID_Version,$GUID_DomainID_Timestamp,$GUID_DomainID_TimestampDec,$GUID_DomainID_ClockSeq,$GUID_DomainID_Node ;88 bytes $StartOffset = 1 $InputDataSize = StringLen($InputData) If $VerboseOn Then _DumpOutput("_Decode_ObjId_O():" & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) EndIf Do $DataOffset = StringMid($InputData, $StartOffset, 4) $DataOffset = Dec(_SwapEndian($DataOffset),2) $DataSize = StringMid($InputData, $StartOffset + 4, 4) $DataSize = Dec(_SwapEndian($DataSize),2) If $DataOffset = 0 Or $DataSize = 0 Then $StartOffset+=16 ;Padding 4 bytes $IndexEntrySize = StringMid($InputData, $StartOffset + 16, 4) $IndexEntrySize = Dec(_SwapEndian($IndexEntrySize),2) If $IndexEntrySize = 0 Then ExitLoop $IndexKeySize = StringMid($InputData, $StartOffset + 20, 4) $IndexKeySize = Dec(_SwapEndian($IndexKeySize),2) ;1=Entry has subnodes, 2=Last entry $Flags = StringMid($InputData, $StartOffset + 24, 4) $Flags = "0x" & _SwapEndian($Flags) ;Padding 2 bytes ;ObjectId $GUID_ObjectId = StringMid($InputData, $StartOffset + 32, 32) ;Decode guid $GUID_ObjectID_Version = Dec(StringMid($GUID_ObjectID,15,1)) $GUID_ObjectID_Timestamp = StringMid($GUID_ObjectID,1,14) & "0" & StringMid($GUID_ObjectID,16,1) $GUID_ObjectID_TimestampDec = Dec(_SwapEndian($GUID_ObjectID_Timestamp),2) $GUID_ObjectID_Timestamp = _DecodeTimestampFromGuid($GUID_ObjectID_Timestamp) $GUID_ObjectID_ClockSeq = StringMid($GUID_ObjectID,17,4) $GUID_ObjectID_ClockSeq = Dec($GUID_ObjectID_ClockSeq) $GUID_ObjectID_Node = StringMid($GUID_ObjectID,21,12) $GUID_ObjectID_Node = _DecodeMacFromGuid($GUID_ObjectID_Node) $GUID_ObjectID = _HexToGuidStr($GUID_ObjectID,0) $MftRef = StringMid($InputData, $StartOffset + 64, 12) $MftRef = Dec(_SwapEndian($MftRef),2) $MftSeqNo = StringMid($InputData, $StartOffset + 76, 4) $MftSeqNo = Dec(_SwapEndian($MftSeqNo),2) ;BirthVolumeId $GUID_BirthVolumeId = StringMid($InputData, $StartOffset + 80, 32) ;Decode guid $GUID_BirthVolumeID_Version = Dec(StringMid($GUID_BirthVolumeID,15,1)) $GUID_BirthVolumeID_Timestamp = StringMid($GUID_BirthVolumeID,1,14) & "0" & StringMid($GUID_BirthVolumeID,16,1) $GUID_BirthVolumeID_TimestampDec = Dec(_SwapEndian($GUID_BirthVolumeID_Timestamp),2) $GUID_BirthVolumeID_Timestamp = _DecodeTimestampFromGuid($GUID_BirthVolumeID_Timestamp) $GUID_BirthVolumeID_ClockSeq = StringMid($GUID_BirthVolumeID,17,4) $GUID_BirthVolumeID_ClockSeq = Dec($GUID_BirthVolumeID_ClockSeq) $GUID_BirthVolumeID_Node = StringMid($GUID_BirthVolumeID,21,12) $GUID_BirthVolumeID_Node = _DecodeMacFromGuid($GUID_BirthVolumeID_Node) $GUID_BirthVolumeID = _HexToGuidStr($GUID_BirthVolumeID,0) ;BirthObjectId $GUID_BirthObjectId = StringMid($InputData, $StartOffset + 112, 32) ;Decode guid $GUID_BirthObjectID_Version = Dec(StringMid($GUID_BirthObjectID,15,1)) $GUID_BirthObjectID_Timestamp = StringMid($GUID_BirthObjectID,1,14) & "0" & StringMid($GUID_BirthObjectID,16,1) $GUID_BirthObjectID_TimestampDec = Dec(_SwapEndian($GUID_BirthObjectID_Timestamp),2) $GUID_BirthObjectID_Timestamp = _DecodeTimestampFromGuid($GUID_BirthObjectID_Timestamp) $GUID_BirthObjectID_ClockSeq = StringMid($GUID_BirthObjectID,17,4) $GUID_BirthObjectID_ClockSeq = Dec($GUID_BirthObjectID_ClockSeq) $GUID_BirthObjectID_Node = StringMid($GUID_BirthObjectID,21,12) $GUID_BirthObjectID_Node = _DecodeMacFromGuid($GUID_BirthObjectID_Node) $GUID_BirthObjectID = _HexToGuidStr($GUID_BirthObjectID,0) ;DomainId $GUID_DomainId = StringMid($InputData, $StartOffset + 144, 32) ;Decode guid $GUID_DomainID_Version = Dec(StringMid($GUID_DomainID,15,1)) $GUID_DomainID_Timestamp = StringMid($GUID_DomainID,1,14) & "0" & StringMid($GUID_DomainID,16,1) $GUID_DomainID_TimestampDec = Dec(_SwapEndian($GUID_DomainID_Timestamp),2) $GUID_DomainID_Timestamp = _DecodeTimestampFromGuid($GUID_DomainID_Timestamp) $GUID_DomainID_ClockSeq = StringMid($GUID_DomainID,17,4) $GUID_DomainID_ClockSeq = Dec($GUID_DomainID_ClockSeq) $GUID_DomainID_Node = StringMid($GUID_DomainID,21,12) $GUID_DomainID_Node = _DecodeMacFromGuid($GUID_DomainID_Node) $GUID_DomainID = _HexToGuidStr($GUID_DomainID,0) If $VerboseOn Then _DumpOutput(@CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData, $StartOffset, $IndexEntrySize*2)) & @CRLF) _DumpOutput("$Counter: " & $Counter & @CRLF) _DumpOutput("$DataOffset: " & $DataOffset & @CRLF) _DumpOutput("$DataSize: " & $DataSize & @CRLF) _DumpOutput("$IndexEntrySize: " & $IndexEntrySize & @CRLF) _DumpOutput("$IndexKeySize: " & $IndexKeySize & @CRLF) _DumpOutput("$Flags: " & $Flags & @CRLF) _DumpOutput("$MftRef: " & $MftRef & @CRLF) _DumpOutput("$MftSeqNo: " & $MftSeqNo & @CRLF) _DumpOutput("$GUID_ObjectID: " & $GUID_ObjectID & @CRLF) _DumpOutput("$GUID_ObjectID_Version: " & $GUID_ObjectID_Version & @CRLF) _DumpOutput("$GUID_ObjectID_Timestamp: " & $GUID_ObjectID_Timestamp & @CRLF) _DumpOutput("$GUID_ObjectID_TimestampDec: " & $GUID_ObjectID_TimestampDec & @CRLF) _DumpOutput("$GUID_ObjectID_ClockSeq: " & $GUID_ObjectID_ClockSeq & @CRLF) _DumpOutput("$GUID_ObjectID_Node: " & $GUID_ObjectID_Node & @CRLF) _DumpOutput("$GUID_BirthVolumeID: " & $GUID_BirthVolumeID & @CRLF) _DumpOutput("$GUID_BirthVolumeID_Version: " & $GUID_BirthVolumeID_Version & @CRLF) _DumpOutput("$GUID_BirthVolumeID_Timestamp: " & $GUID_BirthVolumeID_Timestamp & @CRLF) _DumpOutput("$GUID_BirthVolumeID_TimestampDec: " & $GUID_BirthVolumeID_TimestampDec & @CRLF) _DumpOutput("$GUID_BirthVolumeID_ClockSeq: " & $GUID_BirthVolumeID_ClockSeq & @CRLF) _DumpOutput("$GUID_BirthVolumeID_Node: " & $GUID_BirthVolumeID_Node & @CRLF) _DumpOutput("$GUID_BirthObjectID: " & $GUID_BirthObjectID & @CRLF) _DumpOutput("$GUID_BirthObjectID_Version: " & $GUID_BirthObjectID_Version & @CRLF) _DumpOutput("$GUID_BirthObjectID_Timestamp: " & $GUID_BirthObjectID_Timestamp & @CRLF) _DumpOutput("$GUID_BirthObjectID_TimestampDec: " & $GUID_BirthObjectID_TimestampDec & @CRLF) _DumpOutput("$GUID_BirthObjectID_ClockSeq: " & $GUID_BirthObjectID_ClockSeq & @CRLF) _DumpOutput("$GUID_BirthObjectID_Node: " & $GUID_BirthObjectID_Node & @CRLF) _DumpOutput("$GUID_DomainID: " & $GUID_DomainID & @CRLF) _DumpOutput("$GUID_DomainID_Version: " & $GUID_DomainID_Version & @CRLF) _DumpOutput("$GUID_DomainID_Timestamp: " & $GUID_DomainID_Timestamp & @CRLF) _DumpOutput("$GUID_DomainID_TimestampDec: " & $GUID_DomainID_TimestampDec & @CRLF) _DumpOutput("$GUID_DomainID_ClockSeq: " & $GUID_DomainID_ClockSeq & @CRLF) _DumpOutput("$GUID_DomainID_Node: " & $GUID_DomainID_Node & @CRLF) EndIf ;$TextInformation &= ";MftRef="&$MftRef&";MftSeqNo="&$MftSeqNo FileWriteLine($LogFileObjIdOCsv, $RecordOffset & $de & $this_lsn & $de & $IndexEntrySize & $de & $IndexKeySize & $de & $Flags & $de & $MftRef & $de & $MftSeqNo & $de & $GUID_ObjectID & $de & $GUID_ObjectID_Version & $de & $GUID_ObjectID_Timestamp & $de & $GUID_ObjectID_TimestampDec & $de & $GUID_ObjectID_ClockSeq & $de & $GUID_ObjectID_Node & $de & $GUID_BirthVolumeID & $de & $GUID_BirthVolumeID_Version & $de & $GUID_BirthVolumeID_Timestamp & $de & $GUID_BirthVolumeID_TimestampDec & $de & $GUID_BirthVolumeID_ClockSeq & $de & $GUID_BirthVolumeID_Node & $de & $GUID_BirthObjectID & $de & $GUID_BirthObjectID_Version & $de & $GUID_BirthObjectID_Timestamp & $de & $GUID_BirthObjectID_TimestampDec & $de & $GUID_BirthObjectID_ClockSeq & $de & $GUID_BirthObjectID_Node & $de & $GUID_DomainID & $de & $GUID_DomainID_Version & $de & $GUID_DomainID_Timestamp & $de & $GUID_DomainID_TimestampDec & $de & $GUID_DomainID_ClockSeq & $de & $GUID_DomainID_Node & $de & $IsRedo & @crlf) $StartOffset += $IndexEntrySize*2 $Counter+=1 Until $StartOffset >= $InputDataSize EndFunc Func _Decode_Quota_O($InputData,$IsRedo) Local $Counter=1 $StartOffset = 1 $InputDataSize = StringLen($InputData) If $VerboseOn Then _DumpOutput("_Decode_Quota_O():" & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) EndIf Do $DataOffset = StringMid($InputData, $StartOffset, 4) $DataOffset = Dec(_SwapEndian($DataOffset),2) $DataSize = StringMid($InputData, $StartOffset + 4, 4) $DataSize = Dec(_SwapEndian($DataSize),2) If $DataOffset = 0 Or $DataSize = 0 Then $StartOffset+=16 ;Padding 4 bytes $IndexEntrySize = StringMid($InputData, $StartOffset + 16, 4) $IndexEntrySize = Dec(_SwapEndian($IndexEntrySize),2) If $IndexEntrySize = 0 Then ExitLoop $IndexKeySize = StringMid($InputData, $StartOffset + 20, 4) $IndexKeySize = Dec(_SwapEndian($IndexKeySize),2) $Flags = StringMid($InputData, $StartOffset + 24, 4) $Flags = "0x" & _SwapEndian($Flags) ;Padding 2 bytes $SID = StringMid($InputData, $StartOffset + 32, $IndexKeySize*2) $SID = _DecodeSID($SID) $OwnerId = StringMid($InputData, $StartOffset + 32 + ($IndexKeySize*2), 8) $OwnerId = Dec(_SwapEndian($OwnerId),2) If $VerboseOn Then _DumpOutput(@CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData, $StartOffset, $IndexEntrySize*2)) & @CRLF) _DumpOutput("$Counter: " & $Counter & @CRLF) _DumpOutput("$DataOffset: " & $DataOffset & @CRLF) _DumpOutput("$DataSize: " & $DataSize & @CRLF) _DumpOutput("$IndexEntrySize: " & $IndexEntrySize & @CRLF) _DumpOutput("$IndexKeySize: " & $IndexKeySize & @CRLF) _DumpOutput("$Flags: " & $Flags & @CRLF) _DumpOutput("$SID: " & $SID & @CRLF) _DumpOutput("$OwnerId: " & $OwnerId & @CRLF) EndIf ; $Padding8 = StringMid($InputData, $StartOffset + 32 + ($IndexKeySize*2), 16) FileWriteLine($LogFileQuotaOCsv, $RecordOffset&$de&$this_lsn&$de&$IndexEntrySize&$de&$IndexKeySize&$de&$Flags&$de&$SID&$de&$OwnerId&$de&$IsRedo&@crlf) $Counter+=1 $StartOffset += $IndexEntrySize*2 Until $StartOffset >= $InputDataSize EndFunc Func _Decode_Quota_Q($InputData,$IsRedo) Local $Counter=1 $StartOffset = 1 $InputDataSize = StringLen($InputData) If $VerboseOn Then _DumpOutput("_Decode_Quota_Q():" & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) EndIf Do $DataOffset = StringMid($InputData, $StartOffset, 4) $DataOffset = Dec(_SwapEndian($DataOffset),2) $DataSize = StringMid($InputData, $StartOffset + 4, 4) $DataSize = Dec(_SwapEndian($DataSize),2) If $DataOffset = 0 Or $DataSize = 0 Then $StartOffset+=16 ;Padding 4 bytes $IndexEntrySize = StringMid($InputData, $StartOffset + 16, 4) $IndexEntrySize = Dec(_SwapEndian($IndexEntrySize),2) If $IndexEntrySize = 0 Then ExitLoop $IndexKeySize = StringMid($InputData, $StartOffset + 20, 4) $IndexKeySize = Dec(_SwapEndian($IndexKeySize),2) ;1=Entry has subnodes, 2=Last entry $Flags = StringMid($InputData, $StartOffset + 24, 4) $Flags = "0x" & _SwapEndian($Flags) ;Padding 2 bytes $OwnerId = StringMid($InputData, $StartOffset + 32, 8) $OwnerId = Dec(_SwapEndian($OwnerId),2) $Version = StringMid($InputData, $StartOffset + 40, 8) $Version = "0x" & _SwapEndian($Version) $Flags2 = StringMid($InputData, $StartOffset + 48, 8) $Flags2 = _SwapEndian($Flags2) $Flags2Text = _Decode_QuotaFlags("0x"&$Flags2) $BytesUsed = StringMid($InputData, $StartOffset + 56, 16) $BytesUsed = Dec(_SwapEndian($BytesUsed),2) $ChangeTime = StringMid($InputData, $StartOffset + 72, 16) $ChangeTime = _SwapEndian($ChangeTime) $ChangeTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $ChangeTime) $ChangeTime = _WinTime_UTCFileTimeFormat(Dec($ChangeTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $ChangeTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$ChangeTime_Core = StringMid($ChangeTime,1,StringLen($ChangeTime)-4) ;$ChangeTime_Precision = StringRight($ChangeTime,3) ElseIf $TimestampPrecision = 3 Then $ChangeTime = $ChangeTime & $PrecisionSeparator2 & _FillZero(StringRight($ChangeTime_tmp, 4)) ;$ChangeTime_Core = StringMid($ChangeTime,1,StringLen($ChangeTime)-9) ;$ChangeTime_Precision = StringRight($ChangeTime,8) Else ;$ChangeTime_Core = $ChangeTime EndIf $TextInformation &= ";ChangeTime=" & $ChangeTime $WarningLimit = StringMid($InputData, $StartOffset + 88, 16) $WarningLimit = "0x" & _SwapEndian($WarningLimit) $HardLimit = StringMid($InputData, $StartOffset + 104, 16) $HardLimit = "0x" & _SwapEndian($HardLimit) $ExceededTime = StringMid($InputData, $StartOffset + 120, 16) If $ExceededTime <> "0000000000000000" Then $ExceededTime = _SwapEndian($ExceededTime) $ExceededTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $ExceededTime) $ExceededTime = _WinTime_UTCFileTimeFormat(Dec($ExceededTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $ExceededTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$ExceededTime_Core = StringMid($ExceededTime,1,StringLen($ExceededTime)-4) ;$ExceededTime_Precision = StringRight($ExceededTime,3) ElseIf $TimestampPrecision = 3 Then $ExceededTime = $ExceededTime & $PrecisionSeparator2 & _FillZero(StringRight($ExceededTime_tmp, 4)) ;$ExceededTime_Core = StringMid($ExceededTime,1,StringLen($ExceededTime)-9) ;$ExceededTime_Precision = StringRight($ExceededTime,8) Else ;$ExceededTime_Core = $ExceededTime EndIf Else $ExceededTime = 0 EndIf $SID = StringMid($InputData, $StartOffset + 136) $SID = _DecodeSID($SID) If $VerboseOn Then _DumpOutput(@CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData, $StartOffset, $IndexEntrySize*2)) & @CRLF) _DumpOutput("$Counter: " & $Counter & @CRLF) _DumpOutput("$DataOffset: " & $DataOffset & @CRLF) _DumpOutput("$DataSize: " & $DataSize & @CRLF) _DumpOutput("$IndexEntrySize: " & $IndexEntrySize & @CRLF) _DumpOutput("$IndexKeySize: " & $IndexKeySize & @CRLF) _DumpOutput("$Flags: " & $Flags & @CRLF) _DumpOutput("$OwnerId: " & $OwnerId & @CRLF) _DumpOutput("$Version: " & $Version & @CRLF) _DumpOutput("$Flags2Text: " & $Flags2Text & @CRLF) _DumpOutput("$BytesUsed: " & $BytesUsed & @CRLF) _DumpOutput("$ChangeTime: " & $ChangeTime & @CRLF) _DumpOutput("$WarningLimit: " & $WarningLimit & @CRLF) _DumpOutput("$HardLimit: " & $HardLimit & @CRLF) _DumpOutput("$ExceededTime: " & $ExceededTime & @CRLF) _DumpOutput("$SID: " & $SID & @CRLF) EndIf ;$Padding8 = StringMid($InputData, $StartOffset + 32 + ($IndexKeySize*2), 16) FileWriteLine($LogFileQuotaQCsv, $RecordOffset&$de&$this_lsn&$de&$IndexEntrySize&$de&$IndexKeySize&$de&$Flags&$de&$OwnerId&$de&$Version&$de&$Flags2Text&$de&$BytesUsed&$de&$ChangeTime&$de&$WarningLimit&$de&$HardLimit&$de&$ExceededTime&$de&$SID&$de&$IsRedo&@crlf) $Counter+=1 $StartOffset += $IndexEntrySize*2 Until $StartOffset >= $InputDataSize EndFunc Func _Decode_QuotaFlags($InputData) Local $Output="" If BitAND($InputData, 0x0001) Then $Output &= "Default Limits+" If BitAND($InputData, 0x0002) Then $Output &= "Limit Reached+" If BitAND($InputData, 0x0004) Then $Output &= "Id Deleted+" If BitAND($InputData, 0x0010) Then $Output &= "Tracking Enabled+" If BitAND($InputData, 0x0020) Then $Output &= "Enforcement Enabled+" If BitAND($InputData, 0x0040) Then $Output &= "Tracking Requested+" If BitAND($InputData, 0x0080) Then $Output &= "Log Threshold+" If BitAND($InputData, 0x0100) Then $Output &= "Log Limit+" If BitAND($InputData, 0x0200) Then $Output &= "Out Of Date+" If BitAND($InputData, 0x0400) Then $Output &= "Corrupt+" If BitAND($InputData, 0x0800) Then $Output &= "Pending Deletes+" $Output = StringTrimRight($Output, 1) Return $Output EndFunc Func _Decode_Reparse_R($InputData,$IsRedo) Local $Counter=1 $StartOffset = 1 $InputDataSize = StringLen($InputData) If $VerboseOn Then _DumpOutput("_Decode_Reparse_R():" & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) EndIf Do $DataOffset = StringMid($InputData, $StartOffset, 4) $DataOffset = Dec(_SwapEndian($DataOffset),2) $DataSize = StringMid($InputData, $StartOffset + 4, 4) $DataSize = Dec(_SwapEndian($DataSize),2) ; If $DataOffset = 0 Or $DataSize = 0 Then $StartOffset+=16 ;Padding 4 bytes $IndexEntrySize = StringMid($InputData, $StartOffset + 16, 4) $IndexEntrySize = Dec(_SwapEndian($IndexEntrySize),2) If $IndexEntrySize = 0 Then ExitLoop $IndexKeySize = StringMid($InputData, $StartOffset + 20, 4) $IndexKeySize = Dec(_SwapEndian($IndexKeySize),2) $Flags = StringMid($InputData, $StartOffset + 24, 4) $Flags = "0x" & _SwapEndian($Flags) ;Padding 2 bytes $KeyReparseTag = StringMid($InputData, $StartOffset + 32, 8) $KeyReparseTag = "0x" & _SwapEndian($KeyReparseTag) $KeyReparseTag = _GetReparseType($KeyReparseTag) $KeyMftRefOfReparsePoint = StringMid($InputData, $StartOffset + 40, 12) $KeyMftRefOfReparsePoint = Dec(_SwapEndian($KeyMftRefOfReparsePoint),2) $KeyMftRefSeqNoOfReparsePoint = StringMid($InputData, $StartOffset + 52, 4) $KeyMftRefSeqNoOfReparsePoint = Dec(_SwapEndian($KeyMftRefSeqNoOfReparsePoint),2) If $VerboseOn Then _DumpOutput(@CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData, $StartOffset, $IndexEntrySize*2)) & @CRLF) _DumpOutput("$Counter: " & $Counter & @CRLF) _DumpOutput("$DataOffset: " & $DataOffset & @CRLF) _DumpOutput("$DataSize: " & $DataSize & @CRLF) _DumpOutput("$IndexEntrySize: " & $IndexEntrySize & @CRLF) _DumpOutput("$IndexKeySize: " & $IndexKeySize & @CRLF) _DumpOutput("$Flags: " & $Flags & @CRLF) _DumpOutput("$KeyReparseTag: " & $KeyReparseTag & @CRLF) _DumpOutput("$KeyMftRefOfReparsePoint: " & $KeyMftRefOfReparsePoint & @CRLF) _DumpOutput("$KeyMftRefSeqNoOfReparsePoint: " & $KeyMftRefSeqNoOfReparsePoint & @CRLF) EndIf ; $Padding4 = StringMid($InputData, $StartOffset + 56, 8) FileWriteLine($LogFileReparseRCsv, $RecordOffset&$de&$this_lsn&$de&$IndexEntrySize&$de&$IndexKeySize&$de&$Flags&$de&$KeyReparseTag&$de&$KeyMftRefOfReparsePoint&$de&$KeyMftRefSeqNoOfReparsePoint&$de&$IsRedo&@crlf) $Counter+=1 $StartOffset += $IndexEntrySize*2 Until $StartOffset >= $InputDataSize EndFunc Func _Decode_OpenNonresidentAttribute($datachunk) Local $Unknown1, $aMFTReferenceSeqNo, $LsnOfOpenRecord, $aAttributeHex, $Unknown2, $AllocatedOrNextFree, $DirtyPagesSeen, $SizeOfIndx, $UnknownPointer, $EndSignature, $RetVal=0 ;Local $aMFTReference, $AttributeNamePresent If $VerboseOn Then _DumpOutput("_Decode_OpenNonresidentAttribute(): " & @CRLF) _DumpOutput("LSN: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$datachunk) & @CRLF) EndIf Select Case StringLen($datachunk) = 80 ;OPEN_ATTRIBUTE_ENTRY x64 If $Is32bit Then $TextInformation &= ";Mixed OS detected" $AllocatedOrNextFree = _SwapEndian(StringMid($datachunk,1,8)) ; $DirtyPagesSeen = StringMid($datachunk, 9, 2) ; $unknown0 = StringMid($datachunk, 9, 2) ; $AttributeNamePresent = StringMid($datachunk, 11, 2) ; $unknown1 = StringMid($datachunk, 13, 4) $SizeOfIndx = StringMid($datachunk, 9, 8) $SizeOfIndx = Dec(_SwapEndian($SizeOfIndx),2) $aAttributeHex = StringMid($datachunk,17,8) $AttributeString = _ResolveAttributeType(StringLeft($aAttributeHex,4)) ; $unknown2 = StringMid($datachunk, 25, 8) $DirtyPagesSeen = StringMid($datachunk, 25, 2) $unknown2 = StringMid($datachunk, 27, 6) $PredictedRefNumber = Dec(_SwapEndian(StringMid($datachunk,33,12))) $KeptRef = $PredictedRefNumber $aMFTReferenceSeqNo = Dec(_SwapEndian(StringMid($datachunk,45,4))) $LsnOfOpenRecord = Dec(_SwapEndian(StringMid($datachunk,49,16))) ;LsnOfOpenRecord $TextInformation &= ";LsnOfOpenRecord="&$LsnOfOpenRecord $UnknownPointer = _SwapEndian(StringMid($datachunk, 65, 16)) ; $EndSignature = StringMid($datachunk,73,8) If $VerboseOn Then _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) _DumpOutput("$DirtyPagesSeen: " & $DirtyPagesSeen & @CRLF) _DumpOutput("$SizeOfIndx: " & $SizeOfIndx & @CRLF) _DumpOutput("$aAttributeHex: " & $aAttributeHex & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$Unknown2: " & $Unknown2 & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$aMFTReferenceSeqNo: " & $aMFTReferenceSeqNo & @CRLF) _DumpOutput("$LsnOfOpenRecord: " & $LsnOfOpenRecord & @CRLF) _DumpOutput("$UnknownPointer: " & $UnknownPointer & @CRLF) ; _DumpOutput("$EndSignature: " & $EndSignature & @CRLF) EndIf $FoundInTable = _ArraySearch($OpenAttributesArray,$target_attribute,0,0,0,2,1,0) If $FoundInTable > 0 Then If $OpenAttributesArray[$FoundInTable][1] <> 0xffffffff Then ; _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") ; $OpenAttributesArray[$FoundInTable][0] = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) $OpenAttributesArray[$FoundInTable][1] = "0xFFFFFFFF" $OpenAttributesArray[$FoundInTable][2] = "0x" & $DirtyPagesSeen ; $OpenAttributesArray[$FoundInTable][3] = "0x" & $AttributeNamePresent $OpenAttributesArray[$FoundInTable][3] = $SizeOfIndx ; $OpenAttributesArray[$FoundInTable][4] = "0x" & $unknown1 $OpenAttributesArray[$FoundInTable][4] = "-" $OpenAttributesArray[$FoundInTable][5] = "0x" & $aAttributeHex $OpenAttributesArray[$FoundInTable][6] = "0x" & $unknown2 $OpenAttributesArray[$FoundInTable][7] = $PredictedRefNumber $OpenAttributesArray[$FoundInTable][8] = $aMFTReferenceSeqNo $OpenAttributesArray[$FoundInTable][9] = $LsnOfOpenRecord $OpenAttributesArray[$FoundInTable][10] = "0x" & $UnknownPointer ; $OpenAttributesArray[$FoundInTable][11] = "0x" & $EndSignature $OpenAttributesArray[$FoundInTable][11] = "-" ; $OpenAttributesArray[$FoundInTable][12] = "Attribute name in undo chunk" $OpenAttributesArray[$FoundInTable][13] = 0 $RetVal = $FoundInTable $TextInformation &= ";Updated OpenAttributesArray" Else _DumpOutput("Error in OpenNonresidentAttribute for LSN: " & $this_lsn & @CRLF) _DumpOutput("AllocatedOrNextFree was 0xffffffff" & @CRLF) EndIf Else #cs _DumpOutput("Error in OpenNonresidentAttribute for LSN: " & $this_lsn & @CRLF) _DumpOutput("Could not update array with new entry" & @CRLF) _DumpOutput(_HexEncode("0x"&$datachunk) & @CRLF) _DumpOutput("$target_attribute: " & $target_attribute & @CRLF) _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) _DumpOutput("$DirtyPagesSeen: " & $DirtyPagesSeen & @CRLF) _DumpOutput("$AttributeNamePresent: " & $AttributeNamePresent & @CRLF) _DumpOutput("$aAttributeHex: " & $aAttributeHex & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$Unknown2: " & $Unknown2 & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$aMFTReferenceSeqNo: " & $aMFTReferenceSeqNo & @CRLF) _DumpOutput("$LsnOfOpenRecord: " & $LsnOfOpenRecord & @CRLF) _DumpOutput("$UnknownPointer: " & $UnknownPointer & @CRLF) _DumpOutput("$EndSignature: " & $EndSignature & @CRLF) _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") #ce $ArrayEnd = UBound($OpenAttributesArray) ReDim $OpenAttributesArray[$ArrayEnd+1][14] $OpenAttributesArray[$ArrayEnd][0] = $target_attribute $OpenAttributesArray[$ArrayEnd][1] = "0x" & $AllocatedOrNextFree $OpenAttributesArray[$ArrayEnd][2] = "0x" & $DirtyPagesSeen ; $OpenAttributesArray[$ArrayEnd][3] = "0x" & $AttributeNamePresent $OpenAttributesArray[$ArrayEnd][3] = $SizeOfIndx ; $OpenAttributesArray[$ArrayEnd][4] = "0x" & $unknown1 $OpenAttributesArray[$ArrayEnd][4] = "-" $OpenAttributesArray[$ArrayEnd][5] = "0x" & $aAttributeHex $OpenAttributesArray[$ArrayEnd][6] = "0x" & $unknown2 $OpenAttributesArray[$ArrayEnd][7] = $PredictedRefNumber $OpenAttributesArray[$ArrayEnd][8] = $aMFTReferenceSeqNo $OpenAttributesArray[$ArrayEnd][9] = $LsnOfOpenRecord $OpenAttributesArray[$ArrayEnd][10] = "0x" & $UnknownPointer ; $OpenAttributesArray[$ArrayEnd][11] = "0x" & $EndSignature $OpenAttributesArray[$ArrayEnd][11] = "-" $OpenAttributesArray[$ArrayEnd][13] = 0 $RetVal = $ArrayEnd $TextInformation &= ";Updated OpenAttributesArray" EndIf Case StringLen($datachunk) = 88 ;OPEN_ATTRIBUTE_ENTRY x86 If Not $Is32bit Then $TextInformation &= ";Mixed OS detected" $AllocatedOrNextFree = _SwapEndian(StringMid($datachunk,1,8)) $UnknownPointer = _SwapEndian(StringMid($datachunk, 9, 8)) $PredictedRefNumber = Dec(_SwapEndian(StringMid($datachunk,17,12))) $KeptRef = $PredictedRefNumber $aMFTReferenceSeqNo = Dec(_SwapEndian(StringMid($datachunk,29,4))) $LsnOfOpenRecord = Dec(_SwapEndian(StringMid($datachunk,33,16))) ;LsnOfOpenRecord $unknown2 = StringMid($datachunk, 49, 8) $aAttributeHex = StringMid($datachunk,57,8) $AttributeString = _ResolveAttributeType(StringLeft($aAttributeHex,4)) ; $unknown3 = StringMid($datachunk, 65, 8) ; $EndSignature = StringMid($datachunk,73,8) $EndSignature = StringMid($datachunk,65,16) ; $DirtyPagesSeen = StringMid($datachunk, 81, 2) ; $AttributeNamePresent = StringMid($datachunk, 83, 2) ; $unknown1 = StringMid($datachunk, 85, 4) $SizeOfIndx = StringMid($datachunk, 81, 2) $SizeOfIndx = Dec(_SwapEndian($SizeOfIndx),2) $TextInformation &= ";LsnOfOpenRecord="&$LsnOfOpenRecord If $VerboseOn Then _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) _DumpOutput("$DirtyPagesSeen: " & $DirtyPagesSeen & @CRLF) _DumpOutput("$SizeOfIndx: " & $SizeOfIndx & @CRLF) _DumpOutput("$aAttributeHex: " & $aAttributeHex & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$Unknown2: " & $Unknown2 & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$aMFTReferenceSeqNo: " & $aMFTReferenceSeqNo & @CRLF) _DumpOutput("$LsnOfOpenRecord: " & $LsnOfOpenRecord & @CRLF) _DumpOutput("$UnknownPointer: " & $UnknownPointer & @CRLF) _DumpOutput("$EndSignature: " & $EndSignature & @CRLF) EndIf $FoundInTable = _ArraySearch($OpenAttributesArray,$target_attribute,0,0,0,2,1,0) If $FoundInTable > 0 Then If $OpenAttributesArray[$FoundInTable][1] <> 0xffffffff Then ; _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") ; $OpenAttributesArray[$FoundInTable][0] = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) $OpenAttributesArray[$FoundInTable][1] = "0xFFFFFFFF" ; $OpenAttributesArray[$FoundInTable][2] = "0x" & $DirtyPagesSeen $OpenAttributesArray[$FoundInTable][2] = "-" ; $OpenAttributesArray[$FoundInTable][3] = "0x" & $AttributeNamePresent $OpenAttributesArray[$FoundInTable][3] = $SizeOfIndx ; $OpenAttributesArray[$FoundInTable][4] = "0x" & $unknown1 $OpenAttributesArray[$FoundInTable][4] = "-" $OpenAttributesArray[$FoundInTable][5] = "0x" & $aAttributeHex $OpenAttributesArray[$FoundInTable][6] = "0x" & $unknown2 $OpenAttributesArray[$FoundInTable][7] = $PredictedRefNumber $OpenAttributesArray[$FoundInTable][8] = $aMFTReferenceSeqNo $OpenAttributesArray[$FoundInTable][9] = $LsnOfOpenRecord $OpenAttributesArray[$FoundInTable][10] = "0x" & $UnknownPointer $OpenAttributesArray[$FoundInTable][11] = "0x" & $EndSignature ; $OpenAttributesArray[$FoundInTable][12] = "Attribute name in undo chunk" $OpenAttributesArray[$FoundInTable][13] = 1 $RetVal = $FoundInTable $TextInformation &= ";Updated OpenAttributesArray" ; _DumpOutput($TextInformation & " (existing entry)" & @CRLF) Else _DumpOutput("Error in OpenNonresidentAttribute for LSN: " & $this_lsn & @CRLF) _DumpOutput("AllocatedOrNextFree was 0xffffffff" & @CRLF) EndIf Else #cs _DumpOutput("Error in OpenNonresidentAttribute for LSN: " & $this_lsn & @CRLF) _DumpOutput("Could not update array with new entry" & @CRLF) _DumpOutput(_HexEncode("0x"&$datachunk) & @CRLF) _DumpOutput("$target_attribute: " & $target_attribute & @CRLF) _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) _DumpOutput("$DirtyPagesSeen: " & $DirtyPagesSeen & @CRLF) _DumpOutput("$AttributeNamePresent: " & $AttributeNamePresent & @CRLF) _DumpOutput("$aAttributeHex: " & $aAttributeHex & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$Unknown2: " & $Unknown2 & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$aMFTReferenceSeqNo: " & $aMFTReferenceSeqNo & @CRLF) _DumpOutput("$LsnOfOpenRecord: " & $LsnOfOpenRecord & @CRLF) _DumpOutput("$UnknownPointer: " & $UnknownPointer & @CRLF) _DumpOutput("$EndSignature: " & $EndSignature & @CRLF) _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") #ce $ArrayEnd = UBound($OpenAttributesArray) ReDim $OpenAttributesArray[$ArrayEnd+1][14] $OpenAttributesArray[$ArrayEnd][0] = $target_attribute $OpenAttributesArray[$ArrayEnd][1] = "0x" & $AllocatedOrNextFree ; $OpenAttributesArray[$ArrayEnd][2] = "0x" & $DirtyPagesSeen $OpenAttributesArray[$ArrayEnd][2] = "-" ; $OpenAttributesArray[$ArrayEnd][3] = "0x" & $AttributeNamePresent $OpenAttributesArray[$ArrayEnd][3] = $SizeOfIndx ; $OpenAttributesArray[$ArrayEnd][4] = "0x" & $unknown1 $OpenAttributesArray[$ArrayEnd][4] = "-" $OpenAttributesArray[$ArrayEnd][5] = "0x" & $aAttributeHex $OpenAttributesArray[$ArrayEnd][6] = "0x" & $unknown2 $OpenAttributesArray[$ArrayEnd][7] = $PredictedRefNumber $OpenAttributesArray[$ArrayEnd][8] = $aMFTReferenceSeqNo $OpenAttributesArray[$ArrayEnd][9] = $LsnOfOpenRecord $OpenAttributesArray[$ArrayEnd][10] = "0x" & $UnknownPointer $OpenAttributesArray[$ArrayEnd][11] = "0x" & $EndSignature $OpenAttributesArray[$ArrayEnd][13] = 1 $RetVal = $ArrayEnd $TextInformation &= ";Updated OpenAttributesArray" ;_DumpOutput($TextInformation & " (new entry)" & @CRLF) EndIf Case Else _DumpOutput("Error: Unresolved OpenNonresidentAttribute for LSN: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$datachunk) & @CRLF) EndSelect If $VerboseOn Then _DumpOutput("_Decode_OpenNonresidentAttribute(): " & @CRLF) _DumpOutput("$Unknown1: " & $Unknown1 & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$aMFTReferenceSeqNo: " & $aMFTReferenceSeqNo & @CRLF) _DumpOutput("$LsnOfOpenRecord: " & $LsnOfOpenRecord & @CRLF) _DumpOutput("$aAttributeHex: " & $aAttributeHex & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$Unknown2: " & $Unknown2 & @CRLF) EndIf Return $RetVal EndFunc Func _Decode_SlackOpenNonresidentAttribute($datachunk) Local $Unknown1, $aMFTReferenceSeqNo, $LsnOfOpenRecord, $aAttributeHex, $Unknown2, $AllocatedOrNextFree, $DirtyPagesSeen, $SizeOfIndx, $UnknownPointer, $EndSignature, $RetVal=0 ;Local $aMFTReference, $AttributeNamePresent If $VerboseOn Then _DumpOutput("_Decode_SlackOpenNonresidentAttribute(): " & @CRLF) _DumpOutput("LSN: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$datachunk) & @CRLF) EndIf Select Case StringLen($datachunk) = 80 ;OPEN_ATTRIBUTE_ENTRY x64 If $Is32bit Then $TextInformation &= ";Mixed OS detected" $AllocatedOrNextFree = _SwapEndian(StringMid($datachunk,1,8)) ; $DirtyPagesSeen = StringMid($datachunk, 9, 2) ; $unknown0 = StringMid($datachunk, 9, 2) ; $AttributeNamePresent = StringMid($datachunk, 11, 2) ; $unknown1 = StringMid($datachunk, 13, 4) $SizeOfIndx = StringMid($datachunk, 9, 8) $SizeOfIndx = Dec(_SwapEndian($SizeOfIndx),2) $aAttributeHex = StringMid($datachunk,17,8) $AttributeString = _ResolveAttributeType(StringLeft($aAttributeHex,4)) ; $unknown2 = StringMid($datachunk, 25, 8) $DirtyPagesSeen = StringMid($datachunk, 25, 2) $unknown2 = StringMid($datachunk, 27, 6) $PredictedRefNumber = Dec(_SwapEndian(StringMid($datachunk,33,12))) $KeptRef = $PredictedRefNumber $aMFTReferenceSeqNo = Dec(_SwapEndian(StringMid($datachunk,45,4))) $LsnOfOpenRecord = Dec(_SwapEndian(StringMid($datachunk,49,16))) ;LsnOfOpenRecord $TextInformation &= ";LsnOfOpenRecord="&$LsnOfOpenRecord $UnknownPointer = _SwapEndian(StringMid($datachunk, 65, 16)) ; $EndSignature = StringMid($datachunk,73,8) If $VerboseOn Then _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) _DumpOutput("$DirtyPagesSeen: " & $DirtyPagesSeen & @CRLF) _DumpOutput("$SizeOfIndx: " & $SizeOfIndx & @CRLF) _DumpOutput("$aAttributeHex: " & $aAttributeHex & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$Unknown2: " & $Unknown2 & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$aMFTReferenceSeqNo: " & $aMFTReferenceSeqNo & @CRLF) _DumpOutput("$LsnOfOpenRecord: " & $LsnOfOpenRecord & @CRLF) _DumpOutput("$UnknownPointer: " & $UnknownPointer & @CRLF) ; _DumpOutput("$EndSignature: " & $EndSignature & @CRLF) EndIf $FoundInTable = _ArraySearch($SlackOpenAttributesArray,$target_attribute,0,0,0,2,1,0) If $FoundInTable > 0 Then If $SlackOpenAttributesArray[$FoundInTable][1] <> 0xffffffff Then ; _ArrayDisplay($SlackOpenAttributesArray,"$SlackOpenAttributesArray") ; $SlackOpenAttributesArray[$FoundInTable][0] = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) $SlackOpenAttributesArray[$FoundInTable][1] = "0xFFFFFFFF" $SlackOpenAttributesArray[$FoundInTable][2] = "0x" & $DirtyPagesSeen ; $SlackOpenAttributesArray[$FoundInTable][3] = "0x" & $AttributeNamePresent $SlackOpenAttributesArray[$FoundInTable][3] = $SizeOfIndx ; $SlackOpenAttributesArray[$FoundInTable][4] = "0x" & $unknown1 $SlackOpenAttributesArray[$FoundInTable][4] = "-" $SlackOpenAttributesArray[$FoundInTable][5] = "0x" & $aAttributeHex $SlackOpenAttributesArray[$FoundInTable][6] = "0x" & $unknown2 $SlackOpenAttributesArray[$FoundInTable][7] = $PredictedRefNumber $SlackOpenAttributesArray[$FoundInTable][8] = $aMFTReferenceSeqNo $SlackOpenAttributesArray[$FoundInTable][9] = $LsnOfOpenRecord $SlackOpenAttributesArray[$FoundInTable][10] = "0x" & $UnknownPointer ; $SlackOpenAttributesArray[$FoundInTable][11] = "0x" & $EndSignature $SlackOpenAttributesArray[$FoundInTable][11] = "-" ; $SlackOpenAttributesArray[$FoundInTable][12] = "Attribute name in undo chunk" $SlackOpenAttributesArray[$FoundInTable][13] = 0 $RetVal = $FoundInTable $TextInformation &= ";Updated SlackOpenAttributesArray" Else _DumpOutput("Error in Slack OpenNonresidentAttribute for LSN: " & $this_lsn & @CRLF) _DumpOutput("AllocatedOrNextFree was 0xffffffff" & @CRLF) EndIf Else #cs _DumpOutput("Error in OpenNonresidentAttribute for LSN: " & $this_lsn & @CRLF) _DumpOutput("Could not update array with new entry" & @CRLF) _DumpOutput(_HexEncode("0x"&$datachunk) & @CRLF) _DumpOutput("$target_attribute: " & $target_attribute & @CRLF) _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) _DumpOutput("$DirtyPagesSeen: " & $DirtyPagesSeen & @CRLF) _DumpOutput("$AttributeNamePresent: " & $AttributeNamePresent & @CRLF) _DumpOutput("$aAttributeHex: " & $aAttributeHex & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$Unknown2: " & $Unknown2 & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$aMFTReferenceSeqNo: " & $aMFTReferenceSeqNo & @CRLF) _DumpOutput("$LsnOfOpenRecord: " & $LsnOfOpenRecord & @CRLF) _DumpOutput("$UnknownPointer: " & $UnknownPointer & @CRLF) _DumpOutput("$EndSignature: " & $EndSignature & @CRLF) _ArrayDisplay($SlackOpenAttributesArray,"$SlackOpenAttributesArray") #ce $ArrayEnd = UBound($SlackOpenAttributesArray) ReDim $SlackOpenAttributesArray[$ArrayEnd+1][14] $SlackOpenAttributesArray[$ArrayEnd][0] = $target_attribute $SlackOpenAttributesArray[$ArrayEnd][1] = "0x" & $AllocatedOrNextFree $SlackOpenAttributesArray[$ArrayEnd][2] = "0x" & $DirtyPagesSeen ; $SlackOpenAttributesArray[$ArrayEnd][3] = "0x" & $AttributeNamePresent $SlackOpenAttributesArray[$ArrayEnd][3] = $SizeOfIndx ; $SlackOpenAttributesArray[$ArrayEnd][4] = "0x" & $unknown1 $SlackOpenAttributesArray[$ArrayEnd][4] = "-" $SlackOpenAttributesArray[$ArrayEnd][5] = "0x" & $aAttributeHex $SlackOpenAttributesArray[$ArrayEnd][6] = "0x" & $unknown2 $SlackOpenAttributesArray[$ArrayEnd][7] = $PredictedRefNumber $SlackOpenAttributesArray[$ArrayEnd][8] = $aMFTReferenceSeqNo $SlackOpenAttributesArray[$ArrayEnd][9] = $LsnOfOpenRecord $SlackOpenAttributesArray[$ArrayEnd][10] = "0x" & $UnknownPointer ; $SlackOpenAttributesArray[$ArrayEnd][11] = "0x" & $EndSignature $SlackOpenAttributesArray[$ArrayEnd][11] = "-" $SlackOpenAttributesArray[$ArrayEnd][13] = 0 $RetVal = $ArrayEnd $TextInformation &= ";Updated SlackOpenAttributesArray" EndIf Case StringLen($datachunk) = 88 ;OPEN_ATTRIBUTE_ENTRY x86 If Not $Is32bit Then $TextInformation &= ";Mixed OS detected" $AllocatedOrNextFree = _SwapEndian(StringMid($datachunk,1,8)) $UnknownPointer = _SwapEndian(StringMid($datachunk, 9, 8)) $PredictedRefNumber = Dec(_SwapEndian(StringMid($datachunk,17,12))) $KeptRef = $PredictedRefNumber $aMFTReferenceSeqNo = Dec(_SwapEndian(StringMid($datachunk,29,4))) $LsnOfOpenRecord = Dec(_SwapEndian(StringMid($datachunk,33,16))) ;LsnOfOpenRecord $unknown2 = StringMid($datachunk, 49, 8) $aAttributeHex = StringMid($datachunk,57,8) $AttributeString = _ResolveAttributeType(StringLeft($aAttributeHex,4)) ; $unknown3 = StringMid($datachunk, 65, 8) ; $EndSignature = StringMid($datachunk,73,8) $EndSignature = StringMid($datachunk,65,16) ; $DirtyPagesSeen = StringMid($datachunk, 81, 2) ; $AttributeNamePresent = StringMid($datachunk, 83, 2) ; $unknown1 = StringMid($datachunk, 85, 4) $SizeOfIndx = StringMid($datachunk, 81, 2) $SizeOfIndx = Dec(_SwapEndian($SizeOfIndx),2) $TextInformation &= ";LsnOfOpenRecord="&$LsnOfOpenRecord If $VerboseOn Then _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) _DumpOutput("$DirtyPagesSeen: " & $DirtyPagesSeen & @CRLF) _DumpOutput("$SizeOfIndx: " & $SizeOfIndx & @CRLF) _DumpOutput("$aAttributeHex: " & $aAttributeHex & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$Unknown2: " & $Unknown2 & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$aMFTReferenceSeqNo: " & $aMFTReferenceSeqNo & @CRLF) _DumpOutput("$LsnOfOpenRecord: " & $LsnOfOpenRecord & @CRLF) _DumpOutput("$UnknownPointer: " & $UnknownPointer & @CRLF) _DumpOutput("$EndSignature: " & $EndSignature & @CRLF) EndIf $FoundInTable = _ArraySearch($SlackOpenAttributesArray,$target_attribute,0,0,0,2,1,0) If $FoundInTable > 0 Then If $SlackOpenAttributesArray[$FoundInTable][1] <> 0xffffffff Then ; _ArrayDisplay($SlackOpenAttributesArray,"$SlackOpenAttributesArray") ; $SlackOpenAttributesArray[$FoundInTable][0] = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) $SlackOpenAttributesArray[$FoundInTable][1] = "0xFFFFFFFF" ; $SlackOpenAttributesArray[$FoundInTable][2] = "0x" & $DirtyPagesSeen $SlackOpenAttributesArray[$FoundInTable][2] = "-" ; $SlackOpenAttributesArray[$FoundInTable][3] = "0x" & $AttributeNamePresent $SlackOpenAttributesArray[$FoundInTable][3] = $SizeOfIndx ; $SlackOpenAttributesArray[$FoundInTable][4] = "0x" & $unknown1 $SlackOpenAttributesArray[$FoundInTable][4] = "-" $SlackOpenAttributesArray[$FoundInTable][5] = "0x" & $aAttributeHex $SlackOpenAttributesArray[$FoundInTable][6] = "0x" & $unknown2 $SlackOpenAttributesArray[$FoundInTable][7] = $PredictedRefNumber $SlackOpenAttributesArray[$FoundInTable][8] = $aMFTReferenceSeqNo $SlackOpenAttributesArray[$FoundInTable][9] = $LsnOfOpenRecord $SlackOpenAttributesArray[$FoundInTable][10] = "0x" & $UnknownPointer $SlackOpenAttributesArray[$FoundInTable][11] = "0x" & $EndSignature ; $SlackOpenAttributesArray[$FoundInTable][12] = "Attribute name in undo chunk" $SlackOpenAttributesArray[$FoundInTable][13] = 1 $RetVal = $FoundInTable $TextInformation &= ";Updated SlackOpenAttributesArray" ; _DumpOutput($TextInformation & " (existing entry)" & @CRLF) Else _DumpOutput("Error in Slack OpenNonresidentAttribute for LSN: " & $this_lsn & @CRLF) _DumpOutput("AllocatedOrNextFree was 0xffffffff" & @CRLF) EndIf Else #cs _DumpOutput("Error in OpenNonresidentAttribute for LSN: " & $this_lsn & @CRLF) _DumpOutput("Could not update array with new entry" & @CRLF) _DumpOutput(_HexEncode("0x"&$datachunk) & @CRLF) _DumpOutput("$target_attribute: " & $target_attribute & @CRLF) _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) _DumpOutput("$DirtyPagesSeen: " & $DirtyPagesSeen & @CRLF) _DumpOutput("$AttributeNamePresent: " & $AttributeNamePresent & @CRLF) _DumpOutput("$aAttributeHex: " & $aAttributeHex & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$Unknown2: " & $Unknown2 & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$aMFTReferenceSeqNo: " & $aMFTReferenceSeqNo & @CRLF) _DumpOutput("$LsnOfOpenRecord: " & $LsnOfOpenRecord & @CRLF) _DumpOutput("$UnknownPointer: " & $UnknownPointer & @CRLF) _DumpOutput("$EndSignature: " & $EndSignature & @CRLF) _ArrayDisplay($SlackOpenAttributesArray,"$SlackOpenAttributesArray") #ce $ArrayEnd = UBound($SlackOpenAttributesArray) ReDim $SlackOpenAttributesArray[$ArrayEnd+1][14] $SlackOpenAttributesArray[$ArrayEnd][0] = $target_attribute $SlackOpenAttributesArray[$ArrayEnd][1] = "0x" & $AllocatedOrNextFree ; $SlackOpenAttributesArray[$ArrayEnd][2] = "0x" & $DirtyPagesSeen $SlackOpenAttributesArray[$ArrayEnd][2] = "-" ; $SlackOpenAttributesArray[$ArrayEnd][3] = "0x" & $AttributeNamePresent $SlackOpenAttributesArray[$ArrayEnd][3] = $SizeOfIndx ; $SlackOpenAttributesArray[$ArrayEnd][4] = "0x" & $unknown1 $SlackOpenAttributesArray[$ArrayEnd][4] = "-" $SlackOpenAttributesArray[$ArrayEnd][5] = "0x" & $aAttributeHex $SlackOpenAttributesArray[$ArrayEnd][6] = "0x" & $unknown2 $SlackOpenAttributesArray[$ArrayEnd][7] = $PredictedRefNumber $SlackOpenAttributesArray[$ArrayEnd][8] = $aMFTReferenceSeqNo $SlackOpenAttributesArray[$ArrayEnd][9] = $LsnOfOpenRecord $SlackOpenAttributesArray[$ArrayEnd][10] = "0x" & $UnknownPointer $SlackOpenAttributesArray[$ArrayEnd][11] = "0x" & $EndSignature $SlackOpenAttributesArray[$ArrayEnd][13] = 1 $RetVal = $ArrayEnd $TextInformation &= ";Updated SlackOpenAttributesArray" ;_DumpOutput($TextInformation & " (new entry)" & @CRLF) EndIf Case Else _DumpOutput("Error: Unresolved Slack OpenNonresidentAttribute for LSN: " & $this_lsn & @CRLF) _DumpOutput(_HexEncode("0x"&$datachunk) & @CRLF) EndSelect If $VerboseOn Then _DumpOutput("_Decode_SlackOpenNonresidentAttribute(): " & @CRLF) _DumpOutput("$Unknown1: " & $Unknown1 & @CRLF) _DumpOutput("$PredictedRefNumber: " & $PredictedRefNumber & @CRLF) _DumpOutput("$aMFTReferenceSeqNo: " & $aMFTReferenceSeqNo & @CRLF) _DumpOutput("$LsnOfOpenRecord: " & $LsnOfOpenRecord & @CRLF) _DumpOutput("$aAttributeHex: " & $aAttributeHex & @CRLF) _DumpOutput("$AttributeString: " & $AttributeString & @CRLF) _DumpOutput("$Unknown2: " & $Unknown2 & @CRLF) EndIf Return $RetVal EndFunc Func _Decode_OpenAttributeTableDump64bit($InputData,$IsFirst) Local $StartOffset = 1,$EntryCounter=1, $LocalIs32bit=0 ;Header $TableEntrySize = StringMid($InputData, $StartOffset, 4) $TableEntrySize = Dec(_SwapEndian($TableEntrySize),2) $MaxEntries = StringMid($InputData, $StartOffset + 4, 4) $MaxEntries = Dec(_SwapEndian($MaxEntries),2) $NumberOfEntries = StringMid($InputData, $StartOffset + 8, 8) $NumberOfEntries = Dec(_SwapEndian($NumberOfEntries),2) If ($MaxEntries = 0 Or $NumberOfEntries = 0) Then _DumpOutput("VerboseInfo: Entries was 0 in _Decode_OpenAttributeTableDump64bit() at lsn " & $this_lsn & @CRLF) $EntrySignature = StringMid($InputData, $StartOffset + 24, 8) $OffsetLastRealEntry = StringMid($InputData, $StartOffset + 32, 8) $OffsetLastRealEntry = Dec(_SwapEndian($OffsetLastRealEntry),2) ; $OffsetLastReservedEntry = StringMid($InputData, $StartOffset + 40, 8) ; $OffsetLastReservedEntry = Dec(_SwapEndian($OffsetLastReservedEntry),2) $OffsetLastReservedEntry = $MaxEntries*$TableEntrySize ; $NumberOfEntries = Round($OffsetLastReservedEntry/40) $NumberOfEntries = $MaxEntries If $VerboseOn Then _DumpOutput("_Decode_OpenAttributeTableDump64bit: " & @CRLF) _DumpOutput("$TableEntrySize: " & $TableEntrySize & @CRLF) _DumpOutput("$MaxEntries: " & $MaxEntries & @CRLF) _DumpOutput("$EntrySignature: " & $EntrySignature & @CRLF) _DumpOutput("$OffsetLastRealEntry: " & $OffsetLastRealEntry & @CRLF) _DumpOutput("$OffsetLastReservedEntry: " & $OffsetLastReservedEntry & @CRLF) _DumpOutput("$NumberOfEntries: " & $NumberOfEntries & @CRLF) EndIf $OpenAttributesArray[0][0] = "TableOffset" $OpenAttributesArray[0][1] = "AllocatedOrNextFree" $OpenAttributesArray[0][2] = "DirtyPagesSeen" $OpenAttributesArray[0][3] = "SizeOfIndx" $OpenAttributesArray[0][4] = "unknown1" $OpenAttributesArray[0][5] = "AttributeCode" $OpenAttributesArray[0][6] = "unknown2" $OpenAttributesArray[0][7] = "MftRef" $OpenAttributesArray[0][8] = "MftRefSeqNo" $OpenAttributesArray[0][9] = "Lsn" $OpenAttributesArray[0][10] = "UnknownPointer" $OpenAttributesArray[0][11] = "EndSignature" $OpenAttributesArray[0][12] = "AttributeName" $OpenAttributesArray[0][13] = "Is32bit" $OffsetFirstEntry = 48 $AllocatedOrNextFree = StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ; $TargetAttributeCode0 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 8) $TargetAttributeCode1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 4) $TargetAttributeCode2 = _ResolveAttributeType($TargetAttributeCode1) If $IsFirst=1 And $TargetAttributeCode2 = "UNKNOWN" And ($AllocatedOrNextFree = "00000000" Or $AllocatedOrNextFree = "FFFFFFFF") Then ;Wrong function _DumpOutput("Error in _Decode_OpenAttributeTableDump64bit()" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) ; _DumpOutput("$TargetAttributeCode0: " & $TargetAttributeCode0 & @CRLF) ; _DumpOutput("$TargetAttributeCode1: " & $TargetAttributeCode1 & @CRLF) ; _DumpOutput("$TargetAttributeCode2: " & $TargetAttributeCode2 & @CRLF) _DumpOutput("Calling _Decode_OpenAttributeTableDump32bit()" & @CRLF) If Not $Is32bit Then $TextInformation &= ";Mixed OS detected" _Decode_OpenAttributeTableDump32bit($InputData,0) Return EndIf $LocalIs32bit=0 ReDim $OpenAttributesArray[1+$NumberOfEntries][14] Do $AllocatedOrNextFree = StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ;AllocatedOrNextFree $AllocatedOrNextFree = _SwapEndian($AllocatedOrNextFree) ; $DirtyPagesSeen = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 2) ; $unknown0 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 2) ; $AttributeNamePresent = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 10, 2) ; $unknown1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 12, 4) $SizeOfIndx = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 8) $SizeOfIndx = Dec(_SwapEndian($SizeOfIndx),2) $TargetAttributeCode = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 8) ; $TargetAttributeCode = _SwapEndian($TargetAttributeCode) ; $unknown2 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 24, 8) $DirtyPagesSeen = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 24, 2) $unknown2 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 26, 6) $TargetMftRef = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 32, 12) $TargetMftRef = Dec(_SwapEndian($TargetMftRef),2) $TargetMftRefSeqNo = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 44, 4) $TargetMftRefSeqNo = Dec(_SwapEndian($TargetMftRefSeqNo),2) $TargetLsn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 48, 16) $TargetLsn = Dec(_SwapEndian($TargetLsn),2) ; $unknown3 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 56, 8) $UnknownPointer = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 64, 16) $UnknownPointer = _SwapEndian($UnknownPointer) ; $TargetEndSignature = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 72, 8) $OpenAttributesArray[$EntryCounter][0] = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) $OpenAttributesArray[$EntryCounter][1] = "0x" & $AllocatedOrNextFree $OpenAttributesArray[$EntryCounter][2] = "0x" & $DirtyPagesSeen ; $OpenAttributesArray[$EntryCounter][3] = "0x" & $AttributeNamePresent $OpenAttributesArray[$EntryCounter][3] = $SizeOfIndx ; $OpenAttributesArray[$EntryCounter][4] = "0x" & $unknown1 $OpenAttributesArray[$EntryCounter][4] = "-" $OpenAttributesArray[$EntryCounter][5] = "0x" & $TargetAttributeCode $OpenAttributesArray[$EntryCounter][6] = "0x" & $unknown2 $OpenAttributesArray[$EntryCounter][7] = $TargetMftRef $OpenAttributesArray[$EntryCounter][8] = $TargetMftRefSeqNo $OpenAttributesArray[$EntryCounter][9] = $TargetLsn $OpenAttributesArray[$EntryCounter][10] = "0x" & $UnknownPointer ; $OpenAttributesArray[$EntryCounter][11] = "0x" & $TargetEndSignature $OpenAttributesArray[$EntryCounter][11] = "-" $OpenAttributesArray[$EntryCounter][13] = $LocalIs32bit If $VerboseOn Then _DumpOutput(@CRLF) _DumpOutput("$EntryCounter: " & $EntryCounter & @CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData,$StartOffset+$OffsetFirstEntry,$TableEntrySize*2)) & @CRLF) _DumpOutput("Offset: " & $OpenAttributesArray[$EntryCounter][0] & @CRLF) _DumpOutput("AllocatedOrNextFree: " & $OpenAttributesArray[$EntryCounter][1] & @CRLF) _DumpOutput("DirtyPagesSeen: " & $OpenAttributesArray[$EntryCounter][2] & @CRLF) _DumpOutput("$SizeOfIndx: " & $OpenAttributesArray[$EntryCounter][3] & @CRLF) _DumpOutput("unknown1: " & $OpenAttributesArray[$EntryCounter][4] & @CRLF) _DumpOutput("TargetAttributeCode: " & $OpenAttributesArray[$EntryCounter][5] & @CRLF) _DumpOutput("unknown2: " & $OpenAttributesArray[$EntryCounter][6] & @CRLF) _DumpOutput("TargetMftRef: " & $OpenAttributesArray[$EntryCounter][7] & @CRLF) _DumpOutput("TargetMftRefSeqNo: " & $OpenAttributesArray[$EntryCounter][8] & @CRLF) _DumpOutput("TargetLsn: " & $OpenAttributesArray[$EntryCounter][9] & @CRLF) _DumpOutput("UnknownPointer: " & $OpenAttributesArray[$EntryCounter][10] & @CRLF) _DumpOutput("TargetEndSignature: " & $OpenAttributesArray[$EntryCounter][11] & @CRLF) EndIf $StartOffset += $TableEntrySize*2 $EntryCounter += 1 ; Until $StartOffset >= $OffsetLastRealEntry*2 ; Until $StartOffset-$OffsetFirstEntry >= $OffsetLastReservedEntry*2 Until $StartOffset >= $OffsetLastReservedEntry*2 ReDim $OpenAttributesArray[$EntryCounter][14] $lsn_openattributestable = $this_lsn If $VerboseOn Then _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) ; _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") EndIf EndFunc Func _Decode_OpenAttributeTableDump32bit($InputData,$IsFirst) Local $StartOffset = 1,$EntryCounter=1, $LocalIs32bit=0 ;Header $TableEntrySize = StringMid($InputData, $StartOffset, 4) $TableEntrySize = Dec(_SwapEndian($TableEntrySize),2) $MaxEntries = StringMid($InputData, $StartOffset + 4, 4) $MaxEntries = Dec(_SwapEndian($MaxEntries),2) $NumberOfEntries = StringMid($InputData, $StartOffset + 8, 8) $NumberOfEntries = Dec(_SwapEndian($NumberOfEntries),2) If ($MaxEntries = 0 Or $NumberOfEntries = 0) Then _DumpOutput("VerboseInfo: Entries was 0 in _Decode_OpenAttributeTableDump32bit() at lsn " & $this_lsn & @CRLF) $EntrySignature = StringMid($InputData, $StartOffset + 24, 8) $OffsetLastRealEntry = StringMid($InputData, $StartOffset + 32, 8) $OffsetLastRealEntry = Dec(_SwapEndian($OffsetLastRealEntry),2) ; $OffsetLastReservedEntry = StringMid($InputData, $StartOffset + 40, 8) ; $OffsetLastReservedEntry = Dec(_SwapEndian($OffsetLastReservedEntry),2) $OffsetLastReservedEntry = $MaxEntries*$TableEntrySize ; $NumberOfEntries = Round($OffsetLastReservedEntry/40) $NumberOfEntries = $MaxEntries If $VerboseOn Then _DumpOutput("_Decode_OpenAttributeTableDump32bit: " & @CRLF) _DumpOutput("$TableEntrySize: " & $TableEntrySize & @CRLF) _DumpOutput("$MaxEntries: " & $MaxEntries & @CRLF) _DumpOutput("$EntrySignature: " & $EntrySignature & @CRLF) _DumpOutput("$OffsetLastRealEntry: " & $OffsetLastRealEntry & @CRLF) _DumpOutput("$OffsetLastReservedEntry: " & $OffsetLastReservedEntry & @CRLF) _DumpOutput("$NumberOfEntries: " & $NumberOfEntries & @CRLF) EndIf $OpenAttributesArray[0][0] = "TableOffset" $OpenAttributesArray[0][1] = "AllocatedOrNextFree" $OpenAttributesArray[0][2] = "DirtyPagesSeen" $OpenAttributesArray[0][3] = "SizeOfIndx" $OpenAttributesArray[0][4] = "unknown1" $OpenAttributesArray[0][5] = "AttributeCode" $OpenAttributesArray[0][6] = "unknown2" $OpenAttributesArray[0][7] = "MftRef" $OpenAttributesArray[0][8] = "MftRefSeqNo" $OpenAttributesArray[0][9] = "Lsn" $OpenAttributesArray[0][10] = "UnknownPointer" $OpenAttributesArray[0][11] = "EndSignature" $OpenAttributesArray[0][12] = "AttributeName" $OpenAttributesArray[0][13] = "Is32bit" $OffsetFirstEntry = 48 $AllocatedOrNextFree = StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ; $TargetAttributeCode0 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 56, 8) $TargetAttributeCode1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 56, 4) $TargetAttributeCode2 = _ResolveAttributeType($TargetAttributeCode1) If $IsFirst=1 And $TargetAttributeCode2 = "UNKNOWN" And ($AllocatedOrNextFree = "00000000" Or $AllocatedOrNextFree = "FFFFFFFF") Then ;Wrong function _DumpOutput("Error in _Decode_OpenAttributeTableDump32bit()" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) ; _DumpOutput("$TargetAttributeCode0: " & $TargetAttributeCode0 & @CRLF) ; _DumpOutput("$TargetAttributeCode1: " & $TargetAttributeCode1 & @CRLF) ; _DumpOutput("$TargetAttributeCode2: " & $TargetAttributeCode2 & @CRLF) _DumpOutput("Calling _Decode_OpenAttributeTableDump64bit()" & @CRLF) If $Is32bit Then $TextInformation &= ";Mixed OS detected" _Decode_OpenAttributeTableDump64bit($InputData,0) Return EndIf $LocalIs32bit=1 ReDim $OpenAttributesArray[1+$NumberOfEntries][14] Do $AllocatedOrNextFree = StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ;AllocatedOrNextFree $AllocatedOrNextFree = _SwapEndian($AllocatedOrNextFree) $UnknownPointer = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 8) ;An offset to NamesDump? $UnknownPointer = _SwapEndian($UnknownPointer) $TargetMftRef = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 12) $TargetMftRef = Dec(_SwapEndian($TargetMftRef),2) $TargetMftRefSeqNo = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 28, 4) $TargetMftRefSeqNo = Dec(_SwapEndian($TargetMftRefSeqNo),2) $TargetLsn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 32, 16) $TargetLsn = Dec(_SwapEndian($TargetLsn),2) $unknown2 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 48, 8) $TargetAttributeCode = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 56, 8) ;$unknown3 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 64, 8) ; $TargetEndSignature = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 72, 8) $TargetEndSignature = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 64, 16) ; $DirtyPagesSeen = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 80, 2) ; $AttributeNamePresent = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 82, 2) ; $unknown1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 84, 4) $SizeOfIndx = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 80, 8) $SizeOfIndx = Dec(_SwapEndian($SizeOfIndx),2) $OpenAttributesArray[$EntryCounter][0] = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) $OpenAttributesArray[$EntryCounter][1] = "0x" & $AllocatedOrNextFree ; $OpenAttributesArray[$EntryCounter][2] = "0x" & $DirtyPagesSeen $OpenAttributesArray[$EntryCounter][2] = "-" ; $OpenAttributesArray[$EntryCounter][3] = "0x" & $AttributeNamePresent $OpenAttributesArray[$EntryCounter][3] = $SizeOfIndx ; $OpenAttributesArray[$EntryCounter][4] = "0x" & $unknown1 $OpenAttributesArray[$EntryCounter][4] = "-" $OpenAttributesArray[$EntryCounter][5] = "0x" & $TargetAttributeCode $OpenAttributesArray[$EntryCounter][6] = "0x" & $unknown2 $OpenAttributesArray[$EntryCounter][7] = $TargetMftRef $OpenAttributesArray[$EntryCounter][8] = $TargetMftRefSeqNo $OpenAttributesArray[$EntryCounter][9] = $TargetLsn $OpenAttributesArray[$EntryCounter][10] = "0x" & $UnknownPointer $OpenAttributesArray[$EntryCounter][11] = "0x" & $TargetEndSignature $OpenAttributesArray[$EntryCounter][13] = $LocalIs32bit If $VerboseOn Then _DumpOutput(@CRLF) _DumpOutput("$EntryCounter: " & $EntryCounter & @CRLF) _DumpOutput(_HexEncode("0x"&StringMid($InputData,$StartOffset+$OffsetFirstEntry,$TableEntrySize*2)) & @CRLF) _DumpOutput("Offset: " & $OpenAttributesArray[$EntryCounter][0] & @CRLF) _DumpOutput("AllocatedOrNextFree: " & $OpenAttributesArray[$EntryCounter][1] & @CRLF) _DumpOutput("DirtyPagesSeen: " & $OpenAttributesArray[$EntryCounter][2] & @CRLF) _DumpOutput("$SizeOfIndx: " & $OpenAttributesArray[$EntryCounter][3] & @CRLF) _DumpOutput("unknown1: " & $OpenAttributesArray[$EntryCounter][4] & @CRLF) _DumpOutput("TargetAttributeCode: " & $OpenAttributesArray[$EntryCounter][5] & @CRLF) _DumpOutput("unknown2: " & $OpenAttributesArray[$EntryCounter][6] & @CRLF) _DumpOutput("TargetMftRef: " & $OpenAttributesArray[$EntryCounter][7] & @CRLF) _DumpOutput("TargetMftRefSeqNo: " & $OpenAttributesArray[$EntryCounter][8] & @CRLF) _DumpOutput("TargetLsn: " & $OpenAttributesArray[$EntryCounter][9] & @CRLF) _DumpOutput("UnknownPointer: " & $OpenAttributesArray[$EntryCounter][10] & @CRLF) _DumpOutput("TargetEndSignature: " & $OpenAttributesArray[$EntryCounter][11] & @CRLF) EndIf $StartOffset += $TableEntrySize*2 $EntryCounter += 1 ; Until $StartOffset >= $OffsetLastRealEntry*2 ; Until $StartOffset-$OffsetFirstEntry >= $OffsetLastReservedEntry*2 Until $StartOffset >= $OffsetLastReservedEntry*2 ReDim $OpenAttributesArray[$EntryCounter][14] $lsn_openattributestable = $this_lsn If $VerboseOn Then _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) ; _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") EndIf EndFunc Func _Decode_SlackOpenAttributeTableDump64bit($InputData,$IsFirst) Local $StartOffset = 1,$EntryCounter=1, $InputDataSize = StringLen($InputData), $LocalIs32bit=0 If $BrokenLogFile Then Return ;Header $TableEntrySize = StringMid($InputData, $StartOffset, 4) $TableEntrySize = Dec(_SwapEndian($TableEntrySize),2) $MaxEntries = StringMid($InputData, $StartOffset + 4, 4) $MaxEntries = Dec(_SwapEndian($MaxEntries),2) $NumberOfEntries = StringMid($InputData, $StartOffset + 8, 8) $NumberOfEntries = Dec(_SwapEndian($NumberOfEntries),2) If ($MaxEntries = 0 Or $NumberOfEntries = 0) Then _DumpOutput("VerboseInfo: Entries was 0 in _Decode_SlackOpenAttributeTableDump64bit() at lsn " & $this_lsn & @CRLF) $EntrySignature = StringMid($InputData, $StartOffset + 24, 8) $OffsetLastRealEntry = StringMid($InputData, $StartOffset + 32, 8) $OffsetLastRealEntry = Dec(_SwapEndian($OffsetLastRealEntry),2) ; $OffsetLastReservedEntry = StringMid($InputData, $StartOffset + 40, 8) ; $OffsetLastReservedEntry = Dec(_SwapEndian($OffsetLastReservedEntry),2) $OffsetLastReservedEntry = $MaxEntries*$TableEntrySize ; $NumberOfEntries = Round($OffsetLastReservedEntry/40) $NumberOfEntries = $MaxEntries If $VerboseOn Then _DumpOutput("_Decode_SlackOpenAttributeTableDump64bit: " & @CRLF) _DumpOutput("$TableEntrySize: " & $TableEntrySize & @CRLF) _DumpOutput("$MaxEntries: " & $MaxEntries & @CRLF) _DumpOutput("$EntrySignature: " & $EntrySignature & @CRLF) _DumpOutput("$OffsetLastRealEntry: " & $OffsetLastRealEntry & @CRLF) _DumpOutput("$OffsetLastReservedEntry: " & $OffsetLastReservedEntry & @CRLF) _DumpOutput("$NumberOfEntries: " & $NumberOfEntries & @CRLF) EndIf $SlackOpenAttributesArray[0][0] = "TableOffset" $SlackOpenAttributesArray[0][1] = "AllocatedOrNextFree" $SlackOpenAttributesArray[0][2] = "DirtyPagesSeen" $SlackOpenAttributesArray[0][3] = "SizeOfIndx" $SlackOpenAttributesArray[0][4] = "unknown1" $SlackOpenAttributesArray[0][5] = "AttributeCode" $SlackOpenAttributesArray[0][6] = "unknown2" $SlackOpenAttributesArray[0][7] = "MftRef" $SlackOpenAttributesArray[0][8] = "MftRefSeqNo" $SlackOpenAttributesArray[0][9] = "Lsn" $SlackOpenAttributesArray[0][10] = "UnknownPointer" $SlackOpenAttributesArray[0][11] = "EndSignature" $SlackOpenAttributesArray[0][12] = "AttributeName" $SlackOpenAttributesArray[0][13] = "Is32bit" $OffsetFirstEntry = 48 $AllocatedOrNextFree = StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ; $TargetAttributeCode0 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 8) $TargetAttributeCode1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 4) $TargetAttributeCode2 = _ResolveAttributeType($TargetAttributeCode1) If $IsFirst=1 And $TargetAttributeCode2 = "UNKNOWN" And ($AllocatedOrNextFree = "00000000" Or $AllocatedOrNextFree = "FFFFFFFF") Then ;Wrong function _DumpOutput("Error in _Decode_SlackOpenAttributeTableDump64bit()" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) ; _DumpOutput("$TargetAttributeCode0: " & $TargetAttributeCode0 & @CRLF) ; _DumpOutput("$TargetAttributeCode1: " & $TargetAttributeCode1 & @CRLF) ; _DumpOutput("$TargetAttributeCode2: " & $TargetAttributeCode2 & @CRLF) _DumpOutput("Calling _Decode_SlackOpenAttributeTableDump32bit()" & @CRLF) If Not $Is32bit Then $TextInformation &= ";Mixed OS detected" _Decode_SlackOpenAttributeTableDump32bit($InputData,0) Return EndIf $LocalIs32bit=0 ReDim $SlackOpenAttributesArray[1+$NumberOfEntries][14] Do If $StartOffset >= $InputDataSize Then ExitLoop $AllocatedOrNextFree = StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ;AllocatedOrNextFree $AllocatedOrNextFree = _SwapEndian($AllocatedOrNextFree) ; $DirtyPagesSeen = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 2) ; $unknown0 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 2) ; $AttributeNamePresent = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 10, 2) ; $unknown1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 12, 4) $SizeOfIndx = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 8) $SizeOfIndx = Dec(_SwapEndian($SizeOfIndx),2) $TargetAttributeCode = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 8) ; $TargetAttributeCode = _SwapEndian($TargetAttributeCode) ; $unknown2 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 24, 8) $DirtyPagesSeen = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 24, 2) $unknown2 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 26, 6) $TargetMftRef = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 32, 12) $TargetMftRef = Dec(_SwapEndian($TargetMftRef),2) $TargetMftRefSeqNo = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 44, 4) $TargetMftRefSeqNo = Dec(_SwapEndian($TargetMftRefSeqNo),2) $TargetLsn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 48, 16) $TargetLsn = Dec(_SwapEndian($TargetLsn),2) ; $unknown3 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 56, 8) $UnknownPointer = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 64, 16) $UnknownPointer = _SwapEndian($UnknownPointer) ; $TargetEndSignature = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 72, 8) $SlackOpenAttributesArray[$EntryCounter][0] = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) $SlackOpenAttributesArray[$EntryCounter][1] = "0x" & $AllocatedOrNextFree $SlackOpenAttributesArray[$EntryCounter][2] = "0x" & $DirtyPagesSeen ; $SlackOpenAttributesArray[$EntryCounter][3] = "0x" & $AttributeNamePresent $SlackOpenAttributesArray[$EntryCounter][3] = $SizeOfIndx ; $SlackOpenAttributesArray[$EntryCounter][4] = "0x" & $unknown1 $SlackOpenAttributesArray[$EntryCounter][4] = "-" $SlackOpenAttributesArray[$EntryCounter][5] = "0x" & $TargetAttributeCode $SlackOpenAttributesArray[$EntryCounter][6] = "0x" & $unknown2 $SlackOpenAttributesArray[$EntryCounter][7] = $TargetMftRef $SlackOpenAttributesArray[$EntryCounter][8] = $TargetMftRefSeqNo $SlackOpenAttributesArray[$EntryCounter][9] = $TargetLsn $SlackOpenAttributesArray[$EntryCounter][10] = "0x" & $UnknownPointer ; $SlackOpenAttributesArray[$EntryCounter][11] = "0x" & $TargetEndSignature $SlackOpenAttributesArray[$EntryCounter][11] = "-" $SlackOpenAttributesArray[$EntryCounter][13] = $LocalIs32bit $StartOffset += $TableEntrySize*2 ; If $StartOffset >= $InputDataSize Then ExitLoop $EntryCounter += 1 ; Until $StartOffset >= $OffsetLastRealEntry*2 ; Until $StartOffset-$OffsetFirstEntry >= $OffsetLastReservedEntry*2 Until $StartOffset >= $OffsetLastReservedEntry*2 ReDim $SlackOpenAttributesArray[$EntryCounter][14] For $i = 1 To UBound($SlackOpenAttributesArray)-1 FileWriteLine($LogFileSlackOpenAttributeTableCsv, $RecordOffset&$de&$this_lsn&$de&$SlackOpenAttributesArray[$i][0]&$de&$SlackOpenAttributesArray[$i][12]&$de&$SlackOpenAttributesArray[$i][1]&$de&$SlackOpenAttributesArray[$i][2]&$de&$SlackOpenAttributesArray[$i][3]&$de&$SlackOpenAttributesArray[$i][4]&$de&$SlackOpenAttributesArray[$i][5]&$de&_ResolveAttributeType(StringMid($SlackOpenAttributesArray[$i][5],3,4))&$de&$SlackOpenAttributesArray[$i][6]&$de&$SlackOpenAttributesArray[$i][7]&$de&$SlackOpenAttributesArray[$i][8]&$de&$SlackOpenAttributesArray[$i][9]&$de&$SlackOpenAttributesArray[$i][10]&$de&$SlackOpenAttributesArray[$i][11]&$de&$SlackOpenAttributesArray[$i][13]&@crlf) Next ; $lsn_openattributestable = $this_lsn If $VerboseOn Then _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) ; _ArrayDisplay($SlackOpenAttributesArray,"$SlackOpenAttributesArray") EndIf EndFunc Func _Decode_SlackOpenAttributeTableDump32bit($InputData,$IsFirst) Local $StartOffset = 1,$EntryCounter=1, $InputDataSize = StringLen($InputData), $LocalIs32bit=0 If $BrokenLogFile Then Return ;Header $TableEntrySize = StringMid($InputData, $StartOffset, 4) $TableEntrySize = Dec(_SwapEndian($TableEntrySize),2) $MaxEntries = StringMid($InputData, $StartOffset + 4, 4) $MaxEntries = Dec(_SwapEndian($MaxEntries),2) $NumberOfEntries = StringMid($InputData, $StartOffset + 8, 8) $NumberOfEntries = Dec(_SwapEndian($NumberOfEntries),2) If ($MaxEntries = 0 Or $NumberOfEntries = 0) Then _DumpOutput("VerboseInfo: Entries was 0 in _Decode_SlackOpenAttributeTableDump32bit() at lsn " & $this_lsn & @CRLF) $EntrySignature = StringMid($InputData, $StartOffset + 24, 8) $OffsetLastRealEntry = StringMid($InputData, $StartOffset + 32, 8) $OffsetLastRealEntry = Dec(_SwapEndian($OffsetLastRealEntry),2) ; $OffsetLastReservedEntry = StringMid($InputData, $StartOffset + 40, 8) ; $OffsetLastReservedEntry = Dec(_SwapEndian($OffsetLastReservedEntry),2) $OffsetLastReservedEntry = $MaxEntries*$TableEntrySize ; $NumberOfEntries = Round($OffsetLastReservedEntry/40) $NumberOfEntries = $MaxEntries If $VerboseOn Then _DumpOutput("_Decode_SlackOpenAttributeTableDump32bit: " & @CRLF) _DumpOutput("$TableEntrySize: " & $TableEntrySize & @CRLF) _DumpOutput("$MaxEntries: " & $MaxEntries & @CRLF) _DumpOutput("$EntrySignature: " & $EntrySignature & @CRLF) _DumpOutput("$OffsetLastRealEntry: " & $OffsetLastRealEntry & @CRLF) _DumpOutput("$OffsetLastReservedEntry: " & $OffsetLastReservedEntry & @CRLF) _DumpOutput("$NumberOfEntries: " & $NumberOfEntries & @CRLF) EndIf $SlackOpenAttributesArray[0][0] = "TableOffset" $SlackOpenAttributesArray[0][1] = "AllocatedOrNextFree" $SlackOpenAttributesArray[0][2] = "DirtyPagesSeen" $SlackOpenAttributesArray[0][3] = "SizeOfIndx" $SlackOpenAttributesArray[0][4] = "unknown1" $SlackOpenAttributesArray[0][5] = "AttributeCode" $SlackOpenAttributesArray[0][6] = "unknown2" $SlackOpenAttributesArray[0][7] = "MftRef" $SlackOpenAttributesArray[0][8] = "MftRefSeqNo" $SlackOpenAttributesArray[0][9] = "Lsn" $SlackOpenAttributesArray[0][10] = "UnknownPointer" $SlackOpenAttributesArray[0][11] = "EndSignature" $SlackOpenAttributesArray[0][12] = "AttributeName" $SlackOpenAttributesArray[0][13] = "Is32bit" $OffsetFirstEntry = 48 $AllocatedOrNextFree = StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ; $TargetAttributeCode0 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 56, 8) $TargetAttributeCode1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 56, 4) $TargetAttributeCode2 = _ResolveAttributeType($TargetAttributeCode1) If $IsFirst=1 And $TargetAttributeCode2 = "UNKNOWN" And ($AllocatedOrNextFree = "00000000" Or $AllocatedOrNextFree = "FFFFFFFF") Then ;Wrong function _DumpOutput("Error in _Decode_SlackOpenAttributeTableDump32bit()" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) ; _DumpOutput("$AllocatedOrNextFree: " & $AllocatedOrNextFree & @CRLF) ; _DumpOutput("$TargetAttributeCode0: " & $TargetAttributeCode0 & @CRLF) ; _DumpOutput("$TargetAttributeCode1: " & $TargetAttributeCode1 & @CRLF) ; _DumpOutput("$TargetAttributeCode2: " & $TargetAttributeCode2 & @CRLF) _DumpOutput("Calling _Decode_SlackOpenAttributeTableDump64bit()" & @CRLF) If $Is32bit Then $TextInformation &= ";Mixed OS detected" _Decode_SlackOpenAttributeTableDump64bit($InputData,0) Return EndIf $LocalIs32bit=1 ReDim $SlackOpenAttributesArray[1+$NumberOfEntries][14] Do If $StartOffset >= $InputDataSize Then ExitLoop $AllocatedOrNextFree = StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ;AllocatedOrNextFree $AllocatedOrNextFree = _SwapEndian($AllocatedOrNextFree) $UnknownPointer = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 8) ;An offset to NamesDump? $UnknownPointer = _SwapEndian($UnknownPointer) $TargetMftRef = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 12) $TargetMftRef = Dec(_SwapEndian($TargetMftRef),2) $TargetMftRefSeqNo = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 28, 4) $TargetMftRefSeqNo = Dec(_SwapEndian($TargetMftRefSeqNo),2) $TargetLsn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 32, 16) $TargetLsn = Dec(_SwapEndian($TargetLsn),2) $unknown2 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 48, 8) $TargetAttributeCode = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 56, 8) ;$unknown3 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 64, 8) ; $TargetEndSignature = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 72, 8) $TargetEndSignature = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 64, 16) ; $DirtyPagesSeen = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 80, 2) ; $AttributeNamePresent = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 82, 2) ; $unknown1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 84, 4) $SizeOfIndx = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 80, 8) $SizeOfIndx = Dec(_SwapEndian($SizeOfIndx),2) $SlackOpenAttributesArray[$EntryCounter][0] = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) $SlackOpenAttributesArray[$EntryCounter][1] = "0x" & $AllocatedOrNextFree ; $SlackOpenAttributesArray[$EntryCounter][2] = "0x" & $DirtyPagesSeen $SlackOpenAttributesArray[$EntryCounter][2] = "-" ; $SlackOpenAttributesArray[$EntryCounter][3] = "0x" & $AttributeNamePresent $SlackOpenAttributesArray[$EntryCounter][3] = $SizeOfIndx ; $SlackOpenAttributesArray[$EntryCounter][4] = "0x" & $unknown1 $SlackOpenAttributesArray[$EntryCounter][4] = "-" $SlackOpenAttributesArray[$EntryCounter][5] = "0x" & $TargetAttributeCode $SlackOpenAttributesArray[$EntryCounter][6] = "0x" & $unknown2 $SlackOpenAttributesArray[$EntryCounter][7] = $TargetMftRef $SlackOpenAttributesArray[$EntryCounter][8] = $TargetMftRefSeqNo $SlackOpenAttributesArray[$EntryCounter][9] = $TargetLsn $SlackOpenAttributesArray[$EntryCounter][10] = "0x" & $UnknownPointer $SlackOpenAttributesArray[$EntryCounter][11] = "0x" & $TargetEndSignature $SlackOpenAttributesArray[$EntryCounter][13] = $LocalIs32bit $StartOffset += $TableEntrySize*2 ; If $StartOffset >= $InputDataSize Then ExitLoop $EntryCounter += 1 ; Until $StartOffset >= $OffsetLastRealEntry*2 ; Until $StartOffset-$OffsetFirstEntry >= $OffsetLastReservedEntry*2 Until $StartOffset >= $OffsetLastReservedEntry*2 ReDim $SlackOpenAttributesArray[$EntryCounter][14] For $i = 1 To UBound($SlackOpenAttributesArray)-1 FileWriteLine($LogFileSlackOpenAttributeTableCsv, $RecordOffset&$de&$this_lsn&$de&$SlackOpenAttributesArray[$i][0]&$de&$SlackOpenAttributesArray[$i][12]&$de&$SlackOpenAttributesArray[$i][1]&$de&$SlackOpenAttributesArray[$i][2]&$de&$SlackOpenAttributesArray[$i][3]&$de&$SlackOpenAttributesArray[$i][4]&$de&$SlackOpenAttributesArray[$i][5]&$de&_ResolveAttributeType(StringMid($SlackOpenAttributesArray[$i][5],3,4))&$de&$SlackOpenAttributesArray[$i][6]&$de&$SlackOpenAttributesArray[$i][7]&$de&$SlackOpenAttributesArray[$i][8]&$de&$SlackOpenAttributesArray[$i][9]&$de&$SlackOpenAttributesArray[$i][10]&$de&$SlackOpenAttributesArray[$i][11]&$de&$SlackOpenAttributesArray[$i][13]&@crlf) Next ; $lsn_openattributestable = $this_lsn If $VerboseOn Then _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) ; _ArrayDisplay($SlackOpenAttributesArray,"$SlackOpenAttributesArray") EndIf EndFunc Func _Decode_AttributeNamesDump($InputData) Local $StartOffset = 1,$EntryCounter=1, $EntrySize=0 $InputDataSize = StringLen($InputData) $AttributeNamesDumpArray[0][0] = "DumpOffset" $AttributeNamesDumpArray[0][1] = "OffsetInTable" $AttributeNamesDumpArray[0][2] = "NameLength" $AttributeNamesDumpArray[0][3] = "AttributeStreamName" Do If $StartOffset+8 >= $InputDataSize Then ExitLoop ReDim $AttributeNamesDumpArray[1+$EntryCounter][4] $OffsetInTable = StringMid($InputData, $StartOffset, 4) ; ConsoleWrite("$OffsetInTable: " & $OffsetInTable & @CRLF) $OffsetInTable = _SwapEndian($OffsetInTable) $NameLength = StringMid($InputData, $StartOffset + 4, 4) ; ConsoleWrite("$NameLength: " & $NameLength & @CRLF) $NameLength = Dec(_SwapEndian($NameLength),2) $AttributeStreamName = StringMid($InputData, $StartOffset + 8, $NameLength*2) ; ConsoleWrite("$AttributeStreamName: " & $AttributeStreamName & @CRLF) $AttributeStreamName = BinaryToString("0x"&$AttributeStreamName,2) $AttributeNamesDumpArray[$EntryCounter][0] = "0x" & Hex(Int(($StartOffset- 1)/2),8) $AttributeNamesDumpArray[$EntryCounter][1] = "0x" & $OffsetInTable $AttributeNamesDumpArray[$EntryCounter][2] = $NameLength $AttributeNamesDumpArray[$EntryCounter][3] = $AttributeStreamName If $VerboseOn Then _DumpOutput(@CRLF & "$EntryCounter: " & $EntryCounter & @CRLF) _DumpOutput("$StartOffset: 0x" & Hex(Int(($StartOffset- 1)/2),8) & @CRLF) _DumpOutput("$OffsetInTable: 0x" & $OffsetInTable & @CRLF) _DumpOutput("$NameLength: " & $NameLength & @CRLF) _DumpOutput("$AttributeStreamName: " & $AttributeStreamName & @CRLF) EndIf If Ubound($OpenAttributesArray) > 1 Then ; ConsoleWrite("Ubound($OpenAttributesArray): " & Ubound($OpenAttributesArray) & @CRLF) $FoundInTable = _ArraySearch($OpenAttributesArray,$AttributeNamesDumpArray[$EntryCounter][1],0,0,0,2,1,0) ; ConsoleWrite("$FoundInTable: " & $FoundInTable & @CRLF) If $FoundInTable > 0 Then $OpenAttributesArray[$FoundInTable][12] = $AttributeStreamName EndIf $EntrySize = 12 + ($NameLength*2) $StartOffset += $EntrySize $EntryCounter += 1 Until $StartOffset+8 >= $InputDataSize ReDim $AttributeNamesDumpArray[$EntryCounter][4] For $i = 1 To UBound($OpenAttributesArray)-1 FileWriteLine($LogFileOpenAttributeTableCsv, $RecordOffset&$de&$lsn_openattributestable&$de&$OpenAttributesArray[$i][0]&$de&$OpenAttributesArray[$i][12]&$de&$OpenAttributesArray[$i][1]&$de&$OpenAttributesArray[$i][2]&$de&$OpenAttributesArray[$i][3]&$de&$OpenAttributesArray[$i][4]&$de&$OpenAttributesArray[$i][5]&$de&_ResolveAttributeType(StringMid($OpenAttributesArray[$i][5],3,4))&$de&$OpenAttributesArray[$i][6]&$de&$OpenAttributesArray[$i][7]&$de&$OpenAttributesArray[$i][8]&$de&$OpenAttributesArray[$i][9]&$de&$OpenAttributesArray[$i][10]&$de&$OpenAttributesArray[$i][11]&$de&$OpenAttributesArray[$i][13]&@crlf) Next If $VerboseOn Then _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) ; _ArrayDisplay($AttributeNamesDumpArray,"$AttributeNamesDumpArray") ; ConsoleWrite("_Decode_AttributeNamesDump() end : " & @CRLF) ; _ArrayDisplay($OpenAttributesArray,"$OpenAttributesArray") EndIf EndFunc Func _Decode_SlackAttributeNamesDump($InputData) Local $StartOffset = 1,$EntryCounter=1, $EntrySize=0 $InputDataSize = StringLen($InputData) $SlackAttributeNamesDumpArray[0][0] = "DumpOffset" $SlackAttributeNamesDumpArray[0][1] = "OffsetInTable" $SlackAttributeNamesDumpArray[0][2] = "NameLength" $SlackAttributeNamesDumpArray[0][3] = "AttributeStreamName" Do If $StartOffset+8 >= $InputDataSize Then ExitLoop ReDim $SlackAttributeNamesDumpArray[1+$EntryCounter][4] $OffsetInTable = StringMid($InputData, $StartOffset, 4) ; ConsoleWrite("$OffsetInTable: " & $OffsetInTable & @CRLF) $OffsetInTable = _SwapEndian($OffsetInTable) $NameLength = StringMid($InputData, $StartOffset + 4, 4) ; ConsoleWrite("$NameLength: " & $NameLength & @CRLF) $NameLength = Dec(_SwapEndian($NameLength),2) $AttributeStreamName = StringMid($InputData, $StartOffset + 8, $NameLength*2) ; ConsoleWrite("$AttributeStreamName: " & $AttributeStreamName & @CRLF) $AttributeStreamName = BinaryToString("0x"&$AttributeStreamName,2) $SlackAttributeNamesDumpArray[$EntryCounter][0] = "0x" & Hex(Int(($StartOffset- 1)/2),8) $SlackAttributeNamesDumpArray[$EntryCounter][1] = "0x" & $OffsetInTable $SlackAttributeNamesDumpArray[$EntryCounter][2] = $NameLength $SlackAttributeNamesDumpArray[$EntryCounter][3] = $AttributeStreamName ; If Ubound($SlackOpenAttributesArray) > 1 Then ; ConsoleWrite("Ubound($SlackOpenAttributesArray): " & Ubound($SlackOpenAttributesArray) & @CRLF) ; $FoundInTable = _ArraySearch($SlackOpenAttributesArray,$SlackAttributeNamesDumpArray[$EntryCounter][1],0,0,0,2,1,0) ; ConsoleWrite("$FoundInTable: " & $FoundInTable & @CRLF) ; If $FoundInTable > 0 Then $SlackOpenAttributesArray[$FoundInTable][12] = $AttributeStreamName ; EndIf $EntrySize = 12 + ($NameLength*2) $StartOffset += $EntrySize ; If $StartOffset+8 >= $InputDataSize Then ExitLoop $EntryCounter += 1 Until $StartOffset+8 >= $InputDataSize ReDim $SlackAttributeNamesDumpArray[$EntryCounter][4] For $i = 1 To UBound($SlackAttributeNamesDumpArray)-1 FileWriteLine($LogFileSlackAttributeNamesDumpCsv, $RecordOffset&$de&$this_lsn&$de&$SlackAttributeNamesDumpArray[$i][0]&$de&$SlackAttributeNamesDumpArray[$i][1]&$de&$SlackAttributeNamesDumpArray[$i][2]&$de&$SlackAttributeNamesDumpArray[$i][3]&@crlf) Next If $VerboseOn Then _DumpOutput(@CRLF & "$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$redo_operation: " & $redo_operation & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) ; _ArrayDisplay($SlackAttributeNamesDumpArray,"$SlackAttributeNamesDumpArray") ; _ArrayDisplay($SlackOpenAttributesArray,"$SlackOpenAttributesArray") EndIf EndFunc Func _Decode_DirtyPageTableDump64bit($InputData,$IsFirst) Local $StartOffset = 1,$EntryCounter=1 ;Local $LocalIs32bit=0 ;Header $TableEntrySize = StringMid($InputData, $StartOffset, 4) $TableEntrySize = Dec(_SwapEndian($TableEntrySize),2) ;$unknown0 = StringMid($InputData, $StartOffset + 4, 4) $NumberOfEntries = StringMid($InputData, $StartOffset + 8, 8) $NumberOfEntries = Dec(_SwapEndian($NumberOfEntries),2) ; ConsoleWrite("$NumberOfEntries: " & $NumberOfEntries & @CRLF) $EntrySignature = StringMid($InputData, $StartOffset + 24, 8) $OffsetLastRealEntry = StringMid($InputData, $StartOffset + 32, 8) $OffsetLastRealEntry = Dec(_SwapEndian($OffsetLastRealEntry),2) $OffsetLastReservedEntry = StringMid($InputData, $StartOffset + 40, 8) $OffsetLastReservedEntry = Dec(_SwapEndian($OffsetLastReservedEntry),2) $NumberOfEntries = Round($OffsetLastReservedEntry/40) $DirtyPageTableDumpArray64bit[0][0] = "TableOffset" $DirtyPageTableDumpArray64bit[0][1] = "AllocatedOrNextFree" $DirtyPageTableDumpArray64bit[0][2] = "IndexOfDirtyPageEntryToOpenAttribute" $DirtyPageTableDumpArray64bit[0][3] = "LengthOfTransfer" $DirtyPageTableDumpArray64bit[0][4] = "LcnsToFollow" $DirtyPageTableDumpArray64bit[0][5] = "Reserved" $DirtyPageTableDumpArray64bit[0][6] = "Vcn" $DirtyPageTableDumpArray64bit[0][7] = "OldestLsn" $DirtyPageTableDumpArray64bit[0][8] = "Unknown1" $DirtyPageTableDumpArray64bit[0][9] = "Unknown2" $DirtyPageTableDumpArray64bit[0][10] = "Unknown3" $DirtyPageTableDumpArray64bit[0][11] = "Unknown4" $DirtyPageTableDumpArray64bit[0][12] = "Unknown5" $DirtyPageTableDumpArray64bit[0][13] = "Unknown6" $DirtyPageTableDumpArray64bit[0][14] = "Unknown7" $OffsetFirstEntry = 48 $TestChunk1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 40, 8) $TestChunk1 = Dec(_SwapEndian($TestChunk1),2) If $IsFirst=1 And $TestChunk1 Then ;Wrong function _DumpOutput("Error in _Decode_DirtyPageTableDump64bit()" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$TestChunk1: " & $TestChunk1 & @CRLF) _DumpOutput("Calling _Decode_DirtyPageTableDump32bit()" & @CRLF) If Not $Is32bit Then $TextInformation &= ";Mixed OS detected" _Decode_DirtyPageTableDump32bit($InputData,0) Return EndIf ;$LocalIs32bit=1 $TextInformation &= ";See LogFile_DirtyPageTable64bit.csv" ReDim $DirtyPageTableDumpArray64bit[1+$NumberOfEntries][15] Do If $StartOffset >= $OffsetLastRealEntry*2 Then ExitLoop $AllocatedOrNextFree = StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ;AllocatedOrNextFree If $AllocatedOrNextFree <> $EntrySignature Then ExitLoop ;RESTART_ENTRY_ALLOCATED $IndexOfDirtyPageEntryToOpenAttribute = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 8) $IndexOfDirtyPageEntryToOpenAttribute = _SwapEndian($IndexOfDirtyPageEntryToOpenAttribute) $LengthOfTransfer = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 8) $LengthOfTransfer = _SwapEndian($LengthOfTransfer) $LcnsToFollow = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 24, 8) $LcnsToFollow = _SwapEndian($LcnsToFollow) ; $Reserved = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 32, 8) ; $Reserved = _SwapEndian($Reserved) ; $Vcn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 40, 8) ; $Vcn = Dec(_SwapEndian($Vcn),2) $Vcn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 32, 16) $Vcn = Dec(_SwapEndian($Vcn),2) $OldestLsn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 48, 16) $OldestLsn = Dec(_SwapEndian($OldestLsn),2) ; $LcnsForPage = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 64, 8) ; $LcnsForPage = Dec(_SwapEndian($LcnsForPage),2) ; $TargetEndSignature = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 72, 8) $Unknown1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 64, 16) $Unknown1 = _SwapEndian($Unknown1) $Unknown2 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 80, 16) $Unknown2 = _SwapEndian($Unknown2) $Unknown3 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 96, 16) $Unknown3 = _SwapEndian($Unknown3) $Unknown4 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 112, 16) $Unknown4 = _SwapEndian($Unknown4) $Unknown5 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 128, 16) $Unknown5 = _SwapEndian($Unknown5) $Unknown6 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 144, 16) $Unknown6 = _SwapEndian($Unknown6) $Unknown7 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 160, 16) $Unknown7 = _SwapEndian($Unknown7) ;+5 $DirtyPageTableDumpArray64bit[$EntryCounter][0] = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) $DirtyPageTableDumpArray64bit[$EntryCounter][1] = "0x" & $AllocatedOrNextFree $DirtyPageTableDumpArray64bit[$EntryCounter][2] = "0x" & $IndexOfDirtyPageEntryToOpenAttribute $DirtyPageTableDumpArray64bit[$EntryCounter][3] = "0x" & $LengthOfTransfer $DirtyPageTableDumpArray64bit[$EntryCounter][4] = "0x" & $LcnsToFollow ; $DirtyPageTableDumpArray64bit[$EntryCounter][5] = "0x" & $Reserved $DirtyPageTableDumpArray64bit[$EntryCounter][5] = "-" $DirtyPageTableDumpArray64bit[$EntryCounter][6] = $Vcn $DirtyPageTableDumpArray64bit[$EntryCounter][7] = $OldestLsn $DirtyPageTableDumpArray64bit[$EntryCounter][8] = "0x" & $Unknown1 $DirtyPageTableDumpArray64bit[$EntryCounter][9] = "0x" & $Unknown2 $DirtyPageTableDumpArray64bit[$EntryCounter][10] = "0x" & $Unknown3 $DirtyPageTableDumpArray64bit[$EntryCounter][11] = "0x" & $Unknown4 $DirtyPageTableDumpArray64bit[$EntryCounter][12] = "0x" & $Unknown5 $DirtyPageTableDumpArray64bit[$EntryCounter][13] = "0x" & $Unknown6 $DirtyPageTableDumpArray64bit[$EntryCounter][14] = "0x" & $Unknown7 $StartOffset += $TableEntrySize*2 $EntryCounter += 1 ; Until $StartOffset-$OffsetFirstEntry >= $OffsetLastRealEntry*2 Until $StartOffset >= $OffsetLastRealEntry*2 ReDim $DirtyPageTableDumpArray64bit[$EntryCounter][15] ; _ArrayDisplay($DirtyPageTableDumpArray,"$DirtyPageTableDumpArray") For $i = 1 To UBound($DirtyPageTableDumpArray64bit)-1 FileWriteLine($LogFileDirtyPageTable64bitCsv, $RecordOffset&$de&$this_lsn&$de&$DirtyPageTableDumpArray64bit[$i][0]&$de&$DirtyPageTableDumpArray64bit[$i][1]&$de&$DirtyPageTableDumpArray64bit[$i][2]&$de&$DirtyPageTableDumpArray64bit[$i][3]&$de&$DirtyPageTableDumpArray64bit[$i][4]&$de&$DirtyPageTableDumpArray64bit[$i][5]&$de&$DirtyPageTableDumpArray64bit[$i][6]&$de&$DirtyPageTableDumpArray64bit[$i][7]&$de&$DirtyPageTableDumpArray64bit[$i][8]&$de&$DirtyPageTableDumpArray64bit[$i][9]&$de&$DirtyPageTableDumpArray64bit[$i][10]&$de&$DirtyPageTableDumpArray64bit[$i][11]&$de&$DirtyPageTableDumpArray64bit[$i][12]&$de&$DirtyPageTableDumpArray64bit[$i][13]&$de&$DirtyPageTableDumpArray64bit[$i][14]&@crlf) Next EndFunc Func _Decode_DirtyPageTableDump32bit($InputData,$IsFirst) Local $StartOffset = 1,$EntryCounter=1 ;Local $LocalIs32bit=0 ;Header $TableEntrySize = StringMid($InputData, $StartOffset, 4) $TableEntrySize = Dec(_SwapEndian($TableEntrySize),2) ;$unknown0 = StringMid($InputData, $StartOffset + 4, 4) $NumberOfEntries = StringMid($InputData, $StartOffset + 8, 8) $NumberOfEntries = Dec(_SwapEndian($NumberOfEntries),2) ; ConsoleWrite("$NumberOfEntries: " & $NumberOfEntries & @CRLF) $EntrySignature = StringMid($InputData, $StartOffset + 24, 8) $OffsetLastRealEntry = StringMid($InputData, $StartOffset + 32, 8) $OffsetLastRealEntry = Dec(_SwapEndian($OffsetLastRealEntry),2) $OffsetLastReservedEntry = StringMid($InputData, $StartOffset + 40, 8) $OffsetLastReservedEntry = Dec(_SwapEndian($OffsetLastReservedEntry),2) $NumberOfEntries = Round($OffsetLastReservedEntry/40) $DirtyPageTableDumpArray32bit[0][0] = "TableOffset" $DirtyPageTableDumpArray32bit[0][1] = "AllocatedOrNextFree" $DirtyPageTableDumpArray32bit[0][2] = "IndexOfDirtyPageEntryToOpenAttribute" $DirtyPageTableDumpArray32bit[0][3] = "LengthOfTransfer" $DirtyPageTableDumpArray32bit[0][4] = "LcnsToFollow" $DirtyPageTableDumpArray32bit[0][5] = "Reserved" $DirtyPageTableDumpArray32bit[0][6] = "Vcn" $DirtyPageTableDumpArray32bit[0][7] = "OldestLsn" $DirtyPageTableDumpArray32bit[0][8] = "LcnsForPage" $DirtyPageTableDumpArray32bit[0][9] = "EndSignature" $OffsetFirstEntry = 48 $TestChunk1 = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 32, 8) $TestChunk1 = Dec(_SwapEndian($TestChunk1),2) If $IsFirst=1 And $TestChunk1 Then ;Wrong function _DumpOutput("Error in _Decode_DirtyPageTableDump32bit()" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$TestChunk1: " & $TestChunk1 & @CRLF) _DumpOutput("Calling _Decode_DirtyPageTableDump64bit()" & @CRLF) If $Is32bit Then $TextInformation &= ";Mixed OS detected" _Decode_DirtyPageTableDump64bit($InputData,0) Return EndIf ;$LocalIs32bit=0 $TextInformation &= ";See LogFile_DirtyPageTable32bit.csv" ReDim $DirtyPageTableDumpArray32bit[1+$NumberOfEntries][10] Do If $StartOffset >= $OffsetLastRealEntry*2 Then ExitLoop $AllocatedOrNextFree = StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ;AllocatedOrNextFree If $AllocatedOrNextFree <> $EntrySignature Then ExitLoop ;RESTART_ENTRY_ALLOCATED $IndexOfDirtyPageEntryToOpenAttribute = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 8) $IndexOfDirtyPageEntryToOpenAttribute = _SwapEndian($IndexOfDirtyPageEntryToOpenAttribute) $LengthOfTransfer = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 8) $LengthOfTransfer = _SwapEndian($LengthOfTransfer) $LcnsToFollow = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 24, 8) $LcnsToFollow = _SwapEndian($LcnsToFollow) ; $Reserved = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 32, 16) $Reserved = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 32, 8) ; $Vcn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 48, 8) $Vcn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 40, 8) $Vcn = Dec(_SwapEndian($Vcn),2) ;4 bytes alignment $OldestLsn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 56, 16) $OldestLsn = Dec(_SwapEndian($OldestLsn),2) $LcnsForPage = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 72, 8) $LcnsForPage = Dec(_SwapEndian($LcnsForPage),2) $TargetEndSignature = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 80, 8) $DirtyPageTableDumpArray32bit[$EntryCounter][0] = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) $DirtyPageTableDumpArray32bit[$EntryCounter][1] = "0x" & $AllocatedOrNextFree $DirtyPageTableDumpArray32bit[$EntryCounter][2] = "0x" & $IndexOfDirtyPageEntryToOpenAttribute $DirtyPageTableDumpArray32bit[$EntryCounter][3] = "0x" & $LengthOfTransfer $DirtyPageTableDumpArray32bit[$EntryCounter][4] = "0x" & $LcnsToFollow $DirtyPageTableDumpArray32bit[$EntryCounter][5] = "0x" & $Reserved $DirtyPageTableDumpArray32bit[$EntryCounter][6] = $Vcn $DirtyPageTableDumpArray32bit[$EntryCounter][7] = $OldestLsn $DirtyPageTableDumpArray32bit[$EntryCounter][8] = $LcnsForPage $DirtyPageTableDumpArray32bit[$EntryCounter][9] = "0x" & $TargetEndSignature $StartOffset += $TableEntrySize*2 $EntryCounter += 1 ; Until $StartOffset-$OffsetFirstEntry >= $OffsetLastRealEntry*2 Until $StartOffset >= $OffsetLastRealEntry*2 ReDim $DirtyPageTableDumpArray32bit[$EntryCounter][10] ; _ArrayDisplay($DirtyPageTableDumpArray,"$DirtyPageTableDumpArray") For $i = 1 To UBound($DirtyPageTableDumpArray32bit)-1 FileWriteLine($LogFileDirtyPageTable32bitCsv, $RecordOffset&$de&$this_lsn&$de&$DirtyPageTableDumpArray32bit[$i][0]&$de&$DirtyPageTableDumpArray32bit[$i][1]&$de&$DirtyPageTableDumpArray32bit[$i][2]&$de&$DirtyPageTableDumpArray32bit[$i][3]&$de&$DirtyPageTableDumpArray32bit[$i][4]&$de&$DirtyPageTableDumpArray32bit[$i][5]&$de&$DirtyPageTableDumpArray32bit[$i][6]&$de&$DirtyPageTableDumpArray32bit[$i][7]&$de&$DirtyPageTableDumpArray32bit[$i][8]&$de&$DirtyPageTableDumpArray32bit[$i][9]&@crlf) Next EndFunc Func _WriteCSVHeaderOpenAttributeTable() $OpenAttributeTable_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"TableOffset"&$de&"AttributeName"&$de&"AllocatedOrNextFree"&$de&"DirtyPagesSeen"&$de&"SizeOfIndx"&$de&"unknown1"&$de&"AttributeCode"&$de&"AttributeType"&$de&"unknown2"&$de&"MftRef"&$de&"MftRefSeqNo"&$de&"Lsn"&$de&"UnknownPointer"&$de&"EndSignature"&$de&"Is32bit" FileWriteLine($LogFileOpenAttributeTableCsv, $OpenAttributeTable_Csv_Header & @CRLF) EndFunc Func _WriteCSVHeaderDirtyPageTable32bit() $DirtyPageTable_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"TableOffset"&$de&"AllocatedOrNextFree"&$de&"IndexOfDirtyPageEntryToOpenAttribute"&$de&"LengthOfTransfer"&$de&"LcnsToFollow"&$de&"Reserved"&$de&"Vcn"&$de&"OldestLsn"&$de&"LcnsForPage"&$de&"EndSignature" FileWriteLine($LogFileDirtyPageTable32bitCsv, $DirtyPageTable_Csv_Header & @CRLF) EndFunc Func _WriteCSVHeaderDirtyPageTable64bit() $DirtyPageTable_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"TableOffset"&$de&"AllocatedOrNextFree"&$de&"IndexOfDirtyPageEntryToOpenAttribute"&$de&"LengthOfTransfer"&$de&"LcnsToFollow"&$de&"Reserved"&$de&"Vcn"&$de&"OldestLsn"&$de&"Unknown1"&$de&"Unknown2"&$de&"Unknown3"&$de&"Unknown4"&$de&"Unknown5"&$de&"Unknown6"&$de&"Unknown7" FileWriteLine($LogFileDirtyPageTable64bitCsv, $DirtyPageTable_Csv_Header & @CRLF) EndFunc Func _Decode_BitsInNonresidentBitMap2($data) Local $BitMapOffset, $NumberOfBits $BitMapOffset = "0x"&_SwapEndian(StringMid($data,1,8)) $NumberOfBits = "0x"&_SwapEndian(StringMid($data,9,8)) $TextInformation &= ";BitMapOffset="&$BitMapOffset&";NumberOfBits="&$NumberOfBits EndFunc Func _Decode_BitsInNonresidentBitMap($RedoData,$RedoOperation,$UndoData,$UndoOperation) Local $StartOffset = 1 Local $Redo_BitMapOffset,$Redo_NumberOfBits,$Undo_BitMapOffset,$Undo_NumberOfBits $Redo_BitMapOffset = StringMid($RedoData, $StartOffset, 8) $Redo_BitMapOffset = "0x" & _SwapEndian($Redo_BitMapOffset) $Redo_NumberOfBits = StringMid($RedoData, $StartOffset + 8, 8) $Redo_NumberOfBits = "0x" & _SwapEndian($Redo_NumberOfBits) $Undo_BitMapOffset = StringMid($UndoData, $StartOffset, 8) $Undo_BitMapOffset = "0x" & _SwapEndian($Undo_BitMapOffset) $Undo_NumberOfBits = StringMid($UndoData, $StartOffset + 8, 8) $Undo_NumberOfBits = "0x" & _SwapEndian($Undo_NumberOfBits) If ($Redo_BitMapOffset <> $Undo_BitMapOffset) Or ($Redo_NumberOfBits <> $Undo_NumberOfBits) Then _DumpOutput("Error: Bits mismatch in redo vs undo: " & $this_lsn & @CRLF) MsgBox(0,"Info","Bits mismatch in redo vs undo: " & $this_lsn) EndIf FileWriteLine($LogFileBitsInNonresidentBitMapCsv, $RecordOffset&$de&$this_lsn&$de&$RedoOperation&$de&$Redo_BitMapOffset&$de&$Redo_NumberOfBits&$de&$UndoOperation&$de&$Undo_BitMapOffset&$de&$Undo_NumberOfBits&@crlf) EndFunc Func _WriteCSVHeaderBitsInNonresidentBitMap() $BitsInNonresidentBitMap_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"RedoOperation"&$de&"Redo_BitMapOffset"&$de&"Redo_NumberOfBits"&$de&"UndoOperation"&$de&"Undo_BitMapOffset"&$de&"Undo_NumberOfBits" FileWriteLine($LogFileBitsInNonresidentBitMapCsv, $BitsInNonresidentBitMap_Csv_Header & @CRLF) EndFunc Func _DumpOutput($text) ConsoleWrite($text) If $debuglogfile Then FileWrite($debuglogfile, $text) EndFunc Func _WriteCSVHeaderObjIdO() $ObjIdO_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"IndexEntrySize"&$de&"IndexKeySize"&$de&"Flags"&$de&"MftRef"&$de&"MftRefSeqNo"&$de&"ObjectId"&$de&"ObjectId_Version"&$de&"ObjectId_Timestamp"&$de&"ObjectId_TimestampDec"&$de&"ObjectId_ClockSeq"&$de&"ObjectId_Node"&$de&"BirthVolumeId"&$de&"BirthVolumeId_Version"&$de&"BirthVolumeId_Timestamp"&$de&"BirthVolumeId_TimestampDec"&$de&"BirthVolumeId_ClockSeq"&$de&"BirthVolumeId_Node"&$de&"BirthObjectId"&$de&"BirthObjectId_Version"&$de&"BirthObjectId_Timestamp"&$de&"BirthObjectId_TimestampDec"&$de&"BirthObjectId_ClockSeq"&$de&"BirthObjectId_Node"&$de&"DomainId"&$de&"DomainId_Version"&$de&"DomainId_Timestamp"&$de&"DomainId_TimestampDec"&$de&"DomainId_ClockSeq"&$de&"DomainId_Node"&$de&"IsRedo" FileWriteLine($LogFileObjIdOCsv, $ObjIdO_Csv_Header & @CRLF) EndFunc Func _WriteCSVHeaderQuotaO() $QuotaO_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"IndexEntrySize"&$de&"IndexKeySize"&$de&"Flags"&$de&"SID"&$de&"OwnerId"&$de&"IsRedo" FileWriteLine($LogFileQuotaOCsv, $QuotaO_Csv_Header & @CRLF) EndFunc Func _WriteCSVHeaderQuotaQ() $QuotaQ_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"IndexEntrySize"&$de&"IndexKeySize"&$de&"Flags"&$de&"OwnerId"&$de&"Version"&$de&"Flags2"&$de&"BytesUsed"&$de&"ChangeTime"&$de&"WarningLimit(bytes)"&$de&"HardLimit(bytes)"&$de&"ExceededTime"&$de&"SID"&$de&"IsRedo" FileWriteLine($LogFileQuotaQCsv, $QuotaQ_Csv_Header & @CRLF) EndFunc Func _WriteCSVHeaderReparseR() $ReparseR_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"IndexEntrySize"&$de&"IndexKeySize"&$de&"Flags"&$de&"KeyReparseTag"&$de&"KeyMftRefOfReparsePoint"&$de&"KeyMftRefSeqNoOfReparsePoint"&$de&"IsRedo" FileWriteLine($LogFileReparseRCsv, $ReparseR_Csv_Header & @CRLF) EndFunc Func _Decode_TransactionTableDump($InputData) Local $StartOffset = 1 ;$EntryCounter=1 ;Header $TableEntrySize = StringMid($InputData, $StartOffset, 4) $TableEntrySize = Dec(_SwapEndian($TableEntrySize),2) $MaxEntries = StringMid($InputData, $StartOffset + 4, 4) $MaxEntries = Dec(_SwapEndian($MaxEntries),2) $NumberOfEntries = StringMid($InputData, $StartOffset + 8, 8) $NumberOfEntries = Dec(_SwapEndian($NumberOfEntries),2) If ($MaxEntries = 0 Or $NumberOfEntries = 0) Then _DumpOutput("VerboseInfo: Entries was 0 in _Decode_TransactionTableDump() at lsn " & $this_lsn & @CRLF) $EntrySignature = StringMid($InputData, $StartOffset + 24, 8) $OffsetLastRealEntry = StringMid($InputData, $StartOffset + 32, 8) $OffsetLastRealEntry = Dec(_SwapEndian($OffsetLastRealEntry),2) ; $OffsetLastReservedEntry = StringMid($InputData, $StartOffset + 40, 8) ; $OffsetLastReservedEntry = Dec(_SwapEndian($OffsetLastReservedEntry),2) $OffsetLastReservedEntry = $MaxEntries*$TableEntrySize ; $NumberOfEntries = Round($OffsetLastReservedEntry/40) $NumberOfEntries = $MaxEntries If $VerboseOn Then _DumpOutput("_Decode_TransactionTableDump: " & @CRLF) _DumpOutput("$TableEntrySize: " & $TableEntrySize & @CRLF) _DumpOutput("$MaxEntries: " & $MaxEntries & @CRLF) _DumpOutput("$EntrySignature: " & $EntrySignature & @CRLF) _DumpOutput("$OffsetLastRealEntry: " & $OffsetLastRealEntry & @CRLF) _DumpOutput("$OffsetLastReservedEntry: " & $OffsetLastReservedEntry & @CRLF) _DumpOutput("$NumberOfEntries: " & $NumberOfEntries & @CRLF) EndIf $OffsetFirstEntry = 48 Do $AllocatedOrNextFree = "0x" & StringMid($InputData, $StartOffset + $OffsetFirstEntry, 8) ;AllocatedOrNextFree $TransactionState = "0x" & StringMid($InputData, $StartOffset + $OffsetFirstEntry + 8, 2) $Reserved = "0x" & StringMid($InputData, $StartOffset + $OffsetFirstEntry + 10, 6) $FirstLsn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 16, 16) $FirstLsn = Dec(_SwapEndian($FirstLsn),2) $PreviousLsn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 32, 16) $PreviousLsn = Dec(_SwapEndian($PreviousLsn),2) $UndoNextLsn = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 48, 16) $UndoNextLsn = Dec(_SwapEndian($UndoNextLsn),2) $UndoRecords = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 64, 8) $UndoRecords = Dec(_SwapEndian($UndoRecords),2) $UndoBytes = StringMid($InputData, $StartOffset + $OffsetFirstEntry + 72, 8) $UndoBytes = Dec(_SwapEndian($UndoBytes),2) $EntryOffset = "0x" & Hex(Int(($StartOffset + $OffsetFirstEntry - 1)/2),4) FileWriteLine($LogFileTransactionTableCsv, $this_lsn&$de&$EntryOffset&$de&$AllocatedOrNextFree&$de&$TransactionState&$de&$Reserved&$de&$FirstLsn&$de&$PreviousLsn&$de&$UndoNextLsn&$de&$UndoRecords&$de&$UndoBytes&@crlf) $StartOffset += $TableEntrySize*2 ;$EntryCounter += 1 Until $StartOffset >= $OffsetLastReservedEntry*2 EndFunc Func _WriteCSVHeaderTransactionTable() $TransactionTable_Csv_Header = "lf_LSN"&$de&"TableOffset"&$de&"AllocatedOrNextFree"&$de&"TransactionState"&$de&"Reserved"&$de&"FirstLsn"&$de&"PreviousLsn"&$de&"UndoNextLsn"&$de&"UndoRecords"&$de&"UndoBytes" FileWriteLine($LogFileTransactionTableCsv, $TransactionTable_Csv_Header & @CRLF) EndFunc #cs Global $FileNamesArray[1][3] $FileNamesArray[0][0] = "Ref" $FileNamesArray[0][1] = "FileName" $FileNamesArray[0][2] = "LSN" #ce Func _GetFileNameFromArray($InputRef,$InputLsn) $InputRef=Int($InputRef) Local $FoundInTable = _ArraySearch($FileNamesArray,$InputRef,0,0,0,2,1,0) If $VerboseOn Then _DumpOutput("_GetFileNameFromArray(): " & @CRLF) _DumpOutput("$InputRef: " & $InputRef & @CRLF) _DumpOutput("$InputLsn: " & $InputLsn & @CRLF) _DumpOutput("$FoundInTable: " & $FoundInTable & @CRLF) _DumpOutput("@error: " & @error & @CRLF) _ArrayDisplay($FileNamesArray,"$FileNamesArray") EndIf If $FoundInTable > 0 Then If $InputLsn > $FileNamesArray[$FoundInTable][2] Then Return $FileNamesArray[$FoundInTable][1] EndIf EndIf Return "" EndFunc Func _UpdateFileNameArray($InputRef,$InputRefSeqNo,$InputName,$InputLsn) $InputRef=Int($InputRef) $InputName=String($InputName) ; Local $FoundInTable = _ArraySearch($FileNamesArray,$InputRef,0,0,0,0,0,0) Local $FoundInTable = _ArraySearch($FileNamesArray,$InputRef,0,0,0,2,1,0) If $VerboseOn Then _DumpOutput("_UpdateFileNameArray(): " & @CRLF) _DumpOutput("$InputRef: " & $InputRef & @CRLF) _DumpOutput("$InputRefSeqNo: " & $InputRefSeqNo & @CRLF) _DumpOutput("$InputName: " & $InputName & @CRLF) _DumpOutput("$InputLsn: " & $InputLsn & @CRLF) _DumpOutput("$FoundInTable: " & $FoundInTable & @CRLF) _DumpOutput("@error: " & @error & @CRLF) ; _ArrayDisplay($FileNamesArray,"$FileNamesArray") EndIf If $FoundInTable < 1 Then ;Add new entry $ArrayEnd = UBound($FileNamesArray) ReDim $FileNamesArray[$ArrayEnd+1][3] $FileNamesArray[$ArrayEnd][0] = $InputRef $FileNamesArray[$ArrayEnd][1] = $InputName $FileNamesArray[$ArrayEnd][2] = $InputLsn FileWriteLine($LogFileFileNamesCsv, $RecordOffset & $de & $InputLsn & $de & $InputRef & $de & $InputRefSeqNo & $de & $InputName & @crlf) Else ;Update existing entry If $FileNamesArray[$FoundInTable][1] <> $InputName Then $FileNamesArray[$FoundInTable][0] = $InputRef $FileNamesArray[$FoundInTable][1] = $InputName $FileNamesArray[$FoundInTable][2] = $InputLsn FileWriteLine($LogFileFileNamesCsv, $RecordOffset & $de & $InputLsn & $de & $InputRef & $de & $InputRefSeqNo & $de & $InputName & @crlf) EndIf EndIf Return $FoundInTable EndFunc Func _WriteCSVHeaderRCRD() $RCRD_Csv_Header = "Offset"&$de&"last_lsn"&$de&"page_flags"&$de&"page_count"&$de&"page_position"&$de&"next_record_offset"&$de&"page_unknown"&$de&"last_end_lsn"&$de&"KeepData"&$de&"RulesString"&$de&"GlobalRecordSpreadCounter"&$de&"GlobalRecordSpreadReset2" FileWriteLine($LogFileRCRDCsv, $RCRD_Csv_Header & @CRLF) EndFunc Func _WriteCSVHeaderTransactionHeader() $TransactionHeader_Csv_Header = "RecordOffset"&$de&"this_lsn"&$de&"client_previous_lsn"&$de&"client_undo_next_lsn"&$de&"client_index"&$de&"record_type"&$de&"transaction_id"&$de&"lf_flags"&$de&"redo_operation"&$de&"undo_operation"&$de&"redo_offset"&$de&"redo_length"&$de&"undo_offset"&$de&"undo_length"&$de&"client_data_length"&$de&"target_attribute"&$de&"lcns_to_follow"&$de&"record_offset_in_mft"&$de&"attribute_offset"&$de&"MftClusterIndex"&$de&"target_vcn"&$de&"target_lcn"&$de&"ExcessDataSize" FileWriteLine($LogFileTransactionHeaderCsv, $TransactionHeader_Csv_Header & @CRLF) EndFunc Func _WriteCSVHeaderSlackOpenAttributeTable() $SlackOpenAttributeTable_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"TableOffset"&$de&"AttributeName"&$de&"AllocatedOrNextFree"&$de&"DirtyPagesSeen"&$de&"SizeOfIndx"&$de&"unknown1"&$de&"AttributeCode"&$de&"AttributeType"&$de&"unknown2"&$de&"MftRef"&$de&"MftRefSeqNo"&$de&"Lsn"&$de&"UnknownPointer"&$de&"EndSignature"&$de&"Is32bit" FileWriteLine($LogFileSlackOpenAttributeTableCsv, $SlackOpenAttributeTable_Csv_Header & @CRLF) EndFunc Func _WriteCSVHeaderSlackAttributeNamesDump() $SlackAttributeNamesDump_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"DumpOffset"&$de&"OffsetInTable"&$de&"NameLength"&$de&"AttributeStreamName" FileWriteLine($LogFileSlackAttributeNamesDumpCsv, $SlackAttributeNamesDump_Csv_Header & @CRLF) EndFunc Func _CheckAndRepairTransactionHeader($InputData) Local $StartOffset=1, $SanityCheckSuccess=0, $DummyPrepend = "0000000000000000", $LocalCounter=0, $FragmentFakeLsnA = "3146616b654c736e", $FragmentFakeLsnB = "3246616b654c736e", $ReturnData ;Local $InputDataSize = StringLen($InputData)/2, $FragmentFakeLsn1,$FragmentTestLsn1, Local $FragmentFakeLsn2, $FragmentFakeLsn3, $FragmentTestLsn2, $FragmentTestLsn3, $FragmentRedoLength_tmp,$FragmentUndoLength_tmp Do ; _DumpOutput("$LocalCounter: " & $LocalCounter & @CRLF) ; _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) ; _DumpOutput("$StartOffset = 0x" & Hex(Int(($StartOffset-1)/2)) & @CRLF) $FragmentLsn1 = StringMid($InputData, $StartOffset, 16) $FragmentLsn1 = Dec(_SwapEndian($FragmentLsn1),2) $FragmentLsn2 = StringMid($InputData, $StartOffset + 16, 16) $FragmentLsn2 = Dec(_SwapEndian($FragmentLsn2),2) $FragmentLsn3 = StringMid($InputData, $StartOffset + 32, 16) $FragmentLsn3 = Dec(_SwapEndian($FragmentLsn3),2) $FragmentClientDataLength = StringMid($InputData, $StartOffset + 48, 8) $FragmentClientDataLength = Dec(_SwapEndian($FragmentClientDataLength),2) $FragmentClientIndex = StringMid($InputData, $StartOffset + 56, 8) $FragmentClientIndex = Dec(_SwapEndian($FragmentClientIndex),2) $FragmentRecordType = StringMid($InputData, $StartOffset + 64, 8) $FragmentRecordType = Dec(_SwapEndian($FragmentRecordType),2) $FragmentTransactionId = StringMid($InputData, $StartOffset + 72, 8) $FragmentTransactionId = Dec(_SwapEndian($FragmentTransactionId),2) $FragmentFlags = StringMid($InputData, $StartOffset + 80, 4) $FragmentFlags = Dec(_SwapEndian($FragmentFlags),2) ;Allignment 6 bytes $FragmentRedoOp = StringMid($InputData, $StartOffset + 96, 4) $FragmentRedoOp = Dec(_SwapEndian($FragmentRedoOp),2) $FragmentUndoOp = StringMid($InputData, $StartOffset + 100, 4) $FragmentUndoOp = Dec(_SwapEndian($FragmentUndoOp),2) $FragmentRedoOffset = StringMid($InputData, $StartOffset + 104, 4) $FragmentRedoOffset = Dec(_SwapEndian($FragmentRedoOffset),2) $FragmentRedoLength = StringMid($InputData, $StartOffset + 108, 4) $FragmentRedoLength = Dec(_SwapEndian($FragmentRedoLength),2) $FragmentUndoOffset = StringMid($InputData, $StartOffset + 112, 4) $FragmentUndoOffset = Dec(_SwapEndian($FragmentUndoOffset),2) $FragmentUndoLength = StringMid($InputData, $StartOffset + 116, 4) $FragmentUndoLength = Dec(_SwapEndian($FragmentUndoLength),2) $FragmentTargetAttribute = StringMid($InputData, $StartOffset + 120, 4) $FragmentTargetAttribute = Dec(_SwapEndian($FragmentTargetAttribute),2) $FragmentLcnsToFollow = StringMid($InputData, $StartOffset + 124, 4) $FragmentLcnsToFollow = Dec(_SwapEndian($FragmentLcnsToFollow),2) $FragmentRecordOffsetInMft = StringMid($InputData, $StartOffset + 128, 4) $FragmentRecordOffsetInMft = Dec(_SwapEndian($FragmentRecordOffsetInMft),2) $FragmentAttributeOffset = StringMid($InputData, $StartOffset + 132, 4) $FragmentAttributeOffset = Dec(_SwapEndian($FragmentAttributeOffset),2) $FragmentMftClusterIndex = StringMid($InputData, $StartOffset + 136, 4) $FragmentMftClusterIndex = Dec(_SwapEndian($FragmentMftClusterIndex),2) $FragmentTargetVcn = StringMid($InputData, $StartOffset + 140, 8) $FragmentTargetVcn = Dec(_SwapEndian($FragmentTargetVcn),2) $FragmentTargetLcn = StringMid($InputData, $StartOffset + 148, 8) $FragmentTargetLcn = Dec(_SwapEndian($FragmentTargetLcn),2) ;Do the tests Select Case _SanityCheck_LSN($FragmentLsn1)=0 And $LocalCounter < 1 If $LocalCounter > 0 Then ; _DumpOutput("Skipping _SanityCheck_LSN($FragmentLsn1)" & @CRLF) Else ; _DumpOutput("Error in _SanityCheck_LSN($FragmentLsn1)" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop EndIf Case _SanityCheck_LSN($FragmentLsn2)=0 And $LocalCounter < 2 If $LocalCounter > 1 Then ; _DumpOutput("Skipping _SanityCheck_LSN($FragmentLsn2)" & @CRLF) Else ; _DumpOutput("Error in _SanityCheck_LSN($FragmentLsn2)" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop EndIf Case _SanityCheck_LSN($FragmentLsn3)=0 And $LocalCounter < 3 If $LocalCounter > 2 Then ; _DumpOutput("Skipping _SanityCheck_LSN($FragmentLsn3)" & @CRLF) Else ; _DumpOutput("Error in _SanityCheck_LSN($FragmentLsn3)" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop EndIf Case _SanityTest2($FragmentLsn1,$FragmentLsn2,$FragmentLsn3)=0 And $LocalCounter < 1 If $LocalCounter > 0 Then ; _DumpOutput("Skipping _SanityTest2()" & @CRLF) Else ; _DumpOutput("Error in _SanityTest2()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop EndIf Case _SanityTest3($FragmentLsn2,$FragmentLsn3)=0 And $LocalCounter < 2 If $LocalCounter > 1 Then ; _DumpOutput("Skipping _SanityTest3()" & @CRLF) Else ; _DumpOutput("Error in _SanityTest3()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop EndIf Case _SanityCheck_ClientDataLength($FragmentClientDataLength)=0 And $LocalCounter < 4 If $LocalCounter > 3 Then ; _DumpOutput("Skipping _SanityCheck_ClientDataLength()" & @CRLF) Else ; _DumpOutput("Error in _SanityCheck_ClientDataLength()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop EndIf Case _SanityCheck_ClientIndex($FragmentClientIndex)=0 And $LocalCounter < 4 If $LocalCounter > 3 Then ; _DumpOutput("Skipping _SanityCheck_ClientIndex()" & @CRLF) Else ; _DumpOutput("Error in _SanityCheck_ClientIndex()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop EndIf Case _SanityCheck_RecordType($FragmentRecordType)=0 And $LocalCounter < 5 If $LocalCounter > 4 Then ; _DumpOutput("Skipping _SanityCheck_RecordType()" & @CRLF) Else ; _DumpOutput("Error in _SanityCheck_RecordType()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop EndIf Case _SanityCheck_TransactionId($FragmentTransactionId)=0 And $LocalCounter < 5 If $LocalCounter > 4 Then ; _DumpOutput("Skipping _SanityCheck_TransactionId()" & @CRLF) Else ; _DumpOutput("Error in _SanityCheck_TransactionId()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop EndIf Case _SanityCheck_Flags($FragmentFlags)=0 And $LocalCounter < 6 If $LocalCounter > 5 Then ; _DumpOutput("Skipping _SanityCheck_Flags()" & @CRLF) Else ; _DumpOutput("Error in _SanityCheck_Flags()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop EndIf Case _SanityCheck_UndoRedoOpCode($FragmentRedoOp)=0 ; _DumpOutput("Error in _SanityCheck_UndoRedoOpCode($FragmentRedoOp)" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop Case _SanityCheck_UndoRedoOpCode($FragmentUndoOp)=0 ; _DumpOutput("Error in _SanityCheck_UndoRedoOpCode($FragmentUndoOp)" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop Case _SanityCheck_RedoOffset($FragmentRedoOffset)=0 ; _DumpOutput("Error in _SanityCheck_RedoOffset()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop Case _SanityCheck_UndoOffset($FragmentUndoOffset)=0 ; _DumpOutput("Error in _SanityCheck_UndoOffset()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop Case _SanityCheck_TargetAttribute($FragmentTargetAttribute)=0 ; _DumpOutput("Error in _SanityCheck_TargetAttribute()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop Case _SanityCheck_LcnsToFollow($FragmentLcnsToFollow)=0 ; _DumpOutput("Error in _SanityCheck_LcnsToFollow()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop Case _SanityCheck_RecordOffsetInMft($FragmentRecordOffsetInMft)=0 ; _DumpOutput("Error in _SanityCheck_RecordOffsetInMft()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop Case _SanityCheck_AttributeOffset($FragmentAttributeOffset)=0 ; _DumpOutput("Error in _SanityCheck_AttributeOffset()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop Case _SanityTest1($FragmentRedoOp,$FragmentUndoOp)=0 ; _DumpOutput("Error in _SanityTest1()" & @CRLF) $InputData = $DummyPrepend & $InputData $LocalCounter += 1 ContinueLoop Case Else $SanityCheckSuccess=1 ; _DumpOutput("Case Else" & @CRLF) ; _DumpOutput("_SanityCheckTransactionHeader: Validation success at prepending bytes: " & $LocalCounter*8 & @CRLF) ; _DumpOutput("$StartOffset = 0x" & Hex(Int(($StartOffset-1)/2)) & @CRLF) ExitLoop ; $StartOffset += 96 + ($FragmentClientDataLength*2) EndSelect $SanityCheckSuccess=1 ; _DumpOutput("_SanityCheckTransactionHeader: Validation success at prepending bytes: " & $LocalCounter*8 & @CRLF) ; _DumpOutput("$StartOffset = 0x" & Hex(Int(($StartOffset-1)/2)) & @CRLF) ExitLoop Until $LocalCounter > 6 ; _DumpOutput("_SanityCheckTransactionHeader: Validation success at $StartOffset = " & $StartOffset & @CRLF) ; _DumpOutput("$StartOffset = 0x" & Hex(Int(($StartOffset-1)/2)) & @CRLF) If Not $SanityCheckSuccess Then _DumpOutput("Repair of header failed" & @CRLF) Return SetError(1,0,0) EndIf _DumpOutput("_CheckAndRepairTransactionHeader(): Validation success when prepending bytes: 0x" & Hex(Int($LocalCounter*8),4) & @CRLF) ; _DumpOutput("$StartOffset = 0x" & Hex(Int(($StartOffset-1)/2)) & @CRLF) If $LocalCounter > 3 Then ;Align tmp sizes to 8 bytes $FragmentRedoLength_tmp = $FragmentRedoLength If Mod($FragmentRedoLength_tmp,8) Then While 1 $FragmentRedoLength_tmp+=1 If Mod($FragmentRedoLength_tmp,8) = 0 Then ExitLoop WEnd EndIf $FragmentUndoLength_tmp = $FragmentUndoLength If Mod($FragmentUndoLength_tmp,8) Then While 1 $FragmentUndoLength_tmp+=1 If Mod($FragmentUndoLength_tmp,8) = 0 Then ExitLoop WEnd EndIf EndIf ; _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) ;Attempt rebuilding a header Select Case $LocalCounter = 1 ; _DumpOutput("Case $LocalCounter = 1" & @CRLF) $FragmentTestLsn2 = StringMid($InputData,$StartOffset + 16,16) $FragmentTestLsn2 = Dec(_SwapEndian($FragmentTestLsn2),2) If $FragmentTestLsn2 > 0 Then $FragmentFakeLsn1 = $FragmentTestLsn2 + 760 ;Just add something $FragmentFakeLsn1 = _SwapEndian(Hex($FragmentFakeLsn1,16)) Else $FragmentFakeLsn1 = $FragmentFakeLsnA EndIf $ReturnData = $FragmentFakeLsn1 & StringMid($InputData,$StartOffset + 16) $TextInformation &= ";Header rebuilt with fake (LSN1)" _DumpOutput("Header rebuilt with fake (LSN1)" & @CRLF) Case $LocalCounter = 2 ; _DumpOutput("Case $LocalCounter = 2" & @CRLF) $FragmentTestLsn3 = StringMid($InputData,$StartOffset + 32,16) $FragmentTestLsn3 = Dec(_SwapEndian($FragmentTestLsn3),2) If $FragmentTestLsn3 > 0 Then $FragmentFakeLsn1 = $FragmentTestLsn3 + 760 ;Just add something $FragmentFakeLsn1 = _SwapEndian(Hex($FragmentFakeLsn1,16)) $FragmentFakeLsn2 = _SwapEndian(Hex($FragmentTestLsn3,16)) Else $FragmentFakeLsn1 = $FragmentFakeLsnB $FragmentFakeLsn2 = $DummyPrepend ;$FragmentFakeLsnA EndIf $ReturnData = $FragmentFakeLsn1 & $FragmentFakeLsn2 & StringMid($InputData,$StartOffset + 32) $TextInformation &= ";Header rebuilt with fake (LSN1,LSN2)" _DumpOutput("Header rebuilt with fake (LSN1,LSN2)" & @CRLF) Case $LocalCounter = 3 ; _DumpOutput("Case $LocalCounter = 3" & @CRLF) $FragmentFakeLsn1 = $FragmentFakeLsnB $FragmentFakeLsn2 = $FragmentFakeLsnA $FragmentFakeLsn3 = $FragmentFakeLsnA $ReturnData = $FragmentFakeLsn1 & $FragmentFakeLsn2 & $FragmentFakeLsn3 & StringMid($InputData,$StartOffset + 48) $TextInformation &= ";Header rebuilt with fake (LSN1,LSN2,LSN3)" _DumpOutput("Header rebuilt with fake (LSN1,LSN2,LSN3)" & @CRLF) Case $LocalCounter = 4 ; _DumpOutput("Case $LocalCounter = 4" & @CRLF) $FragmentFakeLsn1 = $FragmentFakeLsnB $FragmentFakeLsn2 = $FragmentFakeLsnA $FragmentFakeLsn3 = $FragmentFakeLsnA ; If _SolveUndoRedoCodes($FragmentRedoOp) <> "CompensationlogRecord" Then $FragmentFakeClientDataLength = _Max(Int($FragmentRedoOffset+$FragmentRedoLength_tmp),Int($FragmentUndoOffset+$FragmentUndoLength_tmp)) $FragmentFakeClientDataLength = _SwapEndian(Hex(Int($FragmentFakeClientDataLength),8)) ; Else ;Actually this is not needed ; $FragmentFakeClientDataLength = (StringLen($InputData)-96)/2 ; $FragmentFakeClientDataLength = _SwapEndian(Hex(Int($FragmentFakeClientDataLength),8)) ; EndIf $FragmentFakeClientIndex = "00000000" $ReturnData = $FragmentFakeLsn1 & $FragmentFakeLsn2 & $FragmentFakeLsn3 & $FragmentFakeClientDataLength & $FragmentFakeClientIndex & StringMid($InputData,$StartOffset + 64) $TextInformation &= ";Header rebuilt with fake (LSN1,LSN2,LSN3,ClientDataLength,ClientIndex)" _DumpOutput("Header rebuilt with fake (LSN1,LSN2,LSN3,ClientDataLength,ClientIndex)" & @CRLF) Case $LocalCounter = 5 ; _DumpOutput("Case $LocalCounter = 5" & @CRLF) $FragmentFakeLsn1 = $FragmentFakeLsnB $FragmentFakeLsn2 = $FragmentFakeLsnA $FragmentFakeLsn3 = $FragmentFakeLsnA ; If _SolveUndoRedoCodes($FragmentRedoOp) <> "CompensationlogRecord" Then $FragmentFakeClientDataLength = _Max(Int($FragmentRedoOffset+$FragmentRedoLength_tmp),Int($FragmentUndoOffset+$FragmentUndoLength_tmp)) $FragmentFakeClientDataLength = _SwapEndian(Hex(Int($FragmentFakeClientDataLength),8)) ; Else ;Actually this is not needed ; $FragmentFakeClientDataLength = (StringLen($InputData)-96)/2 ; $FragmentFakeClientDataLength = _SwapEndian(Hex(Int($FragmentFakeClientDataLength),8)) ; EndIf $FragmentFakeClientIndex = "00000000" $FragmentFakeRecordType = "01000000" $FragmentFakeTransactionId = "18000000" $ReturnData = $FragmentFakeLsn1 & $FragmentFakeLsn2 & $FragmentFakeLsn3 & $FragmentFakeClientDataLength & $FragmentFakeClientIndex & $FragmentFakeRecordType & $FragmentFakeTransactionId & StringMid($InputData,$StartOffset + 80) $TextInformation &= ";Header rebuilt with fake (LSN1,LSN2,LSN3,ClientDataLength,ClientIndex,RecordType,TransactionId)" _DumpOutput("Header rebuilt with fake (LSN1,LSN2,LSN3,ClientDataLength,ClientIndex,RecordType,TransactionId)" & @CRLF) Case $LocalCounter = 6 ; _DumpOutput("Case $LocalCounter = 6" & @CRLF) $FragmentFakeLsn1 = $FragmentFakeLsnB $FragmentFakeLsn2 = $FragmentFakeLsnA $FragmentFakeLsn3 = $FragmentFakeLsnA ; If _SolveUndoRedoCodes($FragmentRedoOp) <> "CompensationlogRecord" Then $FragmentFakeClientDataLength = _Max(Int($FragmentRedoOffset+$FragmentRedoLength_tmp),Int($FragmentUndoOffset+$FragmentUndoLength_tmp)) $FragmentFakeClientDataLength = _SwapEndian(Hex(Int($FragmentFakeClientDataLength),8)) ; Else ;Actually this is not needed ; $FragmentFakeClientDataLength = (StringLen($InputData)-96)/2 ; $FragmentFakeClientDataLength = _SwapEndian(Hex(Int($FragmentFakeClientDataLength),8)) ; EndIf $FragmentFakeClientIndex = "00000000" $FragmentFakeRecordType = "01000000" $FragmentFakeTransactionId = "18000000" $FragmentFakeFlags = "0000" $FragmentFakePadding6 = "000000000000" $ReturnData = $FragmentFakeLsn1 & $FragmentFakeLsn2 & $FragmentFakeLsn3 & $FragmentFakeClientDataLength & $FragmentFakeClientIndex & $FragmentFakeRecordType & $FragmentFakeTransactionId & $FragmentFakeFlags & $FragmentFakePadding6 & StringMid($InputData,$StartOffset + 96) $TextInformation &= ";Header rebuilt with fake (LSN1,LSN2,LSN3,ClientDataLength,ClientIndex,RecordType,TransactionId,Flags)" _DumpOutput("Header rebuilt with fake (LSN1,LSN2,LSN3,ClientDataLength,ClientIndex,RecordType,TransactionId,Flags)" & @CRLF) Case Else $ReturnData = $InputData EndSelect _DumpOutput("Repaired transaction:" & @CRLF) If $LocalCounter < 4 Then ; _DumpOutput(_HexEncode("0x"&StringMid($ReturnData,$StartOffset,96 + ($FragmentClientDataLength*2))) & @CRLF) ;Return StringMid($ReturnData,$StartOffset,96 + ($FragmentClientDataLength*2)) Return StringMid($ReturnData,$StartOffset) Else ; _DumpOutput(_HexEncode("0x"&$ReturnData) & @CRLF) Return $ReturnData EndIf EndFunc Func _SanityTest1($RedoOp,$UndoOp) $Undo = _SolveUndoRedoCodes($UndoOp) $Redo = _SolveUndoRedoCodes($RedoOp) If $Undo = "Noop" And Not ($Redo = "DirtyPageTableDump" Or $Redo = "CompensationlogRecord" Or $Redo = "UpdateNonResidentValue" Or $Redo = "InitializeFileRecordSegment" Or $Redo = "OpenAttributeTableDump" Or $Redo = "AttributeNamesDump" Or $Redo = "OpenNonresidentAttribute" Or $Redo = "TransactionTableDump") Then _DumpOutput("_SanityTest1: 1" & @CRLF) Return 0 EndIf If ($Redo = "ForgetTransaction" And $Undo <> "CompensationlogRecord") Or ($Undo = "CompensationlogRecord" And $Redo <> "ForgetTransaction") Then _DumpOutput("_SanityTest1: 2" & @CRLF) Return 0 EndIf If $Undo = "DeallocateFileRecordSegment" And $Redo <> "Noop" Then _DumpOutput("_SanityTest1: 3" & @CRLF) Return 0 EndIf If ($Redo = "AddIndexEntryAllocation" And $Undo <> "DeleteIndexEntryAllocation") Or ($Undo = "DeleteIndexEntryAllocation" And $Redo <> "AddIndexEntryAllocation") Then _DumpOutput("_SanityTest1: 4" & @CRLF) Return 0 EndIf If ($Redo = "AddindexEntryRoot" And $Undo <> "DeleteindexEntryRoot") Or ($Undo = "DeleteindexEntryRoot" And $Redo <> "AddindexEntryRoot") Then _DumpOutput("_SanityTest1: 5" & @CRLF) Return 0 EndIf If ($Redo = "CreateAttribute" And $Undo <> "DeleteAttribute") Or ($Undo = "DeleteAttribute" And $Redo <> "CreateAttribute") Then _DumpOutput("_SanityTest1: 6" & @CRLF) Return 0 EndIf If ($Redo = "SetBitsInNonresidentBitMap" And $Undo <> "ClearBitsInNonresidentBitMap") Or ($Undo = "SetBitsInNonresidentBitMap" And $Redo <> "ClearBitsInNonresidentBitMap") Then _DumpOutput("_SanityTest1: 7" & @CRLF) Return 0 EndIf If ($Redo = "SetIndexEntryVcnAllocation" And $Undo <> "SetIndexEntryVcnAllocation") Or ($Undo = "SetIndexEntryVcnAllocation" And $Redo <> "SetIndexEntryVcnAllocation") Then _DumpOutput("_SanityTest1: 8" & @CRLF) Return 0 EndIf If ($Redo = "SetIndexEntryVcnRoot" And $Undo <> "SetIndexEntryVcnRoot") Or ($Undo = "SetIndexEntryVcnRoot" And $Redo <> "SetIndexEntryVcnRoot") Then _DumpOutput("_SanityTest1: 9" & @CRLF) Return 0 EndIf If ($Redo = "UpdateMappingPairs" And $Undo <> "UpdateMappingPairs") Or ($Undo = "UpdateMappingPairs" And $Redo <> "UpdateMappingPairs") Then _DumpOutput("_SanityTest1: 10" & @CRLF) Return 0 EndIf If ($Redo = "WriteEndOfIndexBuffer" And $Undo <> "WriteEndOfIndexBuffer") Or ($Undo = "WriteEndOfIndexBuffer" And $Redo <> "WriteEndOfIndexBuffer") Then _DumpOutput("_SanityTest1: 11" & @CRLF) Return 0 EndIf If ($Redo = "UpdateResidentValue" And $Undo <> "UpdateResidentValue") Or ($Undo = "UpdateResidentValue" And $Redo <> "UpdateResidentValue") Then _DumpOutput("_SanityTest1: 12" & @CRLF) Return 0 EndIf If ($Redo = "UpdateFileNameRoot" And $Undo <> "UpdateFileNameRoot") Or ($Undo = "UpdateFileNameRoot" And $Redo <> "UpdateFileNameRoot") Then _DumpOutput("_SanityTest1: 13" & @CRLF) Return 0 EndIf If ($Redo = "UpdateFileNameAllocation" And $Undo <> "UpdateFileNameAllocation") Or ($Undo = "UpdateFileNameAllocation" And $Redo <> "UpdateFileNameAllocation") Then _DumpOutput("_SanityTest1: 14" & @CRLF) Return 0 EndIf Return 1 EndFunc Func _SanityTest2($LSN1,$LSN2,$LSN3) If $LSN2 > $LSN1 Or $LSN3 > $LSN1 Or ($LSN2 = 0 And $LSN3 <> 0) Then Return 0 Else Return 1 EndIf EndFunc Func _SanityTest3($LSN2,$LSN3) If $LSN2 = 0 And $LSN3 <> 0 Then Return 0 Else Return 1 EndIf EndFunc Func _SanityCheck_LSN($InputData) If $InputData = 0 Or $InputData > 0xFFFF Then ;And $InputData < 0xFFFFFFFFFFFFFFFF Then Return 1 Else Return 0 EndIf EndFunc Func _SanityCheck_ClientDataLength($InputData) If $InputData > 0x28 and $InputData < 0xFFFF Then Return 1 Else Return 0 EndIf EndFunc Func _SanityCheck_ClientIndex($InputData) If $InputData <> 0x0 And $InputData <> 0x1 Then Return 0 Else Return 1 EndIf EndFunc Func _SanityCheck_RecordType($InputData) If $InputData <> 0x1 And $InputData <> 0x2 Then Return 0 Else Return 1 EndIf EndFunc Func _SanityCheck_TransactionId($InputData) If Not Mod($InputData,8) Then Return 1 Else Return 0 EndIf EndFunc Func _SanityCheck_Flags($InputData) If $InputData <> 0x0 And $InputData <> 0x1 Then Return 0 Else Return 1 EndIf EndFunc Func _SanityCheck_UndoRedoOpCode($InputData) If _SolveUndoRedoCodes($InputData) <> "UNKNOWN" Then Return 1 Else Return 0 EndIf EndFunc Func _SanityCheck_RedoOffset($InputData) If Not Mod($InputData,8) And $InputData < 0xFFFF Then Return 1 Else Return 0 EndIf EndFunc Func _SanityCheck_UndoOffset($InputData) If $InputData > 0x0 And $InputData < 0xFFFF Then Return 1 Else Return 0 EndIf EndFunc Func _SanityCheck_TargetAttribute($InputData) If $InputData = 0x1 Or $InputData = 0x17 Or $InputData = 0x18 Or Not Mod($InputData+0x10,0x28) Then Return 1 Else Return 0 EndIf EndFunc Func _SanityCheck_LcnsToFollow($InputData) If $InputData <> 0x0 And $InputData <> 0x1 Then Return 0 Else Return 1 EndIf EndFunc Func _SanityCheck_RecordOffsetInMft($InputData) If $InputData < 0xFFFF Then Return 1 Else Return 0 EndIf EndFunc Func _SanityCheck_AttributeOffset($InputData) If $InputData < 0xFFFF Then Return 1 Else Return 0 EndIf EndFunc #cs Func _SanityCheck_MftClusterIndex($InputData) ;Not posible to validate Return 1 EndFunc Func _SanityCheck_TargetVcn($InputData) ;Not posible to validate Return 1 EndFunc Func _SanityCheck_TargetLcn($InputData) ;Not posible to validate Return 1 EndFunc #ce Func _CheckAndRepairTransactionHeader2($InputData) Local $StartOffset=1, $InputDataSize = StringLen($InputData)/2, $SanityCheckSuccess=0 Do _DumpOutput("$StartOffset = 0x" & Hex(Int(($StartOffset-1)/2)) & @CRLF) $FragmentLsn1 = StringMid($InputData, $StartOffset, 16) ; _DumpOutput("$FragmentLsn1: " & $FragmentLsn1 & @CRLF) $FragmentLsn1 = Dec(_SwapEndian($FragmentLsn1),2) $FragmentLsn2 = StringMid($InputData, $StartOffset + 16, 16) $FragmentLsn2 = Dec(_SwapEndian($FragmentLsn2),2) $FragmentLsn3 = StringMid($InputData, $StartOffset + 32, 16) $FragmentLsn3 = Dec(_SwapEndian($FragmentLsn3),2) $FragmentClientDataLength = StringMid($InputData, $StartOffset + 48, 8) $FragmentClientDataLength = Dec(_SwapEndian($FragmentClientDataLength),2) $FragmentClientIndex = StringMid($InputData, $StartOffset + 56, 8) $FragmentClientIndex = Dec(_SwapEndian($FragmentClientIndex),2) ; _DumpOutput("$FragmentClientIndex:" & $FragmentClientIndex & @CRLF) $FragmentRecordType = StringMid($InputData, $StartOffset + 64, 8) $FragmentRecordType = Dec(_SwapEndian($FragmentRecordType),2) $FragmentTransactionId = StringMid($InputData, $StartOffset + 72, 8) $FragmentTransactionId = Dec(_SwapEndian($FragmentTransactionId),2) $FragmentFlags = StringMid($InputData, $StartOffset + 80, 4) $FragmentFlags = Dec(_SwapEndian($FragmentFlags),2) ;Allignment 6 bytes $FragmentRedoOp = StringMid($InputData, $StartOffset + 96, 4) $FragmentRedoOp = Dec(_SwapEndian($FragmentRedoOp),2) $FragmentUndoOp = StringMid($InputData, $StartOffset + 100, 4) $FragmentUndoOp = Dec(_SwapEndian($FragmentUndoOp),2) $FragmentRedoOffset = StringMid($InputData, $StartOffset + 104, 4) $FragmentRedoOffset = Dec(_SwapEndian($FragmentRedoOffset),2) $FragmentRedoLength = StringMid($InputData, $StartOffset + 108, 4) $FragmentRedoLength = Dec(_SwapEndian($FragmentRedoLength),2) $FragmentUndoOffset = StringMid($InputData, $StartOffset + 112, 4) $FragmentUndoOffset = Dec(_SwapEndian($FragmentUndoOffset),2) $FragmentUndoLength = StringMid($InputData, $StartOffset + 116, 4) $FragmentUndoLength = Dec(_SwapEndian($FragmentUndoLength),2) $FragmentTargetAttribute = StringMid($InputData, $StartOffset + 120, 4) ; _DumpOutput("$FragmentTargetAttribute:" & $FragmentTargetAttribute & @CRLF) $FragmentTargetAttribute = Dec(_SwapEndian($FragmentTargetAttribute),2) $FragmentLcnsToFollow = StringMid($InputData, $StartOffset + 124, 4) $FragmentLcnsToFollow = Dec(_SwapEndian($FragmentLcnsToFollow),2) $FragmentRecordOffsetInMft = StringMid($InputData, $StartOffset + 128, 4) $FragmentRecordOffsetInMft = Dec(_SwapEndian($FragmentRecordOffsetInMft),2) $FragmentAttributeOffset = StringMid($InputData, $StartOffset + 132, 4) $FragmentAttributeOffset = Dec(_SwapEndian($FragmentAttributeOffset),2) $FragmentMftClusterIndex = StringMid($InputData, $StartOffset + 136, 4) $FragmentMftClusterIndex = Dec(_SwapEndian($FragmentMftClusterIndex),2) $FragmentTargetVcn = StringMid($InputData, $StartOffset + 140, 8) $FragmentTargetVcn = Dec(_SwapEndian($FragmentTargetVcn),2) $FragmentTargetLcn = StringMid($InputData, $StartOffset + 148, 8) $FragmentTargetLcn = Dec(_SwapEndian($FragmentTargetLcn),2) ;Do the tests Select Case _SanityCheck_LSN($FragmentLsn1)=0 _DumpOutput("Error in _SanityCheck_LSN($FragmentLsn1)" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_LSN($FragmentLsn2)=0 _DumpOutput("Error in _SanityCheck_LSN($FragmentLsn2)" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_LSN($FragmentLsn3)=0 _DumpOutput("Error in _SanityCheck_LSN($FragmentLsn3)" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_ClientDataLength($FragmentClientDataLength)=0 _DumpOutput("Error in _SanityCheck_ClientDataLength()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_ClientIndex($FragmentClientIndex)=0 _DumpOutput("Error in _SanityCheck_ClientIndex()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_RecordType($FragmentRecordType)=0 _DumpOutput("Error in _SanityCheck_RecordType()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_TransactionId($FragmentTransactionId)=0 _DumpOutput("Error in _SanityCheck_TransactionId()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_Flags($FragmentFlags)=0 _DumpOutput("Error in _SanityCheck_Flags()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_UndoRedoOpCode($FragmentRedoOp)=0 _DumpOutput("Error in _SanityCheck_UndoRedoOpCode($FragmentRedoOp)" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_UndoRedoOpCode($FragmentUndoOp)=0 _DumpOutput("Error in _SanityCheck_UndoRedoOpCode($FragmentUndoOp)" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_RedoOffset($FragmentRedoOffset)=0 _DumpOutput("Error in _SanityCheck_RedoOffset()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_UndoOffset($FragmentUndoOffset)=0 _DumpOutput("Error in _SanityCheck_UndoOffset()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_TargetAttribute($FragmentTargetAttribute)=0 _DumpOutput("Error in _SanityCheck_TargetAttribute()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_LcnsToFollow($FragmentLcnsToFollow)=0 _DumpOutput("Error in _SanityCheck_LcnsToFollow()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_RecordOffsetInMft($FragmentRecordOffsetInMft)=0 _DumpOutput("Error in _SanityCheck_RecordOffsetInMft()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityCheck_AttributeOffset($FragmentAttributeOffset)=0 _DumpOutput("Error in _SanityCheck_AttributeOffset()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityTest1($FragmentRedoOp,$FragmentUndoOp)=0 _DumpOutput("Error in _SanityTest1()" & @CRLF) $StartOffset += 16 ContinueLoop Case _SanityTest2($FragmentLsn1,$FragmentLsn2,$FragmentLsn3)=0 _DumpOutput("Error in _SanityTest2()" & @CRLF) $StartOffset += 16 ContinueLoop Case Else $SanityCheckSuccess=1 _DumpOutput("_SanityCheckTransactionHeader: Validation success at $StartOffset = " & $StartOffset & @CRLF) _DumpOutput("$StartOffset = 0x" & Hex(Int(($StartOffset-1)/2)) & @CRLF) ExitLoop ; $StartOffset += 96 + ($FragmentClientDataLength*2) EndSelect $StartOffset += 16 ;Since transactions are always aligned to 8 bytes Until $StartOffset >= $InputDataSize _DumpOutput("_SanityCheckTransactionHeader: Validation success at $StartOffset = " & $StartOffset & @CRLF) _DumpOutput("$StartOffset = 0x" & Hex(Int(($StartOffset-1)/2)) & @CRLF) If Not $SanityCheckSuccess Then Return SetError(1,0,0) ;Return StringMid($InputData,$StartOffset,96 + ($FragmentClientDataLength*2)) Return StringMid($InputData,$StartOffset) EndFunc Func _SelectFragment() $LogFileFragmentFile = FileOpenDialog("Select Fragment",@ScriptDir,"All (*.*)") If @error Then _DisplayInfo("Error getting Fragment: " & $LogFileFragmentFile & @CRLF) GUICtrlSetData($FragmentField,"Error getting Fragment") Return Else ; _DisplayInfo("Selected Fragment: " & $LogFileFragmentFile & @CRLF) GUICtrlSetData($FragmentField,$LogFileFragmentFile) EndIf $FragmentMode=1 EndFunc Func _CheckFragment() Local $HeaderSuccess=0, $InputDataTest, $FragmentFakeLsnA = "3146616b654c736e", $FragmentFakeLsnB = "3246616b654c736e" If Not FileExists($LogFileFragmentFile) Then _DumpOutput("Error: Fragment file not found: " & $LogFileFragmentFile & @CRLF) Return SetError(1) EndIf $FragmentMode=1 $hFragment = FileOpen($LogFileFragmentFile,16) $InputData = FileRead($hFragment) $InputSize = BinaryLen($InputData) _DumpOutput("Size of fragment: " & $InputSize & @CRLF) If StringLeft($InputData,2) = "0x" Then $InputData = StringTrimLeft($InputData,2) ;_DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) $FixupTest = _TestApplyFixups($InputData) If Not @error Then _DumpOutput("Fixups was applied to the fragment" & @CRLF) $InputData = $FixupTest EndIf ;_DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) If StringLeft($InputData,8) = "52435244" Or StringLeft($InputData,8) = "52535452" Then ;RCRD/RSTR ; Global $RebuiltFragment = "0x" & $InputData _DumpOutput("The RCRD/RSTR header structure seemed fine. No don't need to fix anything there. Please load the file as $LogFile input instead." & @CRLF) ; Return EndIf If $InputSize > 4096 Then _DumpOutput("Warning: The input file is larger than page size (4096 bytes). Parsing in this mode may miss data.." & @CRLF) EndIf For $i = 0 To $InputSize-1 $InputDataTest = StringMid($InputData,1+($i*2)) $result = _CheckAndRepairTransactionHeader($InputDataTest) ;If @error Then If @error Or (StringMid($result,1,16) = $FragmentFakeLsnA) Or (StringMid($result,1,16) = $FragmentFakeLsnB) Then _DumpOutput("Error in sanity check of data with " & $i & " bytes removed from start." & @CRLF) ContinueLoop Else $HeaderSuccess=1 ExitLoop EndIf Next If Not $HeaderSuccess Then _DumpOutput("Error: All test failed in sanity check of data." & @CRLF) Return Else _DumpOutput("Success verifying data with " & $i & " bytes removed from start." & @CRLF) EndIf If StringLeft($result,2) = "0x" Then $result = StringTrimLeft($result,2) If $VerboseOn Then _DumpOutput("Fixed transaction(s):" & @CRLF) _DumpOutput(_HexEncode("0x"&$result) & @CRLF) EndIf $InputSizeNew = 0x30 + BinaryLen("0x"&$result) $last_lsn_tmp = StringMid($result,1,16) $last_lsn_tmp = Dec(_SwapEndian($last_lsn_tmp),2) ;---- Reconstruct RCRD header $header = "52435244" ;4b $UsaOffsetAndSize = "28000900" ;4b $last_lsn = _SwapEndian(Hex($last_lsn_tmp,16)) ;8b $page_flags = _SwapEndian(Hex(1,8)) ;4b $page_count = _SwapEndian(Hex(1,4)) ;2b $page_position = _SwapEndian(Hex(1,4)) ;2b $next_record_offset = _SwapEndian(Hex($InputSizeNew,4)) ;2b $page_unknown = _SwapEndian(Hex(0,12)) ;6b $last_end_lsn = _SwapEndian(Hex(Int($last_lsn_tmp*1.1),16)) ;8b $UpdateSequenceArray = "000000000000000000000000000000000000" ;18b $LastPartPadding = "000000000000" ;6b $RebuiltRCRDHeader = $header & $UsaOffsetAndSize & $last_lsn & $page_flags & $page_count & $page_position & $next_record_offset & $page_unknown & $last_end_lsn & $UpdateSequenceArray & $LastPartPadding $RebuildRCRD = "0x" & $RebuiltRCRDHeader & $result $RebuiltFragment = $RebuildRCRD If $VerboseOn Then _DumpOutput("Fixed RCRD:" & @CRLF) _DumpOutput(_HexEncode($RebuiltFragment) & @CRLF) EndIf EndFunc Func _TestApplyFixups($InputData) ;Local $Counter=0, $FixupSuccess=0 If StringLeft($InputData,2) = "0x" Then $InputData = StringTrimLeft($InputData,2) $DataLength = BinaryLen("0x"&$InputData) ConsoleWrite("_TestApplyFixups2 - $DataLength: " & $DataLength & @CRLF) If $DataLength <> 4080 Then ;We don't have enough data to apply any fixup Return SetError(1) EndIf $adjust=34 ;$adjust2=0 $UpdSeqArr = StringMid($InputData,49,9*2*2) $UpdSeqArrPart0 = StringMid($UpdSeqArr,1,4) $UpdSeqArrPart1 = StringMid($UpdSeqArr,5,4) $UpdSeqArrPart2 = StringMid($UpdSeqArr,9,4) $UpdSeqArrPart3 = StringMid($UpdSeqArr,13,4) $UpdSeqArrPart4 = StringMid($UpdSeqArr,17,4) $UpdSeqArrPart5 = StringMid($UpdSeqArr,21,4) $UpdSeqArrPart6 = StringMid($UpdSeqArr,25,4) $UpdSeqArrPart7 = StringMid($UpdSeqArr,29,4) $UpdSeqArrPart8 = StringMid($UpdSeqArr,33,4) $RecordEnd1 = StringMid($InputData,1023-$adjust,4) $RecordEnd2 = StringMid($InputData,2047-$adjust,4) $RecordEnd3 = StringMid($InputData,3071-$adjust,4) $RecordEnd4 = StringMid($InputData,4095-$adjust,4) $RecordEnd5 = StringMid($InputData,5119-$adjust,4) $RecordEnd6 = StringMid($InputData,6143-$adjust,4) $RecordEnd7 = StringMid($InputData,7167-$adjust,4) $RecordEnd8 = StringMid($InputData,8191-$adjust,4) If $UpdSeqArrPart0 <> $RecordEnd1 OR $UpdSeqArrPart0 <> $RecordEnd2 OR $UpdSeqArrPart0 <> $RecordEnd3 OR $UpdSeqArrPart0 <> $RecordEnd4 OR $UpdSeqArrPart0 <> $RecordEnd5 OR $UpdSeqArrPart0 <> $RecordEnd6 OR $UpdSeqArrPart0 <> $RecordEnd7 OR $UpdSeqArrPart0 <> $RecordEnd8 Then ConsoleWrite("Error: Fixup failed at: 0x" & Hex($CurrentFileOffset) & @CRLF) Return SetError(1) EndIf $InputData = StringMid($InputData,1,1022-$adjust) & $UpdSeqArrPart1 & StringMid($InputData,1027-$adjust,1020) & $UpdSeqArrPart2 & StringMid($InputData,2051-$adjust,1020) & $UpdSeqArrPart3 & StringMid($InputData,3075-$adjust,1020) & $UpdSeqArrPart4 & StringMid($InputData,4099-$adjust,1020) & $UpdSeqArrPart5 & StringMid($InputData,5123-$adjust,1020) & $UpdSeqArrPart6 & StringMid($InputData,6147-$adjust,1020) & $UpdSeqArrPart7 & StringMid($InputData,7171-$adjust,1020) & $UpdSeqArrPart8 Return $InputData EndFunc ;Func _Decode_Attribute_List($InputData) ;EndFunc ;Func _DecodeAttrList($TargetFile, $AttrList) Func _DecodeAttrList($AttrList,$IsRedo) Local $offset, $LocalAttribID, $LocalName, $ALRecordLength, $ALNameLength ;Local $ALNameOffset $offset=0 $list=$AttrList $str=";BaseRef=" While StringLen($list) > $offset*2 $type=StringMid($List, ($offset*2)+1, 4) $type = _ResolveAttributeType($type) $ALRecordLength = Dec(_SwapEndian(StringMid($List, $offset*2 + 9, 4))) $ALNameLength = Dec(_SwapEndian(StringMid($List, $offset*2 + 13, 2))) ;$ALNameOffset = Dec(_SwapEndian(StringMid($List, $offset*2 + 15, 2))) $TestVCN = Dec(_SwapEndian(StringMid($List, $offset*2 + 17, 16))) $ref=Dec(_SwapEndian(StringMid($List, $offset*2 + 33, 8))) $LocalAttribID = "0x" & StringMid($List, $offset*2 + 49, 2) & StringMid($List, $offset*2 + 51, 2) If $ALNameLength > 0 Then $LocalName = StringMid($List, $offset*2 + 53, $ALNameLength*2*2) $LocalName = BinaryToString("0x"&$LocalName,2) Else $LocalName = "" EndIf If Not StringInStr($str, $ref) Then $str &= $ref & "-" If $ALRecordLength=0 Or $type="UNKNOWN" Then ExitLoop $EntryOffset = "0x"&Hex(Int($offset),8) FileWriteLine($LogFileAttributeListCsv, $this_lsn&$de&$EntryOffset&$de&$IsRedo&$de&$type&$de&"0x"&Hex($TestVCN,8)&$de&$ref&$de&$LocalName&$de&$LocalAttribID&@crlf) $offset += Dec(_SwapEndian(StringMid($List, $offset*2 + 9, 4))) WEnd EndFunc Func _WriteCSVHeaderAttributeList() $AttributeList_Csv_Header = "lf_LSN"&$de&"ListOffset"&$de&"IsRedoOp"&$de&"AttributeType"&$de&"VCN"&$de&"BaseMFTRef"&$de&"Name"&$de&"AttributeId" FileWriteLine($LogFileAttributeListCsv, $AttributeList_Csv_Header & @CRLF) EndFunc Func _Decode_Quota_Q_SingleEntry($InputData,$IsRedo) ;Local $Counter=1 $StartOffset = 1 $InputDataSize = StringLen($InputData) If $VerboseOn Then _DumpOutput("_Decode_Quota_Q_SingleEntry():" & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) EndIf $DataOffset = "-" $DataSize = "-" $IndexEntrySize = "-" $IndexKeySize = "-" $Flags = "-" $OwnerId = "-" $Version = StringMid($InputData, $StartOffset, 8) $Version = "0x" & _SwapEndian($Version) $Flags2 = StringMid($InputData, $StartOffset + 8, 8) $Flags2 = _SwapEndian($Flags2) $Flags2Text = _Decode_QuotaFlags("0x"&$Flags2) $BytesUsed = StringMid($InputData, $StartOffset + 16, 16) $BytesUsed = Dec(_SwapEndian($BytesUsed),2) Select Case $InputDataSize = 96 $ChangeTime = StringMid($InputData, $StartOffset + 32, 16) $ChangeTime = _SwapEndian($ChangeTime) $ChangeTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $ChangeTime) $ChangeTime = _WinTime_UTCFileTimeFormat(Dec($ChangeTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $ChangeTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$ChangeTime_Core = StringMid($ChangeTime,1,StringLen($ChangeTime)-4) ;$ChangeTime_Precision = StringRight($ChangeTime,3) ElseIf $TimestampPrecision = 3 Then $ChangeTime = $ChangeTime & $PrecisionSeparator2 & _FillZero(StringRight($ChangeTime_tmp, 4)) ;$ChangeTime_Core = StringMid($ChangeTime,1,StringLen($ChangeTime)-9) ;$ChangeTime_Precision = StringRight($ChangeTime,8) Else ;$ChangeTime_Core = $ChangeTime EndIf If $IsRedo Then $TextInformation &= ";ChangeTime=" & $ChangeTime $WarningLimit = StringMid($InputData, $StartOffset + 48, 16) $WarningLimit = "0x" & _SwapEndian($WarningLimit) $HardLimit = StringMid($InputData, $StartOffset + 64, 16) $HardLimit = "0x" & _SwapEndian($HardLimit) $ExceededTime = StringMid($InputData, $StartOffset + 80, 16) If $ExceededTime <> "0000000000000000" Then $ExceededTime = _SwapEndian($ExceededTime) $ExceededTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $ExceededTime) $ExceededTime = _WinTime_UTCFileTimeFormat(Dec($ExceededTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $ExceededTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$ExceededTime_Core = StringMid($ExceededTime,1,StringLen($ExceededTime)-4) ;$ExceededTime_Precision = StringRight($ExceededTime,3) ElseIf $TimestampPrecision = 3 Then $ExceededTime = $ExceededTime & $PrecisionSeparator2 & _FillZero(StringRight($ExceededTime_tmp, 4)) ;$ExceededTime_Core = StringMid($ExceededTime,1,StringLen($ExceededTime)-9) ;$ExceededTime_Precision = StringRight($ExceededTime,8) Else ;$ExceededTime_Core = $ExceededTime EndIf Else $ExceededTime = 0 EndIf Case $InputDataSize = 80 $ChangeTime = StringMid($InputData, $StartOffset + 32, 16) $ChangeTime = _SwapEndian($ChangeTime) $ChangeTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $ChangeTime) $ChangeTime = _WinTime_UTCFileTimeFormat(Dec($ChangeTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $ChangeTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$ChangeTime_Core = StringMid($ChangeTime,1,StringLen($ChangeTime)-4) ;$ChangeTime_Precision = StringRight($ChangeTime,3) ElseIf $TimestampPrecision = 3 Then $ChangeTime = $ChangeTime & $PrecisionSeparator2 & _FillZero(StringRight($ChangeTime_tmp, 4)) ;$ChangeTime_Core = StringMid($ChangeTime,1,StringLen($ChangeTime)-9) ;$ChangeTime_Precision = StringRight($ChangeTime,8) Else ;$ChangeTime_Core = $ChangeTime EndIf If $IsRedo Then $TextInformation &= ";ChangeTime=" & $ChangeTime $WarningLimit = StringMid($InputData, $StartOffset + 48, 16) $WarningLimit = "0x" & _SwapEndian($WarningLimit) $HardLimit = StringMid($InputData, $StartOffset + 64, 16) $HardLimit = "0x" & _SwapEndian($HardLimit) $ExceededTime = $TimestampErrorVal Case $InputDataSize = 64 $ChangeTime = StringMid($InputData, $StartOffset + 32, 16) $ChangeTime = _SwapEndian($ChangeTime) $ChangeTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $ChangeTime) $ChangeTime = _WinTime_UTCFileTimeFormat(Dec($ChangeTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $ChangeTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$ChangeTime_Core = StringMid($ChangeTime,1,StringLen($ChangeTime)-4) ;$ChangeTime_Precision = StringRight($ChangeTime,3) ElseIf $TimestampPrecision = 3 Then $ChangeTime = $ChangeTime & $PrecisionSeparator2 & _FillZero(StringRight($ChangeTime_tmp, 4)) ;$ChangeTime_Core = StringMid($ChangeTime,1,StringLen($ChangeTime)-9) ;$ChangeTime_Precision = StringRight($ChangeTime,8) Else ;$ChangeTime_Core = $ChangeTime EndIf If $IsRedo Then $TextInformation &= ";ChangeTime=" & $ChangeTime $WarningLimit = StringMid($InputData, $StartOffset + 48, 16) $WarningLimit = "0x" & _SwapEndian($WarningLimit) $HardLimit = "-" $ExceededTime = $TimestampErrorVal Case $InputDataSize = 48 $ChangeTime = StringMid($InputData, $StartOffset + 32, 16) $ChangeTime = _SwapEndian($ChangeTime) $ChangeTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $ChangeTime) $ChangeTime = _WinTime_UTCFileTimeFormat(Dec($ChangeTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $ChangeTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then ;$ChangeTime_Core = StringMid($ChangeTime,1,StringLen($ChangeTime)-4) ;$ChangeTime_Precision = StringRight($ChangeTime,3) ElseIf $TimestampPrecision = 3 Then $ChangeTime = $ChangeTime & $PrecisionSeparator2 & _FillZero(StringRight($ChangeTime_tmp, 4)) ;$ChangeTime_Core = StringMid($ChangeTime,1,StringLen($ChangeTime)-9) ;$ChangeTime_Precision = StringRight($ChangeTime,8) Else ;$ChangeTime_Core = $ChangeTime EndIf If $IsRedo Then $TextInformation &= ";ChangeTime=" & $ChangeTime $WarningLimit = "-" $HardLimit = "-" $ExceededTime = $TimestampErrorVal Case Else $ChangeTime = $TimestampErrorVal $WarningLimit = "-" $HardLimit = "-" $ExceededTime = $TimestampErrorVal EndSelect $SID = "-" If $VerboseOn Then _DumpOutput(@CRLF) _DumpOutput("$DataOffset: " & $DataOffset & @CRLF) _DumpOutput("$DataSize: " & $DataSize & @CRLF) _DumpOutput("$IndexEntrySize: " & $IndexEntrySize & @CRLF) _DumpOutput("$IndexKeySize: " & $IndexKeySize & @CRLF) _DumpOutput("$Flags: " & $Flags & @CRLF) _DumpOutput("$OwnerId: " & $OwnerId & @CRLF) _DumpOutput("$Version: " & $Version & @CRLF) _DumpOutput("$Flags2Text: " & $Flags2Text & @CRLF) _DumpOutput("$BytesUsed: " & $BytesUsed & @CRLF) _DumpOutput("$ChangeTime: " & $ChangeTime & @CRLF) _DumpOutput("$WarningLimit: " & $WarningLimit & @CRLF) _DumpOutput("$HardLimit: " & $HardLimit & @CRLF) _DumpOutput("$ExceededTime: " & $ExceededTime & @CRLF) _DumpOutput("$SID: " & $SID & @CRLF) EndIf FileWriteLine($LogFileQuotaQCsv, $RecordOffset&$de&$this_lsn&$de&$IndexEntrySize&$de&$IndexKeySize&$de&$Flags&$de&$OwnerId&$de&$Version&$de&$Flags2Text&$de&$BytesUsed&$de&$ChangeTime&$de&$WarningLimit&$de&$HardLimit&$de&$ExceededTime&$de&$SID&$de&$IsRedo&@crlf) EndFunc Func _GetReparseType($ReparseType) ;winnt.h ;ntifs.h Select Case $ReparseType = '0x00000000' Return 'RESERVED_ZERO' Case $ReparseType = '0x00000001' Return 'RESERVED_ONE' Case $ReparseType = '0x00000002' Return 'RESERVED_TWO' Case $ReparseType = '0x80000005' Return 'DRIVER_EXTENDER' Case $ReparseType = '0x80000006' Return 'HSM2' Case $ReparseType = '0x80000007' Return 'SIS' Case $ReparseType = '0x80000008' Return 'WIM' Case $ReparseType = '0x80000009' Return 'CSV' Case $ReparseType = '0x8000000A' Return 'DFS' Case $ReparseType = '0x8000000B' Return 'FILTER_MANAGER' Case $ReparseType = '0x80000012' Return 'DFSR' Case $ReparseType = '0x80000013' Return 'DEDUP' Case $ReparseType = '0x80000014' Return 'NFS' Case $ReparseType = '0x80000015' Return 'FILE_PLACEHOLDER' Case $ReparseType = '0x80000017' Return 'WOF' Case $ReparseType = '0x80000018' Return 'WCI' Case $ReparseType = '0x80000019' Return 'GLOBAL_REPARSE' Case $ReparseType = '0x8000001B' Return 'APPEXECLINK' Case $ReparseType = '0x8000001E' Return 'HFS' Case $ReparseType = '0x80000020' Return 'UNHANDLED' Case $ReparseType = '0x80000021' Return 'ONEDRIVE' Case $ReparseType = '0x9000001A' Return 'CLOUD' Case $ReparseType = '0x9000101A' Return 'CLOUD_ROOT' Case $ReparseType = '0x9000201A' Return 'CLOUD_ON_DEMAND' Case $ReparseType = '0x9000301A' Return 'CLOUD_ROOT_ON_DEMAND' Case $ReparseType = '0x9000001C' Return 'GVFS' Case $ReparseType = '0xA0000003' Return 'MOUNT_POINT' Case $ReparseType = '0xA000000C' Return 'SYMLINK' Case $ReparseType = '0xA0000010' Return 'IIS_CACHE' Case $ReparseType = '0xA0000019' Return 'GLOBAL_REPARSE' Case $ReparseType = '0xA000001D' Return 'LX_SYMLINK' Case $ReparseType = '0xA000001F' Return 'WCI_TOMBSTONE' Case $ReparseType = '0xA0000022' Return 'GVFS_TOMBSTONE' Case $ReparseType = '0xC0000004' Return 'HSM' Case $ReparseType = '0xC0000014' Return 'APPXSTRM' Case Else Return 'UNKNOWN(' & $ReparseType & ')' EndSelect EndFunc Func _ExtractResidentUpdates($InputData,$IsRedo) If $IsRedo Then $OutResident = $ParserOutDir&"\ResidentExtract\MFT("&$PredictedRefNumber&")_0x"&Hex(Int($record_offset_in_mft),4)&"_0x"&Hex(Int($attribute_offset),4)&"_LSN("&$this_lsn&")redo.bin" Else $OutResident = $ParserOutDir&"\ResidentExtract\MFT("&$PredictedRefNumber&")_0x"&Hex(Int($record_offset_in_mft),4)&"_0x"&Hex(Int($attribute_offset),4)&"_LSN("&$this_lsn&")undo.bin" EndIf $hFileOutResident = FileOpen($OutResident,18) If $VerboseOn Then _DumpOutput("_ExtractResidentUpdates(): " & @CRLF) _DumpOutput("$OutResident: " & $OutResident & @CRLF) _DumpOutput("$hFileOutResident: " & $hFileOutResident & @CRLF) EndIf FileWrite($hFileOutResident,"0x"&$InputData) FileClose($hFileOutResident) EndFunc Func _Get_DataName($MFTEntry) Local $DT_NameLength, $DT_NameRelativeOffset, $DT_Name, $DT_Offset=1 $DT_NameLength = Dec(StringMid($MFTEntry, $DT_Offset + 18, 2)) $DT_NameRelativeOffset = StringMid($MFTEntry, $DT_Offset + 20, 4) $DT_NameRelativeOffset = Dec(_SwapEndian($DT_NameRelativeOffset),2) If $DT_NameLength > 0 Then ;$DT_NameSpace = $DT_NameLength - 1 $DT_Name = StringMid($MFTEntry, $DT_Offset + ($DT_NameRelativeOffset * 2), $DT_NameLength*4) $DT_Name = BinaryToString("0x"&$DT_Name,2) $DT_Name = StringReplace($DT_Name,$de,$CharReplacement) EndIf If $VerboseOn Then _DumpOutput("_Get_DataName():" & @CRLF) _DumpOutput("$DT_NameLength: " & $DT_NameLength & @CRLF) _DumpOutput("$DT_NameRelativeOffset: " & $DT_NameRelativeOffset & @CRLF) _DumpOutput("$DT_Name: " & $DT_Name & @CRLF) EndIf Return $DT_Name EndFunc Func _WriteCSVHeaderFileNames() $FileNames_Csv_Header = "Offset"&$de&"lf_LSN"&$de&"MftRef"&$de&"MftRefSeqNo"&$de&"FileName" FileWriteLine($LogFileFileNamesCsv, $FileNames_Csv_Header & @CRLF) EndFunc ;Func _Decode_TXF_DATA($InputData,$IsRedo) Func _Decode_TXF_DATA($InputData) Local $Counter=1, $replacechars = "" $StartOffset = 1 $InputDataSize = StringLen($InputData) If $VerboseOn Then _DumpOutput("_Decode_TXF_DATA():" & @CRLF) _DumpOutput("$this_lsn: " & $this_lsn & @CRLF) _DumpOutput("$InputDataSize: " & $InputDataSize/2 & @CRLF) _DumpOutput(_HexEncode("0x"&$InputData) & @CRLF) EndIf $TextInformation &= ";See LogFile_TxfData.csv" If Mod($InputDataSize,16) Then While 1 $InputData = "0" & $InputData $Counter += 1 $replacechars &= "-" If Mod(StringLen($InputData),16) = 0 Then ExitLoop WEnd EndIf ; If $Counter > 1 Then $TextInformation &= ";Partial update" If $InputDataSize < 112 Then $TextInformation &= ";Partial update" Select Case $InputDataSize < 113 And $InputDataSize > 96 $MftRef_RM_Root = StringMid($InputData, $StartOffset, 12) $MftRef_RM_Root = Dec(_SwapEndian($MftRef_RM_Root),2) $MftRefSeqNo_RM_Root = StringMid($InputData, $StartOffset + 12, 4) $MftRefSeqNo_RM_Root = Dec(_SwapEndian($MftRefSeqNo_RM_Root),2) $UsnIndex = StringMid($InputData, $StartOffset + 16, 16) $UsnIndex = "0x"&_SwapEndian($UsnIndex) ;Increments with 1. The last TxfFileId is referenced in $Tops standard $DATA stream at offset 0x28 $TxfFileId = StringMid($InputData, $StartOffset + 32, 16) $TxfFileId = "0x"&_SwapEndian($TxfFileId) ;Offset into $TxfLogContainer00000000000000000001 $LsnUserData = StringMid($InputData, $StartOffset + 48, 16) $LsnUserData = "0x"&_SwapEndian($LsnUserData) ;Offset into $TxfLogContainer00000000000000000001 $LsnNtfsMetadata = StringMid($InputData, $StartOffset + 64, 16) $LsnNtfsMetadata = "0x"&_SwapEndian($LsnNtfsMetadata) $LsnDirectoryIndex = StringMid($InputData, $StartOffset + 80, 16) $LsnDirectoryIndex = "0x"&_SwapEndian($LsnDirectoryIndex) $UnknownFlag = StringMid($InputData, $StartOffset + 96, 16) $UnknownFlag = "0x"&_SwapEndian($UnknownFlag) Case $InputDataSize < 97 And $InputDataSize > 80 $StartOffset = -15 $MftRef_RM_Root = "-" $MftRefSeqNo_RM_Root = "-" $UsnIndex = StringMid($InputData, $StartOffset + 16, 16) $UsnIndex = _SwapEndian($UsnIndex) $UsnIndex = StringMid($UsnIndex,1,StringLen($UsnIndex)-($Counter-1)) & $replacechars $UsnIndex = "0x" & $UsnIndex $TxfFileId = StringMid($InputData, $StartOffset + 32, 16) $TxfFileId = "0x"&_SwapEndian($TxfFileId) $LsnUserData = StringMid($InputData, $StartOffset + 48, 16) $LsnUserData = "0x"&_SwapEndian($LsnUserData) $LsnNtfsMetadata = StringMid($InputData, $StartOffset + 64, 16) $LsnNtfsMetadata = "0x"&_SwapEndian($LsnNtfsMetadata) $LsnDirectoryIndex = StringMid($InputData, $StartOffset + 80, 16) $LsnDirectoryIndex = "0x"&_SwapEndian($LsnDirectoryIndex) $UnknownFlag = StringMid($InputData, $StartOffset + 96, 16) $UnknownFlag = "0x"&_SwapEndian($UnknownFlag) Case $InputDataSize < 81 And $InputDataSize > 64 $StartOffset = -31 $MftRef_RM_Root = "-" $MftRefSeqNo_RM_Root = "-" $UsnIndex = "-" $TxfFileId = StringMid($InputData, $StartOffset + 32, 16) $TxfFileId = _SwapEndian($TxfFileId) $TxfFileId = StringMid($TxfFileId,1,StringLen($TxfFileId)-($Counter-1)) & $replacechars $TxfFileId = "0x" & $TxfFileId $LsnUserData = StringMid($InputData, $StartOffset + 48, 16) $LsnUserData = "0x"&_SwapEndian($LsnUserData) $LsnNtfsMetadata = StringMid($InputData, $StartOffset + 64, 16) $LsnNtfsMetadata = "0x"&_SwapEndian($LsnNtfsMetadata) $LsnDirectoryIndex = StringMid($InputData, $StartOffset + 80, 16) $LsnDirectoryIndex = "0x"&_SwapEndian($LsnDirectoryIndex) $UnknownFlag = StringMid($InputData, $StartOffset + 96, 16) $UnknownFlag = "0x"&_SwapEndian($UnknownFlag) Case $InputDataSize < 65 And $InputDataSize > 48 $StartOffset = -47 $MftRef_RM_Root = "-" $MftRefSeqNo_RM_Root = "-" $UsnIndex = "-" $TxfFileId = "-" $LsnUserData = StringMid($InputData, $StartOffset + 48, 16) $LsnUserData = _SwapEndian($LsnUserData) $LsnUserData = StringMid($LsnUserData,1,StringLen($LsnUserData)-($Counter-1)) & $replacechars $LsnUserData = "0x" & $LsnUserData $LsnNtfsMetadata = StringMid($InputData, $StartOffset + 64, 16) $LsnNtfsMetadata = "0x"&_SwapEndian($LsnNtfsMetadata) $LsnDirectoryIndex = StringMid($InputData, $StartOffset + 80, 16) $LsnDirectoryIndex = "0x"&_SwapEndian($LsnDirectoryIndex) $UnknownFlag = StringMid($InputData, $StartOffset + 96, 16) $UnknownFlag = "0x"&_SwapEndian($UnknownFlag) Case $InputDataSize < 49 And $InputDataSize > 32 $StartOffset = -63 $MftRef_RM_Root = "-" $MftRefSeqNo_RM_Root = "-" $UsnIndex = "-" $TxfFileId = "-" $LsnUserData = "-" $LsnNtfsMetadata = StringMid($InputData, $StartOffset + 64, 16) $LsnNtfsMetadata = _SwapEndian($LsnNtfsMetadata) $LsnNtfsMetadata = StringMid($LsnNtfsMetadata,1,StringLen($LsnNtfsMetadata)-($Counter-1)) & $replacechars $LsnNtfsMetadata = "0x" & $LsnNtfsMetadata $LsnDirectoryIndex = StringMid($InputData, $StartOffset + 80, 16) $LsnDirectoryIndex = "0x"&_SwapEndian($LsnDirectoryIndex) $UnknownFlag = StringMid($InputData, $StartOffset + 96, 16) $UnknownFlag = "0x"&_SwapEndian($UnknownFlag) Case $InputDataSize < 33 And $InputDataSize > 16 $StartOffset = -79 $MftRef_RM_Root = "-" $MftRefSeqNo_RM_Root = "-" $UsnIndex = "-" $TxfFileId = "-" $LsnUserData = "-" $LsnNtfsMetadata = "-" $LsnDirectoryIndex = StringMid($InputData, $StartOffset + 80, 16) $LsnDirectoryIndex = _SwapEndian($LsnDirectoryIndex) $LsnDirectoryIndex = StringMid($LsnDirectoryIndex,1,StringLen($LsnDirectoryIndex)-($Counter-1)) & $replacechars $LsnDirectoryIndex = "0x" & $LsnDirectoryIndex $UnknownFlag = StringMid($InputData, $StartOffset + 96, 16) $UnknownFlag = "0x"&_SwapEndian($UnknownFlag) Case Else $MftRef_RM_Root = "-" $MftRefSeqNo_RM_Root = "-" $UsnIndex = "-" $TxfFileId = "-" $LsnUserData = "-" $LsnNtfsMetadata = "-" $LsnDirectoryIndex = "-" $UnknownFlag = "-" EndSelect If $VerboseOn Then _DumpOutput("$MftRef_RM_Root: " & $MftRef_RM_Root & @CRLF) _DumpOutput("$MftRefSeqNo_RM_Root: " & $MftRefSeqNo_RM_Root & @CRLF) _DumpOutput("$UsnIndex: " & $UsnIndex & @CRLF) _DumpOutput("$TxfFileId: " & $TxfFileId & @CRLF) _DumpOutput("$LsnUserData: " & $LsnUserData & @CRLF) _DumpOutput("$LsnNtfsMetadata: " & $LsnNtfsMetadata & @CRLF) _DumpOutput("$LsnDirectoryIndex: " & $LsnDirectoryIndex & @CRLF) EndIf FileWriteLine($LogFileTxfDataCsv, $RecordOffset&$de&$PredictedRefNumber&$de&$this_lsn&$de&$MftRef_RM_Root&$de&$MftRefSeqNo_RM_Root&$de&$UsnIndex&$de&$TxfFileId&$de&$LsnUserData&$de&$LsnNtfsMetadata&$de&$LsnDirectoryIndex&$de&$UnknownFlag) EndFunc Func _WriteCSVHeaderTxfData() $TxfData_Csv_Header = "Offset"&$de&"MftRef"&$de&"lf_LSN"&$de&"MftRef_RM_Root"&$de&"MftRefSeqNo_RM_Root"&$de&"UsnIndex"&$de&"TxfFileId"&$de&"LsnUserData"&$de&"LsnNtfsMetadata"&$de&"LsnDirectoryIndex"&$de&"UnknownFlag" FileWriteLine($LogFileTxfDataCsv, $TxfData_Csv_Header & @CRLF) EndFunc Func _ExtractResidentUpdatesEa($InputData,$EaName) $OutResident = $ParserOutDir&"\ResidentExtract\MFT("&$PredictedRefNumber&")_EaName("&$EaName&")_LSN("&$this_lsn&").bin" $hFileOutResident = FileOpen($OutResident,18) If $VerboseOn Then _DumpOutput("_ExtractResidentUpdates(): " & @CRLF) _DumpOutput("$OutResident: " & $OutResident & @CRLF) _DumpOutput("$hFileOutResident: " & $hFileOutResident & @CRLF) EndIf FileWrite($hFileOutResident,"0x"&$InputData) FileClose($hFileOutResident) EndFunc #cs Global $EaNonResidentArray[1][9] $EaNonResidentArray[0][0] = "MFTRef" $EaNonResidentArray[0][1] = "EntrySize" $EaNonResidentArray[0][2] = "EntryName" $EaNonResidentArray[0][3] = "Written" $EaNonResidentArray[0][4] = "LSN" $EaNonResidentArray[0][5] = "target_attribute" $EaNonResidentArray[0][6] = "MftClusterIndex" $EaNonResidentArray[0][7] = "target_vcn" $EaNonResidentArray[0][8] = "OutputFileName" #ce Func _Get_Ea_NonResident($Entry) Local $LocalAttributeOffset=1,$OffsetToNextEa=0,$EaName,$EaFlags,$EaNameLength,$EaValueLength,$EaCounter=0,$EaOutputFilename,$DoneParsing=0 ;Local $BytesProcessed=0 If $VerboseOn Then _DumpOutput("_Get_Ea_NonResident()" & @crlf) _DumpOutput("$this_lsn: " & $this_lsn & @crlf) _DumpOutput("$RealMftRef: " & $RealMftRef & @crlf) _DumpOutput("$target_attribute: " & $target_attribute & @crlf) _DumpOutput("$MftClusterIndex: " & $MftClusterIndex & @crlf) _DumpOutput("$target_vcn: " & $target_vcn & @crlf) _DumpOutput(_HexEncode("0x"&$Entry) & @crlf) EndIf $StringLengthInput = StringLen($Entry) $BinaryLengthInput = $StringLengthInput/2 $FoundInTable = _ArraySearch($EaNonResidentArray,$RealMftRef,0,0,0,2,0,0) If $FoundInTable > 0 Then ;We have an existing entry for a pair that is not completed writing to disk If $target_attribute = $EaNonResidentArray[$FoundInTable][5] And $EaNonResidentArray[$FoundInTable][1] <> $EaNonResidentArray[$FoundInTable][3] Then ;Match If $target_vcn - $EaNonResidentArray[$FoundInTable][7] <> 0 And $target_vcn - $EaNonResidentArray[$FoundInTable][7] <> 1 Then _DumpOutput("Error: target_vcn was not as expected." & @crlf) EndIf $EaCounter += 1 $EaName = $EaNonResidentArray[$FoundInTable][2] $TextInformation &= ";EaName("&$EaCounter&")="&$EaName $EaOutputFilename = $EaNonResidentArray[$FoundInTable][8] If $EaNonResidentArray[$FoundInTable][1] - $EaNonResidentArray[$FoundInTable][3] >= 4096 Then ;Write chunk (EntrySize - Written >= 4096) $BytesToWrite = $BinaryLengthInput $hFileOutNonResident = FileOpen($EaOutputFilename,17) If Not $hFileOutNonResident Then _DumpOutput("Error: FileOpen failed with @error: " & @error & @crlf) FileSetPos($hFileOutNonResident, 0, $FILE_END) FileWrite($hFileOutNonResident,"0x"&$Entry) FileClose($hFileOutNonResident) $EaNonResidentArray[$FoundInTable][3] += $BytesToWrite $EaNonResidentArray[$FoundInTable][6] = $MftClusterIndex $EaNonResidentArray[$FoundInTable][7] = $target_vcn If $BinaryLengthInput < 4096 Then ;Something wrong: not enough data _DumpOutput("Error: Chunk contained less data than expected." & @crlf) EndIf Return ElseIf $EaNonResidentArray[$FoundInTable][1] - $EaNonResidentArray[$FoundInTable][3] < 4096 Then ;write chunk + and update array for next pair $BytesToWrite = $EaNonResidentArray[$FoundInTable][1] - $EaNonResidentArray[$FoundInTable][3] $hFileOutNonResident = FileOpen($EaOutputFilename,17) If Not $hFileOutNonResident Then _DumpOutput("Error: FileOpen failed with @error: " & @error & @crlf) FileSetPos($hFileOutNonResident, 0, $FILE_END) FileWrite($hFileOutNonResident,"0x"&StringMid($Entry,$LocalAttributeOffset,($BytesToWrite*2)-4)) FileClose($hFileOutNonResident) $EaNonResidentArray[$FoundInTable][3] += $BytesToWrite If $EaNonResidentArray[$FoundInTable][1] - $EaNonResidentArray[$FoundInTable][3] = $BinaryLengthInput Then ;Finished writing everything. Return EndIf $Entry = StringMid($Entry,$LocalAttributeOffset+($BytesToWrite*2)-2) $StringLengthInput = StringLen($Entry) $BinaryLengthInput = $StringLengthInput/2 EndIf Else ;New $EA for same MftRef. Delete existing one?? Slack, lower lsn etc.. ; _DumpOutput("New $EA for same MftRef." & @crlf) EndIf Else ;New entry, test for valid header If $target_vcn <> 0 And $MftClusterIndex <> 0 Then _DumpOutput("Error: New entry but $target_vcn=" & $target_vcn & " and $MftClusterIndex=" & $MftClusterIndex & @crlf) EndIf EndIf Do $LocalAttributeOffset += ($OffsetToNextEa*2) If $LocalAttributeOffset >= $StringLengthInput Then ExitLoop $EaCounter+=1 $OffsetToNextEa = StringMid($Entry,$LocalAttributeOffset,8) $OffsetToNextEa = Dec(_SwapEndian($OffsetToNextEa),2) If $OffsetToNextEa > 65535 Then Return SetError(1,0,"$OffsetToNextEa="&$OffsetToNextEa) $EaFlags = Dec(StringMid($Entry,$LocalAttributeOffset+8,2)) $EaNameLength = Dec(StringMid($Entry,$LocalAttributeOffset+10,2)) $EaValueLength = StringMid($Entry,$LocalAttributeOffset+12,4) $EaValueLength = Dec(_SwapEndian($EaValueLength)) If $EaValueLength >= $OffsetToNextEa Then Return SetError(1,0,"($EaValueLength >= $OffsetToNextEa)="&($EaValueLength >= $OffsetToNextEa)&"|"&$EaValueLength&"-"&$OffsetToNextEa) $EaName = StringMid($Entry,$LocalAttributeOffset+16,$EaNameLength*2) $EaName = _HexToString($EaName) If $EaName = "" Then Return SetError(1,0,"$EaName="&$EaName) $EaOutputFilename = $ParserOutDir&"\NonResidentExtract\MFT("&$RealMftRef&")_EaName("&$EaName&")_LSN("&$this_lsn&").bin" If $LocalAttributeOffset+16+($EaNameLength*2) >= $StringLengthInput Then If $LocalAttributeOffset+16+($EaNameLength*2) > $StringLengthInput Then _DumpOutput("Error: Pair header is spread across page boundary" & @crlf) Return SetError(1,0,"Error: Pair header is spread across page boundary") EndIf _DumpOutput("Warning: Pair is spread across page boundary" & @crlf) $NewArraySize = Ubound($EaNonResidentArray)+1 ReDim $EaNonResidentArray[$NewArraySize][9] $EaNonResidentArray[$NewArraySize-1][0] = $RealMftRef $EaNonResidentArray[$NewArraySize-1][1] = 8+$EaNameLength+1+$EaValueLength $EaNonResidentArray[$NewArraySize-1][2] = $EaName $EaNonResidentArray[$NewArraySize-1][3] += 8+$EaNameLength $EaNonResidentArray[$NewArraySize-1][4] = $this_lsn $EaNonResidentArray[$NewArraySize-1][5] = $target_attribute $EaNonResidentArray[$NewArraySize-1][6] = $MftClusterIndex $EaNonResidentArray[$NewArraySize-1][7] = $target_vcn $EaNonResidentArray[$NewArraySize-1][8] = $EaOutputFilename Return EndIf $EaValue = StringMid($Entry,$LocalAttributeOffset+16+($EaNameLength*2),$EaValueLength*2) $TextInformation &= ";EaName("&$EaCounter&")="&$EaName If $VerboseOn Then _DumpOutput("_Get_Ea_NonResident():" & @CRLF) _DumpOutput("$OffsetToNextEa = " & $OffsetToNextEa & @crlf) _DumpOutput("$EaFlags = " & $EaFlags & @crlf) _DumpOutput("$EaNameLength = " & $EaNameLength & @crlf) _DumpOutput("$EaValueLength = " & $EaValueLength & @crlf) _DumpOutput("$EaName = " & $EaName & @crlf) _DumpOutput("$EaValue:" & @crlf) _DumpOutput(_HexEncode("0x"&$EaValue) & @crlf) EndIf $NewArraySize = Ubound($EaNonResidentArray)+1 ReDim $EaNonResidentArray[$NewArraySize][9] $EaNonResidentArray[$NewArraySize-1][0] = $RealMftRef $EaNonResidentArray[$NewArraySize-1][1] = 8+$EaNameLength+1+$EaValueLength $EaNonResidentArray[$NewArraySize-1][2] = $EaName If (($LocalAttributeOffset-1+16+($EaNameLength*2)+2)/2)+$EaValueLength <= $BinaryLengthInput Then $EaNonResidentArray[$NewArraySize-1][3] += 8+$EaNameLength+1+$EaValueLength Else $EaNonResidentArray[$NewArraySize-1][3] += ($StringLengthInput-$LocalAttributeOffset-1)/2 $DoneParsing=1 EndIf $EaNonResidentArray[$NewArraySize-1][4] = $this_lsn $EaNonResidentArray[$NewArraySize-1][5] = $target_attribute $EaNonResidentArray[$NewArraySize-1][6] = $MftClusterIndex $EaNonResidentArray[$NewArraySize-1][7] = $target_vcn $EaNonResidentArray[$NewArraySize-1][8] = $EaOutputFilename $hFileOutNonResident = FileOpen($EaOutputFilename,17) If Not $hFileOutNonResident Then _DumpOutput("Error: FileOpen failed with @error: " & @error & @crlf) $EaNonResidentArray[$NewArraySize-1][3] = 0 EndIf FileSetPos($hFileOutNonResident, 0, $FILE_END) FileWrite($hFileOutNonResident,"0x"&StringMid($EaValue,3,($EaValueLength*2)-2)) FileClose($hFileOutNonResident) If $DoneParsing Then ExitLoop If $OffsetToNextEa*2 >= $StringLengthInput Then ;Nothing more Return EndIf ; If ($OffsetToNextEa*2) + 18 >= $StringLengthInput Then ;Header is spread across page boundary ; _DumpOutput("Error: Header is spread across page boundary" & @crlf) ; _DumpOutput(_HexEncode("0x"&$Entry) & @crlf) ; Return ; EndIf Until $LocalAttributeOffset >= $StringLengthInput $TextInformation &= ";Search debug.log for " & $this_lsn EndFunc Func _GetInputParams() Local $TimeZone For $i = 1 To $cmdline[0] ;ConsoleWrite("Param " & $i & ": " & $cmdline[$i] & @CRLF) If StringLeft($cmdline[$i],13) = "/LogFileFile:" Then $InputLogFile = StringMid($cmdline[$i],14) If StringLeft($cmdline[$i],21) = "/LogFileFragmentFile:" Then $LogFileFragmentFile = StringMid($cmdline[$i],22) If StringLeft($cmdline[$i],12) = "/MftCsvFile:" Then $TargetMftCsvFile = StringMid($cmdline[$i],13) If StringLeft($cmdline[$i],12) = "/OutputPath:" Then $ParserOutDir = StringMid($cmdline[$i],13) If StringLeft($cmdline[$i],10) = "/TimeZone:" Then $TimeZone = StringMid($cmdline[$i],11) If StringLeft($cmdline[$i],11) = "/Separator:" Then $SeparatorInput = StringMid($cmdline[$i],12) ;If StringLeft($cmdline[$i],15) = "/QuotationMark:" Then $checkquotes = StringMid($cmdline[$i],16) If StringLeft($cmdline[$i],9) = "/Unicode:" Then $CheckUnicode = StringMid($cmdline[$i],10) If StringLeft($cmdline[$i],10) = "/TSFormat:" Then $DateTimeFormat = StringMid($cmdline[$i],11) If StringLeft($cmdline[$i],13) = "/TSPrecision:" Then $TimestampPrecision = StringMid($cmdline[$i],14) If StringLeft($cmdline[$i],22) = "/TSPrecisionSeparator:" Then $PrecisionSeparator = StringMid($cmdline[$i],23) If StringLeft($cmdline[$i],23) = "/TSPrecisionSeparator2:" Then $PrecisionSeparator2 = StringMid($cmdline[$i],24) If StringLeft($cmdline[$i],12) = "/TSErrorVal:" Then $TimestampErrorVal = StringMid($cmdline[$i],13) If StringLeft($cmdline[$i],21) = "/ReconstructDataruns:" Then $CheckReconstruct = StringMid($cmdline[$i],22) If StringLeft($cmdline[$i],21) = "/RebuildHeadersSlack:" Then $CheckBrokenHeaderRebuild = StringMid($cmdline[$i],22) If StringLeft($cmdline[$i],19) = "/SectorsPerCluster:" Then $SectorsPerCluster = StringMid($cmdline[$i],20) If StringLeft($cmdline[$i],15) = "/MftRecordSize:" Then $MFT_Record_Size = StringMid($cmdline[$i],16) If StringLeft($cmdline[$i],15) = "/LsnErrorLevel:" Then $LsnValidationLevel = StringMid($cmdline[$i],16) If StringLeft($cmdline[$i],15) = "/SourceIs32bit:" Then $Check32bit = StringMid($cmdline[$i],16) If StringLeft($cmdline[$i],20) = "/ExtractDataUpdates:" Then $CheckExtractResident = StringMid($cmdline[$i],21) If StringLeft($cmdline[$i],24) = "/ExtractDataUpdatesSize:" Then $MinSizeResidentExtraction = StringMid($cmdline[$i],25) If StringLeft($cmdline[$i],16) = "/VerboseLsnList:" Then $VerboseLsnList = StringMid($cmdline[$i],17) If StringLeft($cmdline[$i],13) = "/SkipSqlite3:" Then $CheckSkipSqlite3 = StringMid($cmdline[$i],14) If StringLeft($cmdline[$i],16) = "/VerifyFragment:" Then $VerifyFragment = StringMid($cmdline[$i],17) If StringLeft($cmdline[$i],17) = "/OutFragmentName:" Then $OutFragmentName = StringMid($cmdline[$i],18) If StringLeft($cmdline[$i],12) = "/SkipFixups:" Then $checkFixups = StringMid($cmdline[$i],13) If StringLeft($cmdline[$i],9) = "/CleanUp:" Then $CleanUp = StringMid($cmdline[$i],10) If StringLeft($cmdline[$i],15) = "/BrokenLogFile:" Then $BrokenLogFile = StringMid($cmdline[$i],16) Next If StringLen($ParserOutDir) > 0 Then If Not FileExists($ParserOutDir) Then ConsoleWrite("Error output path not found: " & $ParserOutDir & @CRLF) Exit EndIf Else $ParserOutDir = @ScriptDir EndIf If StringLen($SectorsPerCluster) > 0 Then If Not StringIsDigit($SectorsPerCluster) Or ($SectorsPerCluster <> 1 And $SectorsPerCluster <> 2 And $SectorsPerCluster <> 4 And $SectorsPerCluster <> 8 And $SectorsPerCluster <> 16 And $SectorsPerCluster <> 32 And $SectorsPerCluster <> 64 And $SectorsPerCluster <> 128) Then ConsoleWrite("Error validating sectors per cluster configuration: " & $SectorsPerCluster & @CRLF) Exit EndIf Else $SectorsPerCluster = 8 EndIf If StringLen($MFT_Record_Size) > 0 Then If $MFT_Record_Size <> 1024 And $MFT_Record_Size <> 4096 Then ConsoleWrite("Error validating MFT record size configuration: " & $MFT_Record_Size & @CRLF) Exit EndIf Else $MFT_Record_Size = 1024 EndIf If StringLen($LsnValidationLevel) > 0 Then If Not StringIsFloat($LsnValidationLevel) Or Not ($LsnValidationLevel > 0 Or $LsnValidationLevel < 1) Then ConsoleWrite("Error validating lsn validation level: " & $LsnValidationLevel & @CRLF) Exit EndIf Else $LsnValidationLevel = 0.1 EndIf If StringLen($MinSizeResidentExtraction) > 0 Then If Not StringIsDigit($MinSizeResidentExtraction) Or ($MinSizeResidentExtraction < 1 Or $MinSizeResidentExtraction > 4096) Then ;4096 is too high, but setting too low limit just impose possibility of lost extraction data ConsoleWrite("Error validating minimum size for data updates extraction: " & $MinSizeResidentExtraction & @CRLF) Exit EndIf Else $MinSizeResidentExtraction = 2 EndIf If StringLen($CheckUnicode) > 0 Then If Not StringIsDigit($CheckUnicode) Or ($CheckUnicode <> 0 And $CheckUnicode <> 1) Then ConsoleWrite("Error validating Unicode configuration: " & $CheckUnicode & @CRLF) Exit EndIf Else $CheckUnicode = 0 EndIf If StringLen($CheckSkipSqlite3) > 0 Then If Not StringIsDigit($CheckSkipSqlite3) Or ($CheckSkipSqlite3 <> 0 And $CheckSkipSqlite3 <> 1) Then ConsoleWrite("Error validating Skip of sqlite3 configuration: " & $CheckSkipSqlite3 & @CRLF) Exit EndIf Else $CheckSkipSqlite3 = 0 EndIf If StringLen($CheckReconstruct) > 0 Then If Not StringIsDigit($CheckReconstruct) Or ($CheckReconstruct <> 0 And $CheckReconstruct <> 1) Then ConsoleWrite("Error validating datarun reconstruct configuration: " & $CheckReconstruct & @CRLF) Exit EndIf Else $CheckReconstruct = 0 EndIf If StringLen($CheckBrokenHeaderRebuild) > 0 Then If Not StringIsDigit($CheckBrokenHeaderRebuild) Or ($CheckBrokenHeaderRebuild <> 0 And $CheckBrokenHeaderRebuild <> 1) Then ConsoleWrite("Error validating broken header reconstruct from slack configuration: " & $CheckBrokenHeaderRebuild & @CRLF) Exit EndIf Else $CheckBrokenHeaderRebuild = 0 EndIf If StringLen($Check32bit) > 0 Then If Not StringIsDigit($Check32bit) Or ($Check32bit <> 0 And $Check32bit <> 1) Then ConsoleWrite("Error validating Is32bit configuration: " & $Check32bit & @CRLF) Exit EndIf Else $Check32bit = 0 EndIf If StringLen($CheckExtractResident) > 0 Then If Not StringIsDigit($CheckExtractResident) Or ($CheckExtractResident <> 0 And $CheckExtractResident <> 1) Then ConsoleWrite("Error validating data updates extraction configuration: " & $CheckExtractResident & @CRLF) Exit EndIf Else $CheckExtractResident = 0 EndIf If StringLen($TimeZone) > 0 Then Select Case $TimeZone = "-12.00" Case $TimeZone = "-11.00" Case $TimeZone = "-10.00" Case $TimeZone = "-9.30" Case $TimeZone = "-9.00" Case $TimeZone = "-8.00" Case $TimeZone = "-7.00" Case $TimeZone = "-6.00" Case $TimeZone = "-5.00" Case $TimeZone = "-4.30" Case $TimeZone = "-4.00" Case $TimeZone = "-3.30" Case $TimeZone = "-3.00" Case $TimeZone = "-2.00" Case $TimeZone = "-1.00" Case $TimeZone = "0.00" Case $TimeZone = "1.00" Case $TimeZone = "2.00" Case $TimeZone = "3.00" Case $TimeZone = "3.30" Case $TimeZone = "4.00" Case $TimeZone = "4.30" Case $TimeZone = "5.00" Case $TimeZone = "5.30" Case $TimeZone = "5.45" Case $TimeZone = "6.00" Case $TimeZone = "6.30" Case $TimeZone = "7.00" Case $TimeZone = "8.00" Case $TimeZone = "8.45" Case $TimeZone = "9.00" Case $TimeZone = "9.30" Case $TimeZone = "10.00" Case $TimeZone = "10.30" Case $TimeZone = "11.00" Case $TimeZone = "11.30" Case $TimeZone = "12.00" Case $TimeZone = "12.45" Case $TimeZone = "13.00" Case $TimeZone = "14.00" Case Else $TimeZone = "0.00" EndSelect Else $TimeZone = "0.00" EndIf $tDelta = _GetUTCRegion($TimeZone)-$tDelta If @error Then ConsoleWrite("Error: Timezone configuration failed." & @CRLF) Else ConsoleWrite("Timestamps presented in UTC: " & $UTCconfig & @CRLF) EndIf $tDelta = $tDelta*-1 If StringLen($InputLogFile) > 0 Then If Not FileExists($InputLogFile) Then ConsoleWrite("Error input $LogFile file does not exist." & @CRLF) Exit EndIf EndIf If StringLen($VerifyFragment) > 0 Then If $VerifyFragment <> 1 Then $VerifyFragment = 0 EndIf EndIf If StringLen($OutFragmentName) > 0 Then If StringInStr($OutFragmentName,"\") Then ConsoleWrite("Error: OutFragmentName must be a filename and not a path." & @CRLF) Exit EndIf EndIf If StringLen($LogFileFragmentFile) > 0 Then If Not FileExists($LogFileFragmentFile) Then ConsoleWrite("Error input $LogFileFragmentFile does not exist." & @CRLF) Exit EndIf $FragmentMode=1 EndIf If StringLen($TargetMftCsvFile) > 0 Then If Not FileExists($TargetMftCsvFile) Then ConsoleWrite("Error input MFT csv file does not exist." & @CRLF) Exit EndIf EndIf If StringLen($PrecisionSeparator) <> 1 Then $PrecisionSeparator = "." If StringLen($SeparatorInput) <> 1 Then $SeparatorInput = "|" If StringLen($TimestampPrecision) > 0 Then Select Case $TimestampPrecision = "None" ConsoleWrite("Timestamp Precision: " & $TimestampPrecision & @CRLF) $TimestampPrecision = 1 Case $TimestampPrecision = "MilliSec" ConsoleWrite("Timestamp Precision: " & $TimestampPrecision & @CRLF) $TimestampPrecision = 2 Case $TimestampPrecision = "NanoSec" ConsoleWrite("Timestamp Precision: " & $TimestampPrecision & @CRLF) $TimestampPrecision = 3 EndSelect Else $TimestampPrecision = 1 EndIf If StringLen($DateTimeFormat) > 0 Then If $DateTimeFormat <> 1 And $DateTimeFormat <> 2 And $DateTimeFormat <> 3 And $DateTimeFormat <> 4 And $DateTimeFormat <> 5 And $DateTimeFormat <> 6 Then $DateTimeFormat = 6 EndIf Else $DateTimeFormat = 6 EndIf If StringLen($CleanUp) > 0 Then If $CleanUp <> 1 Then $CleanUp = 0 EndIf EndIf If StringLen($BrokenLogFile) > 0 Then If $BrokenLogFile <> 1 Then $BrokenLogFile = 0 EndIf EndIf EndFunc Func _Decode_UpdateFileName($attribute,$IsRedo) Local $SI_CTime_tmp, $SI_ATime_tmp, $SI_MTime_tmp, $SI_RTime_tmp If Not $IsRedo Then Local $SI_CTime, $SI_ATime, $SI_MTime, $SI_RTime, $FN_AllocSize, $FN_RealSize, $FN_Flags, $ReparseTag EndIf $SI_CTime = StringMid($attribute, 1, 16) $SI_CTime = _SwapEndian($SI_CTime) $SI_CTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_CTime) ; $SI_CTime = _WinTime_UTCFileTimeFormat(Dec($SI_CTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_CTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_CTime_Core = StringMid($SI_CTime,1,StringLen($SI_CTime)-4) $SI_CTime_Precision = StringRight($SI_CTime,3) ElseIf $TimestampPrecision = 3 Then $SI_CTime = $SI_CTime & $PrecisionSeparator2 & _FillZero(StringRight($SI_CTime_tmp, 4)) $SI_CTime_Core = StringMid($SI_CTime,1,StringLen($SI_CTime)-9) $SI_CTime_Precision = StringRight($SI_CTime,8) Else $SI_CTime_Core = $SI_CTime EndIf ; $SI_ATime = StringMid($attribute, 17, 16) $SI_ATime = _SwapEndian($SI_ATime) $SI_ATime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_ATime) ; $SI_ATime = _WinTime_UTCFileTimeFormat(Dec($SI_ATime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_ATime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_ATime_Core = StringMid($SI_ATime,1,StringLen($SI_ATime)-4) $SI_ATime_Precision = StringRight($SI_ATime,3) ElseIf $TimestampPrecision = 3 Then $SI_ATime = $SI_ATime & $PrecisionSeparator2 & _FillZero(StringRight($SI_ATime_tmp, 4)) $SI_ATime_Core = StringMid($SI_ATime,1,StringLen($SI_ATime)-9) $SI_ATime_Precision = StringRight($SI_ATime,8) Else $SI_ATime_Core = $SI_ATime EndIf ; $SI_MTime = StringMid($attribute, 33, 16) $SI_MTime = _SwapEndian($SI_MTime) $SI_MTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_MTime) ; $SI_MTime = _WinTime_UTCFileTimeFormat(Dec($SI_MTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_MTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_MTime_Core = StringMid($SI_MTime,1,StringLen($SI_MTime)-4) $SI_MTime_Precision = StringRight($SI_MTime,3) ElseIf $TimestampPrecision = 3 Then $SI_MTime = $SI_MTime & $PrecisionSeparator2 & _FillZero(StringRight($SI_MTime_tmp, 4)) $SI_MTime_Core = StringMid($SI_MTime,1,StringLen($SI_MTime)-9) $SI_MTime_Precision = StringRight($SI_MTime,8) Else $SI_MTime_Core = $SI_MTime EndIf ; $SI_RTime = StringMid($attribute, 49, 16) $SI_RTime = _SwapEndian($SI_RTime) $SI_RTime_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $SI_RTime) ; $SI_RTime = _WinTime_UTCFileTimeFormat(Dec($SI_RTime,2) - $tDelta, $DateTimeFormat, $TimestampPrecision) If @error Then $SI_RTime = $TimestampErrorVal ElseIf $TimestampPrecision = 2 Then $SI_RTime_Core = StringMid($SI_RTime,1,StringLen($SI_RTime)-4) $SI_RTime_Precision = StringRight($SI_RTime,3) ElseIf $TimestampPrecision = 3 Then $SI_RTime = $SI_RTime & $PrecisionSeparator2 & _FillZero(StringRight($SI_RTime_tmp, 4)) $SI_RTime_Core = StringMid($SI_RTime,1,StringLen($SI_RTime)-9) $SI_RTime_Precision = StringRight($SI_RTime,8) Else $SI_RTime_Core = $SI_RTime EndIf ; $FN_AllocSize = StringMid($attribute, 65, 16) $FN_AllocSize = Dec(_SwapEndian($FN_AllocSize),2) $FN_RealSize = StringMid($attribute, 81, 16) $FN_RealSize = Dec(_SwapEndian($FN_RealSize),2) $FN_Flags = StringMid($attribute, 97, 8) $FN_Flags = _SwapEndian($FN_Flags) $FN_Flags = _File_Attributes("0x" & $FN_Flags) $ReparseTag = StringMid($attribute,105,8) $ReparseTag = _SwapEndian($ReparseTag) $ReparseTag = _GetReparseType("0x"&$ReparseTag) If $VerboseOn Then _DumpOutput("_Decode_UpdateFileName()" & @CRLF) _DumpOutput("$SI_CTime: " & $SI_CTime & @CRLF) _DumpOutput("$SI_ATime: " & $SI_ATime & @CRLF) _DumpOutput("$SI_MTime: " & $SI_MTime & @CRLF) _DumpOutput("$SI_RTime: " & $SI_RTime & @CRLF) _DumpOutput("$FN_AllocSize: " & $FN_AllocSize & @CRLF) _DumpOutput("$FN_RealSize: " & $FN_RealSize & @CRLF) _DumpOutput("$FN_Flags: " & $FN_Flags & @CRLF) _DumpOutput("$ReparseTag: " & $ReparseTag & @CRLF) _DumpOutput("$Isredo: " & $Isredo & @CRLF) EndIf If $IsRedo Then ; If $ReparseTag <> "ZERO" Then $TextInformation &= ";ReparseTag="&$ReparseTag $TextInformation &= ";See LogFile_UpdateFileName_I30.csv" EndIf FileWriteLine($LogFileUpdateFileNameCsv, $RecordOffset & $de & $this_lsn & $de & $SI_CTime & $de & $SI_ATime & $de & $SI_MTime & $de & $SI_RTime & $de & $FN_AllocSize & $de & $FN_RealSize & $de & $FN_Flags & $de & $ReparseTag & $de & $IsRedo & @crlf) EndFunc Func _SQLite_Startup2($sDll_Filename) Local $hDll = DllOpen($sDll_Filename) If $hDll = -1 Then ;$g_hDll_SQLite = 0 $__g_hDll_SQLite = $hDll = 0 Return SetError(1, 0, "") Else ;$g_hDll_SQLite = $hDll $__g_hDll_SQLite = $hDll Return $sDll_Filename EndIf EndFunc Func ExitPgm() Exit EndFunc Func _WriteCSVHeaderCheckpointRecord() $CheckpointRecord_Csv_Header = "lf_LSN"&$de&"LSN_Checkpoint"&$de&"LSN_OpenAttributeTableDump"&$de&"LSN_AttributeNamesDump"&$de&"LSN_DirtyPageTableDump"&$de&"LSN_TransactionTableDump"&$de&"Size_OpenAttributeTableDump"&$de&"Size_AttributeNamesDump"&$de&"Size_DirtyPageTableDump"&$de&"Size_TransactionTableDump"&$de&"UsnJrnl_RealSize"&$de&"Unknown6"&$de&"LSN_FlushCache"&$de&"BytesPerCluster"&$de&"Unknown8"&$de&"UsnJrnl_MftRef"&$de&"UsnJrnl_MftRefSeqNo"&$de&"Unknown9"&$de&"LSN7" FileWriteLine($LogFileCheckpointRecordCsv, $CheckpointRecord_Csv_Header & @CRLF) EndFunc Func _Decode_CheckpointRecord($InputData) Local $LSN_Checkpoint,$LSN_OpenAttributeTableDump,$LSN_AttributeNamesDump,$LSN_DirtyPageTableDump,$LSN_TransactionTableDump,$Size_OpenAttributeTableDump,$Size_AttributeNamesDump,$Size_DirtyPageTableDump,$Size_TransactionTableDump,$UsnjrnlRealSize Local $Unknown6,$LSN_FlushCache,$Unknown7,$Unknown8,$UsnJrnlMftRef,$UsnjrnlMftrefSeqNo,$Unknown9,$LSN7 Local $StartOffset = 1 $LSN_Checkpoint = StringMid($InputData, $StartOffset, 16) $LSN_Checkpoint = _SwapEndian($LSN_Checkpoint) $LSN_Checkpoint = Dec($LSN_Checkpoint,2) $LSN_OpenAttributeTableDump = StringMid($InputData, $StartOffset + 16, 16) $LSN_OpenAttributeTableDump = _SwapEndian($LSN_OpenAttributeTableDump) $LSN_OpenAttributeTableDump = Dec($LSN_OpenAttributeTableDump,2) $LSN_AttributeNamesDump = StringMid($InputData, $StartOffset + 32, 16) $LSN_AttributeNamesDump = _SwapEndian($LSN_AttributeNamesDump) $LSN_AttributeNamesDump = Dec($LSN_AttributeNamesDump,2) $LSN_DirtyPageTableDump = StringMid($InputData, $StartOffset + 48, 16) $LSN_DirtyPageTableDump = _SwapEndian($LSN_DirtyPageTableDump) $LSN_DirtyPageTableDump = Dec($LSN_DirtyPageTableDump,2) $LSN_TransactionTableDump = StringMid($InputData, $StartOffset + 64, 16) $LSN_TransactionTableDump = _SwapEndian($LSN_TransactionTableDump) $LSN_TransactionTableDump = Dec($LSN_TransactionTableDump,2) $Size_OpenAttributeTableDump = StringMid($InputData, $StartOffset + 80, 8) $Size_OpenAttributeTableDump = _SwapEndian($Size_OpenAttributeTableDump) $Size_OpenAttributeTableDump = Dec($Size_OpenAttributeTableDump,2) $Size_AttributeNamesDump = StringMid($InputData, $StartOffset + 88, 8) $Size_AttributeNamesDump = _SwapEndian($Size_AttributeNamesDump) $Size_AttributeNamesDump = Dec($Size_AttributeNamesDump,2) $Size_DirtyPageTableDump = StringMid($InputData, $StartOffset + 96, 8) $Size_DirtyPageTableDump = _SwapEndian($Size_DirtyPageTableDump) $Size_DirtyPageTableDump = Dec($Size_DirtyPageTableDump,2) $Size_TransactionTableDump = StringMid($InputData, $StartOffset + 104, 8) $Size_TransactionTableDump = _SwapEndian($Size_TransactionTableDump) $Size_TransactionTableDump = Dec($Size_TransactionTableDump,2) $UsnjrnlRealSize = StringMid($InputData, $StartOffset + 112, 8) $UsnjrnlRealSize = _SwapEndian($UsnjrnlRealSize) $UsnjrnlRealSize = Dec($UsnjrnlRealSize,2) $Unknown6 = StringMid($InputData, $StartOffset + 120, 8) $Unknown6 = _SwapEndian($Unknown6) $Unknown6 = Dec($Unknown6,2) $LSN_FlushCache = StringMid($InputData, $StartOffset + 128, 16) $LSN_FlushCache = _SwapEndian($LSN_FlushCache) $LSN_FlushCache = Dec($LSN_FlushCache,2) $Unknown7 = StringMid($InputData, $StartOffset + 144, 8) $Unknown7 = _SwapEndian($Unknown7) $Unknown7 = Dec($Unknown7,2) $Unknown8 = StringMid($InputData, $StartOffset + 152, 8) $Unknown8 = _SwapEndian($Unknown8) $Unknown8 = Dec($Unknown8,2) $UsnJrnlMftRef = StringMid($InputData, $StartOffset + 160, 12) $UsnJrnlMftRef = _SwapEndian($UsnJrnlMftRef) $UsnJrnlMftRef = Dec($UsnJrnlMftRef,2) $UsnJrnlMftrefSeqNo = StringMid($InputData, $StartOffset + 172, 4) $UsnJrnlMftrefSeqNo = _SwapEndian($UsnJrnlMftrefSeqNo) $UsnJrnlMftrefSeqNo = Dec($UsnJrnlMftrefSeqNo,2) $Unknown9 = StringMid($InputData, $StartOffset + 176, 16) $Unknown9 = _SwapEndian($Unknown9) $Unknown9 = Dec($Unknown9,2) $LSN7 = StringMid($InputData, $StartOffset + 192, 16) $LSN7 = _SwapEndian($LSN7) $LSN7 = Dec($LSN7,2) FileWriteLine($LogFileCheckpointRecordCsv, $this_lsn&$de&$LSN_Checkpoint&$de&$LSN_OpenAttributeTableDump&$de&$LSN_AttributeNamesDump&$de&$LSN_DirtyPageTableDump&$de&$LSN_TransactionTableDump&$de&$Size_OpenAttributeTableDump&$de&$Size_AttributeNamesDump&$de&$Size_DirtyPageTableDump&$de&$Size_TransactionTableDump&$de&$UsnjrnlRealSize&$de&$Unknown6&$de&$LSN_FlushCache&$de&$Unknown7&$de&$Unknown8&$de&$UsnJrnlMftRef&$de&$UsnJrnlMftrefSeqNo&$de&$Unknown9&$de&$LSN7 & @CRLF) EndFunc Func _WriteOutputFragment() Local $nBytes, $Offset $Size = BinaryLen($RebuiltFragment) $Size2 = $Size If Mod($Size,0x1000) Then ConsoleWrite("SizeOf $RebuiltFragment: " & $Size & @CRLF) While 1 $RebuiltFragment &= "00" $Size2 += 1 If Mod($Size2,0x1000) = 0 Then ExitLoop WEnd ConsoleWrite("Corrected SizeOf $RebuiltFragment: " & $Size2 & @CRLF) EndIf Local $tBuffer = DllStructCreate("byte[" & $Size2 & "]") DllStructSetData($tBuffer,1,$RebuiltFragment) If @error Then Return SetError(1) Local $OutFile = $ParserOutDir & "\" & $OutFragmentName If Not FileExists($OutFile) Then $Offset = 0 Else $Offset = FileGetSize($OutFile) EndIf Local $hFileOut = _WinAPI_CreateFile("\\.\" & $OutFile,3,6,7) If Not $hFileOut Then Return SetError(1) _WinAPI_SetFilePointerEx($hFileOut, $Offset, $FILE_BEGIN) If Not _WinAPI_WriteFile($hFileOut, DllStructGetPtr($tBuffer), DllStructGetSize($tBuffer), $nBytes) Then Return SetError(1) _WinAPI_CloseHandle($hFileOut) EndFunc Func _WriteObjectIdCsvHeader() $ObjectId_Csv_Header = "MftRef"&$de&"MftRefSeqNo"&$de&"ObjectId"&$de&"ObjectId_Version"&$de&"ObjectId_Timestamp"&$de&"ObjectId_TimestampDec"&$de&"ObjectId_ClockSeq"&$de&"ObjectId_Node"&$de&"BirthVolumeId"&$de&"BirthVolumeId_Version"&$de&"BirthVolumeId_Timestamp"&$de&"BirthVolumeId_TimestampDec"&$de&"BirthVolumeId_ClockSeq"&$de&"BirthVolumeId_Node"&$de&"BirthObjectId"&$de&"BirthObjectId_Version"&$de&"BirthObjectId_Timestamp"&$de&"BirthObjectId_TimestampDec"&$de&"BirthObjectId_ClockSeq"&$de&"BirthObjectId_Node"&$de&"DomainId"&$de&"DomainId_Version"&$de&"DomainId_Timestamp"&$de&"DomainId_TimestampDec"&$de&"DomainId_ClockSeq"&$de&"DomainId_Node" FileWriteLine($LogFileEntriesObjectIdCsvFile, $ObjectId_Csv_Header & @CRLF) EndFunc Func _DecodeMacFromGuid($Input) If StringLen($Input) <> 12 Then Return SetError(1) Local $Mac = StringMid($Input,1,2) & "-" & StringMid($Input,3,2) & "-" & StringMid($Input,5,2) & "-" & StringMid($Input,7,2) & "-" & StringMid($Input,9,2) & "-" & StringMid($Input,11,2) Return $Mac EndFunc Func _DecodeTimestampFromGuid($StampDecode) $StampDecode = _SwapEndian($StampDecode) $StampDecode_tmp = _WinTime_UTCFileTimeToLocalFileTime("0x" & $StampDecode) $StampDecode = _WinTime_UTCFileTimeFormat(Dec($StampDecode,2) - $tDelta - $TimeDiff, $DateTimeFormat, $TimestampPrecision) If @error Then $StampDecode = $TimestampErrorVal ElseIf $TimestampPrecision = 3 Then $StampDecode = $StampDecode & $PrecisionSeparator2 & _FillZero(StringRight($StampDecode_tmp, 4)) EndIf Return $StampDecode EndFunc
AutoIt
3
jschicht/LogFileParser
LogFileParser.au3
[ "CC-BY-3.0" ]
{** * lkjsdhf lkdsajf hlsakjdfh dsf * sdf safs dsfds sdf ds * asdf dsaff hsajfhsa lkjf hlksajd hf * s df dsafdsafds f *} <!DOCTYPE html> <html> <head> <title>Nette Application Skeleton</title> </head> <body> </body> </html>
Latte
1
arusinha/incubator-netbeans
php/php.latte/test/unit/data/testfiles/lexer/top/comment-with-asterisk.latte
[ "Apache-2.0" ]
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head><!-- start favicons snippet, use https://realfavicongenerator.net/ --><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff"><!-- end favicons snippet --> <title>ParsableByteArray (ExoPlayer library)</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> <script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../../../jquery/jquery-3.5.1.js"></script> <script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ParsableByteArray (ExoPlayer library)"; } } catch(err) { } //--> var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; var pathtoroot = "../../../../../"; var useModuleDirectories = false; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a id="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <!-- ======== START OF CLASS DATA ======== --> <main role="main"> <div class="header"> <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">com.google.android.exoplayer2.util</a></div> <h2 title="Class ParsableByteArray" class="title">Class ParsableByteArray</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>com.google.android.exoplayer2.util.ParsableByteArray</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <pre>public final class <span class="typeNameLabel">ParsableByteArray</span> extends <a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></pre> <div class="block">Wraps a byte array, providing a set of methods for parsing data from it. Numerical values are parsed with the assumption that their constituent bytes are in big endian order.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Constructor</th> <th class="colLast" scope="col">Description</th> </tr> <tr class="altColor"> <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">ParsableByteArray</a></span>()</code></th> <td class="colLast"> <div class="block">Creates a new instance that initially has no backing data.</div> </td> </tr> <tr class="rowColor"> <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(byte%5B%5D)">ParsableByteArray</a></span>&#8203;(byte[]&nbsp;data)</code></th> <td class="colLast"> <div class="block">Creates a new instance wrapping <code>data</code>, and sets the limit to <code>data.length</code>.</div> </td> </tr> <tr class="altColor"> <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(byte%5B%5D,int)">ParsableByteArray</a></span>&#8203;(byte[]&nbsp;data, int&nbsp;limit)</code></th> <td class="colLast"> <div class="block">Creates a new instance that wraps an existing array.</div> </td> </tr> <tr class="rowColor"> <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(int)">ParsableByteArray</a></span>&#8203;(int&nbsp;limit)</code></th> <td class="colLast"> <div class="block">Creates a new instance with <code>limit</code> bytes and sets the limit.</div> </td> </tr> </table> </li> </ul> </section> <!-- ========== METHOD SUMMARY =========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colSecond" scope="col">Method</th> <th class="colLast" scope="col">Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#bytesLeft()">bytesLeft</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the number of bytes yet to be read.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#capacity()">capacity</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the capacity of the array, which may be larger than the limit.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ensureCapacity(int)">ensureCapacity</a></span>&#8203;(int&nbsp;requiredCapacity)</code></th> <td class="colLast"> <div class="block">Ensures the backing array is at least <code>requiredCapacity</code> long.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>byte[]</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getData()">getData</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the underlying array.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPosition()">getPosition</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the current offset in the array, in bytes.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#limit()">limit</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the limit.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>char</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#peekChar()">peekChar</a></span>()</code></th> <td class="colLast"> <div class="block">Peeks at the next char.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#peekUnsignedByte()">peekUnsignedByte</a></span>()</code></th> <td class="colLast"> <div class="block">Peeks at the next byte as an unsigned value.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readBytes(byte%5B%5D,int,int)">readBytes</a></span>&#8203;(byte[]&nbsp;buffer, int&nbsp;offset, int&nbsp;length)</code></th> <td class="colLast"> <div class="block">Reads the next <code>length</code> bytes into <code>buffer</code> at <code>offset</code>.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readBytes(com.google.android.exoplayer2.util.ParsableBitArray,int)">readBytes</a></span>&#8203;(<a href="ParsableBitArray.html" title="class in com.google.android.exoplayer2.util">ParsableBitArray</a>&nbsp;bitArray, int&nbsp;length)</code></th> <td class="colLast"> <div class="block">Reads the next <code>length</code> bytes into <code>bitArray</code>, and resets the position of <code> bitArray</code> to zero.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readBytes(java.nio.ByteBuffer,int)">readBytes</a></span>&#8203;(<a href="https://developer.android.com/reference/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="externalLink" target="_top">ByteBuffer</a>&nbsp;buffer, int&nbsp;length)</code></th> <td class="colLast"> <div class="block">Reads the next <code>length</code> bytes into <code>buffer</code>.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code><a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readDelimiterTerminatedString(char)">readDelimiterTerminatedString</a></span>&#8203;(char&nbsp;delimiter)</code></th> <td class="colLast"> <div class="block">Reads up to the next delimiter byte (or the limit) as UTF-8 characters.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>double</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readDouble()">readDouble</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next eight bytes as a 64-bit floating point value.</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>float</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readFloat()">readFloat</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next four bytes as a 32-bit floating point value.</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readInt()">readInt</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next four bytes as a signed value</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readInt24()">readInt24</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next three bytes as a signed value.</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code><a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readLine()">readLine</a></span>()</code></th> <td class="colLast"> <div class="block">Reads a line of text.</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readLittleEndianInt()">readLittleEndianInt</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next four bytes as a signed value in little endian order.</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readLittleEndianInt24()">readLittleEndianInt24</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next three bytes as a signed value in little endian order.</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code>long</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readLittleEndianLong()">readLittleEndianLong</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next eight bytes as a signed value in little endian order.</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code>short</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readLittleEndianShort()">readLittleEndianShort</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next two bytes as a signed value.</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code>long</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readLittleEndianUnsignedInt()">readLittleEndianUnsignedInt</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next four bytes as an unsigned value in little endian order.</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readLittleEndianUnsignedInt24()">readLittleEndianUnsignedInt24</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next three bytes as an unsigned value in little endian order.</div> </td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readLittleEndianUnsignedIntToInt()">readLittleEndianUnsignedIntToInt</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next four bytes as a little endian unsigned integer into an integer, if the top bit is a zero.</div> </td> </tr> <tr id="i24" class="altColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readLittleEndianUnsignedShort()">readLittleEndianUnsignedShort</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next two bytes as an unsigned value.</div> </td> </tr> <tr id="i25" class="rowColor"> <td class="colFirst"><code>long</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readLong()">readLong</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next eight bytes as a signed value.</div> </td> </tr> <tr id="i26" class="altColor"> <td class="colFirst"><code><a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readNullTerminatedString()">readNullTerminatedString</a></span>()</code></th> <td class="colLast"> <div class="block">Reads up to the next NUL byte (or the limit) as UTF-8 characters.</div> </td> </tr> <tr id="i27" class="rowColor"> <td class="colFirst"><code><a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readNullTerminatedString(int)">readNullTerminatedString</a></span>&#8203;(int&nbsp;length)</code></th> <td class="colLast"> <div class="block">Reads the next <code>length</code> bytes as UTF-8 characters.</div> </td> </tr> <tr id="i28" class="altColor"> <td class="colFirst"><code>short</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readShort()">readShort</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next two bytes as a signed value.</div> </td> </tr> <tr id="i29" class="rowColor"> <td class="colFirst"><code><a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readString(int)">readString</a></span>&#8203;(int&nbsp;length)</code></th> <td class="colLast"> <div class="block">Reads the next <code>length</code> bytes as UTF-8 characters.</div> </td> </tr> <tr id="i30" class="altColor"> <td class="colFirst"><code><a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readString(int,java.nio.charset.Charset)">readString</a></span>&#8203;(int&nbsp;length, <a href="https://developer.android.com/reference/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="externalLink" target="_top">Charset</a>&nbsp;charset)</code></th> <td class="colLast"> <div class="block">Reads the next <code>length</code> bytes as characters in the specified <a href="https://developer.android.com/reference/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="externalLink" target="_top"><code>Charset</code></a>.</div> </td> </tr> <tr id="i31" class="rowColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readSynchSafeInt()">readSynchSafeInt</a></span>()</code></th> <td class="colLast"> <div class="block">Reads a Synchsafe integer.</div> </td> </tr> <tr id="i32" class="altColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readUnsignedByte()">readUnsignedByte</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next byte as an unsigned value.</div> </td> </tr> <tr id="i33" class="rowColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readUnsignedFixedPoint1616()">readUnsignedFixedPoint1616</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next four bytes, returning the integer portion of the fixed point 16.16 integer.</div> </td> </tr> <tr id="i34" class="altColor"> <td class="colFirst"><code>long</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readUnsignedInt()">readUnsignedInt</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next four bytes as an unsigned value.</div> </td> </tr> <tr id="i35" class="rowColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readUnsignedInt24()">readUnsignedInt24</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next three bytes as an unsigned value.</div> </td> </tr> <tr id="i36" class="altColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readUnsignedIntToInt()">readUnsignedIntToInt</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next four bytes as an unsigned integer into an integer, if the top bit is a zero.</div> </td> </tr> <tr id="i37" class="rowColor"> <td class="colFirst"><code>long</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readUnsignedLongToLong()">readUnsignedLongToLong</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next eight bytes as an unsigned long into a long, if the top bit is a zero.</div> </td> </tr> <tr id="i38" class="altColor"> <td class="colFirst"><code>int</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readUnsignedShort()">readUnsignedShort</a></span>()</code></th> <td class="colLast"> <div class="block">Reads the next two bytes as an unsigned value.</div> </td> </tr> <tr id="i39" class="rowColor"> <td class="colFirst"><code>long</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readUtf8EncodedLong()">readUtf8EncodedLong</a></span>()</code></th> <td class="colLast"> <div class="block">Reads a long value encoded by UTF-8 encoding</div> </td> </tr> <tr id="i40" class="altColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reset(byte%5B%5D)">reset</a></span>&#8203;(byte[]&nbsp;data)</code></th> <td class="colLast"> <div class="block">Updates the instance to wrap <code>data</code>, and resets the position to zero and the limit to <code>data.length</code>.</div> </td> </tr> <tr id="i41" class="rowColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reset(byte%5B%5D,int)">reset</a></span>&#8203;(byte[]&nbsp;data, int&nbsp;limit)</code></th> <td class="colLast"> <div class="block">Updates the instance to wrap <code>data</code>, and resets the position to zero.</div> </td> </tr> <tr id="i42" class="altColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reset(int)">reset</a></span>&#8203;(int&nbsp;limit)</code></th> <td class="colLast"> <div class="block">Resets the position to zero and the limit to the specified value.</div> </td> </tr> <tr id="i43" class="rowColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setLimit(int)">setLimit</a></span>&#8203;(int&nbsp;limit)</code></th> <td class="colLast"> <div class="block">Sets the limit.</div> </td> </tr> <tr id="i44" class="altColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setPosition(int)">setPosition</a></span>&#8203;(int&nbsp;position)</code></th> <td class="colLast"> <div class="block">Sets the reading offset in the array.</div> </td> </tr> <tr id="i45" class="rowColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#skipBytes(int)">skipBytes</a></span>&#8203;(int&nbsp;bytes)</code></th> <td class="colLast"> <div class="block">Moves the reading offset by <code>bytes</code>.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></h3> <code><a href="https://developer.android.com/reference/java/lang/Object.html#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink" target="_top">wait</a></code></li> </ul> </li> </ul> </section> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a id="&lt;init&gt;()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ParsableByteArray</h4> <pre>public&nbsp;ParsableByteArray()</pre> <div class="block">Creates a new instance that initially has no backing data.</div> </li> </ul> <a id="&lt;init&gt;(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ParsableByteArray</h4> <pre>public&nbsp;ParsableByteArray&#8203;(int&nbsp;limit)</pre> <div class="block">Creates a new instance with <code>limit</code> bytes and sets the limit.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>limit</code> - The limit to set.</dd> </dl> </li> </ul> <a id="&lt;init&gt;(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ParsableByteArray</h4> <pre>public&nbsp;ParsableByteArray&#8203;(byte[]&nbsp;data)</pre> <div class="block">Creates a new instance wrapping <code>data</code>, and sets the limit to <code>data.length</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>data</code> - The array to wrap.</dd> </dl> </li> </ul> <a id="&lt;init&gt;(byte[],int)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>ParsableByteArray</h4> <pre>public&nbsp;ParsableByteArray&#8203;(byte[]&nbsp;data, int&nbsp;limit)</pre> <div class="block">Creates a new instance that wraps an existing array.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>data</code> - The data to wrap.</dd> <dd><code>limit</code> - The limit to set.</dd> </dl> </li> </ul> </li> </ul> </section> <!-- ============ METHOD DETAIL ========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a id="reset(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>reset</h4> <pre class="methodSignature">public&nbsp;void&nbsp;reset&#8203;(int&nbsp;limit)</pre> <div class="block">Resets the position to zero and the limit to the specified value. This might replace or wipe the <a href="#getData()"><code>underlying array</code></a>, potentially invalidating any local references.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>limit</code> - The limit to set.</dd> </dl> </li> </ul> <a id="reset(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>reset</h4> <pre class="methodSignature">public&nbsp;void&nbsp;reset&#8203;(byte[]&nbsp;data)</pre> <div class="block">Updates the instance to wrap <code>data</code>, and resets the position to zero and the limit to <code>data.length</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>data</code> - The array to wrap.</dd> </dl> </li> </ul> <a id="reset(byte[],int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>reset</h4> <pre class="methodSignature">public&nbsp;void&nbsp;reset&#8203;(byte[]&nbsp;data, int&nbsp;limit)</pre> <div class="block">Updates the instance to wrap <code>data</code>, and resets the position to zero.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>data</code> - The array to wrap.</dd> <dd><code>limit</code> - The limit to set.</dd> </dl> </li> </ul> <a id="ensureCapacity(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ensureCapacity</h4> <pre class="methodSignature">public&nbsp;void&nbsp;ensureCapacity&#8203;(int&nbsp;requiredCapacity)</pre> <div class="block">Ensures the backing array is at least <code>requiredCapacity</code> long. <p><a href="#getPosition()"><code>position</code></a>, <a href="#limit()"><code>limit</code></a>, and all data in the underlying array (including that beyond <a href="#limit()"><code>limit()</code></a>) are preserved. <p>This might replace or wipe the <a href="#getData()"><code>underlying array</code></a>, potentially invalidating any local references.</div> </li> </ul> <a id="bytesLeft()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>bytesLeft</h4> <pre class="methodSignature">public&nbsp;int&nbsp;bytesLeft()</pre> <div class="block">Returns the number of bytes yet to be read.</div> </li> </ul> <a id="limit()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>limit</h4> <pre class="methodSignature">public&nbsp;int&nbsp;limit()</pre> <div class="block">Returns the limit.</div> </li> </ul> <a id="setLimit(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setLimit</h4> <pre class="methodSignature">public&nbsp;void&nbsp;setLimit&#8203;(int&nbsp;limit)</pre> <div class="block">Sets the limit.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>limit</code> - The limit to set.</dd> </dl> </li> </ul> <a id="getPosition()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getPosition</h4> <pre class="methodSignature">public&nbsp;int&nbsp;getPosition()</pre> <div class="block">Returns the current offset in the array, in bytes.</div> </li> </ul> <a id="setPosition(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setPosition</h4> <pre class="methodSignature">public&nbsp;void&nbsp;setPosition&#8203;(int&nbsp;position)</pre> <div class="block">Sets the reading offset in the array.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>position</code> - Byte offset in the array from which to read.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="https://developer.android.com/reference/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="externalLink" target="_top">IllegalArgumentException</a></code> - Thrown if the new position is neither in nor at the end of the array.</dd> </dl> </li> </ul> <a id="getData()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getData</h4> <pre class="methodSignature">public&nbsp;byte[]&nbsp;getData()</pre> <div class="block">Returns the underlying array. <p>Changes to this array are reflected in the results of the <code>read...()</code> methods. <p>This reference must be assumed to become invalid when <a href="#reset(int)"><code>reset(int)</code></a> or <a href="#ensureCapacity(int)"><code>ensureCapacity(int)</code></a> are called (because the array might get reallocated).</div> </li> </ul> <a id="capacity()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>capacity</h4> <pre class="methodSignature">public&nbsp;int&nbsp;capacity()</pre> <div class="block">Returns the capacity of the array, which may be larger than the limit.</div> </li> </ul> <a id="skipBytes(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>skipBytes</h4> <pre class="methodSignature">public&nbsp;void&nbsp;skipBytes&#8203;(int&nbsp;bytes)</pre> <div class="block">Moves the reading offset by <code>bytes</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>bytes</code> - The number of bytes to skip.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="https://developer.android.com/reference/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="externalLink" target="_top">IllegalArgumentException</a></code> - Thrown if the new position is neither in nor at the end of the array.</dd> </dl> </li> </ul> <a id="readBytes(com.google.android.exoplayer2.util.ParsableBitArray,int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readBytes</h4> <pre class="methodSignature">public&nbsp;void&nbsp;readBytes&#8203;(<a href="ParsableBitArray.html" title="class in com.google.android.exoplayer2.util">ParsableBitArray</a>&nbsp;bitArray, int&nbsp;length)</pre> <div class="block">Reads the next <code>length</code> bytes into <code>bitArray</code>, and resets the position of <code> bitArray</code> to zero.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>bitArray</code> - The <a href="ParsableBitArray.html" title="class in com.google.android.exoplayer2.util"><code>ParsableBitArray</code></a> into which the bytes should be read.</dd> <dd><code>length</code> - The number of bytes to write.</dd> </dl> </li> </ul> <a id="readBytes(byte[],int,int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readBytes</h4> <pre class="methodSignature">public&nbsp;void&nbsp;readBytes&#8203;(byte[]&nbsp;buffer, int&nbsp;offset, int&nbsp;length)</pre> <div class="block">Reads the next <code>length</code> bytes into <code>buffer</code> at <code>offset</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>buffer</code> - The array into which the read data should be written.</dd> <dd><code>offset</code> - The offset in <code>buffer</code> at which the read data should be written.</dd> <dd><code>length</code> - The number of bytes to read.</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="https://developer.android.com/reference/java/lang/System.html#arraycopy(java.lang.Object,int,java.lang.Object,int,int)" title="class or interface in java.lang" class="externalLink" target="_top"><code>System.arraycopy(Object, int, Object, int, int)</code></a></dd> </dl> </li> </ul> <a id="readBytes(java.nio.ByteBuffer,int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readBytes</h4> <pre class="methodSignature">public&nbsp;void&nbsp;readBytes&#8203;(<a href="https://developer.android.com/reference/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="externalLink" target="_top">ByteBuffer</a>&nbsp;buffer, int&nbsp;length)</pre> <div class="block">Reads the next <code>length</code> bytes into <code>buffer</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>buffer</code> - The <a href="https://developer.android.com/reference/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="externalLink" target="_top"><code>ByteBuffer</code></a> into which the read data should be written.</dd> <dd><code>length</code> - The number of bytes to read.</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="https://developer.android.com/reference/java/nio/ByteBuffer.html#put(byte%5B%5D,int,int)" title="class or interface in java.nio" class="externalLink" target="_top"><code>ByteBuffer.put(byte[], int, int)</code></a></dd> </dl> </li> </ul> <a id="peekUnsignedByte()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>peekUnsignedByte</h4> <pre class="methodSignature">public&nbsp;int&nbsp;peekUnsignedByte()</pre> <div class="block">Peeks at the next byte as an unsigned value.</div> </li> </ul> <a id="peekChar()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>peekChar</h4> <pre class="methodSignature">public&nbsp;char&nbsp;peekChar()</pre> <div class="block">Peeks at the next char.</div> </li> </ul> <a id="readUnsignedByte()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readUnsignedByte</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readUnsignedByte()</pre> <div class="block">Reads the next byte as an unsigned value.</div> </li> </ul> <a id="readUnsignedShort()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readUnsignedShort</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readUnsignedShort()</pre> <div class="block">Reads the next two bytes as an unsigned value.</div> </li> </ul> <a id="readLittleEndianUnsignedShort()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readLittleEndianUnsignedShort</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readLittleEndianUnsignedShort()</pre> <div class="block">Reads the next two bytes as an unsigned value.</div> </li> </ul> <a id="readShort()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readShort</h4> <pre class="methodSignature">public&nbsp;short&nbsp;readShort()</pre> <div class="block">Reads the next two bytes as a signed value.</div> </li> </ul> <a id="readLittleEndianShort()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readLittleEndianShort</h4> <pre class="methodSignature">public&nbsp;short&nbsp;readLittleEndianShort()</pre> <div class="block">Reads the next two bytes as a signed value.</div> </li> </ul> <a id="readUnsignedInt24()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readUnsignedInt24</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readUnsignedInt24()</pre> <div class="block">Reads the next three bytes as an unsigned value.</div> </li> </ul> <a id="readInt24()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readInt24</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readInt24()</pre> <div class="block">Reads the next three bytes as a signed value.</div> </li> </ul> <a id="readLittleEndianInt24()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readLittleEndianInt24</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readLittleEndianInt24()</pre> <div class="block">Reads the next three bytes as a signed value in little endian order.</div> </li> </ul> <a id="readLittleEndianUnsignedInt24()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readLittleEndianUnsignedInt24</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readLittleEndianUnsignedInt24()</pre> <div class="block">Reads the next three bytes as an unsigned value in little endian order.</div> </li> </ul> <a id="readUnsignedInt()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readUnsignedInt</h4> <pre class="methodSignature">public&nbsp;long&nbsp;readUnsignedInt()</pre> <div class="block">Reads the next four bytes as an unsigned value.</div> </li> </ul> <a id="readLittleEndianUnsignedInt()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readLittleEndianUnsignedInt</h4> <pre class="methodSignature">public&nbsp;long&nbsp;readLittleEndianUnsignedInt()</pre> <div class="block">Reads the next four bytes as an unsigned value in little endian order.</div> </li> </ul> <a id="readInt()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readInt</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readInt()</pre> <div class="block">Reads the next four bytes as a signed value</div> </li> </ul> <a id="readLittleEndianInt()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readLittleEndianInt</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readLittleEndianInt()</pre> <div class="block">Reads the next four bytes as a signed value in little endian order.</div> </li> </ul> <a id="readLong()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readLong</h4> <pre class="methodSignature">public&nbsp;long&nbsp;readLong()</pre> <div class="block">Reads the next eight bytes as a signed value.</div> </li> </ul> <a id="readLittleEndianLong()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readLittleEndianLong</h4> <pre class="methodSignature">public&nbsp;long&nbsp;readLittleEndianLong()</pre> <div class="block">Reads the next eight bytes as a signed value in little endian order.</div> </li> </ul> <a id="readUnsignedFixedPoint1616()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readUnsignedFixedPoint1616</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readUnsignedFixedPoint1616()</pre> <div class="block">Reads the next four bytes, returning the integer portion of the fixed point 16.16 integer.</div> </li> </ul> <a id="readSynchSafeInt()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readSynchSafeInt</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readSynchSafeInt()</pre> <div class="block">Reads a Synchsafe integer. <p>Synchsafe integers keep the highest bit of every byte zeroed. A 32 bit synchsafe integer can store 28 bits of information.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The parsed value.</dd> </dl> </li> </ul> <a id="readUnsignedIntToInt()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readUnsignedIntToInt</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readUnsignedIntToInt()</pre> <div class="block">Reads the next four bytes as an unsigned integer into an integer, if the top bit is a zero.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="https://developer.android.com/reference/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="externalLink" target="_top">IllegalStateException</a></code> - Thrown if the top bit of the input data is set.</dd> </dl> </li> </ul> <a id="readLittleEndianUnsignedIntToInt()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readLittleEndianUnsignedIntToInt</h4> <pre class="methodSignature">public&nbsp;int&nbsp;readLittleEndianUnsignedIntToInt()</pre> <div class="block">Reads the next four bytes as a little endian unsigned integer into an integer, if the top bit is a zero.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="https://developer.android.com/reference/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="externalLink" target="_top">IllegalStateException</a></code> - Thrown if the top bit of the input data is set.</dd> </dl> </li> </ul> <a id="readUnsignedLongToLong()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readUnsignedLongToLong</h4> <pre class="methodSignature">public&nbsp;long&nbsp;readUnsignedLongToLong()</pre> <div class="block">Reads the next eight bytes as an unsigned long into a long, if the top bit is a zero.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="https://developer.android.com/reference/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="externalLink" target="_top">IllegalStateException</a></code> - Thrown if the top bit of the input data is set.</dd> </dl> </li> </ul> <a id="readFloat()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readFloat</h4> <pre class="methodSignature">public&nbsp;float&nbsp;readFloat()</pre> <div class="block">Reads the next four bytes as a 32-bit floating point value.</div> </li> </ul> <a id="readDouble()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readDouble</h4> <pre class="methodSignature">public&nbsp;double&nbsp;readDouble()</pre> <div class="block">Reads the next eight bytes as a 64-bit floating point value.</div> </li> </ul> <a id="readString(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readString</h4> <pre class="methodSignature">public&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a>&nbsp;readString&#8203;(int&nbsp;length)</pre> <div class="block">Reads the next <code>length</code> bytes as UTF-8 characters.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>length</code> - The number of bytes to read.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The string encoded by the bytes.</dd> </dl> </li> </ul> <a id="readString(int,java.nio.charset.Charset)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readString</h4> <pre class="methodSignature">public&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a>&nbsp;readString&#8203;(int&nbsp;length, <a href="https://developer.android.com/reference/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="externalLink" target="_top">Charset</a>&nbsp;charset)</pre> <div class="block">Reads the next <code>length</code> bytes as characters in the specified <a href="https://developer.android.com/reference/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="externalLink" target="_top"><code>Charset</code></a>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>length</code> - The number of bytes to read.</dd> <dd><code>charset</code> - The character set of the encoded characters.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The string encoded by the bytes in the specified character set.</dd> </dl> </li> </ul> <a id="readNullTerminatedString(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readNullTerminatedString</h4> <pre class="methodSignature">public&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a>&nbsp;readNullTerminatedString&#8203;(int&nbsp;length)</pre> <div class="block">Reads the next <code>length</code> bytes as UTF-8 characters. A terminating NUL byte is discarded, if present.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>length</code> - The number of bytes to read.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The string, not including any terminating NUL byte.</dd> </dl> </li> </ul> <a id="readNullTerminatedString()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readNullTerminatedString</h4> <pre class="methodSignature">@Nullable public&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a>&nbsp;readNullTerminatedString()</pre> <div class="block">Reads up to the next NUL byte (or the limit) as UTF-8 characters.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The string not including any terminating NUL byte, or null if the end of the data has already been reached.</dd> </dl> </li> </ul> <a id="readDelimiterTerminatedString(char)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readDelimiterTerminatedString</h4> <pre class="methodSignature">@Nullable public&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a>&nbsp;readDelimiterTerminatedString&#8203;(char&nbsp;delimiter)</pre> <div class="block">Reads up to the next delimiter byte (or the limit) as UTF-8 characters.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The string not including any terminating delimiter byte, or null if the end of the data has already been reached.</dd> </dl> </li> </ul> <a id="readLine()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>readLine</h4> <pre class="methodSignature">@Nullable public&nbsp;<a href="https://developer.android.com/reference/java/lang/String.html" title="class or interface in java.lang" class="externalLink" target="_top">String</a>&nbsp;readLine()</pre> <div class="block">Reads a line of text. <p>A line is considered to be terminated by any one of a carriage return ('\r'), a line feed ('\n'), or a carriage return followed immediately by a line feed ('\r\n'). The UTF-8 charset is used. This method discards leading UTF-8 byte order marks, if present.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The line not including any line-termination characters, or null if the end of the data has already been reached.</dd> </dl> </li> </ul> <a id="readUtf8EncodedLong()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>readUtf8EncodedLong</h4> <pre class="methodSignature">public&nbsp;long&nbsp;readUtf8EncodedLong()</pre> <div class="block">Reads a long value encoded by UTF-8 encoding</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Decoded long value</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="https://developer.android.com/reference/java/lang/NumberFormatException.html" title="class or interface in java.lang" class="externalLink" target="_top">NumberFormatException</a></code> - if there is a problem with decoding</dd> </dl> </li> </ul> </li> </ul> </section> </li> </ul> </div> </div> </main> <!-- ========= END OF CLASS DATA ========= --> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a id="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> </footer> </body> </html>
HTML
5
UniiqTV/ExoPlayer
docs/doc/reference/com/google/android/exoplayer2/util/ParsableByteArray.html
[ "Apache-2.0" ]
HAI 1.2 HOW IZ I CALCULATE_CIRCLE_PERIMETER YR RADIUS I HAS A RESULT BOTH SAEM RADIUS AN 0, O RLY? YA RLY, GTFO NO WAI RESULT R PRODUKT OF 6.28 AN RADIUS FOUND YR RESULT OIC IF U SAY SO I HAS A RADIUS I HAS A PERIMETER VISIBLE "GIMME RADIUS:" GIMMEH RADIUS RADIUS IS NOW A NUMBAR PERIMETER R I IZ CALCULATE_CIRCLE_PERIMETER YR RADIUS MKAY PERIMETER IS NOW A YARN VISIBLE "YER PERIMETER IZ " PERIMETER KTHXBYE
LOLCODE
3
Himanshu21git/Lokalise-source
lolcode-fun-post/calculate_perimeter.lol
[ "MIT" ]
# asm.fy # This file loads Rubinius bytecode versions of some core methods for # improved performance. class Rubinius Generator { forwards_unary_ruby_methods alias_ruby_setters class Label { forwards_unary_ruby_methods } } require: "asm/array" require: "asm/class" require: "asm/integer"
Fancy
2
bakkdoor/fancy
lib/asm.fy
[ "BSD-3-Clause" ]
.ErrorTree, .WarningTree { padding: 0.25rem 0 0 0; } .HeaderRow { padding: 0 0.25rem; } .HeaderRow { padding: 0 0.25rem; } .Error, .Warning { padding: 0 0.5rem; display: flex; align-items: center; } .Error { border-top: 1px solid var(--color-console-error-border); background-color: var(--color-console-error-background); color: var(--color-error-text); padding: 0 0.5rem; } .Warning { border-top: 1px solid var(--color-console-warning-border); background-color: var(--color-console-warning-background); color: var(--color-warning-text); padding: 0 0.5rem; } .Message { overflow-x: hidden; text-overflow: ellipsis; white-space: nowrap; } .ErrorBadge, .WarningBadge { display: inline-block; width: 0.75rem; height: 0.75rem; flex: 0 0 0.75rem; line-height: 0.75rem; text-align: center; border-radius: 0.25rem; margin-right: 0.25rem; font-size: var(--font-size-monospace-small); } .ErrorBadge { background-color: var(--color-console-error-icon); color: var(--color-console-error-badge-text); } .WarningBadge { background-color: var(--color-console-warning-icon); color: var(--color-console-warning-badge-text); }
CSS
2
GBKstc/react-analysis
packages/react-devtools-shared/src/devtools/views/Components/InspectedElementErrorsAndWarningsTree.css
[ "MIT" ]
.q-tab-panels background: #fff .q-tab-panel padding: 16px
Sass
2
ygyg70/quasar
ui/src/components/tab-panels/QTabPanel.sass
[ "MIT" ]
J333?
PureBasic
2
rajeevsrao/onnx
onnx/backend/test/data/pytorch-operator/test_operator_basic/test_data_set_0/input_1.pb
[ "MIT" ]
{ "@context": "0127-context-1.jsonld", "@id": "ex:id", "prop": { "value": "v" } }
JSONLD
1
donbowman/rdflib
test/jsonld/1.1/expand/0127-in.jsonld
[ "BSD-3-Clause" ]
export default { html: '<div><span>lol</span></div>' };
JavaScript
1
Theo-Steiner/svelte
test/runtime/samples/component-slot-slot/_config.js
[ "MIT" ]
void main() { var start = new int[2]; int[] sums = {0, 0}; for (int i = 0; i < 2; i++) { var xs = stdin.read_line().split(" "); start[i] = int.parse(xs[xs.length - 1]) - 1; } int i = 0; while (true) { for (int j = 0; j < 2; j++) { start[j] = (start[j] + 3*i + 6) % 10; sums[j] += start[j] + 1; i += 3; if (sums[j] >= 1000) { stdout.printf("%d\n", sums[j^1] * i); return; } } } }
Vala
3
abeaumont/competitive-programming
advent-of-code/2021/day21/part1.vala
[ "WTFPL" ]
(* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) open Google.OrTools.FSharp let opts = SolverOpts.Default .Name("Volsay3") .Goal(Maximize) .Objective([30.0;40.0]) .Matrix([[1.0;3.0;0.0]; [1.0;4.0;1.0]]) .VectorUpperBound([50.0; 180.0; 40.0]) .VarLowerBound([0.0; 0.0]) .VarUpperBound([10000.0; 10000.0]) .Algorithm(LP CLP) let slvr = opts |> lpSolve |> SolverSummary slvr |> ignore
F#
4
klorel/or-tools
examples/contrib/fsvolsay3-lpSolve.fs
[ "Apache-2.0" ]
Note 0 Copyright (C) 2017 Jonathan Hough. All rights reserved. ) Note 1 This is an implementation of the Nedler-Mead method for unconstrained function optimization. Example usage of dyadic verb minimizeNelderMead: 1-dimensional example (function from R->R), where the function to minimize is given by func = 5x^2 -7x + 2 Define function: func=:2&+@:(_7&* + 5&*@:*:) Input samples given by samples (func f.) `'' minNelderMead_jLearnOpt_ samples will minimize this function, using the sample data. ) cocurrent 'jLearnOpt' alpha =: 1 gamma=: 2 rho=: 0.5 sigma =: 0.5 order=: 4 : 0 func=. x `:6 data=. y vals=. func data od=. data /: vals NB. ordered data ov=. /:~ vals NB. ordered values od;ov ) reflect=: 4 : 0 func=. x `:6 data=. y centroid=. (+/ % #) data last=. {: data ref=. centroid + alpha * (centroid - last) ref ) expand=: 4 : 0 func=. x `:6 'data ref'=. y centroid=. (+/ % #) data ex=. centroid + gamma * (ref - centroid) ex ) contract=: 4 : 0 func=. x `:6 data=. y centroid=. (+/ % #) data con=. centroid + rho * (({: data) - centroid) con ) minNelderMeadX=: 3 : 0 'funcWrapper x0 maxIter tol beta'=: y func=. 3 : ' func__funcWrapper y'"1 d=. 20 3 $, 10 * +: 0.5-~? (20 3) $ 0 smoutput $d data=.20 1 $, func"1 d smoutput $data ((func f.)`'') minNelderMead d ) minNelderMead=: 4 : 0 "0 _ func=: (x `:6) f. data=. y iterations =. 50 ctr=. 0 while. ctr < iterations do. ctr=. ctr+1 o=. x order data od=. >{.o NB. ordered data ov=. >{:o NB. ordered values drop=. }: od ref=: (func `'') reflect drop NB. REFLECTION if. (( (x `:6) {. drop) <: (x `:6) ref) *. (( (x `:6) ref) < (x `:6) {: drop) do. nextData=. ( drop), ref NB. append ref to the list data=. nextData continue. end. NB. EXPANSION if. (func ref) < func {. drop do. ex=: x expand data;ref if. (func ex) < func ref do. drop=. }: data nextData=. ( drop), ex NB. append ex to the list data=. nextData continue. else. drop=. }: data nextData=. ( drop), ref NB. append ref to the list data=. nextData continue. end. end. NB. CONTRACTION con =. x contract data if. (func con) < func {: data do. drop=. }: data nextData=. ( drop), ref NB. append ref to the list data=. nextData continue. end. first=. {. data d=. first for_i. 1}.i.#data do. d=. d, (first + sigma *((i{data) - first)) end. data =. d end. )
J
3
ajnavarro/language-dataset
data/github.com/jonghough/jlearn/8361c081b618b69bfc36decde67c689d46d5c917/optimize/neldermead.ijs
[ "MIT" ]
# ------------------------------------------------------------------------------ # FILE: emotty.plugin.zsh # DESCRIPTION: Return an emoji for the current $TTY number. # AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net) # VERSION: 1.0.0 # DEPENDS: emoji plugin # # There are different sets of emoji characters available, to choose a different # set export emotty_set to the name of the set you would like to use, e.g.: # % export emotty_set=nature # ------------------------------------------------------------------------------ typeset -gAH _emotty_sets local _emotty_plugin_dir="${0:h}" source "$_emotty_plugin_dir/emotty_stellar_set.zsh" source "$_emotty_plugin_dir/emotty_floral_set.zsh" source "$_emotty_plugin_dir/emotty_zodiac_set.zsh" source "$_emotty_plugin_dir/emotty_nature_set.zsh" source "$_emotty_plugin_dir/emotty_emoji_set.zsh" source "$_emotty_plugin_dir/emotty_love_set.zsh" unset _emotty_plugin_dir emotty_default_set=emoji function emotty() { # Use emotty set defined by user, fallback to default local emotty=${_emotty_sets[${emotty_set:-$emotty_default_set}]} # Parse tty number via prompt expansion. %l equals: # - N if tty = /dev/ttyN # - pts/N if tty = /dev/pts/N local tty=${${(%):-%l}##pts/} # Normalize it to an emotty set index (( tty = (tty % ${#${=emotty}}) + 1 )) local character_name=${${=emotty}[tty]} echo "${emoji[${character_name}]}${emoji2[emoji_style]}" } function display_emotty() { local name=${1:-$emotty_set} echo $name for i in ${=_emotty_sets[$name]}; do printf "${emoji[$i]}${emoji2[emoji_style]} " done print for i in ${=_emotty_sets[$name]}; do print "${emoji[$i]}${emoji2[emoji_style]} = $i" done }
Shell
4
sshishov/ohmyzsh
plugins/emotty/emotty.plugin.zsh
[ "MIT" ]