├── page
├── .prettierrc
├── .prettierignore
├── public
│ └── pinata.png
├── src
│ ├── vite-env.d.ts
│ ├── lib
│ │ └── utils.ts
│ ├── fb
│ │ ├── events.ts
│ │ ├── debugger
│ │ │ ├── state.ts
│ │ │ ├── pause-request.ts
│ │ │ └── get-state-request.ts
│ │ └── debugger.ts
│ ├── components
│ │ ├── ui
│ │ │ ├── skeleton.tsx
│ │ │ ├── label.tsx
│ │ │ ├── separator.tsx
│ │ │ ├── input.tsx
│ │ │ ├── checkbox.tsx
│ │ │ ├── radio-group.tsx
│ │ │ ├── popover.tsx
│ │ │ ├── badge.tsx
│ │ │ ├── scroll-area.tsx
│ │ │ ├── tooltip.tsx
│ │ │ ├── tabs.tsx
│ │ │ ├── resizable.tsx
│ │ │ ├── button.tsx
│ │ │ └── card.tsx
│ │ ├── text-tooltip.tsx
│ │ ├── youtube-video.tsx
│ │ ├── app-sidebar.tsx
│ │ ├── theme-provider.tsx
│ │ ├── status-indicator.tsx
│ │ └── item-list.tsx
│ ├── hooks
│ │ └── use-mobile.ts
│ ├── main.tsx
│ ├── animation.css
│ ├── zip-file.ts
│ ├── Loader.ts
│ ├── Header.tsx
│ ├── App.tsx
│ └── download.ts
├── tsconfig.json
├── .gitignore
├── components.json
├── tsconfig.node.json
├── eslint.config.js
├── tsconfig.app.json
├── vite.config.ts
├── index.html
└── package.json
├── src
├── emulator
│ ├── empty.cpp
│ ├── CMakeLists.txt
│ ├── memory_region.hpp
│ ├── emulator.hpp
│ ├── cpu_interface.hpp
│ ├── address_utils.hpp
│ ├── serialization_helper.hpp
│ ├── scoped_hook.hpp
│ ├── memory_permission.hpp
│ └── arch_emulator.hpp
├── windows-gdb-stub
│ ├── empty.cpp
│ └── CMakeLists.txt
├── tools
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── dump-apiset
│ │ └── CMakeLists.txt
│ └── grab-registry.bat
├── backends
│ ├── icicle-emulator
│ │ ├── icicle-bridge
│ │ │ ├── .gitignore
│ │ │ ├── data
│ │ │ │ └── Ghidra
│ │ │ │ │ └── Processors
│ │ │ │ │ └── x86
│ │ │ │ │ └── data
│ │ │ │ │ └── languages
│ │ │ │ │ ├── x86-16.gdis
│ │ │ │ │ ├── macros.sinc
│ │ │ │ │ ├── x86-64.slaspec
│ │ │ │ │ ├── x86-32-golang.register.info
│ │ │ │ │ ├── old
│ │ │ │ │ ├── x86RealV1.trans
│ │ │ │ │ ├── x86smmV1.trans
│ │ │ │ │ ├── x86V1.trans
│ │ │ │ │ └── x86_64bit_v1.trans
│ │ │ │ │ ├── x86.slaspec
│ │ │ │ │ ├── clwb.sinc
│ │ │ │ │ ├── x86-64-golang.register.info
│ │ │ │ │ ├── lzcnt.sinc
│ │ │ │ │ ├── x86-16-real.pspec
│ │ │ │ │ ├── x86-16.pspec
│ │ │ │ │ ├── adx.sinc
│ │ │ │ │ ├── rdrand.sinc
│ │ │ │ │ ├── x86.dwarf
│ │ │ │ │ ├── smx.sinc
│ │ │ │ │ ├── x86-64.dwarf
│ │ │ │ │ └── sha.sinc
│ │ │ └── Cargo.toml
│ │ ├── icicle_x86_64_emulator.hpp
│ │ └── CMakeLists.txt
│ ├── CMakeLists.txt
│ └── unicorn-emulator
│ │ ├── unicorn_x86_64_emulator.hpp
│ │ ├── CMakeLists.txt
│ │ ├── unicorn.hpp
│ │ ├── function_wrapper.hpp
│ │ ├── unicorn_memory_regions.hpp
│ │ └── unicorn_hook.hpp
├── fuzzer
│ ├── resources
│ │ └── icon.ico
│ ├── CMakeLists.txt
│ └── std_include.hpp
├── analyzer
│ ├── resources
│ │ └── icon.ico
│ ├── snapshot.hpp
│ ├── test.py
│ ├── std_include.hpp
│ ├── CMakeLists.txt
│ ├── analysis.hpp
│ └── tenet_tracer.hpp
├── windows-emulator
│ ├── ports
│ │ ├── api_port.hpp
│ │ ├── dns_resolver.hpp
│ │ └── api_port.cpp
│ ├── devices
│ │ ├── mount_point_manager.hpp
│ │ ├── security_support_provider.hpp
│ │ ├── afd_endpoint.hpp
│ │ └── named_pipe.hpp
│ ├── network
│ │ ├── static_socket_factory.hpp
│ │ ├── socket_factory.hpp
│ │ ├── i_socket.hpp
│ │ ├── socket_wrapper.hpp
│ │ └── socket_factory.cpp
│ ├── cpu_context.hpp
│ ├── minidump_loader.hpp
│ ├── CMakeLists.txt
│ ├── module
│ │ ├── module_mapping.hpp
│ │ └── mapped_module.hpp
│ ├── generic_logger.hpp
│ ├── std_include.hpp
│ ├── wow64_heaven_gate.hpp
│ ├── apiset
│ │ └── apiset.hpp
│ ├── logger.hpp
│ ├── exception_dispatch.hpp
│ ├── syscall_dispatcher.hpp
│ ├── kusd_mmio.hpp
│ └── syscalls
│ │ └── exception.cpp
├── samples
│ ├── test-sample
│ │ ├── resources
│ │ │ └── icon.ico
│ │ └── CMakeLists.txt
│ ├── bad-sample
│ │ ├── CMakeLists.txt
│ │ └── bad.cpp
│ └── CMakeLists.txt
├── backend-selection
│ ├── backend_selection.hpp
│ ├── CMakeLists.txt
│ └── backend_selection.cpp
├── common
│ ├── platform
│ │ ├── network.hpp
│ │ ├── synchronisation.hpp
│ │ ├── traits.hpp
│ │ ├── platform.hpp
│ │ ├── compiler.hpp
│ │ ├── primitives.hpp
│ │ └── port.hpp
│ ├── utils
│ │ ├── compression.hpp
│ │ ├── win.hpp
│ │ ├── interupt_handler.hpp
│ │ ├── object.hpp
│ │ ├── timer.hpp
│ │ ├── io.hpp
│ │ ├── moved_marker.hpp
│ │ ├── string.cpp
│ │ ├── function.hpp
│ │ ├── finally.hpp
│ │ ├── lazy_object.hpp
│ │ ├── concurrency.hpp
│ │ ├── path_key.hpp
│ │ ├── nt_handle.hpp
│ │ └── interupt_handler.cpp
│ ├── CMakeLists.txt
│ └── network
│ │ ├── tcp_server_socket.hpp
│ │ ├── udp_socket.hpp
│ │ ├── tcp_server_socket.cpp
│ │ ├── tcp_client_socket.hpp
│ │ ├── udp_socket.cpp
│ │ └── socket.hpp
├── debugger
│ ├── message_transmitter.hpp
│ ├── event_handler.hpp
│ ├── CMakeLists.txt
│ ├── events.fbs
│ └── message_transmitter.cpp
├── gdb-stub
│ ├── CMakeLists.txt
│ ├── checksum.hpp
│ ├── stream_processor.hpp
│ ├── async_handler.hpp
│ ├── connection_handler.hpp
│ ├── async_handler.cpp
│ └── gdb_stub.hpp
├── fuzzing-engine
│ ├── CMakeLists.txt
│ ├── fuzzer.hpp
│ ├── random_generator.cpp
│ ├── input_generator.hpp
│ └── random_generator.hpp
├── windows-emulator-test
│ ├── file_system_test.cpp
│ ├── CMakeLists.txt
│ ├── emulation_test.cpp
│ └── time_test.cpp
└── CMakeLists.txt
├── .clang-format-ignore
├── docs
└── images
│ ├── yt.jpg
│ ├── cover.png
│ └── preview.jpg
├── cmake
├── misc
│ └── node-pre-script.js
└── toolchain
│ ├── ios.cmake
│ ├── android-ndk.cmake
│ ├── emscripten.cmake
│ └── mingw-w64.cmake
├── deps
├── googletest.cmake
├── zlib.cmake
└── CMakeLists.txt
├── .github
└── dependabot.yml
├── .clang-format
├── .gitmodules
└── CMakePresets.json
/page/.prettierrc:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/src/emulator/empty.cpp:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/windows-gdb-stub/empty.cpp:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.clang-format-ignore:
--------------------------------------------------------------------------------
1 | **/*.hxx
2 | deps/**/*
3 |
--------------------------------------------------------------------------------
/src/tools/.gitignore:
--------------------------------------------------------------------------------
1 | root
2 | root*/
3 | registry
--------------------------------------------------------------------------------
/src/tools/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(dump-apiset)
2 |
--------------------------------------------------------------------------------
/page/.prettierignore:
--------------------------------------------------------------------------------
1 | # Ignore artifacts:
2 | dist
3 | src/fb/
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /Ghidra
3 |
--------------------------------------------------------------------------------
/docs/images/yt.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/momo5502/sogen/HEAD/docs/images/yt.jpg
--------------------------------------------------------------------------------
/cmake/misc/node-pre-script.js:
--------------------------------------------------------------------------------
1 | Module["preRun"] = () => {
2 | ENV = process.env;
3 | };
4 |
--------------------------------------------------------------------------------
/docs/images/cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/momo5502/sogen/HEAD/docs/images/cover.png
--------------------------------------------------------------------------------
/docs/images/preview.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/momo5502/sogen/HEAD/docs/images/preview.jpg
--------------------------------------------------------------------------------
/page/public/pinata.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/momo5502/sogen/HEAD/page/public/pinata.png
--------------------------------------------------------------------------------
/src/fuzzer/resources/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/momo5502/sogen/HEAD/src/fuzzer/resources/icon.ico
--------------------------------------------------------------------------------
/src/analyzer/resources/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/momo5502/sogen/HEAD/src/analyzer/resources/icon.ico
--------------------------------------------------------------------------------
/deps/googletest.cmake:
--------------------------------------------------------------------------------
1 | option(BUILD_GMOCK OFF)
2 | option(INSTALL_GTEST OFF)
3 |
4 | add_subdirectory(googletest)
5 |
--------------------------------------------------------------------------------
/page/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/src/windows-emulator/ports/api_port.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../port.hpp"
3 |
4 | std::unique_ptr create_api_port();
5 |
--------------------------------------------------------------------------------
/cmake/toolchain/ios.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_SYSTEM_NAME "iOS")
2 | set(CMAKE_OSX_ARCHITECTURES "arm64")
3 | set(CMAKE_OSX_DEPLOYMENT_TARGET 14.0)
--------------------------------------------------------------------------------
/src/samples/test-sample/resources/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/momo5502/sogen/HEAD/src/samples/test-sample/resources/icon.ico
--------------------------------------------------------------------------------
/src/windows-emulator/ports/dns_resolver.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../port.hpp"
3 |
4 | std::unique_ptr create_dns_resolver();
5 |
--------------------------------------------------------------------------------
/src/backends/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(unicorn-emulator)
2 |
3 | if (MOMO_ENABLE_RUST)
4 | add_subdirectory(icicle-emulator)
5 | endif()
6 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/x86-16.gdis:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/windows-emulator/devices/mount_point_manager.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../io_device.hpp"
3 |
4 | std::unique_ptr create_mount_point_manager();
5 |
--------------------------------------------------------------------------------
/src/windows-emulator/devices/security_support_provider.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../io_device.hpp"
3 |
4 | std::unique_ptr create_security_support_provider();
5 |
--------------------------------------------------------------------------------
/src/backend-selection/backend_selection.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | std::unique_ptr create_x86_64_emulator();
7 |
--------------------------------------------------------------------------------
/src/common/platform/network.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | template
4 | struct EMU_WSABUF
5 | {
6 | ULONG len;
7 | EMULATOR_CAST(typename Traits::PVOID, CHAR*) buf;
8 | };
9 |
--------------------------------------------------------------------------------
/page/src/lib/utils.ts:
--------------------------------------------------------------------------------
1 | import { clsx, type ClassValue } from "clsx";
2 | import { twMerge } from "tailwind-merge";
3 |
4 | export function cn(...inputs: ClassValue[]) {
5 | return twMerge(clsx(inputs));
6 | }
7 |
--------------------------------------------------------------------------------
/src/windows-emulator/devices/afd_endpoint.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../io_device.hpp"
3 |
4 | std::unique_ptr create_afd_endpoint();
5 | std::unique_ptr create_afd_async_connect_hlp();
6 |
--------------------------------------------------------------------------------
/src/windows-emulator/network/static_socket_factory.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "socket_factory.hpp"
4 |
5 | namespace network
6 | {
7 | std::unique_ptr create_static_socket_factory();
8 | }
9 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/macros.sinc:
--------------------------------------------------------------------------------
1 | macro conditionalAssign(dest, cond, trueVal, falseVal) {
2 | dest = zext(cond) * trueVal | zext(!cond) * falseVal;
3 | }
4 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/x86-64.slaspec:
--------------------------------------------------------------------------------
1 | @define IA64 "IA64"
2 | @include "x86.slaspec"
3 | with : lockprefx=0 {
4 | @include "sgx.sinc"
5 | @include "fma.sinc"
6 | }
7 |
--------------------------------------------------------------------------------
/cmake/toolchain/android-ndk.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_SYSTEM_NAME "Android")
2 | set(CMAKE_ANDROID_NDK "$ENV{ANDROID_NDK_ROOT}")
3 |
4 | set(ANDROID_ABI "$ENV{ANDROID_ABI}")
5 | set(CMAKE_ANDROID_ARCH_ABI "${ANDROID_ABI}")
6 | set(CMAKE_ANDROID_API "24")
--------------------------------------------------------------------------------
/src/windows-emulator/cpu_context.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "arch_emulator.hpp"
3 |
4 | namespace cpu_context
5 | {
6 | void save(x86_64_emulator& emu, CONTEXT64& context);
7 | void restore(x86_64_emulator& emu, const CONTEXT64& context);
8 | }
9 |
--------------------------------------------------------------------------------
/src/windows-emulator/minidump_loader.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | class windows_emulator;
5 |
6 | namespace minidump_loader
7 | {
8 | void load_minidump_into_emulator(windows_emulator& win_emu, const std::filesystem::path& minidump_path);
9 | }
10 |
--------------------------------------------------------------------------------
/page/src/fb/events.ts:
--------------------------------------------------------------------------------
1 | // automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4 |
5 | export * as Debugger from './debugger.js';
6 |
--------------------------------------------------------------------------------
/src/samples/bad-sample/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | add_executable(bad-sample ${SRC_FILES})
10 | target_link_libraries(bad-sample PRIVATE emulator-common)
11 |
12 | momo_assign_source_group(${SRC_FILES})
13 |
--------------------------------------------------------------------------------
/src/emulator/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | add_library(emulator ${SRC_FILES})
10 |
11 | target_link_libraries(emulator PUBLIC emulator-common)
12 | target_include_directories(emulator INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
13 |
--------------------------------------------------------------------------------
/page/src/fb/debugger/state.ts:
--------------------------------------------------------------------------------
1 | // automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4 |
5 | export enum State {
6 | None = 0,
7 | Running = 1,
8 | Paused = 2
9 | }
10 |
--------------------------------------------------------------------------------
/src/debugger/message_transmitter.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | namespace debugger
7 | {
8 | void suspend_execution(std::chrono::milliseconds ms = std::chrono::milliseconds(0));
9 | void send_message(const std::string& message);
10 | std::string receive_message();
11 | }
12 |
--------------------------------------------------------------------------------
/src/samples/test-sample/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | add_executable(test-sample ${SRC_FILES})
10 |
11 | if(WIN)
12 | target_link_libraries(test-sample PRIVATE ws2_32)
13 | endif()
14 |
15 | momo_assign_source_group(${SRC_FILES})
16 |
--------------------------------------------------------------------------------
/page/src/components/ui/skeleton.tsx:
--------------------------------------------------------------------------------
1 | import { cn } from "@/lib/utils";
2 |
3 | function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4 | return (
5 |
10 | );
11 | }
12 |
13 | export { Skeleton };
14 |
--------------------------------------------------------------------------------
/page/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": [],
3 | "references": [
4 | {
5 | "path": "./tsconfig.app.json"
6 | },
7 | {
8 | "path": "./tsconfig.node.json"
9 | }
10 | ],
11 | "compilerOptions": {
12 | "baseUrl": ".",
13 | "paths": {
14 | "@/*": ["./src/*"]
15 | },
16 | "types": ["vite-plugin-pwa/client"]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/page/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/x86-32-golang.register.info:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/tools/dump-apiset/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | add_executable(dump-apiset ${SRC_FILES})
10 |
11 | momo_assign_source_group(${SRC_FILES})
12 |
13 | target_link_libraries(dump-apiset PRIVATE
14 | emulator-common
15 | )
16 |
17 | momo_strip_target(dump-apiset)
18 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/old/x86RealV1.trans:
--------------------------------------------------------------------------------
1 |
2 |
3 | x86:LE:16:Real Mode
4 | x86:LE:16:Real Mode
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "icicle"
3 | version = "0.1.0"
4 | edition = "2024"
5 |
6 | [lib]
7 | crate-type = ["staticlib"]
8 |
9 | [dependencies]
10 | icicle-vm = { git = "https://github.com/icicle-emu/icicle-emu" }
11 | icicle-cpu = { git = "https://github.com/icicle-emu/icicle-emu" }
12 | pcode = { git = "https://github.com/icicle-emu/icicle-emu" }
13 |
--------------------------------------------------------------------------------
/src/common/utils/compression.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | namespace utils::compression
7 | {
8 | namespace zlib
9 | {
10 | constexpr unsigned int ZCHUNK_SIZE = 16384u;
11 | std::vector compress(std::span data);
12 | std::vector decompress(std::span data);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/old/x86smmV1.trans:
--------------------------------------------------------------------------------
1 |
2 |
3 | x86:LE:32:System Management Mode
4 | x86:LE:32:System Management Mode
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/emulator/memory_region.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "memory_permission.hpp"
3 | #include
4 |
5 | template
6 | struct basic_memory_region
7 | {
8 | uint64_t start{};
9 | size_t length{}; // uint64_t?
10 | PermissionType permissions{};
11 | };
12 |
13 | struct memory_region : basic_memory_region<>
14 | {
15 | bool committed{};
16 | };
17 |
--------------------------------------------------------------------------------
/src/common/platform/synchronisation.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // NOLINTBEGIN(modernize-use-using)
4 |
5 | typedef enum _EVENT_TYPE
6 | {
7 | NotificationEvent,
8 | SynchronizationEvent
9 | } EVENT_TYPE;
10 |
11 | typedef enum _WAIT_TYPE
12 | {
13 | WaitAll,
14 | WaitAny,
15 | WaitNotification,
16 | WaitDequeue,
17 | WaitDpc,
18 | } WAIT_TYPE;
19 |
20 | // NOLINTEND(modernize-use-using)
21 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/old/x86V1.trans:
--------------------------------------------------------------------------------
1 |
2 |
3 | x86:LE:32:default
4 | x86:LE:32:default
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/old/x86_64bit_v1.trans:
--------------------------------------------------------------------------------
1 |
2 |
3 | x64:LE:64:default
4 | x86:LE:64:default
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/gdb-stub/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | add_library(gdb-stub ${SRC_FILES})
10 |
11 | momo_assign_source_group(${SRC_FILES})
12 |
13 | target_link_libraries(gdb-stub PUBLIC
14 | emulator-common
15 | )
16 |
17 | target_include_directories(gdb-stub INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
18 |
19 | momo_strip_target(gdb-stub)
20 |
--------------------------------------------------------------------------------
/src/gdb-stub/checksum.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace gdb_stub
6 | {
7 | constexpr size_t CHECKSUM_SIZE = 2;
8 |
9 | inline uint8_t compute_checksum(const std::string_view data)
10 | {
11 | uint8_t checksum = 0;
12 | for (const auto c : data)
13 | {
14 | checksum += static_cast(c);
15 | }
16 |
17 | return checksum;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/samples/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | momo_get_all_targets(EXISTING_TARGETS)
2 |
3 | ##########################################
4 |
5 | add_subdirectory(bad-sample)
6 | add_subdirectory(test-sample)
7 |
8 | ##########################################
9 |
10 | momo_get_all_targets(ALL_TARGETS)
11 | momo_list_difference("${ALL_TARGETS}" "${EXISTING_TARGETS}" SAMPLE_TARGETS)
12 | momo_targets_remove_compile_options("${SAMPLE_TARGETS}" /arch:AVX2 -mavx2)
--------------------------------------------------------------------------------
/src/fuzzing-engine/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | add_library(fuzzing-engine ${SRC_FILES})
10 |
11 | momo_assign_source_group(${SRC_FILES})
12 |
13 | target_link_libraries(fuzzing-engine PRIVATE
14 | emulator-common
15 | )
16 |
17 | target_include_directories(fuzzing-engine INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
18 |
19 | momo_strip_target(fuzzing-engine)
20 |
--------------------------------------------------------------------------------
/src/windows-gdb-stub/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | add_library(windows-gdb-stub ${SRC_FILES})
10 |
11 | momo_assign_source_group(${SRC_FILES})
12 |
13 | target_link_libraries(windows-gdb-stub PUBLIC
14 | gdb-stub
15 | windows-emulator
16 | )
17 |
18 | target_include_directories(windows-gdb-stub INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
19 |
20 | momo_strip_target(windows-gdb-stub)
21 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle_x86_64_emulator.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include "platform/platform.hpp"
6 |
7 | #ifdef ICICLE_EMULATOR_IMPL
8 | #define ICICLE_EMULATOR_DLL_STORAGE EXPORT_SYMBOL
9 | #else
10 | #define ICICLE_EMULATOR_DLL_STORAGE IMPORT_SYMBOL
11 | #endif
12 |
13 | namespace icicle
14 | {
15 | #if !SOGEN_BUILD_STATIC
16 | ICICLE_EMULATOR_DLL_STORAGE
17 | #endif
18 | std::unique_ptr create_x86_64_emulator();
19 | }
20 |
--------------------------------------------------------------------------------
/src/backends/unicorn-emulator/unicorn_x86_64_emulator.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include "platform/platform.hpp"
6 |
7 | #ifdef UNICORN_EMULATOR_IMPL
8 | #define UNICORN_EMULATOR_DLL_STORAGE EXPORT_SYMBOL
9 | #else
10 | #define UNICORN_EMULATOR_DLL_STORAGE IMPORT_SYMBOL
11 | #endif
12 |
13 | namespace unicorn
14 | {
15 | #if !SOGEN_BUILD_STATIC
16 | UNICORN_EMULATOR_DLL_STORAGE
17 | #endif
18 | std::unique_ptr create_x86_64_emulator();
19 | }
20 |
--------------------------------------------------------------------------------
/src/analyzer/snapshot.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace snapshot
6 | {
7 | std::vector create_emulator_snapshot(const windows_emulator& win_emu);
8 | std::filesystem::path write_emulator_snapshot(const windows_emulator& win_emu, bool log = true);
9 |
10 | void load_emulator_snapshot(windows_emulator& win_emu, std::span snapshot);
11 | void load_emulator_snapshot(windows_emulator& win_emu, const std::filesystem::path& snapshot_file);
12 | }
13 |
--------------------------------------------------------------------------------
/page/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "new-york",
4 | "rsc": false,
5 | "tsx": true,
6 | "tailwind": {
7 | "config": "",
8 | "css": "src/index.css",
9 | "baseColor": "neutral",
10 | "cssVariables": true,
11 | "prefix": ""
12 | },
13 | "aliases": {
14 | "components": "@/components",
15 | "utils": "@/lib/utils",
16 | "ui": "@/components/ui",
17 | "lib": "@/lib",
18 | "hooks": "@/hooks"
19 | },
20 | "iconLibrary": "lucide"
21 | }
22 |
--------------------------------------------------------------------------------
/src/common/utils/win.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #ifdef _WIN32
4 |
5 | #ifndef _CRT_SECURE_NO_WARNINGS
6 | #define _CRT_SECURE_NO_WARNINGS
7 | #endif
8 |
9 | #ifndef _CRT_NO_POSIX_ERROR_CODES
10 | #define _CRT_NO_POSIX_ERROR_CODES
11 | #endif
12 |
13 | #ifndef NOMINMAX
14 | #define NOMINMAX
15 | #endif
16 |
17 | #ifndef WIN32_LEAN_AND_MEAN
18 | #define WIN32_LEAN_AND_MEAN
19 | #endif
20 |
21 | #ifdef __MINGW64__
22 | #include
23 | #else
24 | #include
25 | #endif
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/src/tools/grab-registry.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | NET SESSIONS > NUL 2>&1
4 | IF %ERRORLEVEL% NEQ 0 (
5 | ECHO Error: This script requires administrative privileges.
6 | EXIT /B 1
7 | )
8 |
9 | SET REGDIR="registry"
10 | MKDIR %REGDIR%
11 |
12 | REG SAVE HKLM\SYSTEM %REGDIR%\SYSTEM /Y
13 | REG SAVE HKLM\SECURITY %REGDIR%\SECURITY /Y
14 | REG SAVE HKLM\SOFTWARE %REGDIR%\SOFTWARE /Y
15 | REG SAVE HKLM\HARDWARE %REGDIR%\HARDWARE /Y
16 | REG SAVE HKLM\SAM %REGDIR%\SAM /Y
17 | COPY /B /Y C:\Users\Default\NTUSER.DAT "%REGDIR%\NTUSER.DAT"
18 |
--------------------------------------------------------------------------------
/src/gdb-stub/stream_processor.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 |
5 | namespace gdb_stub
6 | {
7 | class stream_processor
8 | {
9 | public:
10 | bool has_packet() const;
11 | std::string get_next_packet();
12 | void push_stream_data(const std::string& data);
13 |
14 | private:
15 | std::string stream_{};
16 | std::queue packets_{};
17 |
18 | void process_data_stream();
19 | void enqueue_packet(std::string packet);
20 | };
21 | }
22 |
--------------------------------------------------------------------------------
/src/common/utils/interupt_handler.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | namespace utils
5 | {
6 | struct interupt_handler
7 | {
8 | interupt_handler(std::function callback);
9 | ~interupt_handler();
10 |
11 | interupt_handler(interupt_handler&&) = delete;
12 | interupt_handler(const interupt_handler&) = delete;
13 |
14 | interupt_handler& operator=(interupt_handler&&) = delete;
15 | interupt_handler& operator=(const interupt_handler&) = delete;
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/src/backend-selection/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | add_library(backend-selection ${SRC_FILES})
10 |
11 | momo_assign_source_group(${SRC_FILES})
12 |
13 | target_include_directories(backend-selection INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
14 |
15 | target_link_libraries(backend-selection PRIVATE
16 | unicorn-emulator
17 | )
18 |
19 | if (MOMO_ENABLE_RUST)
20 | target_link_libraries(backend-selection PRIVATE
21 | icicle-emulator
22 | )
23 | endif()
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/x86.slaspec:
--------------------------------------------------------------------------------
1 | @include "ia.sinc"
2 | @include "lockable.sinc"
3 | with : lockprefx=0 {
4 | @include "avx.sinc"
5 | @include "avx_manual.sinc"
6 | @include "avx2.sinc"
7 | @include "avx2_manual.sinc"
8 | @include "adx.sinc"
9 | @include "clwb.sinc"
10 | @include "pclmulqdq.sinc"
11 | @include "mpx.sinc"
12 | @include "lzcnt.sinc"
13 | @include "bmi1.sinc"
14 | @include "bmi2.sinc"
15 | @include "sha.sinc"
16 | @include "smx.sinc"
17 | @include "cet.sinc"
18 | @include "rdrand.sinc"
19 | }
20 |
--------------------------------------------------------------------------------
/deps/zlib.cmake:
--------------------------------------------------------------------------------
1 | set(ZLIB_BUILD_TESTING OFF CACHE BOOL "" FORCE)
2 | set(ZLIB_BUILD_SHARED OFF CACHE BOOL "" FORCE)
3 | set(ZLIB_BUILD_MINIZIP OFF CACHE BOOL "" FORCE)
4 | set(ZLIB_INSTALL OFF CACHE BOOL "" FORCE)
5 |
6 | add_subdirectory(zlib)
7 | target_compile_definitions(zlibstatic PUBLIC ZLIB_CONST=1)
8 | #target_include_directories(zlibstatic PUBLIC ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR})
9 |
10 | if (TARGET zlib)
11 | set_target_properties(zlib PROPERTIES EXCLUDE_FROM_ALL TRUE)
12 | set_target_properties(zlib PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
13 | endif()
14 |
--------------------------------------------------------------------------------
/src/windows-emulator/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | add_library(windows-emulator ${SRC_FILES})
10 |
11 | momo_assign_source_group(${SRC_FILES})
12 |
13 | if(NOT MOMO_ENABLE_CLANG_TIDY)
14 | target_precompile_headers(windows-emulator PRIVATE std_include.hpp)
15 | endif()
16 |
17 | target_link_libraries(windows-emulator PUBLIC emulator minidump)
18 |
19 | target_include_directories(windows-emulator INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
20 |
21 | momo_strip_target(windows-emulator)
22 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/clwb.sinc:
--------------------------------------------------------------------------------
1 | define pcodeop clwb;
2 | :CLWB m8 is vexMode=0 & $(PRE_66) & byte=0x0F; byte=0xAE; m8 & reg_opcode=6 ... {
3 | clwb(m8);
4 | }
5 |
6 | @ifdef IA64
7 | define pcodeop clflushopt;
8 | :CLFLUSHOPT m8 is $(LONGMODE_ON) & vexMode=0 & $(PRE_66) & byte=0x0F; byte=0xAE; m8 & reg_opcode=7 ... {
9 | clflushopt(m8);
10 | }
11 | @endif
12 |
13 | # Note: PCOMMIT was deprecated prior to it ever being implemented in production processors.
14 | # I never found the encoding for it. Therefore, no constructor.
15 |
--------------------------------------------------------------------------------
/page/src/components/text-tooltip.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Tooltip,
3 | TooltipContent,
4 | TooltipTrigger,
5 | } from "@/components/ui/tooltip";
6 |
7 | export interface TextTooltipProps {
8 | children?: React.ReactNode;
9 | tooltip: React.ReactNode;
10 | }
11 |
12 | export function TextTooltip(props: TextTooltipProps) {
13 | return (
14 |
15 |
16 | {props.children}
17 |
18 | {props.tooltip}
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(icicle-bridge)
2 |
3 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
4 | *.cpp
5 | *.hpp
6 | *.rc
7 | )
8 |
9 | list(SORT SRC_FILES)
10 |
11 | if(SOGEN_BUILD_STATIC)
12 | add_library(icicle-emulator STATIC ${SRC_FILES})
13 | else()
14 | add_library(icicle-emulator SHARED ${SRC_FILES})
15 | endif()
16 |
17 | target_include_directories(icicle-emulator INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
18 |
19 | target_link_libraries(icicle-emulator PUBLIC emulator)
20 | target_link_libraries(icicle-emulator PRIVATE emulator-common icicle-bridge)
21 |
--------------------------------------------------------------------------------
/src/windows-emulator/network/socket_factory.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "i_socket.hpp"
4 |
5 | #include
6 |
7 | namespace network
8 | {
9 | struct poll_entry
10 | {
11 | i_socket* s{};
12 | int16_t events{};
13 | int16_t revents{};
14 | };
15 |
16 | struct socket_factory
17 | {
18 | socket_factory();
19 | virtual ~socket_factory() = default;
20 |
21 | virtual std::unique_ptr create_socket(int af, int type, int protocol);
22 | virtual int poll_sockets(std::span entries);
23 | };
24 | }
25 |
--------------------------------------------------------------------------------
/src/backends/unicorn-emulator/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | if(SOGEN_BUILD_STATIC)
10 | add_library(unicorn-emulator STATIC ${SRC_FILES})
11 | else()
12 | add_library(unicorn-emulator SHARED ${SRC_FILES})
13 | endif()
14 |
15 | target_include_directories(unicorn-emulator INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
16 |
17 | target_link_libraries(unicorn-emulator PUBLIC emulator)
18 | target_link_libraries(unicorn-emulator PRIVATE unicorn emulator-common)
19 |
20 | momo_strip_target(unicorn-emulator)
21 |
--------------------------------------------------------------------------------
/src/common/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | )
5 |
6 | add_library(emulator-common ${SRC_FILES})
7 |
8 | momo_assign_source_group(${SRC_FILES})
9 |
10 | target_include_directories(emulator-common INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
11 |
12 | set(THREADS_PREFER_PTHREAD_FLAG ON)
13 | find_package(Threads REQUIRED)
14 |
15 | target_link_libraries(emulator-common PUBLIC
16 | Threads::Threads
17 | zlibstatic
18 | minidump::minidump
19 | )
20 |
21 | if(WIN)
22 | target_link_libraries(emulator-common PUBLIC
23 | ws2_32
24 | )
25 | endif()
26 |
--------------------------------------------------------------------------------
/src/fuzzer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS
2 | *.cpp
3 | *.hpp
4 | *.rc
5 | )
6 |
7 | list(SORT SRC_FILES)
8 |
9 | add_executable(fuzzer ${SRC_FILES})
10 |
11 | momo_assign_source_group(${SRC_FILES})
12 |
13 | if(NOT MOMO_ENABLE_CLANG_TIDY)
14 | target_precompile_headers(fuzzer PRIVATE std_include.hpp)
15 | endif()
16 |
17 | target_link_libraries(fuzzer PRIVATE
18 | fuzzing-engine
19 | windows-emulator
20 | )
21 |
22 | if (MOMO_ENABLE_RUST)
23 | target_link_libraries(fuzzer PRIVATE
24 | icicle-emulator
25 | )
26 | endif()
27 |
28 | momo_strip_target(fuzzer)
29 |
--------------------------------------------------------------------------------
/src/common/utils/object.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace utils
4 | {
5 | struct object
6 | {
7 | object() = default;
8 | virtual ~object() = default;
9 |
10 | object(object&&) = default;
11 | object(const object&) = default;
12 | object& operator=(object&&) = default;
13 | object& operator=(const object&) = default;
14 | };
15 |
16 | template
17 | void reset_object_with_delayed_destruction(T& obj)
18 | {
19 | T new_obj{};
20 | const auto old = std::move(obj);
21 | obj = std::move(new_obj);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/windows-emulator/module/module_mapping.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "mapped_module.hpp"
4 | #include "../memory_manager.hpp"
5 |
6 | mapped_module map_module_from_data(memory_manager& memory, std::span data, std::filesystem::path file);
7 | template
8 | mapped_module map_module_from_file(memory_manager& memory, std::filesystem::path file);
9 | template
10 | mapped_module map_module_from_memory(memory_manager& memory, uint64_t base_address, uint64_t image_size, const std::string& module_name);
11 |
12 | bool unmap_module(memory_manager& memory, const mapped_module& mod);
13 |
--------------------------------------------------------------------------------
/src/debugger/event_handler.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace debugger
6 | {
7 | enum class emulation_state
8 | {
9 | none,
10 | running,
11 | paused,
12 | };
13 |
14 | struct event_context
15 | {
16 | windows_emulator& win_emu;
17 | emulation_state state{emulation_state::none};
18 | };
19 |
20 | void handle_events(event_context& c);
21 | void handle_exit(const windows_emulator& win_emu, std::optional exit_status);
22 | void update_emulation_status(const windows_emulator& win_emu);
23 | }
24 |
--------------------------------------------------------------------------------
/src/analyzer/test.py:
--------------------------------------------------------------------------------
1 | import os
2 | import subprocess
3 |
4 | emulator_root = os.getenv('EMULATOR_ROOT')
5 | analysis_sample = os.getenv('ANALYSIS_SAMPLE')
6 | virtual_sample = 'C:/analysis-sample.exe'
7 |
8 | application = 'analyzer'
9 |
10 | def make_app(app):
11 | if os.name == 'nt':
12 | return app + ".exe"
13 |
14 | return app
15 |
16 | command = [
17 | os.path.join(os.getcwd(), make_app(application)),
18 | '-c',
19 | '-e', emulator_root,
20 | '-p', virtual_sample, analysis_sample,
21 | virtual_sample
22 | ]
23 |
24 | result = subprocess.run(command, cwd=os.getcwd())
25 |
26 | exit(result.returncode)
27 |
--------------------------------------------------------------------------------
/src/backends/icicle-emulator/icicle-bridge/data/Ghidra/Processors/x86/data/languages/x86-64-golang.register.info:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/windows-emulator-test/file_system_test.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 |
5 | namespace test
6 | {
7 | TEST(FileSystemTest, PathTraversalIsNotPossible)
8 | {
9 | const auto current_dir = std::filesystem::current_path();
10 |
11 | const file_system fs{current_dir};
12 |
13 | EXPECT_EQ(current_dir / "a", fs.translate(windows_path('a', {u"..", u"..", u"..", u"..", u"a.txt"})));
14 | EXPECT_EQ(current_dir / "a", fs.translate(windows_path('a', {u"b", u"..", u"..", u"b", u"..", u"a.txt"})));
15 | EXPECT_EQ(current_dir / "a", fs.translate(windows_path('a', {u"..", u"b"})));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: gitsubmodule
4 | directory: "/"
5 | schedule:
6 | interval: monthly
7 | open-pull-requests-limit: 100
8 |
9 | - package-ecosystem: "github-actions"
10 | directory: "/"
11 | schedule:
12 | interval: monthly
13 | open-pull-requests-limit: 100
14 |
15 | - package-ecosystem: "npm"
16 | directory: "/page"
17 | schedule:
18 | interval: monthly
19 | open-pull-requests-limit: 100
20 |
21 | - package-ecosystem: "cargo"
22 | directory: "/src/backends/icicle-emulator/icicle-bridge/"
23 | schedule:
24 | interval: monthly
25 | open-pull-requests-limit: 100
26 |
--------------------------------------------------------------------------------
/page/src/hooks/use-mobile.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 |
3 | const MOBILE_BREAKPOINT = 768;
4 |
5 | export function useIsMobile() {
6 | const [isMobile, setIsMobile] = React.useState(
7 | undefined,
8 | );
9 |
10 | React.useEffect(() => {
11 | const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
12 | const onChange = () => {
13 | setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
14 | };
15 | mql.addEventListener("change", onChange);
16 | setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
17 | return () => mql.removeEventListener("change", onChange);
18 | }, []);
19 |
20 | return !!isMobile;
21 | }
22 |
--------------------------------------------------------------------------------
/src/common/network/tcp_server_socket.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "socket.hpp"
4 | #include "tcp_client_socket.hpp"
5 |
6 | namespace network
7 | {
8 | class tcp_server_socket : public socket
9 | {
10 | public:
11 | tcp_server_socket(int af);
12 |
13 | tcp_server_socket() = default;
14 | ~tcp_server_socket() override = default;
15 |
16 | tcp_server_socket(tcp_server_socket&& obj) noexcept = default;
17 | tcp_server_socket& operator=(tcp_server_socket&& obj) noexcept = default;
18 |
19 | tcp_client_socket accept();
20 |
21 | void listen();
22 |
23 | private:
24 | bool listening_{false};
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/page/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4 | "target": "ES2022",
5 | "lib": ["ES2023"],
6 | "module": "ESNext",
7 | "skipLibCheck": true,
8 |
9 | /* Bundler mode */
10 | "moduleResolution": "bundler",
11 | "allowImportingTsExtensions": true,
12 | "isolatedModules": true,
13 | "moduleDetection": "force",
14 | "noEmit": true,
15 |
16 | /* Linting */
17 | "strict": true,
18 | "noUnusedLocals": true,
19 | "noUnusedParameters": true,
20 | "noFallthroughCasesInSwitch": true,
21 | "noUncheckedSideEffectImports": true
22 | },
23 | "include": ["vite.config.ts"]
24 | }
25 |
--------------------------------------------------------------------------------
/page/src/components/ui/label.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import * as LabelPrimitive from "@radix-ui/react-label";
3 |
4 | import { cn } from "@/lib/utils";
5 |
6 | function Label({
7 | className,
8 | ...props
9 | }: React.ComponentProps) {
10 | return (
11 |
19 | );
20 | }
21 |
22 | export { Label };
23 |
--------------------------------------------------------------------------------
/src/common/network/udp_socket.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "socket.hpp"
4 |
5 | #include
6 |
7 | namespace network
8 | {
9 | struct udp_socket : socket
10 | {
11 | udp_socket(int af);
12 | udp_socket() = default;
13 | ~udp_socket() override = default;
14 |
15 | udp_socket(udp_socket&& obj) noexcept = default;
16 | udp_socket& operator=(udp_socket&& obj) noexcept = default;
17 |
18 | [[maybe_unused]] bool send(const address& target, const void* data, size_t size) const;
19 | [[maybe_unused]] bool send(const address& target, std::string_view data) const;
20 | std::optional> receive() const;
21 | };
22 | }
23 |
--------------------------------------------------------------------------------
/src/fuzzer/std_include.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include