mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:14:58 +00:00

JBIG2 is infamous for two things: 1. It's used in xerox scanners were it falsifies scanned numbers: https://www.dkriesel.com/en/blog/2013/0802_xerox-workcentres_are_switching_written_numbers_when_scanning 2. It was allegedly used in an iOS zero day, in a very cool way: https://googleprojectzero.blogspot.com/2021/12/a-deep-dive-into-nso-zero-click.html Needless to say, we need support for it in Serenity. (...because it's used in PDF files.) This adds all the scaffolding, but no actual implementation yet. It's enough for `file` to print the mime type of .jb2 files, but `image` can't do anything with the files yet.
379 lines
8.1 KiB
Text
379 lines
8.1 KiB
Text
import("//Meta/gn/build/write_cmake_config.gni")
|
|
|
|
config("ak_headers") {
|
|
include_dirs = [
|
|
"//",
|
|
"$root_gen_dir",
|
|
]
|
|
}
|
|
|
|
shared_library("AK") {
|
|
output_name = "ak"
|
|
|
|
public_configs = [ ":ak_headers" ]
|
|
public_deps = [ ":ak_debug_gen" ]
|
|
|
|
# FIXME: Split out non-kernel sources to their own set
|
|
sources = [
|
|
"AllOf.h",
|
|
"AnyOf.h",
|
|
"ArbitrarySizedEnum.h",
|
|
"Array.h",
|
|
"Assertions.cpp",
|
|
"Assertions.h",
|
|
"Atomic.h",
|
|
"AtomicRefCounted.h",
|
|
"Badge.h",
|
|
"Base64.cpp",
|
|
"Base64.h",
|
|
"BigIntBase.h",
|
|
"BinaryBufferWriter.h",
|
|
"BinaryHeap.h",
|
|
"BinarySearch.h",
|
|
"BitCast.h",
|
|
"BitStream.h",
|
|
"Bitmap.h",
|
|
"BitmapView.h",
|
|
"BufferedStream.h",
|
|
"BuiltinWrappers.h",
|
|
"BumpAllocator.h",
|
|
"ByteBuffer.h",
|
|
"ByteReader.h",
|
|
"ByteString.cpp",
|
|
"ByteString.h",
|
|
"CharacterTypes.h",
|
|
"Checked.h",
|
|
"CheckedFormatString.h",
|
|
"CircularBuffer.cpp",
|
|
"CircularBuffer.h",
|
|
"CircularDeque.h",
|
|
"CircularQueue.h",
|
|
"Complex.h",
|
|
"Concepts.h",
|
|
"ConstrainedStream.cpp",
|
|
"ConstrainedStream.h",
|
|
"CountingStream.cpp",
|
|
"CountingStream.h",
|
|
"DOSPackedTime.cpp",
|
|
"DOSPackedTime.h",
|
|
"DateConstants.h",
|
|
"DefaultDelete.h",
|
|
"Demangle.h",
|
|
"DeprecatedFlyString.cpp",
|
|
"DeprecatedFlyString.h",
|
|
"Diagnostics.h",
|
|
"DisjointChunks.h",
|
|
"DistinctNumeric.h",
|
|
"DoublyLinkedList.h",
|
|
"Endian.h",
|
|
"EnumBits.h",
|
|
"Error.cpp",
|
|
"Error.h",
|
|
"FPControl.h",
|
|
"Find.h",
|
|
"FixedArray.h",
|
|
"FixedPoint.h",
|
|
"FloatingPoint.h",
|
|
"FloatingPointStringConversions.cpp",
|
|
"FloatingPointStringConversions.h",
|
|
"FlyString.cpp",
|
|
"FlyString.h",
|
|
"Format.cpp",
|
|
"Format.h",
|
|
"Forward.h",
|
|
"Function.h",
|
|
"FuzzyMatch.cpp",
|
|
"FuzzyMatch.h",
|
|
"GenericLexer.cpp",
|
|
"GenericLexer.h",
|
|
"GenericShorthands.h",
|
|
"HashFunctions.h",
|
|
"HashMap.h",
|
|
"HashTable.h",
|
|
"Hex.cpp",
|
|
"Hex.h",
|
|
"IDAllocator.h",
|
|
"IPv4Address.h",
|
|
"IPv6Address.h",
|
|
"InsertionSort.h",
|
|
"IntegralMath.h",
|
|
"IntrusiveDetails.h",
|
|
"IntrusiveList.h",
|
|
"IntrusiveListRelaxedConst.h",
|
|
"IntrusiveRedBlackTree.h",
|
|
"IterationDecision.h",
|
|
"Iterator.h",
|
|
"JsonArray.h",
|
|
"JsonArraySerializer.h",
|
|
"JsonObject.cpp",
|
|
"JsonObject.h",
|
|
"JsonObjectSerializer.h",
|
|
"JsonParser.cpp",
|
|
"JsonParser.h",
|
|
"JsonPath.cpp",
|
|
"JsonPath.h",
|
|
"JsonValue.cpp",
|
|
"JsonValue.h",
|
|
"LEB128.h",
|
|
"LexicalPath.cpp",
|
|
"LexicalPath.h",
|
|
"MACAddress.h",
|
|
"Math.h",
|
|
"MaybeOwned.h",
|
|
"MemMem.h",
|
|
"Memory.h",
|
|
"MemoryStream.cpp",
|
|
"MemoryStream.h",
|
|
"NeverDestroyed.h",
|
|
"NoAllocationGuard.h",
|
|
"Noncopyable.h",
|
|
"NonnullOwnPtr.h",
|
|
"NonnullRefPtr.h",
|
|
"NumberFormat.cpp",
|
|
"NumberFormat.h",
|
|
"NumericLimits.h",
|
|
"OptionParser.cpp",
|
|
"OptionParser.h",
|
|
"Optional.h",
|
|
"OwnPtr.h",
|
|
"Platform.h",
|
|
"PrintfImplementation.h",
|
|
"Ptr32.h",
|
|
"Queue.h",
|
|
"QuickSelect.h",
|
|
"QuickSort.h",
|
|
"Random.cpp",
|
|
"Random.h",
|
|
"RecursionDecision.h",
|
|
"RedBlackTree.h",
|
|
"RefCountForwarder.h",
|
|
"RefCounted.h",
|
|
"RefPtr.h",
|
|
"Result.h",
|
|
"ReverseIterator.h",
|
|
"SIMD.h",
|
|
"SIMDExtras.h",
|
|
"SIMDMath.h",
|
|
"ScopeGuard.h",
|
|
"ScopeLogger.h",
|
|
"ScopedValueRollback.h",
|
|
"Singleton.h",
|
|
"SinglyLinkedList.h",
|
|
"SinglyLinkedListSizePolicy.h",
|
|
"SipHash.cpp",
|
|
"SipHash.h",
|
|
"Slugify.cpp",
|
|
"Slugify.h",
|
|
"SourceGenerator.h",
|
|
"SourceLocation.h",
|
|
"Span.h",
|
|
"Stack.h",
|
|
"StackInfo.cpp",
|
|
"StackInfo.h",
|
|
"Statistics.h",
|
|
"StdLibExtraDetails.h",
|
|
"StdLibExtras.h",
|
|
"Stream.cpp",
|
|
"Stream.h",
|
|
"String.cpp",
|
|
"String.h",
|
|
"StringBase.cpp",
|
|
"StringBase.h",
|
|
"StringBuilder.cpp",
|
|
"StringBuilder.h",
|
|
"StringFloatingPointConversions.cpp",
|
|
"StringFloatingPointConversions.h",
|
|
"StringHash.h",
|
|
"StringImpl.cpp",
|
|
"StringImpl.h",
|
|
"StringUtils.cpp",
|
|
"StringUtils.h",
|
|
"StringView.cpp",
|
|
"StringView.h",
|
|
"TemporaryChange.h",
|
|
"Time.cpp",
|
|
"Time.h",
|
|
"Traits.h",
|
|
"Trie.h",
|
|
"Try.h",
|
|
"Tuple.h",
|
|
"TypeCasts.h",
|
|
"TypeList.h",
|
|
"TypedTransfer.h",
|
|
"Types.h",
|
|
"UBSanitizer.h",
|
|
"UFixedBigInt.h",
|
|
"UFixedBigIntDivision.h",
|
|
"URL.cpp",
|
|
"URL.h",
|
|
"URLParser.cpp",
|
|
"URLParser.h",
|
|
"UUID.cpp",
|
|
"UUID.h",
|
|
"UnicodeUtils.h",
|
|
"Userspace.h",
|
|
"Utf16View.cpp",
|
|
"Utf16View.h",
|
|
"Utf32View.cpp",
|
|
"Utf32View.h",
|
|
"Utf8View.cpp",
|
|
"Utf8View.h",
|
|
"Variant.h",
|
|
"Vector.h",
|
|
"WeakPtr.h",
|
|
"Weakable.h",
|
|
"kmalloc.cpp",
|
|
"kmalloc.h",
|
|
"kstdio.h",
|
|
]
|
|
}
|
|
|
|
write_cmake_config("ak_debug_gen") {
|
|
input = "Debug.h.in"
|
|
output = "$root_gen_dir/AK/Debug.h"
|
|
values = [
|
|
"AFLACLOADER_DEBUG=",
|
|
"AUDIO_DEBUG=",
|
|
"AWAVLOADER_DEBUG=",
|
|
"BINDINGS_GENERATOR_DEBUG=",
|
|
"BMP_DEBUG=",
|
|
"CACHE_DEBUG=",
|
|
"CALLBACK_MACHINE_DEBUG=",
|
|
"CANVAS_RENDERING_CONTEXT_2D_DEBUG=",
|
|
"CFF_DEBUG=",
|
|
"CMAKE_DEBUG=",
|
|
"COMPOSE_DEBUG=",
|
|
"COPY_DEBUG=",
|
|
"CPP_DEBUG=",
|
|
"CPP_LANGUAGE_SERVER_DEBUG=",
|
|
"CRYPTO_DEBUG=",
|
|
"CSS_LOADER_DEBUG=",
|
|
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AGE_SERVER_DEBUG=",
|
|
"LEXER_DEBUG=",
|
|
"LIBWEB_CSS_ANIMATION_DEBUG=",
|
|
"LIBWEB_CSS_DEBUG=",
|
|
"LINE_EDITOR_DEBUG=",
|
|
"LOG_DEBUG=",
|
|
"LOOKUPSERVER_DEBUG=",
|
|
"LZMA_DEBUG=",
|
|
"LZW_DEBUG=",
|
|
"MALLOC_DEBUG=",
|
|
"MARKDOWN_DEBUG=",
|
|
"MATROSKA_DEBUG=",
|
|
"MATROSKA_TRACE_DEBUG=",
|
|
"MBR_DEBUG=",
|
|
"MEMORY_DEBUG=",
|
|
"MENU_DEBUG=",
|
|
"MOVE_DEBUG=",
|
|
"NETWORKJOB_DEBUG=",
|
|
"NT_DEBUG=",
|
|
"OCCLUSIONS_DEBUG=",
|
|
"OPENTYPE_GPOS_DEBUG=",
|
|
"PATH_DEBUG=",
|
|
"PDF_DEBUG=",
|
|
"PLAYBACK_MANAGER_DEBUG=",
|
|
"PNG_DEBUG=",
|
|
"PORTABLE_IMAGE_LOADER_DEBUG=",
|
|
"PROMISE_DEBUG=",
|
|
"PTHREAD_DEBUG=",
|
|
"REACHABLE_DEBUG=",
|
|
"REGEX_DEBUG=",
|
|
"REQUESTSERVER_DEBUG=",
|
|
"RESIZE_DEBUG=",
|
|
"RESOURCE_DEBUG=",
|
|
"RSA_PARSE_DEBUG=",
|
|
"SERVICE_DEBUG=",
|
|
"SHARED_QUEUE_DEBUG=",
|
|
"SHELL_JOB_DEBUG=",
|
|
"SHELL_POSIX_PARSER_DEBUG=",
|
|
"SH_DEBUG=",
|
|
"SH_LANGUAGE_SERVER_DEBUG=",
|
|
"SOLITAIRE_DEBUG=",
|
|
"SPAM_DEBUG=",
|
|
"SPICE_AGENT_DEBUG=",
|
|
"SQLSERVER_DEBUG=",
|
|
"SQL_DEBUG=",
|
|
"SYNTAX_HIGHLIGHTING_DEBUG=",
|
|
"SYSCALL_1_DEBUG=",
|
|
"SYSTEMSERVER_DEBUG=",
|
|
"SYSTEM_MENU_DEBUG=",
|
|
"TERMCAP_DEBUG=",
|
|
"TERMINAL_DEBUG=",
|
|
"TEXTEDITOR_DEBUG=",
|
|
"TIFF_DEBUG=",
|
|
"TIME_ZONE_DEBUG=",
|
|
"TLS_DEBUG=",
|
|
"TLS_SSL_KEYLOG_DEBUG=",
|
|
"TOKENIZER_TRACE_DEBUG=",
|
|
"UCI_DEBUG=",
|
|
"UPDATE_COALESCING_DEBUG=",
|
|
"URL_PARSER_DEBUG=",
|
|
"UTF8_DEBUG=",
|
|
"VPX_DEBUG=",
|
|
"WASI_DEBUG=",
|
|
"WASM_BINPARSER_DEBUG=",
|
|
"WASI_FINE_GRAINED_DEBUG=",
|
|
"WASM_TRACE_DEBUG=",
|
|
"WASM_VALIDATOR_DEBUG=",
|
|
"WEBDRIVER_DEBUG=",
|
|
"WEBDRIVER_ROUTE_DEBUG=",
|
|
"WEBGL_CONTEXT_DEBUG=",
|
|
"WEBP_DEBUG=",
|
|
"WEBSERVER_DEBUG=",
|
|
"WEB_FETCH_DEBUG=",
|
|
"WEB_WORKER_DEBUG=",
|
|
"WINDOWMANAGER_DEBUG=",
|
|
"WORKER_THREAD_DEBUG=",
|
|
"WSMESSAGELOOP_DEBUG=",
|
|
"WSSCREEN_DEBUG=",
|
|
"XML_PARSER_DEBUG=",
|
|
]
|
|
}
|