Skip to content

Wasm viewer#252

Merged
omerbenamram merged 14 commits intomasterfrom
wasm-viewer
Jul 11, 2025
Merged

Wasm viewer#252
omerbenamram merged 14 commits intomasterfrom
wasm-viewer

Conversation

@omerbenamram
Copy link
Owner

@omerbenamram omerbenamram commented Jul 6, 2025

https://omerbenamram.github.io/evtx/

This is kind of an advanced clone of the windows event explorer that runs entirely in browser. it uses duckdb compiled to WASM along with the WASM version of the parser to stream chunks over IPC using apache arrow to parse and filter logs in lightning speed.

It was also a chance for me to experiment with native like react single page apps.

CleanShot 2025-07-07 at 10 06 02@2x

@williballenthin
Copy link

as a drive-by user, it would be convenient if there were a demo evtx file that could be loaded from the file menu. this would make the tool easier to evaluate, since i don't have to find an evtx file (especially on mobile).

(feel free to ignore)

@omerbenamram
Copy link
Owner Author

hey @williballenthin ! though about this haha, may include a small one to showcase which loads dynamically to not blow up bundle size.

This really shines with larger files though. let me know what your thoughts are if you get a chance to try it :)

@omerbenamram
Copy link
Owner Author

@williballenthin decided to add a small sample anyways :) was just one cursor request away. have fun!

@williballenthin
Copy link

thanks, its great!

I love the include/exclude/add to column actions.

@omerbenamram
Copy link
Owner Author

duckdb is insanely performant - so that's the reason it's possible to do this while maintaining facet counts on zillion lines logs. glad you liked it!

@omerbenamram omerbenamram requested a review from Copilot July 7, 2025 15:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a full browser-based EVTX log viewer powered by a Rust-compiled WASM parser and DuckDB via Apache Arrow, wrapped in a React single-page application.

  • Adds evtx-wasm crate with WASM bindings for EVTX parsing and Arrow IPC serialization
  • Provides run_viewer.sh to build the WASM module and launch a Vite dev server
  • Implements a React SPA with global state, virtualization, theming, and a suite of Windows-style UI components

Reviewed Changes

Copilot reviewed 78 out of 82 changed files in this pull request and generated 3 comments.

File Description
src/lib.rs Re-exported file header types to support WASM viewer binding
run_viewer.sh Shell script for building the WASM crate and starting Vite
evtx-wasm/src/lib.rs Core WASM bindings & parsing logic for EVTX files
evtx-wasm/evtx-viewer/vite.config.ts Vite configuration for serving/building the React viewer
Comments suppressed due to low confidence (1)

evtx-wasm/src/lib.rs:71

  • This function lacks dedicated unit tests to verify bucket counts across various record scenarios. Consider adding tests for compute_buckets with sample EVTX blobs to ensure correct bucket computation and error handling.
pub fn compute_buckets(data: &[u8]) -> Result<JsValue, JsError> {

}

/** Build a SQL WHERE clause from current filters */
export function buildWhere(filters: FilterOptions): string {
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation constructs SQL WHERE clauses via string interpolation, which may be vulnerable to injection if filter values contain quotes or unexpected characters. Consider using parameterized queries or a SQL builder API to safely bind values.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,343 @@
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This file is over 300 lines and handles multiple concerns. Consider refactoring parts (e.g., hook logic, helper functions) into smaller modules to improve readability and maintainability.

Copilot uses AI. Check for mistakes.
display: inline-block;
`;

const ToggleButton = styled.button<{ $disabled?: boolean }>`
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The toggle button does not include ARIA attributes (e.g., aria-haspopup, aria-expanded) for accessibility. Consider adding ARIA roles and states to improve screen-reader support.

Copilot uses AI. Check for mistakes.
small sidebar fixes

rules
rust!

fix cargo flag

Fix chunk_arrow_ipc call to preserve this binding in strict mode

filters fix

lint

support JSON filters

remove old code

just use duckdb for everything

update import

event detail state

file switch state

lint

cleanup

removed dynamic shit

smarter ingest tracking
components cleanup

loading for wasm assets

wording

removed old bucketCounts state

break down sidebar

move to reducer slices

breakdown mega hook

make sure file dragged shows immediatly

new rule
… an Example Logs folder with security.evtx sample. File is fetched on demand. Dev scripts symlink sample; CI copies sample into public.
… works

fix(viewer): build sample URL using import.meta.env.BASE_URL for pages sub-path

fix(viewer): robust sample URL concat when BASE_URL undefined
…d formatting\n\nIntroduces a new `formatTimeValue` utility for better timestamp display in the LogTable. The time column now supports adaptive time-bucket grouping based on data span, improving filtering and visualization. Updates to the filter menu ensure timestamps are displayed in a user-friendly format.
@omerbenamram omerbenamram merged commit 9f60858 into master Jul 11, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants