CTFワークスペースを追加#22
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efacf17191
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } catch (caughtError) { | ||
| setError(caughtError instanceof Error ? caughtError.message : "変換に失敗しました。"); | ||
| } |
There was a problem hiding this comment.
Clear stale transform result on errors
When a user successfully runs one transform and then runs another transform that throws, such as invalid Hex/Base64/URL input, this catch path only sets the error message and leaves the previous result rendered in the result panel with copy buttons. That stale output can be mistaken for the failed transform's output; clear result before/inside the error path so failed conversions do not display an unrelated prior result.
Useful? React with 👍 / 👎.
|
確認しましたが、この PR は現状マージしません。 理由:
対応案:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c47c7fbb49
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join(""); | ||
|
|
||
| const parseHexBytes = (input: string) => { | ||
| const normalized = input.replace(/^0x/i, "").replace(/[\s:_-]/g, ""); |
There was a problem hiding this comment.
Strip hex dump offsets before decoding
When users paste an xxd-style hex dump as the textarea placeholder suggests (for example 00000000: 666c 6167 7b78 7d), this normalizer removes the colon and spaces but leaves the address offset as hex data, so Hex decode emits leading NUL/offset bytes and corrupts multi-line dumps instead of decoding only the byte column. Either strip recognized dump offsets/ASCII columns before decoding or avoid advertising hex-dump input.
Useful? React with 👍 / 👎.
# Conflicts: # src/pages/CtfPage.tsx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd84505830
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const nextResult = { | ||
| name: activeTransform.label, | ||
| output: transformResult.output, | ||
| flagCandidates: analyzeCtfInput(transformResult.output).flag, |
There was a problem hiding this comment.
Persist decoded flag candidates in the writeup
When a transform reveals a flag (for example decoding ZmxhZ3t4fQ==), this stores the candidate only in result.flagCandidates, so the result panel shows it but workspace.flagCandidates remains unchanged. Because the writeup preview/export is generated from workspace, the exported Markdown still has empty Flag Candidates/Final Flag sections for automatically discovered flags unless the user manually copies them into notes; add these candidates to the workspace or include them when generating the writeup.
Useful? React with 👍 / 👎.
Motivation
Description
src/features/ctf/ctfTools.tsを追加し、型定義、CTF_TRANSFORMS、入力解析用のanalyzeCtfInput、変換実行のtransformCtfInput(内部にrunTransformを持つ)などCTF処理ロジックを実装しました。src/features/ctf/index.tsを追加して型と関数を再エクスポートするエントリを用意しました。src/pages/CtfPage.tsxを全面的に差し替え、以下のパネルを持つCTF WorkspaceUI を実装しました:入力エリア(テキスト貼り付け・ファイル選択・クリア)、自動解析パネル(flag/Base64/Hex/URL/printable候補)、変換パネル(Base64/Hex/URL/ROT13/Caesar/単一バイトXORなど)、結果パネル(変換結果・flag候補・コピー操作)、操作履歴パネル(変換名・入力/出力概要・タイムスタンプ)。analyzeCtfInput/transformCtfInput/summarizeText等)を呼び出す実装にして変換ロジックをページに直接詰め込まない設計にしました。Testing
npm run build(tsc -b && vite build)で成功しました。npm run lint(eslint .)で成功しました。Codex Task