Compare commits

...

657 commits

Author SHA1 Message Date
Benjamin Funke
342dda3064 add update_info_timestamp scripts 2026-06-23 17:54:39 +02:00
horsicq
74e9ca450d chore: update date to 2026-06-23 in db info files 2026-06-23 01:46:57 +02:00
DosX
eed67fc08d dbs_min update 2026-06-22 18:55:48 +03:00
Benjamin Funke
958258a5cd update DiE version in RUN.md 2026-06-22 17:34:53 +02:00
DosX
d23269a06e Add VCasm-Protector and Excalibur detections
Add new heuristics to PE DB: insert VCasm-Protector (version 1.1-1.2, hash 0xcfed7c1e) and Excalibur (version 1.0X, hash 0x7f364e1f) into the packer/cryptor signature list, and add a section-name rule for VCasm-Protector ('vcasm'). Also adjust array punctuation for the appended entries.
2026-06-22 18:33:43 +03:00
DosX
6b53f22ae4 Improve Skater .NET detector
Add upstream GitHub reference and replace the slow signature-in-section check with PE.isNetObjectPresent checks for 'RustemSoft.Skater' and 'RustemSoft.Skater.Skater_NET_Obfuscator' to speed up detection. Keeps the existing EP .NET compare logic and version detection for 2.X.
2026-06-22 18:33:15 +03:00
DosX
5c5e3ad911 Rename and refactor Unicode signature generator
Rename generateUnicodeSignatureMask to convertStringToUnicodeSignature and change its output to a continuous UTF-16LE hex string (no spaces) with consistent zero-padding. Update all callers accordingly across the PE heuristics file, adjust doc examples to the new format, and remove an obsolete substring adjustment for the NjRAT separator pattern. These changes standardize how UTF-16LE signatures are produced and consumed by PE.isSignature*/PE.findSignature calls.
2026-06-22 16:47:15 +03:00
DosX
1af9c5240f dbs_min update 2026-06-22 16:29:29 +03:00
DosX
a8180360d2 Refactor variable names in heuristics
Rename many internal variables in scanForMaliciousCode_NET_and_Native to clearer, self-descriptive identifiers (e.g. k0_off/k1_off/k3_off -> offsetKey0/offsetKey1/offsetKey3, lfa*_off -> offsetLfa*, keyLen/j/L -> keyLength/offset, and byte variables like b0/b1 -> cipherM/cipherZ, etc.). Changes span the pre-calculation block, verifyPeSignature, and scanBuffer to improve readability and maintainability. No functional logic changes intended — behavior should remain the same.
2026-06-22 16:29:00 +03:00
DosX
61509245aa Optimize signature pattern checks
Adjust signature pattern handling in scanForMaliciousCode_NET_and_Native.

- Remove the added "??" prefix when building njRatDataSeparatorPattern so the pattern uses the substring directly.
- Remove the trailing " **" wildcard from the Unicode " RAT" signature passed to PE.isSignatureInSectionPresent to narrow matching.
2026-06-22 16:28:35 +03:00
DosX
6774f5bfb8 Generate precise UTF-16LE hex signature mask
Rewrite generateUnicodeSignatureMask to produce UTF-16LE hex byte sequences for each character. The new implementation uses charCodeAt to extract code units, computes low/high bytes in little-endian order, pads bytes to two hex digits (ES3/ES5 compatible), and joins byte pairs with spaces. This replaces the previous quoted 'char'00' style output and correctly handles non-ASCII characters.
2026-06-22 16:27:49 +03:00
DosX
c4c388de73 Refactor PE scan buffer decoding and checks
Replace custom hex decoding and helper with direct PE.readBytes, removing hexLUT and getDecodedBuffer to reduce overhead. Simplify scanBuffer signature and internals (rename comment, local caching, remove unused offsetBase), tighten verifyPeSignature comments and remove redundant explanatory comments. Use PE.readBytes for resources, overlay and sections, and keep existing algorithm detection logic intact; this is a cleanup/optimization to improve readability and performance without changing core behavior.
2026-06-22 16:15:17 +03:00
DosX
7f96c2e668 Simplify e_lfanew fast-fail and cache lfa3
Remove redundant b3 decode and consolidate the e_lfanew fast-fail check to test upper 16-bits against max bounds. Treat the MSB of e_lfanew as implicitly 0 and move its per-iteration validation into the main scan loop by caching lfa3_off as _lfa3 and reading the MSB (d3F) once per iteration. This reduces repeated reads and unnecessary variables, clarifies assumptions about e_lfanew, and slightly improves performance by localizing offsets and eliminating a prior separate fast-fail branch.
2026-06-22 16:09:36 +03:00
DosX
16791938db Optimize PE signature decryption and scanning
Inline and optimize PE header verification and scanning hot paths for performance. Added precomputed lfa*_off lookup tables for e_lfanew byte offsets and removed the getDecryptedByte helper by inlining decryption math inside verifyPeSignature to avoid function-call and modulo overhead. Reduced repeated arithmetic by caching base indices, precomputing remainder r, and validating high-order bytes early; also added maxLfa to avoid recomputing buffer bounds. Minor micro-optimizations: cache hexLUT locally in getDecodedBuffer, cache k*_off arrays in scanBuffer, and break out of loops once an encrypted PE is detected. Behavior and verification checks are preserved while improving throughput in tight scanning loops.
2026-06-22 16:07:28 +03:00
DosX
f2fa6b342b Optimize PE heuristic scanning and decryption
Performance and memory optimizations for the PE heuristic scanner:

- Tighten DOS-PDB scan loop to stop once pdbPathBeginOffset is found (avoids an extra break).
- Replace offset tables (k0_off/k1_off/k3_off) with typed Uint8Array to reduce allocations and improve access speed.
- Extract a single getDecryptedByte function (removed inner closure) to avoid per-call closure allocation and centralize decrypt logic.
- Add a fast-fail check for the most-significant byte of e_lfanew and simplify lfaNewOffset calculation to speed header validation.
- Replace multiple inline decryption calls with getDecryptedByte in verifyPeSignature for clarity and efficiency.
- Restructure the detection inner loop to early-continue on mismatches and apply lazy evaluation for arithmetic checks (ADD-SUB / SUB-REV) to reduce unnecessary work.

Behavior should be unchanged functionally while reducing CPU and memory overhead during scanning.
2026-06-22 16:02:50 +03:00
DosX
1837b16d0b dbs_min update 2026-06-22 14:55:45 +03:00
DosX
987d68a71d Optimize PE section scanning and caching
Cache section properties (offset, size, name) and replace direct PE.section accesses to improve readability and performance. Adjust skip logic to use cached sectionSize/sectionName. Expand scanning windows: scan .text of .NET assemblies up to 0x64000, increase data-like sections to 0x12000 and other sections to 0x6000 (previously smaller), to improve detection of encoded/encrypted payloads.
2026-06-22 14:55:36 +03:00
DosX
ab126dd877 dbs_min update 2026-06-22 14:02:37 +03:00
DosX
6b180e6bb8 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-22 14:02:01 +03:00
DosX
3303f77420 Standardize wildcard and broaden resource checks
Replace inconsistent byte wildcard in a signature ("81 ED ?? ?? 01 20" -> "81 ED .. .. 01 20") to match the file's wildcard convention, and expand resource-name detection by adding a regex for obvious malicious names (TROJAN, VIRUS, MALWARE, DROPPER). An inline comment was added explaining the resource-name check; minor spacing was also adjusted.
2026-06-22 14:01:59 +03:00
Benjamin Funke
0b2f054553 add references to PE signatures 2026-06-21 17:54:53 +02:00
DosX
134b93e3d2 dbs_min update 2026-06-21 13:10:07 +03:00
DosX
435cf589d0 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-21 13:09:24 +03:00
DosX
9853fdc223 Rename MSDOS rule files; adjust RM_FORTRAN mode
Rename several MSDOS detection rule files to include category prefixes and improve organization. Files renamed:
- db/MSDOS/RM_FORTRAN.4.sg -> db/MSDOS/compiler_RM_FORTRAN.4.sg (mode changed 100755 -> 100644; only whitespace/formatting normalized, no detection logic change)
- db/MSDOS/REC_small_AV.1.sg -> db/MSDOS/immunizer_REC_small_AV.1.sg
- db/MSDOS/RLE_com-packer.2.sg -> db/MSDOS/packer_RLE_com-packer.2.sg
- db/MSDOS/REC_small.1.sg -> db/MSDOS/protector_REC_small.1.sg
- db/MSDOS/anti-tracing_add-on.1.sg -> db/MSDOS/protector_anti-tracing_add-on.1.sg

No functional changes to detection rules aside from the noted formatting and permission adjustment.
2026-06-21 13:09:22 +03:00
Benjamin Funke
4e608a54f6 add references for Aztec C/AmigaBasic signature 2026-06-21 11:54:54 +02:00
DosX
82e408f2df Rename DB files to sfx_ and compiler_ prefixes
Rename several database pages to standardized prefixes for clearer organization: db/LX/{PKZIP-SFX.1.sg,RAR-SFX.1.sg} -> db/LX/sfx_PKZIP-SFX.1.sg and db/LX/sfx_RAR-SFX.1.sg; db/MSDOS/{Microsoft_Fortran.4.sg,Microsoft_Quick_Basic.4.sg} -> db/MSDOS/compiler_Microsoft_Fortran.4.sg and db/MSDOS/compiler_Microsoft_Quick_Basic.4.sg. Files are unchanged (100% similarity); only filenames were updated to reflect type (sfx for self-extractors, compiler for compilers).
2026-06-21 12:46:12 +03:00
DosX
bb3351fdbb Rename Borland C to C++ and update sLang
Rename db/LX/compiler_Borland_C.4.sg to db/LX/compiler_Borland_C++.4.sg and update the detect() function to set sLang from "C/C++" to "C++". This adjusts the file/name to explicitly represent the C++ compiler and aligns the language identifier accordingly; no other functional changes.
2026-06-21 12:44:48 +03:00
DosX
b0f6c22d8d Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-21 12:43:23 +03:00
DosX
86151c660f Strengthen de4dot .NET detection logic
Refine the PE.NET detection in tool_de4dot.6.sg: accept either method_0 or smethod_0 and require either both GClass0 & GClass1 or both Class0 & Class1. Previously the check relied on smethod_0 and allowed a single GClass0 (or Class0+Class1), which could produce false positives; this change makes detection stricter and more accurate.
2026-06-21 12:43:13 +03:00
Benjamin Funke
3c0c6b8a53 add references to LX signatures 2026-06-21 11:31:02 +02:00
Benjamin Funke
fa082ddaf1 add references to MACH signatures 2026-06-21 11:29:03 +02:00
DosX
dac2016dfb Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-21 12:26:31 +03:00
DosX
3113bca5ed Expand malware signature list with more variants
Add additional signature variants to the signsToCheck array in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg (scanForMaliciousCode_NET_and_Native). New entries cover different capitalizations and synonyms for file/cookie/wallet stealers (e.g. Grabfiles/stealfiles, GrabCookies, WalletsStealer/WalletsGrabber) to improve detection coverage for varied naming conventions.
2026-06-21 12:26:22 +03:00
Benjamin Funke
96836f65dc redefine Virbox signature as protector 2026-06-21 11:25:36 +02:00
DosX
e087251e33 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-21 12:22:27 +03:00
DosX
f249f403a6 Categorize and rename MSDOS rule files
Rename many db/MSDOS detection rules to include category prefixes (e.g. compiler_, extender_, immunizer_, linker_, protector_, other_) for clearer organization. Add sLang assignment for Microsoft_C rule to set "C" or "C/C++" based on sName. Normalize formatting/whitespace in several scripts and remove executable bit from a few rule files. No detection logic changes besides the explicit sLang assignment.
2026-06-21 12:22:16 +03:00
Benjamin Funke
fb7147c698 rename library_java to library_Java
Also added reference to the Java website
2026-06-21 11:19:12 +02:00
DosX
4f6397516c dbs_min update 2026-06-21 12:14:04 +03:00
DosX
a5b91db3ad Refactor MSDOS rule filenames; set LSI C language
Renamed multiple db/MSDOS detection rule files to include category prefixes (compiler_, library_, protector_, self-displayer_, sfx_) for clearer organization. Cleared executable bits on LSI_C and Khrome_Crypt files (100755 → 100644). Added sLang = "C" to the LSI C detection rule to explicitly mark the language. No other functional changes.
2026-06-21 12:13:36 +03:00
DosX
20c1d39026 Set sLang in detectors; rename DB files
Populate sLang in several MS-DOS detector scripts so the detected language is recorded (Logitech_Modula-2.4: sLang = "Modula-2"; ASIC-Basic, ApBasic, BetterBASIC, Turbo_Basic: sLang = "Basic"). Also rename L_O_V_E__FORTH.4.sg to compiler_L_O_V_E__FORTH.4.sg and Phar_Lap.0a.sg to extender_Phar_Lap.0a.sg to standardize database file naming. No other logic changes.
2026-06-21 12:06:59 +03:00
DosX
9a03a2c257 Reclassify and rename MSDOS rule files
Rename multiple files in db/MSDOS to add category prefixes (e.g. converter_, extender_, packer_, protector_, self-displayer_) for clearer organization. Remove executable bit on several .sg files (mode 100755 -> 100644) and apply minor whitespace/line-ending normalization in a few detection rules (no functional changes).
2026-06-21 12:01:50 +03:00
DosX
798b437caa Add Rabby Wallet signature to heuristics
Append Rabby Wallet signature string to the PE heuristic list in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to improve detection of Rabby Wallet-related binaries.
2026-06-21 11:57:24 +03:00
DosX
d0fb016461 Remove sOptions assignment in MACH gcc detect
Stop forcing sOptions = "C/C++" in db/MACH/compiler_gcc.4.sg when libgcc_s.1.dylib is present. The detection now only sets bDetected, avoiding an unintended override of compiler option state elsewhere.
2026-06-21 11:40:53 +03:00
DosX
5890991148 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-21 11:38:47 +03:00
DosX
74a0883a84 Stop .NET header loop early; add OneKey Wallet sig
Limit iteration in scanForObfuscations_NET by adding an early-exit condition to the for loop (for ... && !isStrangeEpPosition) and remove the redundant break. Also append the OneKey signature string to the malicious signature array in scanForMaliciousCode_NET_and_Native so it is recognized by heuristics.
2026-06-21 11:38:44 +03:00
Benjamin Funke
6b276f63cb improve gcc MACH signature
Change bDetected types to = true to sync our coding standards, remove an duplicated MACH variant which is already in use by the signature
2026-06-21 09:57:53 +02:00
Benjamin Funke
82469c4924 add reference for Delphi signature 2026-06-21 09:56:18 +02:00
Benjamin Funke
f38b4b9623 add references for NE signatures 2026-06-21 09:50:46 +02:00
Benjamin Funke
cc0e869a2b add references for PE signatures 2026-06-21 09:46:17 +02:00
Benjamin Funke
511c99562f add references to signatures 2026-06-20 22:32:01 +02:00
Benjamin Funke
f46b3ca1ac remove newlines in MS-XNA/KTX signature 2026-06-20 21:36:33 +02:00
DosX
cf5a235a54 dbs_min update 2026-06-20 19:44:12 +03:00
DosX
10b6350cb5 Extend PE compare signature; minor formatting
Extend the PE.compare pattern used to skip bitmap resources by adding extra trailing zero bytes to the signature, reducing false positives when determining resource types. Also perform minor whitespace/formatting cleanups in heuristic functions (isNameObfuscated and scanForLanguagesAndCompilers) to improve readability.
2026-06-20 19:43:24 +03:00
DosX
d77aa6f6dd Skip empty/small sections during entropy scan
Add a guard in scanForPackersAndCryptors_NET_and_Native to skip sections with FileOffset == 0 or FileSize < 0x1000 before calculating entropy. This avoids reading invalid/empty section data and reduces false/high-entropy detections for very small sections, improving robustness of packer/cryptor detection.
2026-06-20 19:33:40 +03:00
DosX
10fa1b1822 Only skip tiny sections when sectionOffset > 0
Restrict the small-section skip in scanForMaliciousCode_NET_and_Native to cases where sectionOffset > 0. This prevents erroneously bypassing section processing when sectionOffset is zero or unset, preserving entry/resource section checks and improving heuristic scanning accuracy in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg.
2026-06-20 16:09:22 +03:00
DosX
16aff736fc dbs_min update 2026-06-20 15:59:58 +03:00
DosX
722077df81 Allow wildcards in sub ebp immediate pattern
Replace the fixed immediate bytes in the heuristic pattern (was `81 ED 32 6F 01 20`) with wildcards (`81 ED ?? ?? 01 20`) in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg. This relaxes the signature for the `sub ebp, imm` instruction so the rule can match more binary variants while keeping the surrounding instruction sequence intact for detection.
2026-06-20 15:59:50 +03:00
DosX
eb07d5723d Refactor risk score calc and verdict details
Introduce a percentageOfRiskScore variable to avoid recomputing the risk expression and clamp it to 100. Use this variable in the verdict details string and append the mayBeInfected note when the computed percentage is below 70%, improving readability and providing conditional infection context.
2026-06-20 08:06:00 +03:00
DosX
ddcb553e3f dbs_min update 2026-06-20 07:42:54 +03:00
DosX
7c7194f655 Refactor scanning: extract scanArea and improve heuristics
Extracted a reusable scanArea(areaOffset, areaSize) helper to centralize base64/anchor scanning and replaced global/unicode scanning with targeted scans. Add targeted scanning of PE sections, unmanaged resources and the overlay (gated by packer/protector results), with optimizations to skip unlikely sections (small sections, common .text/.rsrc/.idata/.reloc cases) and to only target large resources (>4KB) while skipping bitmaps. Also renamed/cleaned up offset variables and simplified encrypted-payload scanning logic by consolidating maxScanSize/dataBuffer creation and removing redundant conditionals. These changes improve performance and detection coverage.
2026-06-20 07:42:34 +03:00
DosX
f22203954f Extend section name regex to match .edata/.xdata
Update the section name pattern from /^\.(?:r)?data$/i to /^\.[rex]?data$/i so .edata and .xdata (in addition to .rdata and .data) are recognized and get the larger scan size when scanning for malicious code.
2026-06-20 06:02:20 +03:00
DosX
3a4f9a10e6 Detect ASCII/UTF-16LE Base64 payloads
Replace simple signature variants with robust Base64 payload detection for both ASCII and UTF-16LE encodings. The patch checks for "TV" + raw postfix bytes in the DOS stub (ASCII) and searches for a UTF-16LE "TV" anchor plus Unicode signature masks, sets a base64Version flag, and emits an "Encoded executable payload" verdict including the encoding (Base64, ASCII/UTF-16LE). Removes the prior validateGlobalUnicodeString/validateSignature path and consolidates detection logic.
2026-06-20 05:59:25 +03:00
DosX
90db1886d7 dbs_min update 2026-06-19 17:53:21 +03:00
DosX
88548b7a0b Clarify detection scope in comment
Update comment to explicitly state the heuristic detects encrypted PE files in resources, sections, and overlay via KPA (Known Plaintext Attack). This is a documentation-only change to clarify detection scope; no functional code changes.
2026-06-19 17:52:58 +03:00
DosX
0ab54f846c Label payloads as executable and skip PE sections
Update verdict labels to specify "executable" for Base64 and encrypted payloads for clarity. Add an optimization comment and additional checks to skip scanning common PE sections (.rsrc, .idata, .reloc) when they're unlikely to contain encrypted payloads, and reorder a conditional for the entry-point/.text check to be more robust.
2026-06-19 17:49:09 +03:00
DosX
0a74ea574a Optimize PE scan loop and hex decoding
Performance and readability refactor of the PE heuristic scanner.

- Introduce Uint8Arr alias (fallback to Array) and a hexLUT typed lookup table for fast hex-to-byte decoding.
- Replace dynamic per-byte hex parsing with LUT and allocate decoded buffers as Uint8Arr to reduce overhead.
- Refactor scanBuffer: hoist variables, minimize re-computation, and apply lazy evaluation for alternative decryption checks (ADD/SUB and SUB/REV) to short-circuit work when XOR/XNOR matches.
- Minor cleanup of PE header offset assignment/comment.

Changes are intended to improve speed and reduce allocations while preserving existing verification logic.
2026-06-19 11:45:39 +03:00
DosX
b92aeb6e9a Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-19 11:22:34 +03:00
DosX
5f45111d01 Refactor getDecrypted and add conhost.exe
Change the inner getDecrypted implementation to a named function with combined variable declarations and clearer multiline ternary formatting for readability; no functional change to the decryption logic. Also add "conhost.exe" to systemFileNamesDict so the console host is treated as a system-signed filename.
2026-06-19 11:22:31 +03:00
Benjamin Funke
f4aa94179a add ObjGrid signature 2026-06-19 01:18:10 +02:00
Benjamin Funke
d7ce667b68 add FluidSynth signature 2026-06-19 00:45:21 +02:00
Benjamin Funke
8d8fa5f773 add DWMAPI signature 2026-06-19 00:16:31 +02:00
Kaens
d74d71aa29 audio.1.sg now has unique format IDs for parsing + extra
(see Kaens/audio1sg for details)
2026-06-18 20:06:01 +02:00
DosX
400ed3f5d9 dbs_min update 2026-06-18 19:34:33 +03:00
DosX
8dc9261189 Support SUB-REV mode and PE verification fix
Add detection/support for a new SUB-REV (arithmetic-reverse) decryption mode: introduce mode 2 in verifyPeSignature and extend the universal decryptor return to handle SUB-REV. Compute reverse expected bytes (e0_rev/e1_rev) and add a matching detection branch. Also fix PE header offset handling (avoid double addition of peStartOffset) and normalize algorithm labels (e.g. "XOR-XNOR", "ADD-SUB") and the verdict version string to include "Algo: ". These changes improve heuristic coverage for encrypted PE payloads using reversed subtraction schemes.
2026-06-18 19:34:17 +03:00
DosX
828cb6e9cf Remove redundant whitespace stripping on signature
Eliminate the unnecessary .replace(/\s/g,'') call when obtaining the hex signature in scanForMaliciousCode_NET_and_Native (db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg). PE.getSignature already provides the expected format, so this avoids redundant processing and preserves the original returned string.
2026-06-18 19:07:58 +03:00
DosX
85f36dee0a Increase default section scan size to 0x3000
Adjust the maxScanSize calculation in scanForMaliciousCode_NET_and_Native so non-.rdata PE sections are scanned up to 0x3000 bytes (was 0x2500). .rdata sections remain capped at 0x6000. This expands the scan window to improve detection coverage for larger sections.
2026-06-18 18:29:01 +03:00
DosX
4c582a4ef1 Refactor: add getDecodedBuffer and reuse
Introduce getDecodedBuffer(offset, size) to decode PE.getSignature hex strings into byte arrays and replace three duplicated decoding loops (resources, overlay, sections) with calls to this helper. This reduces code duplication, improves readability and maintainability, and preserves existing scanBuffer behavior. Also removes a stray blank line.
2026-06-18 18:11:14 +03:00
DosX
47d213b809 dbs_min update 2026-06-18 18:00:44 +03:00
DosX
4c480aa3b6 Fix PE header, hex parsing, and overlay scan
Use lfaNewOffset directly for the PE header offset (avoids adding peStartOffset incorrectly). Normalize hex signatures by removing whitespace and uppercasing lowercase hex chars before byte conversion (applied to resource, overlay and section scans). Increase overlay scan limit from 0x1000 to 0x14000 to allow scanning larger overlays. These changes improve signature parsing reliability and broaden scanning coverage.
2026-06-18 17:58:35 +03:00
DosX
9893fbad90 Fix lfaNewOffset unsigned calc and verify size
Coerce the computed e_lfanew to an unsigned 32-bit value using >>> 0 to avoid negative/incorrect offsets. Also tighten the remaining-buffer length passed to verifyPeSignature from (bufferSize - j - 4) to (bufferSize - j - 0x20) in both signature-check branches to avoid overly permissive/unsafe verification and reduce risk of out-of-bounds reads.
2026-06-18 16:02:09 +03:00
DosX
a69fcc2e0e Update __GenericHeuristicAnalysis_By_DosX.7.sg 2026-06-18 15:55:22 +03:00
DosX
1f67d14028 Reduce scan sizes and add section scanning
Lower max scan size for resource and overlay scans from 0x2000 to 0x1000 to reduce scanning work, and add a new section-scanning pass to detect encrypted payloads. The new loop skips obvious benign sections (entry-point .text and .rsrc) and only scans large sections (>0x2500), using a larger window for data-like sections (.data/.rdata). Hex signatures are converted to a byte buffer and fed to scanBuffer; if a match is found isEncPePresent is set to true.
2026-06-18 15:24:57 +03:00
DosX
d21026b565 Refactor KPA scan; add overlay scanning
Extract repeated KPA scanning logic into a scanBuffer helper to avoid duplication and simplify resource scanning. Extend detection to include PE overlays (in addition to resources), reading up to 0x2000 bytes of overlay data (only if overlaySize > 0x1000 and the PE is unsigned) and converting the hex signature into a data buffer before scanning. Updated comment to reflect overlay support and preserved existing multi-algorithm/key-length verification via verifyPeSignature.
2026-06-18 09:55:36 +03:00
DosX
123c8e1eb3 Tighten PE heuristic thresholds
Reduce the allowed NumberOfSections upper bound from 96 to 48 to tighten PE header validation and reduce false positives. Increase the targeted resource payload threshold from 0x300 (768 bytes) to 0x1000 (4096 bytes) so the heuristic focuses on larger payloads; the comment was updated accordingly. Changes made in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg.
2026-06-18 09:23:28 +03:00
DosX
00603c95ef Detect multiple encrypted PE algorithms in resources
Add KPA-based detection for encrypted PE files embedded in resources, supporting multiple algorithms (XOR/XNOR and ADD/SUB) and key lengths up to 20 bytes. Replace isXorPePresent with a generic isEncPePresent and track detectedAlgo. Introduce mode-aware decryptor and stronger PE header verification (checks for PE signature, Optional Header magic, NumberOfSections and Characteristics). Adjust resource size/scan thresholds and skip bitmap-like resources. Report encrypted payloads with detected algorithm type.
2026-06-18 09:09:37 +03:00
DosX
f58d4d00fe Extend XOR PE KPA to 20-byte keys and tighten checks
Expand the Known-Plaintext Attack (KPA) support from 16 to 20-byte keys by resizing offset arrays and updating loops; document that 20 bytes is the mathematical maximum for this O(1) KPA using the e_res2 20-byte zero block. Replace throw string with throw new Error for consistent error objects. Increase minimum resource size check from 0x100 to 0x800 (2 KB) to avoid scanning tiny resources, remove noisy debug/key-dump logging, and simplify fast-fail logic and comments for clearer, slightly faster XOR-PE detection.
2026-06-18 08:21:42 +03:00
DosX
a065244668 dbs_min update 2026-06-18 07:29:20 +03:00
DosX
f6de2b5687 Update __GenericHeuristicAnalysis_By_DosX.7.sg 2026-06-18 07:29:12 +03:00
DosX
29cb94f796 Declare loop variables and tighten scopes
Move several loop/index variables (len, i, k, p, j, L) into their for-loop headers with var to limit scope and avoid accidental globals. Remove redundant initializations and a stray variable declaration. Also convert the verifyPeSignature function expression into a function declaration for clarity. No algorithmic changes intended—this is a scoping/cleanup refactor to reduce potential bugs.
2026-06-18 07:22:58 +03:00
DosX
5cd261630b Detect XOR-encrypted PE in resource sections
Add heuristic to detect XOR-encrypted PE files embedded in resources using a known-plaintext attack (assumes 'MZ'). Supports key lengths 1–16 bytes and precomputes offset maps to avoid costly modulo math in the hot loop. Implements a strict verifyPeSignature routine to validate e_lfanew/PE signature, limits scans to the first 4KB of each resource for performance, and reports a "XOR-encrypted payload" verdict when found.
2026-06-18 07:12:46 +03:00
DosX
c654c99320 Expand heuristic strings, add NoIP and fixes
Update PE heuristic database to improve detection coverage and correct signatures: add "NSS_Init" to Firefox-related fingerprints; include alternate WindowsLive/\My Received Files path variant; broaden Paltalk registry keys to include uppercase SOFTWARE and HKCU variants; add NoIP (Vitalwerks DUC) registry keys; include "Ftplist.txt" for FTP Commander detection; and clarify the generic entry comment to reduce false positives. These changes refine string matches and widen coverage for legitimate variations of targeted applications.
2026-06-18 05:48:33 +03:00
DosX
78aab14a73 Enhance credential heuristics and patterns
Update PE heuristic database to broaden credential and artifact detection: add alternate key filenames (\keys3.db, \keys4.db), include additional Outlook profile GUIDs, and add Microsoft Edge user-data path. Expand IMVU name variants for case-insensitive matching and add extra password token variants (including spaced and uppercase forms) to improve credential string matching.
2026-06-18 05:29:59 +03:00
DosX
6fb2cf5815 dbs_min update 2026-06-17 17:53:19 +03:00
DosX
9e0b8daba0 Improve Intel XeSS detection heuristics
Extend the detect() logic to also check for xessGetVersion and xessDestroyContext via PE.isFunctionPresent so the Intel XeSS library is detected even when the lib name isn't found. Preserve the export-symbol regex fallback that sets sOptions to "static" only when matching xess export functions are present. This makes detection more reliable and reduces false positives for static-only classification.
2026-06-17 17:52:50 +03:00
DosX
a4bf165f51 Expand OpenSSL library detection regex
Add libeay32 and ssleay32 to the OpenSSL detection regex in db/PE/library_OpenSSL.4.sg so the PE scanner also recognizes legacy Windows OpenSSL library names (libeay32/ssleay32) in addition to libssl/libcrypto.
2026-06-17 17:39:58 +03:00
DosX
4eb1f22b4e Add Detect It Easy rule for NVIDIA GeForce NOW SDK
Add new detection rule (db/PE/library_Nvidia_GeForce_NOW_SDK.4.sg) to identify the NVIDIA GeForce NOW SDK. The rule checks for presence of GfnRuntimeSdk.dll or exported functions matching /^gfn(?:Free|Get|Register|Start|Stop)/, sets the "static" option for EAT-based detections, and returns the detection result. File includes author/contact metadata.
2026-06-17 17:39:49 +03:00
DosX
1dd4e2eeaf Refine protector heuristic regex
Tighten the "protector" detection regex in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to avoid false positives. The updated pattern adds anchors and exclusions to skip Unity symbols like `_guard_c`/`_guard_d` and avoid matching Chromiums' exact "prot" token, and includes an inline comment explaining the exceptions.
2026-06-17 14:21:28 +03:00
DosX
2902dc790d Add PE detection rule for Brotli library
Add db/PE/library_Brotli.4.sg to detect the Google Brotli library in PE files. The rule checks for library names matching brotlidec/brotlienc and for exported functions starting with BrotliDecoder or BrotliEncoder; when only exports are present it sets sOptions to "static". File includes author/contact metadata.
2026-06-17 14:12:20 +03:00
DosX
bbc91ca478 dbs_min update 2026-06-14 18:51:21 +03:00
DosX
1bbd0975ed Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-14 18:51:03 +03:00
DosX
4ff9abd380 Add GrabFiles and StealFiles to heuristic signs
Add two new string indicators ('GrabFiles', 'StealFiles') to the signsToCheck array in the PE generic heuristic analysis script to improve detection of file-exfiltration/stealer behaviors. Also adjust formatting of the array entries for clarity.
2026-06-14 18:51:02 +03:00
DosX
66641fb85f Improve Nvidia DLSS regex and add Nvidia NTC rule
Refine DLSS detection regex to match '.dlss' followed by either a dot or underscore (changed from '.dlss(.|_)' to '.dlss[._]') for simpler, equivalent matching. Add new detection rule db/PE/library_Nvidia_NTC.4.sg to detect Nvidia NTC (matches 'libntc') and return the detection result.
2026-06-14 18:50:54 +03:00
Benjamin Funke
bf2f69c527 add 8.38 to Digital Mars signature 2026-06-13 08:47:07 +02:00
DosX
4496a8a8bc dbs_min update 2026-06-13 02:37:56 +03:00
DosX
7f564a0834 Improve heuristic signatures and add detections
Expand and correct heuristic detection patterns across multiple app rules. Fix ProtonVPN string, add OpenVPN profile/ovpn matches, include NordApp, FileZilla.log and extra Ethereum/Electrum/Bitcoin/Bytecoin path variations. Add new rules for Yahoo/YahooMessenger, Kazaa, Digsby, PuTTY, Microsoft Office registry keys, and VimeWorld Minecraft entries. Enhance Discord, DashCore and Chromium signatures and extend the generic block with RDP, password patterns, credit-card/ID regexes and Active Setup keys to improve coverage and reduce false negatives.
2026-06-13 02:36:19 +03:00
DosX
500105925a Heuristics: add paths and refactor stealer checks
Extend heuristic signatures and simplify detection logic:

- Add more Steam config path variants and FlashFXP v4 / ProgramData quick.dat paths.
- Reorder/remove duplicate registry entries (Rockstar GTA IV entry moved/cleaned).
- Add additional detection strings (DisableTaskMgr, DisableRegistry, keyscrambler) to the generic string list.
- Replace a long chain of PE.isNetObjectPresent(...) checks with a consolidated signsToCheck array and loop, adding more variants (KeyLogger/ClipLogger/GrabPasswords/ScanWallets/etc.) and breaking on first match to reduce duplication and improve maintainability.
2026-06-12 22:05:21 +03:00
DosX
46a84cb7a5 dbs_min update 2026-06-12 13:14:30 +03:00
DosX
b131106437 Prefix MSDOS DB filenames by type
Rename several entries under db/MSDOS to include a category prefix (compiler_, extender_, immunizer_, installer_, loader_, protector_) for clearer organization. Affected files include Fitted_Modula-2.4, Lahey_Fortran.4, Lattice_C.4, PDC_Prolog.4, EMMXXXX0_check.0a, GameWizard_DOS_Extender.0a, File_Shield.1, GamBit_Pro_Library.1, DOS32_loader.0a, and Eliashim's_CodeTrack.1. This improves discoverability and groups records by type.
2026-06-12 13:14:19 +03:00
DosX
d4928d2f41 Update heuristic signatures for browsers and IM apps
Expand and refine PE heuristic checks: add Firefox artifacts (mozsqlite3.dll, encryptedPassword) to improve Firefox profile/password detection; normalize Yahoo name casing and add Yahoo Messenger profile/archive paths; add MSN "\My Received Files\" string and new Skype and Paltalk heuristics (Skype folder checks, Paltalk registry/software keys); include Opera wand.dat locations to catch older Opera profile files. These changes broaden detection coverage for various browsers and instant‑messaging clients.
2026-06-12 13:04:04 +03:00
DosX
53315c082b dbs_min update 2026-06-12 00:57:41 +03:00
DosX
113d05014a Add rule aliases for wallet heuristics
Update PE heuristic database to include additional names/aliases for wallet detections. Added "ElectrumRule", "AtomicRule", and "ArmoryRule" to the respective name arrays to provide consistent rule identifiers and improve matching/lookup for Electrum, AtomicWallet, and Armory entries.
2026-06-12 00:56:47 +03:00
DosX
200b13fdc3 Add Firefox and crypto patterns to heuristics
Update PE heuristic signatures to improve detection coverage: add a duplicated "Mozilla Firefox\\" variant and "moz_logins" to Firefox-related string checks, and introduce multiple cryptocurrency address regexes (Bitcoin, Bitcoin Cash, Ethereum, Litecoin, Ripple, Tron, etc.) to the malicious-string list. These changes expand browser artifact detection and enable spotting embedded wallet addresses in analyzed binaries.
2026-06-12 00:48:13 +03:00
DosX
cc4a926e8e Heuristics: add IMVU & registry/key tweaks
Update PE heuristic DB to improve detection coverage:

- Add Yahoo registry key "Software\\Yahoo\\pager" to Yahoo signature.
- Include "pstorec.dll" in credential-related signatures.
- Reorder MSN-related strings and add IMVU detection entries for HKEY_CURRENT_USER\\Software\\IMVU\\username/password.
- Normalize and reorder Steam entries by adding "SOFTWARE\\Valve\\Steam" and adjusting config/blob path entries.

These changes broaden heuristic matches for various IM clients and Steam registry variants and include an additional DLL used in credential storage.
2026-06-12 00:28:04 +03:00
DosX
01efc93fa5 Normalize and expand heuristic strings
Update PE heuristic signature entries: consolidate ProtonVPN string literals onto a single line, add alternate path variants for FlashFXP and Pidgin (without leading backslash/escape), and include an additional "FTP Commander" identifier for the FTPCommander entry. These minor formatting and signature expansions improve detection coverage for varied path/registry representations.
2026-06-12 00:12:46 +03:00
DosX
f6b0c34fa5 dbs_min update 2026-06-12 00:01:43 +03:00
DosX
117addfc61 Expand and normalize heuristic detection strings
Update PE heuristic database to improve detection coverage and consistency. Adds additional VM identifier variants (VMware/VirtualBox) and normalizes several string lists by including variants with and without leading backslashes. Expanded detections for Telegram, credential stores, multiple VPN clients (PiaVPN, ExpressVPN), various cryptocurrency wallets (Monero, Litecoin, Exodus, Electrum, Bytecoin, Bitcoin Core, AtomicWallet), Yahoo Messenger, and Steam (added Steampath and several config/login vdf patterns). These changes increase match robustness across different path formats and naming variations.
2026-06-12 00:01:28 +03:00
DosX
9249ab795b Refactor RAT checks and expand signature groups
Restructure the RAT detection condition (adjusted parentheses/grouping) and remove the surrounding verdicts.length===0 guards so signature/group checks are evaluated consistently. Move the signGroupsToCheck definition out of the conditional and update/extend signature groups (add Guarda, Coinomi, IE78 and other string/name refinements) and minor formatting improvements.
2026-06-11 23:20:27 +03:00
DosX
3027d21793 Enhance heuristic signatures for apps and wallets
Update generic heuristic rules: add ProtonVPNRule and ExodusRule to name lists; include FileZilla sitemanager.xml; extend Firefox signatures with Gecko and nss3.dll/softokn3.dll; add Chrome LocalPrefs.json; include HKLM Steam registry path and reorder Steam entries; move cryptowallet extension IDs into a separate generic signature object. Minor formatting and ordering tweaks for readability.
2026-06-11 16:14:51 +03:00
DosX
f33e17d943 Cap risk counter and adjust risk score calc
Add an early break when detectedRiskScoreCounter reaches 9 to prevent further counting, and reduce the per-item risk increment by changing the scaling factor from (35/3) to (35/6). This halves the incremental score growth for items beyond the threshold, limiting overly aggressive risk estimates in the PE heuristic scan.
2026-06-11 15:56:34 +03:00
DosX
8d43c7efa9 dbs_min update 2026-06-11 15:07:17 +03:00
DosX
21ddb860fb Adjust heuristic rules, detection threshold and scoring
Update heuristic detection groups and scoring logic: add new signature names (GetMSN, GetChrome, GetOpera) and additional search strings ("WindowsLive:name=*", "outpost"). Remove short-circuiting in the string/name loops so all group entries are evaluated. Lower the detection threshold from 4 to 3 and replace the static "Z-Engine_alpha" detail with a computed "RiskScore" percentage. Move the signGroupsToCheck cleanup to after verdict determination. These changes increase sensitivity and provide a dynamic risk score while keeping the dictionary release at the end of processing.
2026-06-11 15:07:08 +03:00
DosX
24e699a444 dbs_min update 2026-06-11 01:53:52 +03:00
DosX
eb2d4647f2 Improve heuristic scan logic and update signatures
Update PE heuristic signatures and scanning logic in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg. Add extra Zcash signature entries and consolidate several string arrays (minor reordering/formatting of wallet, VPN, Outlook and Minecraft markers); remove the "taskmgr" token from the generic list. Change the two inner loops to short-circuit on detection (add && !isElementFromGroupDetected) instead of using break statements for clarity/efficiency. Raise the detected risk score threshold for a Stealer verdict from 3 to 4 to reduce false positives.
2026-06-11 01:53:23 +03:00
DosX
f6eb0347f1 Normalize scan string formatting and add aliases
Reflowed and consolidated string array entries in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg for readability and line-length consistency. Added additional application name variants (e.g. CoreFtp, FlashFxp and other casing variants) and introduced the generic token "DisableCMD" to broaden heuristic detection. These are mostly formatting and minor detection-expansion changes; no algorithmic logic was altered.
2026-06-11 01:38:26 +03:00
DosX
ac294b595e Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-11 01:10:18 +03:00
DosX
b5dfeb9672 Enhance VM detection and add '*.txt' indicator
Add additional VM-related unicode checks and an extra malicious indicator. The update expands anti-VM heuristics with "VirtualBox Graphics Adapters" and "VMWARE svga 2" (and reorders inclusion of "vmware"), and adds "*.txt" to the list of strings checked in scanForMaliciousCode_NET_and_Native to broaden detection coverage.
2026-06-11 01:10:13 +03:00
Benjamin Funke
cbff3c4c83 add QT6 Fedora build instructions 2026-06-10 22:11:44 +02:00
DosX
0601364671 dbs_min update 2026-06-10 22:13:24 +03:00
DosX
ff00536c61 Reformat string arrays in PE heuristic script
Reflowed and reorganized long string literal arrays in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to improve readability and line-wrapping. This is a formatting-only change; no heuristic logic or string content was altered.
2026-06-10 22:12:43 +03:00
DosX
badceb8e4d Detect Proxifier and card_number_encrypted
Update PE heuristic DB: add Proxifier detection entry (names 'Proxifier', 'proxifier' with profile path '\Roaming\Proxifier\Profiles\Default.ppx' and 'Default.ppx') in scanForMaliciousCode_NET_and_Native(), and add 'card_number_encrypted' to the Chrome credit-card artifact strings to catch additional stored card indicators.
2026-06-10 22:04:19 +03:00
DosX
3bd656f50a Enhance VPN and wallet detection rules
Update db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to broaden heuristic detections: expand OpenVPN name variants; add PIA (pia_manager) detection; add ExpressVPN detection; reintroduce NordVPN with additional casing and an executable pattern; add MetaMask wallet detection strings. These changes improve coverage for common name variants and additional wallet/VPN artifacts.
2026-06-10 21:45:27 +03:00
DosX
69fbef3d49 Add cryptowallet extension IDs to heuristic DB
Update db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg: extend the array used by scanForMaliciousCode_NET_and_Native with a large list of known cryptowallet extension IDs and a comment marking them. This change ensures the heuristic routine recognizes these extension IDs (reducing false positives or enabling targeted handling) when analyzing PE samples.
2026-06-10 21:37:01 +03:00
DosX
b0650c8278 dbs_min update 2026-06-10 21:17:22 +03:00
DosX
e75a3dab4a Refactor sign groups detection and extend checks
Rename and clarify variables used for signature/group detection (groups -> signGroupsToCheck, detectedCounter -> detectedRiskScoreCounter, found -> isElementFromGroupDetected) and update loop variable names for readability. Add several new heuristics/patterns (additional Jaxx, Exodus, Firefox, Yahoo, Discord entries and API v7) and normalize string arrays formatting; insert a cleanup assignment (signGroupsToCheck = undefined) after use. Functionality preserved: increments detection counter per matched group and triggers the existing Stealer verdict when >= 3 matches.
2026-06-10 21:05:38 +03:00
DosX
f9f6a460d2 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-10 20:44:19 +03:00
DosX
8edb9e3bc7 Enhance PE heuristic detection strings
Expand and refine heuristic signatures used by the PE scanner: add "Telegram Desktop" to Telegram checks; include "StoredPassword" for ICQRecover; add jDownloader database config SQL pattern; extend Minecraft detection and add Roblox registry token lookup; and significantly enlarge the generic blacklist with antivirus/vt domains, numerous GUIDs and common computer/user names to improve detection coverage and reduce false negatives.
2026-06-10 20:44:15 +03:00
Benjamin Funke
bff0cefc4a add SensAPI signature 2026-06-10 18:47:18 +02:00
DosX
1cb5d3f645 Add CMSNMessengerPasswords to MSN heuristic
Update db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg: include "CMSNMessengerPasswords" in the names array alongside "MSN" and "getMSN75Passwords". This expands the heuristic's alias coverage so signatures using the CMSNMessengerPasswords identifier will match the existing MSN Messenger password extraction strings; no other logic was changed.
2026-06-10 17:40:47 +03:00
DosX
079c6cd0b0 Detect additional Movfuscator signature
Add a second ELF entry-point signature to detect Movfuscator v2 by OR-ing a new pattern with the existing one. The change sets sVersion to "v2" and ensures bDetected is flagged for the new signature, improving detection coverage in db/ELF/compiler_movfuscator.4.sg.
2026-06-10 17:40:25 +03:00
DosX
6164082738 Update PE heuristics: Firefox queries and new strings
Modify PE heuristic scanner: add additional Firefox SQLite queries (moz_disabledHosts and moz_places) alongside moz_logins, and introduce new detection string sets for RuneScape (RSBot_Accounts.ini) and ICQRecover (\ICQ, \Owner.mdb). These extend the generic heuristic analysis to catch more credential/storage artifacts.
2026-06-10 12:09:22 +03:00
DosX
d92f5650f5 dbs_min update 2026-06-10 11:40:56 +03:00
DosX
54fbc6b158 Enhance PE heuristic signatures and .NET checks
Update PE heuristic database to broaden application and credential-stealing detections. Add/normalize strings and name variants for ProtonVPN, FileZilla, Firefox (extra DLLs, profiles, SQL queries), Discord API v6 endpoint, Bitcoin wallet paths, Steam registry keys, Trillian, CoreFTP, LastPass, Pidgin, FTPCommander, and SmartFTP case variants. Insert a generic GUID indicator and restore some path variants (e.g., recentservers.xml). Extend .NET object presence checks to include KeyLogger/keylogger and Cliplogger to improve detection of key/clipboard loggers.
2026-06-10 10:26:15 +03:00
DosX
c22407cd2c Add extra Firefox and Opera data strings
Include Firefox profile DB names (moz_places, moz_cookies, moz_bookmarks) in the heuristic signatures and add a generic 'Cookies' path for Opera entries in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to improve detection of browser-stored data (history, cookies, bookmarks).
2026-06-09 01:06:13 +03:00
DosX
95e2a569a0 dbs_min update 2026-06-09 00:53:30 +03:00
DosX
f004710a03 Add password/cookie checks and adjust detection names
Update PE heuristic rules in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg: remove TGrabber and DGrabber from the Telegram/Discord name groups, add additional network-object presence checks (GrabPasswords, GetCookies, TGrabber, DGrabber) to improve stealer detection, and reflow a GameKeys strings line for readability. These changes broaden detection coverage and tidy up name lists.
2026-06-09 00:52:59 +03:00
DosX
59505262ef Expand PE heuristics for Firefox, Yahoo, GameKeys
Add additional detection strings for Firefox (profiles, mozglue, signons.sqlite and certificate OID hex patterns) and add patterns for Yahoo Messenger paths. Expand the GameKeys heuristic by adding multiple alias names and many registry key patterns and common key-related tokens (CDKey, ProductKey, Serial, RegistrationCode, etc.) to improve coverage for license/key-stealer and license-related artifact detection.
2026-06-09 00:46:52 +03:00
DosX
c07cb51eb2 Add FlashFXP/SmartFTP and tweak heuristics
Fix Internet Explorer name entries (corrected CIE7Passwords), add Chrome Web Data path to improve credential detection, and add new heuristics for FlashFXP (quick.dat) and SmartFTP (Quick Connect favorites). Also add "EnableLUA" to generic strings to catch additional system settings. These changes expand coverage for common browsers and FTP clients in the heuristic scanner.
2026-06-09 00:25:26 +03:00
DosX
49037752e2 Add IE password alias and taskmgr heuristic
Update PE heuristic patterns to improve detection coverage: add a new alias "CIEPasswords" to the Internet Explorer/IE7 heuristic and include the GUID "{5E7E8100-9138-11D1-945A-00C04FC308FF}" in its string list. Also add a small generic heuristic that looks for the string "taskmgr". Changes applied in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg within scanForMaliciousCode_NET_and_Native.
2026-06-09 00:15:56 +03:00
DosX
e6b40f9a3c Update heuristic strings for wallets and Steam
Enhance PE heuristic signatures in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg: add additional Electrum path patterns (electrum_data and variants) to improve detection, include a generic "wallet.dat" entry for BitcoinCore signatures to catch more wallet files, and remove a duplicate Steam config entry (\config\SteamAppData.vdf) from the Steam strings.
2026-06-08 23:15:05 +03:00
DosX
7d5406adf5 Expand credential and Firefox heuristics
Update PE generic heuristic scan to add more credential indicators and Firefox-related strings. The Creds list is expanded with numerous payment/card name variants (e.g. Amex Card, BCGlobal, Mastercard, Visa Card, Express Card, etc.) to improve detection of stored payment data. A new FireFox/Firefox/firefox block was added with strings "\\mozglue.dll" and "\\Firefox\\Profiles\\" to help identify Firefox installations and profiles.
2026-06-08 22:56:09 +03:00
DosX
c2e92adb95 Add group-based stealer detection
Extend scanForMaliciousCode_NET_and_Native with a large set of application/group indicators (wallets, browsers, VPNs, messengers, steam, game keys, etc.) and check both Net UStrings and NetObjects. Count matched groups and emit a "Stealer" verdict with details "Z-Engine_alpha" when >=3 groups are detected; otherwise fall back to existing NetObject checks to produce a generic "Stealer" verdict. This replaces/relocates the previous simpler NetObject-only check and centralizes heuristics for broader, multi-indicator detection.
2026-06-08 21:27:32 +03:00
DosX
6462379ab2 Handle falsy instruction in getAsmOpCode
Add a guard in getAsmOpCode to check for a falsy instruction before calling indexOf/split. This prevents runtime errors when instruction is null/undefined and preserves the existing behavior for valid instruction strings (returning the opcode or the original string).
2026-06-08 21:25:23 +03:00
DosX
3ff9b61f69 Add XerinFuscator .xerin signature
Add a new entry for XerinFuscator (version 8.X.X) with the ".xerin" extension to the PE heuristic scanner list in scanForPackersAndCryptors_NET_and_Native. This complements the existing ".Xerin" entry to ensure detection of the lowercase extension variant.
2026-06-08 01:26:52 +03:00
DosX
acc91b17fb Refactor XerinFuscator detection and add getVersion
Centralize version extraction into a new getVersion() helper and simplify detection branches. The change replaces per-branch section scanning with a single function that searches all sections for the "XerinFuscator v" marker, cleans the string and extracts the version via regex. Detection now sets bDetected when a version is found and supports both "Xerin.Runtime" and "XerinFuscator" object presence, reducing duplicated code and improving robustness.
2026-06-08 01:23:31 +03:00
DosX
ec3a3cc0cb Add XerinFuscator detection and metadata
Improve detection for XerinFuscator by adding a .NET library entry ("Xerin.Runtime") and registering the ".Xerin" packer signature (with reference URL). Remove the duplicate ".Xerin" entry and add a protector metadata file that includes the official XerinFuscator site. These changes enhance heuristic coverage for identifying XerinFuscator-protected samples.
2026-06-07 18:46:21 +03:00
DosX
e5e463101a Don't flag 'no init' for DLLs
Only append the "no init" option when no init function is detected and the PE is not a DLL. This prevents falsely marking DLLs (which may legitimately lack a normal init entry) as "no init" in the detect() logic in db/PE/compiler_tcc.6.sg.
2026-06-07 02:04:48 +03:00
DosX
8f59b01213 Add nAvgBytesPerSec check for Imminent RAT
Extend the Imminent Monitor RAT heuristic in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg: allow a detection when the .NET unicode string 'nAvgBytesPerSec: ' is present in addition to the existing LZLoader+Injector object check. This increases coverage for samples that expose the characteristic string but may not have both .NET objects.
2026-06-06 22:02:21 +03:00
DosX
a86b67a410 Detect RevengeRAT via 'Nuclear Explosion' name
Add a heuristic to the PE generic analysis to identify RevengeRAT (v0.3) when a .NET assembly or module name is "Nuclear Explosion" or "Nuclear Explosion.exe". This pushes a verdict with type "RevengeRAT" and empty details. Referenced Malpedia indicator.
2026-06-06 21:54:31 +03:00
DosX
bd8df5c931 Refactor Makeself signature and detection logic
Clean up and simplify Makeself detector: combine variable declarations and perform an early size check; replace Binary.isSignaturePresent with Binary.compare and short-circuit when too small; reformat regex matching for readability; remove the separate bHasBinary flag and use bDetected directly with an early-exit loop when scanning the trailer. Overall this streamlines the code and reduces temporary state used during binary-presence checks.
2026-06-06 21:19:35 +03:00
github-actions[bot]
9f7255ffe0 style: auto-format JavaScript files in db directories 2026-06-05 19:09:58 +00:00
Hors
bc30073017
Merge pull request #361 from 6eh01der/patch-1
Create sfx_Makeself.1.sg
2026-06-05 21:09:29 +02:00
DosX
0665d02704 Update BeRoEXEPacker detection patterns
Add an additional EP signature to the v1.00 detection (OR in PE.compareEP for "60FCB9...F3A4"). Remove a redundant PE.compare fallback ("'BeRo'******!PE") and keep the primary signature check. Add a new check for the special header pattern ("52c3'BeRo^fr!PE'") that sets sOptions to "Special PE Header". Ensure bDetected remains driven by sVersion or sOptions.
2026-06-05 21:17:06 +03:00
DosX
ae76ada90c dbs_min update 2026-06-05 21:03:55 +03:00
DosX
be59ae73dc Improve BeRoEXEPacker detection
Add an additional PE.compare check in detect() to match the signature "'BeRo'******!PE" at offset 4 (ORed with the existing check). This broadens detection for BeRoEXEPacker-packed PE files and sets bDetected when matched without altering existing checks.
2026-06-05 21:03:28 +03:00
Artur Lebedev
988b3de0b7
Update sfx_Makeself.1.sg
More robust detection
2026-06-05 14:05:14 +03:00
DosX
0e6f1adfaa Add Echelon Stealer heuristic detection
Introduce a new heuristic in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to detect the Echelon Stealer. The check adds a verdict when the module name is "Echelon.exe", a .NET object "TGrabber" is present, or the embedded string "\n📂 FileGrabber: " is found. A reference to the archived repository is included as a comment.
2026-06-05 13:11:36 +03:00
Artur Lebedev
558f2bb61c
Update sfx_Makeself.1.sg
fix
2026-06-05 12:03:47 +03:00
Artur Lebedev
bd4083e9fe
Update sfx_Makeself.1.sg
fixes
2026-06-05 11:59:50 +03:00
Artur Lebedev
f24a678c4c
Update sfx_Makeself.1.sg
More strict checks
2026-06-05 11:46:35 +03:00
DosX
ea8d1d4400 dbs_min update 2026-06-05 02:37:17 +03:00
DosX
8aadec1a09 Sanitize version and product name strings
Use File.cleanString on ProductVersion and ProductName in db/PE/protector_HASP.2.sg detect() to normalize and strip unwanted characters (e.g. whitespace/control chars) before detection. This makes string comparisons more robust and improves detection reliability without changing detection logic.
2026-06-05 02:37:06 +03:00
DosX
367ed3423a Detect Orcus RAT via .orcusInstallation string
Extend the Orcus RAT heuristic in the PE generic analysis to also check for the .NET user string ".orcusInstallation". Previously the detection relied on the module name "Orcus.exe" or the presence of the "Orcus.Connections" .NET object; this change adds PE.isNetUStringPresent(".orcusInstallation") to catch variants that embed an installation marker before pushing the Orcus verdict.
2026-06-05 02:27:36 +03:00
DosX
aaf7f102af Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-05 02:21:27 +03:00
DosX
2cf6dce238 Add Ramnit/Parite signatures and tidy Themida
Add heuristic entries to db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to detect Ramnit and Parite infections: a ".rmnet" section name for Ramnit and a regex (\.[a-z]{3}[\u0006\u0007\u0009]$) for Parite. Also adjust whitespace/comment alignment for the Themida 3.XX entry. These changes improve PE section-name based detection and clean up formatting.
2026-06-05 02:21:25 +03:00
Artur Lebedev
095ab8a6a9
Update sfx_Makeself.1.sg
meta instead of init
2026-06-04 17:02:23 +03:00
Artur Lebedev
5ac04060ea
Create sfx_Makeself.1.sg
Makeself detector
2026-06-04 16:55:56 +03:00
Benjamin Funke
f2a0884014 add Rockall Heap Manager signature 2026-06-04 11:56:58 +02:00
DosX
f001d35258 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-03 20:40:53 +03:00
DosX
270cddfb14 Format ASF rule and refine Parite heuristic
Apply whitespace/formatting and minor readability edits to db/Binary/media_ASF_WMA_WMV.1.sg (reflow const block, spacing, and comment placement) without changing detection behavior. In db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg replace pariteSubFound boolean with a pariteState numeric state machine (0/1/2) and adjust the detection flow to require a PUSH/XOR -> SUB -> JNE sequence; simplify logic by removing the previous target disasm check and adding explicit state resets (including on JNE/JMP). This clarifies intent and tightens the Parite heuristic control flow.
2026-06-03 20:39:38 +03:00
Benjamin Funke
8d07b592b2
Update changelog for version 3.22
Added new features, translations, and improvements in version 3.22.
2026-06-03 18:31:54 +02:00
DosX
1f67f6f893 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-06-01 18:31:56 +03:00
DosX
c4a8a9babf Add PE detection rule for ImGui
Add new rule db/PE/library_ImGui.4.sg to detect the ImGui library in PE files. The rule marks a match if the library name contains "imgui" or if exported functions start with "ImGui" (sets sOptions to "static" for EAT). Includes author/contact metadata.
2026-06-01 18:31:54 +03:00
Kaens
f67dd4bad2 Create media_ASF_WMA_WMV.1.sg
Microsoft Advanced Systems Format container added (known to laymen as WMA/WMV because nothing else took off), info-ed & ripper-ready.
Duration reporting is off, which is weird
2026-06-01 02:57:14 +02:00
DosX
e12e38e589 Add detection for Valve Linker
Introduce a new PE linker signature check to recognize the Valve Linker. Adds a PE.compare for "**010000'VLV'0001'" at offset 0x3c, sets sName to "Valve Linker" and marks bDetected = true; placed before the Turbo Linker case.
2026-06-01 00:56:12 +03:00
DosX
9993ee4e2d Use .rdata section size for signature detection
Introduce a local rdataSection variable and use rdataSection.FileOffset and rdataSection.FileSize when calling PE.isSignaturePresent. This replaces the previous use of PE.section[0].FileOffset and PE.getSize() - PE.getOverlaySize(), restricting signature scanning to the .rdata section and improving detection accuracy (avoids scanning overlays or incorrect sections).
2026-06-01 00:17:11 +03:00
DosX
ae40acf032 dbs_min update 2026-06-01 00:05:03 +03:00
DosX
5534e01b37 Add .htext to Helios packer signature
Extend the Helios entry in the PE heuristic database to include the .htext extension alongside .helios, improving detection of files produced by the Helios protection service.
2026-05-31 06:22:08 +03:00
DosX
615f15c08c Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-30 18:22:20 +03:00
DosX
8eab1f7938 Add Detect It Easy rule for Astral-PE
Add a Detect It Easy (DIE) detection rule for the Astral-PE tool. The rule matches PE files with an empty first section name, no Rich signature, zero TimeDateStamp and CheckSum, zero linker versions, and an exported library path pattern (indicating IAT mutation). When matched, it sets sOptions to "IAT mutation".
2026-05-30 18:22:18 +03:00
Benjamin Funke
2f099b18ad dbs_min update 2026-05-30 14:51:48 +02:00
Benjamin Funke
a0d9fd8299 add InstallAware signature 2026-05-30 11:23:14 +02:00
Benjamin Funke
56084e392e add LÖVE game engine signature 2026-05-29 17:57:33 +02:00
DosX
00278adb83 dbs_min update 2026-05-28 23:50:00 +03:00
DosX
e6f56fd165 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-28 23:49:19 +03:00
DosX
3499d9a63f Add Helios (.helios) to packer heuristics
Register Helios in the PE heuristic list used by scanForPackersAndCryptors_NET_and_Native. Adds an entry to detect the .helios extension (Helios protection/online service) with a reference link.
2026-05-28 23:49:16 +03:00
Benjamin Funke
782d8f4128 add ProductName detection for AGS 2026-05-28 16:06:21 +02:00
Benjamin Funke
442029ed1a add sVersion to AGS signature
sVersion is used to extract the version number of the game engine, extracted over PE.getFileVersion()
2026-05-28 16:01:14 +02:00
DosX
0a9b94d2d0 dbs_min update 2026-05-28 00:02:40 +03:00
DosX
9148133bf8 Delete db.json 2026-05-28 00:00:23 +03:00
DosX
1db7ae8b55 Refactor DB entries, update heuristics
Rename and reorganize multiple MSDOS rule files into categorized names (compiler_*, converter_*, debug_data_*, protector_*). Add sLang="C" to Aztec C detection, adjust Borland TDS meta key to "debug data" and tweak its description. Improve PE generic heuristic whitelist with many new/expanded regexes for dates, versions, GUIDs/hashes, naming conventions, platform identifiers and product/package tokens. Update author/attribution comments for several PE cryptor/compiler rules to DosX, and fix detection logic in Duals eXe Encryptor by marking bDetected earlier. Miscellaneous formatting and comment cleanups.
2026-05-27 08:51:11 +03:00
DosX
f41cc895a2 Whitelist GUIDs, timestamps, tokens, OIDs
Add several regex whitelist entries in isTokenObfuscated to reduce false positives: braced GUIDs, compact ISO 8601 datetime stamps, .NET PublicKeyToken fields, and multi-component OID strings. This updates db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to better recognize common legitimate tokens.
2026-05-27 08:29:31 +03:00
DosX
6d71a02e68 Enhance token heuristics and add PL/I
Refine PE generic heuristic whitelist to reduce false positives and cover more real-world versioning/token patterns: extend numeric timestamp/changelist length, add runtime/tool version and .NET TFM regexes, adjust PascalCase/camelCase/snake_case rules, broaden library/version, SemVer and curve patterns, and update related comments. Also tweak various suffix and identifier patterns for better coverage of product/component names. In compiler_IBM_VisualAge_PL_I.6.sg set sLang = "PL/I" (add language identifier) and terminate file with a newline.
2026-05-27 08:24:45 +03:00
DosX
b103b0c3c2 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-27 08:17:41 +03:00
DosX
75ac6bedbd Add regex for delimiter-separated identifiers
Introduce a case-insensitive regex to isTokenObfuscated to match delimiter-separated word identifiers (e.g. dotnet-sdk-9.0.202-w, libssl-3.0.9-dev, api-2.1, bin-debug). This complements existing version/assembly and suffix patterns to reduce false positives for product names, filenames and package IDs by allowing letter groups separated by '-', '_' or '.' with optional numeric segments.
2026-05-27 08:17:39 +03:00
Benjamin Funke
0611610f97 add Battlenet signature 2026-05-26 19:33:26 +02:00
Benjamin Funke
f79fbb5ab9 remove old comment in QT signature 2026-05-26 18:24:53 +02:00
DosX
b140ce5050 dbs_min update 2026-05-26 02:34:28 +03:00
DosX
cf168193cd Nest system file loop under packer/protector check
Move the iteration over systemFileNamesDict inside the check for PE_Cached.isDotNet / rich-signature absence and packer/protector results. This avoids running the loop when there are no packer/protector signatures (or when the .NET/rich-signature condition isn't met), reducing unnecessary iterations and improving clarity. The behavior remains the same: isFakeOrInfected is set only when compareOriginalAndInternalNames matches and packer/protector results are present.
2026-05-26 01:05:22 +03:00
DosX
940f26c0f6 Use logType constants and rename dotNet to net
Replace magic numeric literals in the log() function with logType enum constants for clarity and consistency (use logType.warning and logType.nothing instead of -2 and 0). Also update the switch case from logType.dotNet to logType.net to match enum naming.
2026-05-26 01:00:11 +03:00
DosX
db385c4281 Use logType constants in log switch
Replace numeric case labels (-2, -1, 1, 2) with descriptive logType constants (warning, about, any, dotNet) in the log() switch to remove magic numbers and improve readability and maintainability. No functional change intended.
2026-05-26 00:56:32 +03:00
DosX
94a0584b9a dbs_min update 2026-05-26 00:53:26 +03:00
DosX
3f04825893 Heuristic: recognize .CRT sections as C/C++
Add a check for PE.isSectionNamePresentExp(/\.CRT(?:\$[A-Z]{3})?$/i) in the language heuristic branch that sets the language to C/C++. This treats CRT-related sections (e.g. .CRT, .CRT$XYZ) as indicators of MSVC C/C++ runtime usage, improving detection when api-ms-win-crt or .msvcjmc are present.
2026-05-26 00:52:48 +03:00
DosX
25cd07ea3a Refactor IL2CPP section detection logic
Improve IL2CPP detection by introducing an isIl2cpp flag and a regex check for .rtc sections (PE.isSectionNamePresentExp(/^\.rtc\$[IT](?:AA|ZZ)$/)). Collapse and reorder the section-name checks into a smaller array and defer setting the compiler/lang result until after detection completes. This makes the detection flow clearer and handles .rtc variants more reliably.
2026-05-26 00:47:24 +03:00
DosX
55f957fc77 Treat DB first EP instruction as incorrect
Mark the PE entry point as incorrect when the first disassembled instruction is a DB byte directive. This adds a check for /^DB / against PE_Cached.firstEpAsmInstruction to catch cases where the EP is damaged or points to the wrong location. Also trims an extra blank line near the isVbNetStandardLibraryPresent comment.
2026-05-26 00:25:21 +03:00
DosX
9c2f2c2519 Ensure worker event handlers run only once
Add execArgv: [] when creating the Worker and introduce a 'settled' flag with a once() helper to ensure 'message', 'error', and 'exit' handlers only act once. This prevents multiple resolve/stat updates if the worker emits multiple events (avoiding duplicate stats increments, repeated resolves, and noisy error handling). Keeps existing resourceLimits and preserves logging for failures.
2026-05-25 21:13:41 +03:00
DosX
c1011944aa dbs_min update 2026-05-25 21:04:56 +03:00
DosX
6767b50dbf Remove line breaks 2026-05-25 21:03:46 +03:00
DosX
800723a60c Add reference URLs to protection signatures
Insert external reference comments into two PE protection rule files: a Wikipedia link for Microsoft Warbird in db/PE/protection_Microsoft_Warbird.2.sg and a Freedownloadmanager page for Softlocx in db/PE/protection_Softlocx.1.sg. These are non-functional comment additions to provide source/context for the detections.
2026-05-25 20:59:32 +03:00
DosX
4aeaa3ea4e Extend PE heuristic whitelist patterns
Expand the heuristic whitelist in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to reduce false positives when detecting obfuscated tokens. The change augments the existing build/CI keyword regex with additional channel/release terms (nightly, canary, stable, preview, insider, hotfix, snapshot, release, update, patch, master, develop) and adds several new regex patterns to recognize common versioning and naming schemes: ECC curve identifiers, semantic versions (with pre-release/build metadata), library version tokens (underscore/dot-separated), long-name+date suffixes, uppercase acronym+revision patterns, module names with embedded dot-versions, and common product suffixes like installer/launcher/updater. These additions improve detection accuracy for legitimate versioned/module names that previously looked like obfuscated tokens.
2026-05-25 20:45:08 +03:00
DosX
90e55cabf8 Refine date whitelist regex and tidy comments
Update the whitelist date/year regex to accept a wider variety of date formats (years, ranges, DD.MM.YYYY, YYYY-MM-DD, etc.) and optional trailing comma/period to reduce false positives when detecting obfuscated tokens. Add clearer example comments to document accepted forms. Also make a minor formatting tweak to the opcode byte-string comment alignment in the EP comparison for readability.
2026-05-25 20:32:49 +03:00
DosX
732d790bf8 Add Equation Group heuristic via BINRES
Add a heuristic in scanForMaliciousCode_NET_and_Native that checks unmanaged resources for a resource named "BINRES" containing the signature bytes "4D 5A 90" (MZ header). If found and no prior verdicts exist, push an "Equation Group" verdict (empty version/details) and stop further checks. This adds a targeted detection for Equation Group artifacts.
2026-05-25 13:38:45 +03:00
DosX
0132017fc3 Add Name alias for FileName
Set this.Name to this.FileName in the Resource constructor. This exposes a Name property mirroring FileName (alongside existing FileSize/FileOffset aliases) to improve compatibility with callers that expect a Name field.
2026-05-25 13:37:01 +03:00
DosX
a6c95ff277 Add Olympic Destroyer heuristic to PE scan
Introduce a new heuristic in __GenericHeuristicAnalysis_By_DosX to detect Olympic Destroyer: when there are unmanaged resources and no prior verdicts, compare the first resource at FileOffset against the signature "C1 7E 20 A2 DA F9 56 45 61 39 EB DB 51 9D A7 4F" and push a verdict object with type "Olympic Destroyer". Includes Malpedia reference and is placed before the existing win.bozok check.
2026-05-25 13:22:06 +03:00
DosX
63f7efd14e Add Slingshot APT heuristic for LineRecs
Introduce a heuristic in GenericHeuristicAnalysis that appends a 'Slingshot APT' verdict when there are no prior verdicts and the PE.section['LineRecs'] field is present. Includes a reference comment to the Habr article and initializes version and details as empty strings.
2026-05-25 13:10:36 +03:00
DosX
87511f3e9f Use non-capturing group in FXS regex
Replace the capturing group with a non-capturing group in the Microsoft Fax library detection regex (FXS(?:API|TIFF|CLNTR)). This avoids creating an unnecessary capture while preserving the original matching behavior (case-insensitive match for FXSAPI, FXSTIFF, FXSCLNTR).
2026-05-25 12:49:35 +03:00
DosX
c991951a83 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-25 12:49:04 +03:00
DosX
9e284c697e Rename packer_Virbox rule to protector
Rename db/ELF/packer_Virbox.2.sg to db/ELF/protector_Virbox.2.sg and update rule metadata from meta("packer", "Virbox") to meta("protector", "Virbox"). Also remove the now-unnecessary sVersion assignment for "Virbox Protector" after detection.
2026-05-25 12:49:01 +03:00
Benjamin Funke
8b9f861409 add Microsoft Fax signature 2026-05-25 10:55:28 +02:00
Benjamin Funke
cb0ad89bb5 add CLBCATQ signature 2026-05-24 18:46:10 +02:00
Benjamin Funke
b4b5b2792b add AVIFIL signature 2026-05-24 18:36:30 +02:00
DosX
ccf41d4d54 Simplify DirectPlay detection regex
Replace the unnecessary alternation /^dplay(x|)/i with /^dplay/i in db/PE/library_DirectPlay.4.sg to simplify and clarify the library presence check. This keeps matching both 'dplay' and 'dplayx' while removing a redundant capture/alternation.
2026-05-24 19:03:19 +03:00
DosX
83c87bfe58 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-24 19:01:29 +03:00
DosX
d17e94c720 dbs_min update 2026-05-24 19:01:25 +03:00
Benjamin Funke
d68b89de6a add DirectPlay signature 2026-05-24 08:11:15 +02:00
DosX
766ef4d963 Detect mutated import table (IAT mutation)
Add a heuristic in scanForObfuscations_Native to detect mutated import table entries (e.g. names prefixed with '././' or '.\\./') by checking for libraries matching /^
\.[\\/]\.[\\/]/. When found, set an "IAT mutation" option so such import obfuscation is flagged.
2026-05-23 09:28:51 +03:00
DosX
d2db0f9f70 Lower PE entropy threshold to 7.25 2026-05-23 08:21:19 +03:00
DosX
53aabe54a4 Refine PE heuristics: exclude NjRAT, set WiX v3
Add an exclusion to the generic System.Net.Sockets heuristic so it won't trigger when njRatVersion is already detected, reducing false positives for NjRAT. Also set sVersion to "3.X" for a specific WiX Toolset installer entrypoint pattern to improve installer version detection.
2026-05-23 07:44:37 +03:00
DosX
09a14623eb Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-23 07:40:14 +03:00
DosX
f32c01520f Add StormKitty detection heuristic
Introduce a heuristic in scanForMaliciousCode_NET_and_Native to detect StormKitty RAT by looking for .NET Unicode strings. The new check adds a verdict when either "\nStormKitty v" is present or both "---" and "btc" are found, referencing Malpedia detection patterns. Version and details fields are left empty for now.
2026-05-23 07:40:12 +03:00
DosX
d300f9aa42 Add NjRAT detection and tighten RAT heuristics
Enhance .NET malware heuristics in scanForMaliciousCode_NET_and_Native:

- Add dedicated NjRAT detection: introduce isNjRatDetected, njRatVersion and a Unicode separator pattern. Detect NjRAT via assembly names, specific strings (im523 -> version 0.7D Green Edition), njLogger, |PWD| and request-separator signatures.
- Avoid duplicate separator generation and reuse the new detection flag to push NjRAT verdicts with the discovered version.
- Guard several checks with verdicts.length === 0 to prevent further matching after a prior verdict (including the System.Net.Sockets import-based check).
- Tighten AsyncRAT detection: require Pastebin+Packet or Antivirus+Pong combinations instead of Pastebin alone.
- Add detection for a "Stealer" .NET object in the final object-check group.

Small refactor and consolidation to reduce duplicated logic and reduce false positives.
2026-05-23 07:39:24 +03:00
DosX
3578dd8d51 Add Irdeto to Denuvo regex & tweak header art
Extend the Denuvo detection pattern to also match "irdeto" so Irdeto-based protections are recognized. Also adjust the ASCII comment header line to include window control symbols (cosmetic change).
2026-05-23 07:39:01 +03:00
horsicq
efc16678e0 chore: update date to 2026-05-22 in db info files 2026-05-22 19:41:02 +02:00
DosX
a2f22343cd Add Scylla entry; update labels and heuristics
Update PE heuristic database: rename XVolkolak label to "XVolkolak (unpacked)" and add a new "Scylla (dumped)" entry (.SCY) to better distinguish unpackers vs dumpers/reconstructors. Also broaden the "a protector" heuristic by including the token "trial" to improve detection of protection-related markers.
2026-05-22 00:43:14 +03:00
DosX
df120a9798 Update __GenericHeuristicAnalysis_By_DosX.7.sg 2026-05-22 00:20:48 +03:00
DosX
f4bee6f458 Rename clearSectionName to cleanSectionName
Refactor: rename clearSectionName() to cleanSectionName() and update all call sites to use the new name. Also make small related fixes in the same changeset: 1) short-circuit the licensing-strings loop (add && !isInterestingStringsFound) instead of relying on break; 2) sanitize extracted PDB path with File.cleanName; 3) switch a section-name regex group to non-capturing. These changes improve naming clarity, tighten string-search logic, and sanitize output paths.
2026-05-21 23:50:35 +03:00
DosX
7a91221502 Broaden ASM Guard resource detection
Replace the literal ASMG.DLL resource check with a regex that matches either ASMG.DLL or ASM_GUARD and remove the duplicate literal entry. This makes the heuristic more robust to different ASM Guard resource naming variants in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg.
2026-05-21 23:36:51 +03:00
DosX
31b9141354 Only append 'modified' when sOptions empty
Add a guard in db/PE/packer_UPX.2.sg detect() so that "modified" is appended to sOptions only if sOptions is not already set. This prevents appending the flag to an existing options string and avoids producing duplicate or malformed option values during UPX detection.
2026-05-21 23:25:39 +03:00
DosX
a054fe5472 Add BASE_GIT_URL to partner CONFIG
Introduce BASE_GIT_URL in autotools/partner/CONFIG pointing to the Detect-It-Easy GitHub repo. This provides a configurable base repository URL for partner autotools/scripts that need to fetch or reference the Detect-It-Easy project.
2026-05-21 23:09:28 +03:00
DosX
50dc9aa509 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-21 23:07:20 +03:00
DosX
31fc8b23b8 Require section[2] not RWX in PE heuristic
Tighten the scanForPackersAndCryptors_NET_and_Native heuristic by adding a check that section[2] is not RWX while still validating it is readable or read+write. This reduces false positives when multiple sections had RWX characteristics.
2026-05-21 23:07:15 +03:00
horsicq
8f64ee4e34 chore: update date to 2026-05-21 in db info files 2026-05-21 19:04:22 +02:00
DosX
9b32efd03d Rename and reformat several detection files
Rename RIFF, U-Boot and shellcode rule files to a standardized naming scheme (format_RIFF.1.sg, format_U-Boot.1.sg, shellcode_pe_to_shellcode.1.sg), clear the executable bit on the renamed files, and apply code style/whitespace cleanup across the JS detection rules. Also tidy up db/Binary/ROM_1.sg (minor formatting changes and replace meta("ROM", "") with meta("ROM")). No substantive logic changes intended.
2026-05-21 19:35:08 +03:00
DosX
0aa476434e Rename and reorganize db/Amiga and db/PE files
Rename several detection rule files to enforce a consistent naming scheme: Maxon_C++.4.sg -> compiler_Maxon_C++.4.sg, TNM/Time/Titanics_Cruncher.1.sg -> cruncher_*.1.sg, and players.1.sg -> player_players.1.sg. Also rename db/PE/linkers.6.sg -> _linkers.6.sg and change its mode from executable (100755) to non-executable (100644). File contents are unchanged (high similarity); these changes improve clarity and organization of the db directory.
2026-05-21 19:31:59 +03:00
DosX
eb0f6d1f9d dbs_min update 2026-05-21 18:45:07 +03:00
DosX
2d75e51a7e Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-21 18:43:39 +03:00
DosX
a7681bc996 Tighten fake-signs detection; update DNGuard author
Change detection logic in protection_obfusheader_h.5.sg to require .enigma1, .vmp0 and .xtls sections (and set bDetected = true) before appending the "fake signs" option — this avoids relying on a prior bDetected flag and reduces false positives. Also update protector_DNGuard.2.sg metadata to reflect a new author (DosX) and add contact links.
2026-05-21 18:43:36 +03:00
DosX
9bf431ba2f Add NecroVM and RAT/UXCryptor heuristics
Add 'NecroVM.Runtime' to the .NET obfuscator signature list. Introduce heuristics to detect Qatar RAT (module 'QatarC.exe') and Cryptobytes/UXCryptor (checks for 'lc.exe' or assembly 'lc' and a specific .NET object signature). Reference links for both detections are included as comments.
2026-05-21 18:43:19 +03:00
DosX
76425fc5b5 Add PE detection rule for bzip2 library
Add Detect It Easy rule (db/PE/library_bzip2.4.sg) to detect bzip2 in PE files. The rule sets meta("library", "bzip2") and uses PE.isLibraryPresentExp(/(?:bzip|libbz)2/i) to mark detection; includes author/contact metadata.
2026-05-21 18:42:58 +03:00
horsicq
18461cf452 chore: update db date to 2026-05-19 2026-05-19 20:42:18 +02:00
Benjamin Funke
c4c9d34761 add Omni Demo to Lego1 signature 2026-05-18 17:37:43 +02:00
DosX
87dd0b73f8
Update README.md 2026-05-17 18:00:45 +03:00
DosX
b5cdaefac9 dbs_min update 2026-05-16 19:04:38 +03:00
DosX
aade9d41d9 Regen dbs_min -> (bad logic), fixed 2026-05-16 19:04:22 +03:00
DosX
043a583c43 dbs_min update 2026-05-16 19:01:55 +03:00
DosX
99e4073c6e Add rule for prometheus-net
Add a new PE detection rule at db/PE/library_prometheus-net.4.sg that marks files as detected when the .NET object "Prometheus.NetStandard" is present.
2026-05-16 19:01:34 +03:00
DosX
13af0d1509 Add TimeZoneConverter detection rule
Add a Detect It Easy PE rule (db/PE/library_TimeZoneConverter.4.sg) to detect the TimeZoneConverter .NET library. The rule uses PE.isNetObjectPresent("TimeZoneConverter") to mark detection and includes author metadata.
2026-05-16 18:59:09 +03:00
DosX
f43141e9b9 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-16 18:53:54 +03:00
DosX
eba57c7fa6 Use _setLang and String() in Perl detection
Refactor Perl runtime detection: replace direct sLang assignments with a call to _setLang("Perl"), move the final sLang = "Perl" to the end of the function, and change the empty-string result argument to String(). Also reorder bDetected/sVersion assignment for clarity. These changes standardize language setting and ensure the result uses a String() placeholder.
2026-05-16 18:53:49 +03:00
Benjamin Funke
e00b5ab2ea add PE.isNet() check for Digital Mars signature 2026-05-16 14:50:02 +02:00
DosX
8b6345a3b5 Add heuristic detection for Polip malware
Introduce a heuristic in PE generic analysis to detect Win32/Polip-like infections. The new logic (x86 only, non-64bit) checks for executables with multiple sections where the entry instruction is PUSH or CALL, then scans unnamed sections for RWX flags, excludes known sections (entry, resource, import, export, relocs, TLS), high entropy (>7.3) and a byte-sequence signature (push ebp; mov ebp, esp; sub esp, ...; pushal). If matched, it pushes a "Polip" infected verdict. Includes reference to the Microsoft threat encyclopedia URL.
2026-05-15 17:57:29 +03:00
DosX
ca7e9d21ad Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-15 17:56:38 +03:00
DosX
13db106134 Add 32-bit check and reorder cacheMap entries
Require an explicit 32-bit guard for the CIH heuristic and reorganize cacheMap initialization.

- In scanForMaliciousCode_NET_and_Native, added !PE_Cached.is64bit to the condition that checks for the x86 'push ebp' entry-point pattern, preventing the heuristic from running on 64-bit PEs.
- In initializeCache, moved local function bindings (isArchX86, isCppClrLikeApp, isVbNetStandardLibraryPresent, isJscriptNetStandardLibraryPresent, firstEpAsmInstruction) below the computed/native entries to group related cache entries and improve initialization ordering/readability.
2026-05-15 17:56:35 +03:00
Benjamin Funke
db64fe4fc3 add Mikmod signature 2026-05-15 16:41:24 +02:00
DosX
9863826990 Refactor JS heuristic and improve template parsing
Extracted and de-duplicated the main heuristic logic, making detect() only call main() during heuristic scans. The update reorganizes file-suffix handling and enhances JS content analysis: it skips string literals, properly handles template literals and nested ${...} expressions (using skipNestedTemplate), and distinguishes bytecode vs. plain-text scripts. Detection for minified/compiled code was improved by scanning code segments outside strings with updated regex checks.
2026-05-15 13:33:54 +03:00
DosX
8641f9da43 Lower size threshold for JS heuristic
Change the Binary.getSize() check from >3000 to >0x400 (1024) so the MiniJavaScript heuristic will run on smaller binary/text inputs. This makes the detector cover scripts between ~1KB and the previous 3KB cutoff, improving detection for smaller embedded scripts.
2026-05-15 13:31:26 +03:00
DosX
5c33d67919 dbs_min update 2026-05-15 13:26:52 +03:00
DosX
6aa64aeb04 Fix regex char class in MiniJavaScript heuristic
Escape closing brace and parenthesis inside the regex character class used by the minification heuristic. This corrects the token-matching pattern so punctuation like ";", "}" and ")" are recognized reliably and prevents potential regex parsing issues in db/Binary/__MiniJavaScriptHeuristic_By_DosX.7.sg.
2026-05-15 13:26:36 +03:00
DosX
21782fbd78 Add skipNestedTemplate helper for templates
Introduce skipNestedTemplate(s, i) to robustly skip JavaScript template literals, handling nested ${} expressions, inner string literals, escape sequences, and recursion. Replace the previous ad-hoc template-scanning loop in main with a call to this helper when encountering a nested backtick, simplifying the logic and improving correctness when parsing nested templates in scriptContent during heuristic scans.
2026-05-15 13:26:20 +03:00
DosX
3e1fa4cab4 Enhance JS heuristic parsing and regex fixes
Improve the MiniJavaScript heuristic parsing: skip escaped characters, properly skip string literals inside expressions, and handle nested template literals (tracking ${} depth) to avoid false positives when scanning script content. Also tighten regexes by switching to non-capturing groups and refining the whitespace/token check used to detect minified/compiled code.
2026-05-15 13:16:03 +03:00
DosX
5cce7a286d Add jsx/mjs/cjs extensions to JS heuristic
Recognize .jsx, .mjs, and .cjs as JavaScript file types in the MiniJavaScript heuristic. Adds switch cases for JavaScript XML, Module, and CommonJS Module in db/Binary/__MiniJavaScriptHeuristic_By_DosX.7.sg to improve detection of modern JS file extensions.
2026-05-15 13:00:12 +03:00
DosX
e97e6825a6 Use strict equality and clean up compiler_DMC
Refactor compiler_DMC.6.sg detection routine: replaced loose equality checks with strict (===), combined major/minor linker version declarations into one statement, adjusted indentation and whitespace, and tidied bracket alignment. These are stylistic/clarity changes and should not alter detection logic or behavior.
2026-05-15 12:44:47 +03:00
DosX
525bf76520 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-15 12:42:47 +03:00
DosX
8f3dcd066f Use PE_Cached offsets in PE scans
Switch entropy and signature checks to use PE_Cached.dosStubSize and PE_Cached.fileBodySize instead of hardcoded 0x00 or getSize()-getOverlaySize(). Changes in scanForPackersAndCryptors_NET_and_Native, scanForLicensingSystems_NET_and_Native and scanForLanguagesAndCompilers_NET_and_Native ensure scans skip the DOS stub and overlay, producing more accurate entropy/signature results and reducing false positives.
2026-05-15 12:42:37 +03:00
DosX
67ae0bdde7 Cache PE values; fix detections and minor tweaks
Add computed fields to PE cache (fileBodySize, addressOfUnmanagedEntryPoint, dosStubSize) and update many routines to use PE_Cached instead of repeated PE.get*/VAToOffset/findSignature calls for correctness/performance. Adjust Intel C++ compiler detection to only compare watermark on 32-bit builds. Minor fixes: simplify byte buffer concat and add "Enhanced by: DosX" credit to pkr_ce1a rule.
2026-05-15 12:41:49 +03:00
Benjamin Funke
2db6c1b988 add 8.52 to sVersion for DMC signature
The samples between 8.52 and 8.57 has identical major und minor version
2026-05-15 10:42:58 +02:00
Benjamin Funke
a8d7028397 dbs_min update 2026-05-15 08:14:51 +02:00
Benjamin Funke
b01868ec3b add Digital Mars compiler signature
Co-Authored-By: Hors <horsicq@gmail.com>
2026-05-14 22:22:28 +02:00
DosX
5c23a5aa54 Tighten PE packer detection checks (#359)
Replace a single signature scan with a set of stricter checks to reduce false positives: ensure the binary is 32-bit, has at least 4 sections, matches an entry-point byte pattern, imports KERNEL32.dll, exposes IsDebuggerPresent and LoadLibraryA/W, and contains the specific signature in section 1 instead of scanning the entire file. This makes packer detection more precise.
2026-05-14 17:33:41 +03:00
DosX
20b042df85
Merge pull request #359 from Tenzzzzzz/Add/pkr_ce1a
Added the detection of "pkr_ce1a" packer
2026-05-14 17:07:40 +03:00
Benjamin Funke
26f79591e5 add lchcdap game engine signature 2026-05-14 11:08:27 +02:00
Yosef Khaled
41f48b120e
Update packer_pkr_ce1a.2.sg 2026-05-14 10:48:48 +03:00
DosX
0d7ae97db4 dbs_min update 2026-05-14 06:48:37 +03:00
DosX
23a3ae79c6 Update ANDpakk detection; remove extra blank line
Fix heuristic entry for ANDpakk: rename product from 'ANDpakk2' to 'ANDpakk' and add version '2.0' while preserving the match token 'ANDpakk2' for detection. Also remove an extraneous blank line in other_GSplit.1.sg as a minor whitespace cleanup.
2026-05-14 06:45:20 +03:00
DosX
2248e623b0 Add Detect It Easy rule for Rusty packer
Add a new Detect It Easy (DIE) detection rule for the Rusty PE packer (db/PE/packer_Rusty.2.sg). The rule (author: DosX) marks files as packed by "Rusty" based on import/resource heuristics and specific import-position hashes, and flags binaries as "modified" when the first resource name differs from "STUB". Includes metadata and source reference to the original Rusty-PE-Packer project.
2026-05-14 06:20:44 +03:00
yosef khaled shehata
a7e0010f92 Added the detection of "pkr_ce1a" packer
I added a detection rule file under "/db/PE" to detect a packer called "pkr_ce1a" used by malware authors.
2026-05-14 00:59:53 +03:00
DosX
3b2dfac1de Add source URLs to tool metadata
Add comment reference URLs to two PE tool metadata files for context. Inserted a Wikipedia link for Microsoft Visual Studio in db/PE/tool_Microsoft_VisualStudio_NET.6.sg and a GitHub link for de4dot in db/PE/tool_de4dot.6.sg; these are non-functional comments intended as source/reference annotations.
2026-05-13 23:14:21 +03:00
DosX
4d9608eb09 Update game_engine_ClickteamFusion.3.sg 2026-05-13 23:08:49 +03:00
DosX
c36254255d dbs_min update 2026-05-13 20:39:27 +03:00
DosX
0430b77931 Improve Clickteam Fusion detection pattern
Add an extra EP signature check and a comment to improve detection for Clickteam Fusion. The detect() function now includes an additional PE.compareEP("E8........E9$$$$$$$$6A14") check.
2026-05-13 20:30:51 +03:00
DosX
5445b4b92c Enhance Clickteam Fusion detection logic
Broaden Clickteam Fusion 2.X+ detection by adding a rich-signature + entry-point pattern check (compareEP with "E8........E9........CCCCCCCCCCCCCCCCCCCCCC"). Retains the existing export-function + overlay check (zi32Support + compareOverlay) as an alternative detection path.
2026-05-13 20:16:40 +03:00
DosX
13f47a591b Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-13 20:01:12 +03:00
DosX
ece9b51579 Add Clickteam Fusion detection rule
Add a Detect It Easy rule (db/PE/game_engine_ClickteamFusion.3.sg) to identify Clickteam Fusion executables. The rule checks for the PE export function `zi32Support` and an overlay signature, sets the detected version to `2.X+`, and includes author metadata.
2026-05-13 20:01:09 +03:00
Benjamin Funke
7e1c18cdcb add Unreal game engine signature 2026-05-13 18:21:01 +02:00
DosX
74268286dd dbs_min update 2026-05-13 19:13:00 +03:00
DosX
18903e438f Regen dbs_min -> (wrong Lvy RAT name bug), fixed 2026-05-13 19:12:49 +03:00
DosX
f44981d2ab Update __GenericHeuristicAnalysis_By_DosX.7.sg 2026-05-13 19:11:51 +03:00
DosX
c269309221 dbs_min update 2026-05-13 19:11:32 +03:00
DosX
b227feda23 Add safety checks for resource and disasm offsets
Add defensive checks to avoid using invalid offsets and missing disassembly strings. Guard against -1 resource/VAToOffset results before calling PE.compare/PE.isSignaturePresent, cache the resource offset in a local variable, and break when PE.getDisasmString() returns falsy to avoid caching undefined. These changes prevent false matches and runtime errors when resources or disassembly are not present.
2026-05-13 19:04:08 +03:00
DosX
b65fd76005 Replace substr with substring and simplify checks
Use substring instead of substr for string slicing in heuristic scanners and simplify a redundant ASCII check. Updates in scanForObfuscations_NET and scanForObfuscations_Native: replace sectionName.substr(1, ...) and libraryName.substr(..., 4) with substring calls, and remove a redundant !isAsciiString(libraryName) condition in the import-character test. These changes improve consistency and clarity of the string operations without altering the intended detection logic.
2026-05-13 18:53:19 +03:00
DosX
f3c443dd11 Use strict !== instead of != in heuristics
Replace loose inequality checks with strict !== to avoid type-coercion issues in PE heuristic scanning. Changes apply to db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg across functions like scanForPackersAndCryptors_NET_and_Native, validateSignature, validateNetByteCode, validateGlobalUnicodeString, generateUnicodeSignatureMask, and scanForObfuscations_Native. This is a behavior-preserving refactor intended to make comparisons more robust and explicit.
2026-05-13 18:47:30 +03:00
DosX
f0fba511a8 Add safety check for missing disassembly
Break out of the loop if PE.getDisasmString returns a falsy value. Adds a guard in emulateAndGetEpAsmPattern to avoid appending undefined instructions and to prevent potential crashes or infinite loops when disassembly is unavailable.
2026-05-13 18:38:32 +03:00
DosX
72db591361 Use strict equality and cache section entropy
Replace loose comparisons (==/!=) with strict operators (===/!==) in NetOpCodes, scanForBadFileFormat_NET_and_Native, and isNameObfuscated for correctness and consistency. Also compute sectionEntropy once in scanForPackersAndCryptors_NET_and_Native and reuse it for the threshold check and logging to avoid redundant calculations and improve readability/performance.
2026-05-13 18:32:20 +03:00
DosX
44ed59ed02 Use raw instruction text in EP regex checks
In scanForObfuscations_Native(), replace calls to getAsmOpCode(PE_Cached.firstEpAsmInstruction) with direct regex tests against PE_Cached.firstEpAsmInstruction. This affects both x86 and ARM branches that detect breakpoint/return patterns for TLS entry point checks, reducing redundant parsing and ensuring the regex matches the actual instruction text.
2026-05-13 18:25:46 +03:00
DosX
02b7e6dcfe Limit PDB scan range and accept '/' in paths
In scanForDebugData_NET_and_Native (db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg): stop the backward scan for the PDB path at PE.getDosStubOffset() + PE.getDosStubSize() instead of 0 to avoid scanning into the DOS stub region, and relax the absolute-path check to accept either backslash or forward slash (so both C:\... and C:/... are recognized). These changes reduce false positives and prevent reading outside the intended bounds.
2026-05-13 18:20:15 +03:00
DosX
76edcd71b2 Use strict !== instead of != in scans
Replace loose inequality checks (!=) with strict (!==) across multiple scan functions in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg (e.g. scanForObfuscations_NET, scanForAntiAnalysis_NET, scanForPackersAndCryptors_NET_and_Native, scanForLicensingSystems_NET_and_Native, scanForBadFileFormat_NET_and_Native, scanForDebugData_NET_and_Native, scanForObfuscations_Native, scanForInterestingMarkers_NET_and_Native). This change enforces strict type-safe comparisons to avoid unintended type coercion and improve reliability of detection logic. No other logic changes made.
2026-05-13 18:15:48 +03:00
DosX
7f0a630c56 Bound section scan loop and use strict equality
Tighten the loop that finds the last non -1 section address in scanForPackersAndCryptors_NET_and_Native(): use strict equality (===) and add an upper bound (i <= PE_Cached.numberOfSections) to avoid infinite loops or out-of-range section accesses when no valid section is found.
2026-05-13 18:13:45 +03:00
DosX
a201d52bc8 Scan NET short-names from index 0; fix hex padding
Start the short-name detection loop at index 0 so the first character in the 'chars' set is checked (previously it was skipped). Also correct hex byte formatting when building the buffer by left-padding single-digit hex strings (currentByte.length === 1) with a '0' instead of only handling the literal '0', ensuring bytes like 0x0A produce '0a' instead of 'a'.
2026-05-13 15:03:24 +03:00
DosX
4fe3900b65 dbs_min update 2026-05-13 03:07:23 +03:00
DosX
ec2a4a0bd4 Refine name obfuscation detection
Change handling of leading uppercase tokens in isNameObfuscated() from returning false to continuing, so an uppercase abbreviation at the start doesn't prematurely mark the whole name as not-obfuscated and allows subsequent tokens to be evaluated. Also tighten the copyright-year whitelist regex in isTokenObfuscated() by anchoring the end (added $) to require a full-token match, preventing partial matches that could cause false positives.
2026-05-13 03:01:44 +03:00
DosX
0749844697 Guard against missing <Module> .ctor signature
Calculate ctorSignatureOffset and handle a -1 result from PE.findSignature so subsequent reads/comparisons aren't done at an invalid offset. Only run the short-name detection, the short-name scanning loop, and the buffer read loop when a valid afterCtorOffset exists. Also rename the signature variable for clarity and change protectionsRuntime from const to var (compatibility/consistency). These changes prevent out-of-bounds reads and false detections when the <Module> .ctor signature is not found.
2026-05-13 02:57:42 +03:00
DosX
6e3aead49a Clear PE cache, correct ldloca and findSignature
Fix several PE heuristic issues: unloadCache now clears all enumerable properties from PE_Cached instead of setting it to undefined to avoid leaving stale object references; correct the MSIL ldloca opcode from "FE09????" to "FE0D????"; and adjust the PE.findSignature call to pass sectionSize (instead of sectionOffset + sectionSize) so signature searches use the proper length. These changes address cache-clearing bugs, an incorrect opcode mapping, and an incorrect signature search range.
2026-05-13 02:45:17 +03:00
DosX
f4f90dc552 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-13 02:44:40 +03:00
DosX
73cbb7f846 Update JSDoc for unloadCache behavior
Clarify unloadCache JSDoc to state it removes all enumerable properties from PE_Cached instead of setting it to undefined, keeping the documentation consistent with the implementation in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg.
2026-05-13 02:44:25 +03:00
DosX
d003e8f9cb Simplify capitalization for option labels
Remove unnecessary .toUpperCase() calls when constructing option strings in two places (scanForPackersAndCryptors_NET_and_Native and scanForObfuscations_Native). The code now concatenates the raw first character with the lowercased remainder, avoiding potential runtime issues and ensuring consistent label formatting for detected opcodes near EP.
2026-05-13 01:13:05 +03:00
DosX
5d34bf3cf9 dbs_min update 2026-05-13 01:09:42 +03:00
DosX
4acb6d77f6 Refine ' RAT' signature heuristic with object checks
Tighten the heuristic in scanForMaliciousCode_NET_and_Native: only treat the Unicode " RAT" signature as a trigger when it appears together with at least one of the specified objects (System.Net.Sockets, GetWindowText, avicap32.dll). Keeps the existing fallback checks for other Net objects (AntiTaskManager, BlockAvSites, UpdaterEXE, etc.). This reduces false positives by requiring both the signature and contextual API/library usage.
2026-05-13 01:07:33 +03:00
DosX
2348272a08 Update library_Direct3D.4.sg 2026-05-12 23:43:00 +03:00
DosX
a9f2880eca Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-12 23:42:24 +03:00
DosX
269db4ffbb Safely handle regex match in Direct3D detection
Avoid indexing the regex result directly when no match is found. Assign the full match array to sVersion, check that it contains a capture group, then extract the version token and validate it (1..13). This prevents runtime errors on null matches and ensures correct Direct3D version detection.
2026-05-12 23:42:12 +03:00
Benjamin Funke
71c5e60f00 dbs_min update 2026-05-12 22:26:46 +02:00
Benjamin Funke
5d884dca8e add libvpx ELF signature 2026-05-12 22:25:45 +02:00
DosX
684dc97516 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-12 23:09:10 +03:00
DosX
828363eea9 dbs_min update 2026-05-12 23:08:44 +03:00
Benjamin Funke
b4a75790d2 add Argon2 ELF signature 2026-05-12 22:08:41 +02:00
DosX
c31eb5c7f4 Tighten Direct3D import regex and version checks
Restrict Direct3D import detection to 1-2 digit versions and ensure detected versions are in the 1..13 range. The import regex was changed from /d3dx?(\d+)/i to /d3dx?(\d{1,2})/i, maxVersion is now validated (<= 13), and the fallback now extracts the d3d major version with PE.isLibraryPresentExp(/^d3d(\d{1,2})/i)[1] and validates it before setting bDetected. This prevents false positives and out-of-range version matches.
2026-05-12 23:07:07 +03:00
DosX
0ca9674f6b Refine KD token regex and clarify build comment
Fix a heuristic bug by changing the KD transport regex from /^kd[_n]/i to /^kd(?:_|net_)/i so it correctly matches "kd_..." and "kdnet_..." prefixes (avoids accidental matches like "kdn..."). Also tweak the changelist/build comment examples to emphasize numeric parts (e.g. CL [35398403], Build [123456]). These edits improve token obfuscation detection accuracy and comment clarity in the PE heuristic rules.
2026-05-12 22:52:59 +03:00
DosX
218f5a0fee Whitelist common identifier naming patterns
Add several regex patterns to isTokenObfuscated whitelist in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg. New rules recognize common OOP/API noun suffixes (handler, manager, factory, callback, decoder, etc.), Hungarian-style Windows API prefixes (lpsz/dw/hWnd/... followed by PascalCase), PascalCase/camelCase names with trailing version digits (e.g. Direct3D9, CreateFile2), and multi-segment snake_case identifiers. These additions aim to reduce false positives by treating legitimate identifier naming conventions as non-obfuscated tokens.
2026-05-12 22:49:54 +03:00
DosX
8d681e44fe Tighten Direct3D module regex to require digits
Change the Direct3D module name pattern from /^d3d/i to /^d3d\d{1,2}/i in the PE heuristics. This requires 1–2 digits after 'd3d' (e.g. D3D9, D3D10, D3D11) and reduces false positives from tokens that merely start with 'd3d'.
2026-05-12 22:41:03 +03:00
DosX
d5fc32ec3d dbs_min update 2026-05-12 22:36:58 +03:00
DosX
fef3bf931a Enhance PE heuristic whitelist patterns
Expand and refine the heuristic whitelist used in PE generic analysis. Added more driver/service suffixes (srv, svc, port, bus, hub, hid) to the existing regex to reduce false positives for Windows components. Introduced new patterns to recognize PascalCase and camelCase compound identifiers and a regex for known Windows kernel/network component substrings (ndis, acpi, storport, usbhub, etc.). These changes improve whitelisting of legitimate symbol names and reduce accidental obfuscation flags.
2026-05-12 22:36:11 +03:00
DosX
00b9f14fbd Consolidate token whitelist into array
Replace many individual token.match checks with a single whitelist array of regular expressions and iterate over it, reducing duplication and improving readability/maintainability. Tighten the Windows resource/constant identifier regex to require an underscore and a stricter pattern; all other whitelist patterns were preserved but consolidated into the array. Changes are localized to the PE heuristic whitelist logic.
2026-05-12 22:32:01 +03:00
DosX
50ded292a8 Refine token whitelist regexes
Tighten heuristics in isTokenObfuscated(): strengthen the hardware/model whitelist to require a well-formed prefix+digit block and optional underscore/dash suffixes (anchored to the end) to avoid accidentally whitelisting random strings; add CUDART64_132_51 to examples. Also adjust the SCREAMING_SNAKE_CASE rule to require at least one underscore so all-caps hex-like identifiers (e.g. DEADBEEF) are no longer whitelisted.
2026-05-12 21:24:55 +03:00
DosX
e53afb42f4 Update __GenericHeuristicAnalysis_By_DosX.7.sg 2026-05-12 20:15:16 +03:00
DosX
d66e10266f Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-12 20:11:52 +03:00
DosX
d1b9abfe12 Refine PE heuristic obfuscation rules
Update PE generic heuristic rules to reduce false positives and better recognize benign tokens: add a debug _setResult call when an obfuscated chunk is logged; expand benign token whitelist with cuda, iscsi, scsi, sstp, uart; add DirectX (d3d) and kernel debugger (kd_) exclusions; add hardware chip/model pattern and driver/service suffix exclusions. Also relax the uppercase-only resource token rule by removing the lower-case check, and raise the repeated-consonant detection threshold from 5 to 7 to avoid flagging legitimate names (examples: luainstall.dll, rassstp.sys, msiscsi.sys). Changes applied to db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg.
2026-05-12 20:11:50 +03:00
Benjamin Funke
89ad65810a add XCOMPILE signature 2026-05-12 18:59:42 +02:00
Benjamin Funke
06f62b0798 Use PE.getFileVersion() in XPAT signature 2026-05-12 18:49:46 +02:00
DosX
edecf14bc1 Improve token obfuscation heuristics
Enhance isTokenObfuscated checks to reduce false positives and better recognize common non-obfuscated tokens. Added regexes to allow partial GUIDs/GUID fragments and build/version hashes with optional word suffixes. Extended CI/build keyword list (added sql,tmp), added charset/codepage name detection (cp/iso/utf/ucs/etc.), and added detection for uppercase Windows resource/constant identifiers. Tightened obfuscation rule for long consonant clusters by raising the threshold from 6 to 8 and updating the related comment and regex.
2026-05-12 19:28:34 +03:00
DosX
c3fc6b8e14 Add SecurityHealthService and simplify signing 2026-05-12 19:04:24 +03:00
DosX
59e5bd7c97 Improve fake system/file and company checks
Remove an obsolete CFG-without-DEP check and refactor heuristic checks for fake build info and system files. Rename companyNames to companyNamesDict, and introduce combined system file name lists with a helper to compare OriginalFilename/InternalName. Defer adding verdicts until a consolidated isFakeOrInfected flag is determined, and add additional checks for Rich signature, signing, .NET builds, and packer/protector heuristics to reduce false positives.
2026-05-12 19:00:56 +03:00
DosX
1433beadaf dbs_min update 2026-05-12 18:11:16 +03:00
DosX
a40da7ca3a Fix export name check precedence
Wrap the export-name condition in parentheses to ensure functionName is evaluated before checking if it starts with a digit or is non-ASCII. This prevents isAsciiString from being called when functionName is falsy and fixes the logical precedence that could yield false positives for strange exports.
2026-05-12 02:29:32 +03:00
DosX
b5d27b6599 dbs_min update 2026-05-12 02:21:07 +03:00
DosX
921c5f4ed1 Fix mangled name parsing for E/G/R and $ methods
Adjust mangled symbol parsing in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg: for _E/_G/_R patterns (destructor, vector destructor, RTTI) strip the prefix and return the name suffix instead of the whole token; normalize class method parsing by removing a leading '$' before splitting, and compare against 'bctr'/'bdtr' (without $) to correctly detect constructors/destructors and return class name or '~class'. This corrects incorrect name extraction for those mangled forms.
2026-05-12 02:19:26 +03:00
DosX
1bacd6bc4b Use non-capturing groups in PE regexes
Replace unnecessary capturing groups with non-capturing groups (?: ) in several regular expressions inside scanForObfuscations_Native in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg. This removes spurious capture overhead for patterns matching INT 3, RET <n>, and BX LR while keeping behavior unchanged (used for TLS/EP heuristic checks).
2026-05-12 02:17:24 +03:00
DosX
eda20ef5a8 dbs_min update 2026-05-12 02:03:31 +03:00
DosX
0ba0ea7396 Add Rusty packer and annotate packer entries
Add detection entry for the Rusty PE packer (magic 0xa2260c1d, heuristic value 10). Also add documentation comments/URLs for Packman and Amber and tidy related inline comments; no other functional changes.
2026-05-12 02:01:33 +03:00
DosX
5b95a17a4c Add reference URLs to packer entries
Add inline reference comments for py2exe and BoxedApp entries in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to document source websites. This is a non-functional change (comments only) to improve maintainability and provide quick lookup links for those packer signatures.
2026-05-12 01:22:53 +03:00
DosX
45f0a4ca16 Add extra tokens to CI/build regex
Include additional common tokens (mgr, vds, word, runtime) in the build/CI server pattern inside isTokenObfuscated(). This prevents those tokens from being treated as obfuscated by the heuristic and reduces false positives when analyzing PE names.
2026-05-11 21:57:26 +03:00
DosX
d0bc44a4c3 Add '.imrsiv' (UWP) to standard sections list
Expand the standardSectionsWithUnusualValuesDict to a multi-line array for readability and add the '.imrsiv' entry (with a comment marking it as UWP). Also annotate 'hydrated' as .NET Native. This extends heuristic recognition for .NET Native and UWP binaries.
2026-05-11 21:50:56 +03:00
DosX
342a1b1ddb dbs_min update 2026-05-11 21:40:39 +03:00
DosX
adf55c8b27 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-11 21:39:25 +03:00
DosX
0651601ce1 Detect fake system files via version info
Add a heuristic that flags PE files whose OriginalFilename or InternalName matches common Windows system executables (e.g. csrss.exe, wininit.exe, lsass.exe, svchost.exe, taskhostw.exe, ntkrnlmp.exe) but that are .NET, lack a Rich signature, or are unsigned. When detected, a verdict of "Fake ...system file" is appended to indicate possible masquerading or infection. This helps catch malware that copies legitimate system names without proper signing or Rich signature metadata.
2026-05-11 21:39:24 +03:00
Benjamin Funke
aa786eb6d3 refactor DEV7 game signature
Co-Authored-By: DosX <collab@kay-software.ru>
2026-05-11 19:48:51 +02:00
DosX
63f963caff Normalize PE file version strings in engine detectors
Use File.cleanString(PE.getFileVersion()) when populating sVersion for several game engine detectors (Atlas, Godot, Wintermute) to ensure cleaned/normalized version strings. Refactor Director detector to remove repeated sVersion assignments and set sVersion once (cleaned) when any detection branch matches. Minor whitespace cleanup included.
2026-05-11 20:29:12 +03:00
DosX
14901fa064 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-11 20:27:14 +03:00
DosX
3a69bb160c Improve Warbird detection and token rules
Enhance heuristic detection for Microsoft Warbird and adjust token obfuscation exclusions.

- db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg: broaden Warbird signature to include PROTDATA and section-name patterns (/^PAGE(?:VRFY|wx[1-6])$/). Also add "krnl" to the list of tokens treated as non-obfuscated.
- db/PE/protection_Microsoft_Warbird.2.sg: add fallback detection that marks Warbird as present when a .sys library exists and a PAGEVRFY/PAGEwx1-6 style section name is present.

These changes make Warbird identification more reliable by matching additional known markers and prevent mislabeling common kernel-related tokens as obfuscated.
2026-05-11 20:27:11 +03:00
Benjamin Funke
8b7dbb6391 use PE.getFileVersion() for game engine signatures
Re-introduce sVersion with PE.getFileVersion() to extract the exact version number of the game engine
2026-05-11 19:20:33 +02:00
Benjamin Funke
336994ff14 add FMOD signature 2026-05-11 18:59:58 +02:00
DosX
eb9d248319 dbs_min update 2026-05-11 19:40:43 +03:00
DosX
1017f556d5 Add inject2pe signature to PE heuristics (#355)
Register inject2pe as a known packer by adding the ".inj" signature to db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg. This enables heuristic detection of inject2pe-packed files (reference: https://github.com/0xballistics/inject2pe).
2026-05-11 18:41:56 +03:00
DosX
0a42c33b00 Rename tool_inject2pe.2.sg -> tool_inject2pe.6.sg (#355) 2026-05-11 18:36:45 +03:00
DosX
74bb0a17bf Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-11 18:34:12 +03:00
DosX
5b57795d2b Refine inject2pe detection rule
Tighten the Detect It Easy rule for inject2pe: require non-64-bit, zero DOS stub size, and use strict comparisons; keep checks for single section, specific Characteristics, header size, no imports, and non-console. Add detection of modified wrappers by marking sOptions="modified" when the section name is not ".inj". Minor formatting and return placement adjusted to improve accuracy and reduce false positives.
2026-05-11 18:34:02 +03:00
github-actions[bot]
84742d83eb style: auto-format JavaScript files in db directories 2026-05-11 15:33:37 +00:00
Benjamin Funke
bf74b6d8e6 fix inject2pe filename 2026-05-11 17:32:13 +02:00
github-actions[bot]
8d2c3eaf6f style: auto-format JavaScript files in db directories 2026-05-11 15:27:03 +00:00
DosX
ef60be45d1
Merge pull request #355 from Tenzzzzzz/inject2pe/detection
Add inject2pe detection rule
2026-05-11 18:26:26 +03:00
Yosef Khaled
9da0680939
Update tool.inject2pe.2.sg 2026-05-11 18:20:42 +03:00
DosX
947974eb12 dbs_min update 2026-05-11 02:15:17 +03:00
DosX
a1f6c641e4 Add checks for CFG without DEP and No-SEH on x64
Add validation in scanForObfuscations_Native() to detect invalid DLL characteristic combinations: flag Control Flow Guard (IMAGE_DLLCHARACTERISTICS_GUARD_CF) when NX/DEP (IMAGE_DLLCHARACTERISTICS_NX_COMPAT) is not set (adds option "CFG without DEP"), and flag No-SEH (IMAGE_DLLCHARACTERISTICS_NO_SEH) when the image is 64-bit (adds option "No-SEH on x64"). These identify broken or nonsensical security flag combinations that are not produced by legitimate toolchains.
2026-05-11 02:10:02 +03:00
DosX
9a0f73b9a1 Flag PE images with CFG but no ASLR
Add a heuristic that detects when IMAGE_DLLCHARACTERISTICS_GUARD_CF is set but IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE is not. When observed, the code appends the "CFG without ASLR" option to the analysis results to highlight a potentially inconsistent or suspicious configuration (CFG is only effective on ASLR-enabled images).
2026-05-11 02:09:45 +03:00
DosX
27be07a78e Detect FORCE_INTEGRITY without ASLR
Add a check in scanForObfuscations_Native to detect when IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY is set but IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE (ASLR) is not. When found, set isForceIntegrityWithoutAslr and add the "Force integrity without ASLR" option so such PE images are flagged during heuristic analysis.
2026-05-11 02:09:37 +03:00
DosX
35240ed05e Handle high-entropy VA on 32-bit PE
Refine high-entropy VA handling: change the existing option text to "High entropy VA without ASLR" and add a new check to detect when IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA is set on 32-bit images (which is meaningless). When detected, add the "High entropy VA on x32" option to avoid misleading heuristics/false positives.
2026-05-11 02:09:27 +03:00
DosX
c2730fdb82 Warn if High-Entropy VA set without ASLR
Add a heuristic in scanForObfuscations_Native to detect when the IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA flag (0x0020) is set but IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE (ASLR, 0x0040) is not. When this inconsistent combination is found, set an option message "High entropy VA needs ASLR" to flag the likely misconfiguration or ineffective setting. This helps identify PE files that declare 64-bit ASLR entropy while ASLR itself is disabled.
2026-05-11 02:07:11 +03:00
DosX
360128a0dd Add DLL characteristics flags and validity check
Define IMAGE_DLLCHARACTERISTICS constants and add a check in scanForObfuscations_Native to read DllCharacteristics from the PE optional header. The new logic detects if reserved bits 0-4 are set (which should never be used) and marks the binary with the "Invalid DLL flags" option when found. This enhances heuristic detection of malformed or potentially obfuscated PE files by validating DLL characteristic flags.
2026-05-11 02:06:56 +03:00
DosX
c0ba049aad Tweak PE heuristic checks and comments
Three small edits to PE heuristic logic and comments:

- Remove the "43210" alternative from the numeric-sequence regex used to detect 5+ digit ascending/descending sequences.
- Clean up a block comment header for ARM/ARM64 NOP-equivalent instructions (remove an extra leading '*' and align text).
- Add "DECRYPTOR" to the resource-name detection regex so resources named DECRYPTOR are flagged alongside PAYLOAD, SHELLCODE, INJECT, and CRYPTED.
2026-05-11 02:06:29 +03:00
DosX
bd31ca55f3 Add PE rule for SSH.NET
Add a new detection rule db/PE/library_SSH_NET.sg that identifies the SSH.NET .NET library by checking for the presence of the Renci.SshNet object. The rule includes a library meta tag and author/contact metadata to help PE analysis detect SSH.NET in binaries.
2026-05-11 00:17:46 +03:00
DosX
c1b5696c2c Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-10 23:58:45 +03:00
DosX
dba850efa2 Improve token obfuscation heuristics
Refactor and extend obfuscation checks for tokens. Consonant-repetition logic now only runs for tokens under 15 chars and uses a regex-based consonant test with an inline counter/early return for >=5 repeats. Expanded keyboard-walk detection to cover horizontal row patterns (5+ chars, forward/backward) and added vertical column patterns (6+ chars) as well as number-row sequences (5+ consecutive digits). These changes tighten thresholds to reduce false positives and broaden detection of common obfuscation patterns.
2026-05-10 23:58:43 +03:00
Yosef Khaled
0850c5400a
Fix detection logic in tool.inject2pe.2.sg 2026-05-10 22:33:15 +03:00
yosef khaled shehata
1d84b6b603 Add inject2pe detection rule
Add a Detect It Easy (DIE) rule to identify the inject2pe tool's wrapper method. The rule (author: Yosef Khaled) tags files with meta tool="inject2pe" and matches PEs with no imports, a single section, SizeOfHeaders == 0x200, first section Characteristics == 0xE0000020 and not a console binary; it sets options to "shellcode2exe wrapper". Includes link to the project: https://github.com/0xballistics/inject2pe.
2026-05-10 22:19:13 +03:00
Benjamin Funke
a8aac75db7 add libxml2 signature 2026-05-10 17:11:24 +02:00
DosX
d63afaeb91 Update packer_Fatpack.2.sg
Co-Authored-By: Yosef Khaled <124172634+tenzzzzzz@users.noreply.github.com>
2026-05-10 17:58:49 +03:00
DosX
36837d7f45 Fatpack: add attribution and remove else branch (#354)
Add contributor attribution ('Enhanced by: Yosef Khaled') and minor formatting. Remove the else branch in detect() that set sVersion = "custom" when the section name was ".fpack  ", altering the version-detection behavior for this packer.

Co-Authored-By: Yosef Khaled <124172634+tenzzzzzz@users.noreply.github.com>
2026-05-10 17:49:28 +03:00
github-actions[bot]
f2e62b35bb style: auto-format JavaScript files in db directories 2026-05-10 14:45:38 +00:00
DosX
37d0b8218e
Merge pull request #354 from Tenzzzzzz/Enhance-FatPack-detection
Enhanced Fatpack detection
2026-05-10 17:45:12 +03:00
DosX
c6e8bad81c dbs_min update 2026-05-10 15:38:10 +03:00
DosX
90cdf51541 Add Detect It Easy rule for Torrent format
Add new detection rule db/Binary/format_Torrent.1.sg for Detect It Easy to identify .torrent files. The rule checks for the bencoded 'd8:announce' key and a URL signature ('://') within the header to detect torrent metadata. File includes author contact and metadata.
2026-05-10 15:37:37 +03:00
DosX
6171ac3dc4 Add DETE to detect Minecraft Bedrock ZIPs
Add a Detect It Easy rule (db/ZIP/format_Minecraft_Bedrock.1.sg) to identify Minecraft Bedrock ZIP packages. The script checks for ZIP file format version 2.0 with Deflate compression and matches file suffixes mcworld, mcpack, and mcaddon to set options to "World", "Resource Pack", or "Add-on" and tag the result as Bedrock Edition. Includes author metadata.
2026-05-10 15:25:05 +03:00
DosX
a8aaa65564 Refine PE heuristics: entrypoint and .NET checks
Allow heuristic scanning to continue when the PE entry point is 0 by removing the early break, ensuring packer/cryptor detection still runs. Also broaden .NET malicious detection: in addition to detecting a 'avfucker' object, treat the presence of both Unicode strings 'SharpInvoker' and 'myres' as an indicator for the 'RAT Injector' verdict when no other verdicts exist.
2026-05-10 14:34:08 +03:00
DosX
5ce214d8d3 Delete library_CSCWCNG.4.sg 2026-05-10 13:35:30 +03:00
DosX
c022fab131 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-10 13:34:21 +03:00
DosX
84386d3b16 Verify PE entry point before EP address checks
Add a guard using PE.isEntryPointCorrect() and fetch the entry point earlier. If the entry point is zero, exit the check early. This removes a redundant PE.getAddressOfEntryPoint() call and prevents invalid/zero EP values from being compared against the last section address when scanning for packers/cryptors in non-DLL PE files.
2026-05-10 13:34:19 +03:00
Benjamin Funke
86ab7f3db4 add MSXFS signature 2026-05-10 11:29:15 +02:00
github-actions[bot]
73debcf7fb style: auto-format JavaScript files in db directories 2026-05-10 09:25:39 +00:00
Benjamin Funke
2d6cc2ca38 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-10 11:24:45 +02:00
Benjamin Funke
028ac20024 add CSCWCNG signature 2026-05-10 11:23:22 +02:00
github-actions[bot]
6f980c2e1c style: auto-format JavaScript files in db directories 2026-05-10 09:20:19 +00:00
Benjamin Funke
5bb453028c add CSCWCNG signature 2026-05-10 11:19:38 +02:00
DosX
b90d1ff802 Use non-capturing groups in regexes
Replace unnecessary capturing groups (...) with non-capturing groups (?:...) in several regex literals in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg (e.g. section/flag and numeric suffix patterns). This prevents creating unused capture groups, clarifies intent, and preserves existing behavior.
2026-05-10 01:03:22 +03:00
DosX
54ce869efe Use non-capturing groups in Denuvo regexes
Replace unnecessary capturing groups with non-capturing groups in two Denuvo-related regexes. Updated patterns to /^GetDenuvo(?:TimeTicketRequest|TicketLocation)$/ (in __GenericHeuristicAnalysis_By_DosX.7.sg) and /^ANTICHEAT_OBFUSCATE_(?:.+_)?CODEMARKER$/ (in protection_Denuvo.5.sg). This avoids creating unused capture groups and prevents unintended capture-index shifts, with no change to matching behavior.
2026-05-10 00:48:16 +03:00
DosX
8fa1c91dd3 Tighten version regex and compress char checks
Allow an optional 'v.' prefix when matching version numbers (accepts 'v.1.2' in addition to 'v1.2' and '1.2') and refactor the character-type branches in isTokenObfuscated() into single-line conditionals to reduce line count while preserving the counting and type-assignment behavior.
2026-05-10 00:37:07 +03:00
yosef khaled shehata
18c5c9644d Enhanced Fatpack
Enhanced FatPack detection
I have corrected the detection logic as follows:

1-Since different versions of "fatpack" do not have a constant number of sections, I eliminated that criterion from the code.
2-Avoided false detections for manually unpacked samples.
3-Improved the detection of packed samples using the --resources option by looping through all resources and searching for the signature "5D00001000" in any of them. If found, it means the resource payload has been identified. This modification is more reliable because resource names and counts can be modified or manipulated, so the detection now relies on deeper analysis.
4-Improved the code readability.
2026-05-10 00:36:33 +03:00
DosX
558e7d5704 Broaden copyright regex to accept years/ranges
Relax the copyright whitelist regex in __GenericHeuristicAnalysis_By_DosX.7.sg: make the (C)/© marker optional, allow an optional space after it, and accept both hyphen and en-dash as year-range separators. This lets plain 4-digit years and year ranges (e.g., 2020-2022 or 2020–2022) pass the whitelist to reduce false positives in obfuscation detection.
2026-05-10 00:33:32 +03:00
DosX
7de9d8f663 Fix missing quote for 'intel' in company list
Add a missing closing quotation mark for "intel" in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg. This corrects a syntax error in the companyNames array that could cause the script to fail parsing.
2026-05-10 00:25:11 +03:00
DosX
b55855ae51
Update __GenericHeuristicAnalysis_By_DosX.7.sg 2026-05-10 00:12:45 +03:00
DosX
309ce3c207 Update vendor names in heuristic list
Remove the 'avg' entry and replace the 'amd' abbreviation with the full name 'advanced micro devices' in the companyNames array used by the PE heuristic scan. This clarifies vendor matching strings for the malicious code detection routine.
2026-05-10 00:01:50 +03:00
Benjamin Funke
157155c91c add new companies to companyNames 2026-05-09 22:24:28 +02:00
DosX
b24a60a43f Add MIT license and update file header formatting
Update the file's ASCII comment headers and add an explicit MIT license block. Cosmetic changes include restyled ABOUT/CONTACT/DONATE headings, extra padding lines for readability, and insertion of a © LICENSE section (Copyright © 2026 DosX) describing allowed/disallowed uses. These are comment-only edits with no functional changes to analysis logic.
2026-05-09 19:45:58 +03:00
DosX
293780e609 Port node_modules_clean for Linux 2026-05-09 19:27:17 +03:00
DosX
1699c6dfde Move node module LICENSEs to node_licenses
Rename and relocate LICENSE files from autotools/dbcompiler/node_modules into autotools/dbcompiler/node_licenses/ (e.g. LICENSE -> LICENSE.<pkg>.txt) to centralize third-party licenses. Also remove assorted package metadata and docs (README, CHANGELOG, tests, CONTRIBUTING, governance, etc.) from vendor node_modules entries to reduce noise in the tree.
2026-05-09 19:20:53 +03:00
DosX
ed043323b7 Add script to extract licenses & run modclean
Add Windows batch script node_modules_clean.cmd that copies LICENSE/LICENCE/COPYING files from node_modules into a node_licenses directory (creating it if missing), renaming saved files to include package names, and invokes npx modclean -n default:safe -r to remove extraneous files. Intended to gather third-party licenses for offline/legal distribution and clean node_modules.
2026-05-09 19:19:44 +03:00
DosX
f88a5201f0 dbs_min update 2026-05-09 18:57:28 +03:00
DosX
37774f636a Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-09 18:56:34 +03:00
DosX
1944772003 Organize Amiga DB files and add prefixes
Rename and relocate several Amiga database entries to improve categorization and naming consistency. All files are identical (similarity index 100%) — only path/name changes.

Renames:
- db/Amiga/Master_Cruncher.1.sg -> db/Amiga/cruncher_Master_Cruncher.1.sg
- db/Amiga/RexxMasher_(jrms).1.sg -> db/Amiga/cruncher_RexxMasher_(jrms).1.sg
- db/Amiga/LhPak_SFX.1.sg -> db/Amiga/sfx_LhPak_SFX.1.sg
- db/Amiga/library_library.1.sg -> db_extra/Amiga/library_library.1.sg
- db/Amiga/other_other.1.sg -> db_extra/Amiga/other_other.1.sg

These changes standardize prefixes (e.g., "cruncher", "sfx") and move less-common entries into db_extra for clearer organization.
2026-05-09 18:56:33 +03:00
DosX
5a111a54f3
Merge pull request #351 from securitystar/arxan
Improve Arxan detection
2026-05-09 17:29:59 +03:00
DosX
afde685003 Add *.die-db to .gitignore
Ignore generated .die-db files to prevent committing build artifacts.
2026-05-09 16:39:59 +03:00
DosX
77276a4fe9 Add archiver and pack .die-db archives
Add archiver dependency to package.json and update package-lock. Require archiver in task.js and implement createDieDb(srcDir, archivePath) to produce zip-based .die-db archives of processed output directories. After cleaning and reporting, the script now creates a .die-db archive per input directory and logs success/failure with archive sizes.
2026-05-09 16:38:11 +03:00
DosX
fbb2b38767 dbs_min update 2026-05-09 16:30:47 +03:00
DosX
ee3b2d03cf Add JSON minification handling in worker
Add isJson helper and handle .json files specially: attempt to minify by JSON.parse+JSON.stringify and write result; on parse error fall back to writing the original file and mark the result as failed. Update result flags to reflect whether the file was minified, skipped, failed, or failed-skip so callers can distinguish outcomes. This ensures JSON assets are compacted and errors are handled gracefully.
2026-05-09 16:29:00 +03:00
DosX
76524a8a6a dbs_min update 2026-05-09 16:24:42 +03:00
DosX
907fb6f411 Sanitize PlayStation BIOS version string
Use File.cleanString when reading the BIOS version string in detect() to remove unwanted/control characters before storing sOptions. Also add a TODO to validate the version string with a regex for stricter checking.
2026-05-09 16:20:19 +03:00
DosX
057795ca27 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-09 16:17:56 +03:00
DosX
bca296d661 Add comments for decryptor & resource heuristics
Add inline comments to the PE heuristic scanner: include an archived reference URL for a SumHex decryptor and document the purpose of the subsequent resource-name checks in .NET/native assemblies (to flag builders or attempts to hide payloads). These are non-functional clarifications to aid future maintainers.
2026-05-09 16:17:54 +03:00
github-actions[bot]
34b5318300 style: auto-format JavaScript files in db directories 2026-05-09 11:14:55 +00:00
Benjamin Funke
aff275c4cc add Playstation 1 BIOS signature 2026-05-09 13:14:19 +02:00
horsicq
6545af225c feat: add initial database schema with 11,834 records 2026-05-09 10:24:20 +02:00
horsicq
32928bbfcd chore: bump DIE version and update db dates to 2026-05-09 2026-05-09 10:24:16 +02:00
securitystar
d900b7d26f
Improve Arxan detection
This change adds support for DLLs without an entry point.
2026-05-09 02:57:51 +02:00
DosX
2fe6f375e3 dbs_min update 2026-05-08 23:14:13 +03:00
DosX
67eca52962 Add EP pattern check for Ramnit heuristic
Extend the PE generic heuristic for Ramnit: in addition to checking for a ".rmnet" section, add a PE.compareEP() check for a specific entry-point byte pattern (pushal, call, pop ebp, mov eax, ebp, sub/mem ops, mov al,0). If no prior verdicts and either condition matches, the analyzer now emits a Ramnit verdict to improve detection of samples that lack the .rmnet section.
2026-05-08 23:05:25 +03:00
DosX
e4fe10b02f Extend disassembly loop from 300 to 364
Increase the iteration limit in scanForMaliciousCode_NET_and_Native from 300 to 364 so the heuristic disassembly (parite scanning) examines a larger range of instructions. This expands the window for detecting additional opcode/obfuscation patterns in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg.
2026-05-08 22:45:30 +03:00
DosX
9053222165 Use non-capturing groups in regexes; rename var
Replace multiple regex capture groups with non-capturing groups (?:...) across the PE heuristic scanner to avoid unintended captures and clarify intent (affects packer/cryptor detection, section/name/resource checks, debug detection, token heuristics, export checks, etc.). Also rename local variable asmInstruction to currentInstruction in scanForObfuscations_Native and update its usages. These are refactors only — no behavioral logic changes intended beyond regex grouping and naming clarity.
2026-05-08 21:53:38 +03:00
DosX
5a9ec6b635 Add Parite heuristic detection in PE scanner
Introduce a heuristic to detect Parite (win.parite) infections in the PE scanner. For x86 binaries (and only when no prior verdicts exist) the code scans up to 300 instructions from the entry point, looking for a SUB followed by a backwards JNE to a target containing PUSH/XOR DWORD PTR [reg + reg] patterns. It counts repeated loop occurrences and emits a "Parite" infected verdict when the pattern repeats >= 0x20. Reference: Malpedia win.parite.
2026-05-08 21:49:02 +03:00
DosX
e2543f6f2e dbs_min update 2026-05-08 20:45:28 +03:00
DosX
ed344ecfac Expand whitelist in isTokenObfuscated regex
Update db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg: expand the non-obfuscation token regex in isTokenObfuscated to include beta, alpha, and client, and adjust the Windows variant grouping (win(32|64|2)). This change broadens the whitelist of common build/CI and client-related tokens to reduce false positives when detecting obfuscated tokens.
2026-05-08 20:45:06 +03:00
DosX
9a4bc5ffa1 Add null check for _gyminfo
Avoid accessing _gyminfo[0] when parseMDGYM may return null/undefined during heuristic/deep scans. Add a guard to return early if _gyminfo is falsy to prevent runtime errors in the GYM audio parser.
2026-05-08 20:43:13 +03:00
DosX
be434dca4d Update audio.1.sg 2026-05-08 20:40:56 +03:00
DosX
2eaedbbb93 Defang max[.]ru URL in comment and add warning
Update comment to use defanged URL (https://max[.]ru/) and append a "Malicious site; Be careful!" note. This is a non-functional change to clarify that the referenced site is malicious.
2026-05-08 15:10:03 +03:00
DosX
c974599d29 Narrow EP signature search range to 0x20
In db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg, reduce the signature search window from 0x30 to 0x20 in scanForMaliciousCode_NET_and_Native when scanning for the Win9x CIH-like instruction patterns near the entry point. Also include minor whitespace/comment alignment cleanups for readability. The change limits the distance searched from the entry point, reducing unnecessary matches and work.
2026-05-08 13:14:47 +03:00
DosX
90193088f5 dbs_min update 2026-05-08 13:09:45 +03:00
DosX
874498f0c4 Normalize rule filenames
Rename several detection rule files to use underscores (e.g. archive.ACE.1.sg -> archive_ACE.1.sg, archive.ZIP.1.sg -> archive_ZIP.1.sg) and rename Amiga_loadable.1.sg to format_Amiga_loadable.1.sg.
2026-05-08 13:09:04 +03:00
DosX
9042212e3e Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-08 13:04:30 +03:00
DosX
675cb2687a Detect fake LegalCopyright
Add a heuristic to flag fake LegalCopyright version strings that impersonate well-known vendors (e.g. Microsoft, Google, Adobe, Kaspersky, Nvidia, etc.). The new check ignores entries that include standard copyright markers and scans the LegalCopyright field for known company names; if found, it pushes a "Fake build info" verdict (using mayBeInfected details). Also modernize a local variable by changing `var fieldsToCheck` to `const fieldsToCheck`.
2026-05-08 13:04:29 +03:00
Kaens
1067538a79 *OPX
- MSX .OPX improved for a couple fringe cases
2026-05-08 11:38:03 +02:00
DosX
db52897e91 Whitelist copyright year patterns
Add a whitelist check in isTokenObfuscated to treat copyright/year tokens like (C)2020, ©1999, or (c) 2018 as non-obfuscated. The new case-insensitive regex (/^(\(C\)|©)[0-9]{4}(-[0-9]{4})?/) prevents these common copyright/date patterns from being flagged as obfuscated tokens.
2026-05-08 12:15:21 +03:00
DosX
c9e7e47076 Prefix db filenames with category labels
Rename multiple database entries to include explicit category prefixes for clarity. Files in db/Amiga were renamed to use compiler_, cruncher_, font_, and sfx_ prefixes; files in db_extra/PE were renamed to use installer_, protector_, and sfx_ prefixes. All changes are pure renames (100% similarity) with no content modifications.
2026-05-07 22:14:17 +03:00
DosX
f976dd93a3 dbs_min update 2026-05-07 21:12:36 +03:00
DosX
792324ec17 Reorganize db/PE Microsoft filenames
Rename and reclassify several files in db/PE to better reflect their roles and adjust file modes. Changes include: Microsoft.6.sg -> _Microsoft.6.sg (mode changed), Microsoft_JScript.6.sg -> compiler_Microsoft_JScript.6.sg, Microsoft_Class_Installer.1.sg -> installer_Microsoft_Class_Installer.1.sg, Microsoft_Compound-based_installer.1.sg -> installer_Microsoft_Compound-based_installer.1.sg, Microsoft_Help.1.sg -> other_Microsoft_Help.1.sg. Also updated db/PE/players.1.sg (mode/content change).
2026-05-07 21:11:54 +03:00
DosX
9d6b0e1acc Rename Amiga DB files and tweak signatures
Rename several Amiga database entries to use clearer prefixes (compiler_*/cruncher_*). Update db/MSDOS/virus.1.sg to call meta("virus") without the empty second argument. Normalize wildcard placeholders in PE/__GenericHeuristicAnalysis_By_DosX.7.sg from "??" to "..", adjust a region comment spacing, and make minor comment/formatting tweaks to improve consistency and readability.
2026-05-07 20:35:50 +03:00
DosX
68d27b52dc Add zero FileSize check to heuristic UPX Structure detection (#349)
Update scanForPackersAndCryptors_NET_and_Native to require PE.section[0].FileSize === 0 when checking three-section PE files with RWX flags. This narrows the heuristic to better detect packer/cryptor layouts (first section with zero FileSize) and reduce false positives. Change is in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg.

Co-Authored-By: Yosef Khaled <124172634+tenzzzzzz@users.noreply.github.com>
2026-05-07 19:54:55 +03:00
DosX
a4703c0851 dbs_min update 2026-05-07 14:08:32 +03:00
DosX
bbb20c1c7d Refactor PE debug data detection
Remove unused nDataSize parameter and simplify detectUnknownDebugData signature; use PE.getDebugDataSize(i) for the size check. Compact and reformat switch cases in detect() (single-line cases and grouped fall-throughs) and normalize empty-string arguments to String() for consistent typing in _setResult calls. Purely stylistic/refactor changes intended to preserve existing behavior.
2026-05-07 14:08:01 +03:00
DosX
699d23b935 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-07 13:57:24 +03:00
DosX
0341428200 Format and sort PE debug data types
Collect detected PE debug-data types into an array, map known type tokens to human-friendly names (e.g., CodeView, VC Feature, Ext-DLL Characteristics, Reserved (10)), preserve all-caps abbreviations (REPRO, POGO, COFF, FPO), and capitalize other types. Then sort normal names and abbreviations separately and join them into sOptions. This also replaces the previous naive toLowerCase/append approach and fixes incorrect sOptions.append usage.
2026-05-07 13:57:23 +03:00
github-actions[bot]
c69e26b0ed style: auto-format JavaScript files in db directories 2026-05-06 16:35:23 +00:00
Benjamin Funke
a7e6e6528e add NGI game engine signature 2026-05-06 18:34:25 +02:00
DosX
272fa770d7 dbs_min update 2026-05-06 19:22:54 +03:00
DosX
1047fe88ce Add Win9x CIH (Chernobyl) heuristic detection
Introduce a heuristic to detect the Win9x CIH (Chernobyl) virus by scanning for a small sequence of instruction signatures near the entry point on x86 binaries. The new code builds an instruction pattern array, searches forward from the EP offset using PE.findSignature (0x30 window), and pushes a "Win9X.CIH" verdict if all patterns are found. Also includes a minor comment spacing tweak in an unrelated mov comment.
2026-05-06 19:15:13 +03:00
DosX
3a20b3b4fb Add Slugin heuristic to PE generic scan
Add an x86 entry-point byte-pattern check to the generic PE heuristic scanner to detect Slugin infections (based on a sample referenced from securityhome). The new rule matches a sequence of instructions (pushal, call, sub ebx/esp, movs) and pushes a "Slugin" verdict when no prior verdict exists. Applied only for 32-bit PE files using PE.compareEP.
2026-05-06 18:19:47 +03:00
DosX
b074c22d23 dbs_min update 2026-05-06 17:53:01 +03:00
DosX
d5a9f45c48 Rename Amiga DB files and set compiler lang
Rename multiple Amiga database entries to use consistent prefixes (cruncher_*/sfx_*) for better categorization and filenames. Also add sLang = "E" to compiler_Amiga_E.4.sg to explicitly set the language; no other functional changes were made.
2026-05-06 17:52:49 +03:00
DosX
87d97dbebb Rename Amiga DB files and add Amiga E detector
Rename several db/Amiga rule files to use a consistent "compiler_" prefix (AMOS_Basic, Absoft_AC_Basic, Absoft_Fortran, Blitz_BASIC, Free_Pascal, Lattice_C, Storm_C). Add a new Detect It Easy rule db/Amiga/compiler_Amiga_E.4.sg (author: hypn0) that checks three entry-point signatures and sets sOptions to "type 1", "type 2" or "type 3" on detection.
2026-05-06 17:51:17 +03:00
DosX
c2c1823759 Add type prefixes to COM filenames
Rename three db/COM sample files to include type prefixes for clearer categorization. No content changes; only filenames updated:
- db/COM/WiZ_Cryptor.2.sg -> db/COM/cryptor_WiZ_Cryptor.2.sg
- db/COM/VSF&K_protection.2.sg -> db/COM/protector_VSF&K_protection.2.sg
- db/COM/WSP_self_update.2.sg -> db/COM/sfx_WSP_self_update.2.sg
This standardizes naming (cryptor/protector/sfx) for easier maintenance and discovery.
2026-05-06 17:49:50 +03:00
DosX
1c3c613c37 Rename db/COM rules and update metadata
Rename multiple detection rule files under db/COM to more specific names (e.g. Unknown_cryptors.2.sg → cryptor_cryptors_pt2.2.sg, Text_Header.1.sg → other_Text_Header.1.sg, etc.). Update metadata strings: change cryptor meta from "Unknown cryptor" to "Cryptor" and set the virus rule meta to "Cascade". Also modify the virus detection logic to append the version suffix to sName (sName += ".1701" / ".1704") instead of assigning it, preserving any existing name prefix.
2026-05-06 17:46:14 +03:00
DosX
6e24b49741 Refine AIX loader detection; clean Rust version
Rename IBM_AIX_kernel_loader.4.sg to boot_IBM_AIX_kernel_loader.4.sg and tighten detection: only set sVersion to "PowerPC" if the AIX loader was actually detected (bDetected) to avoid false positives. In compiler_Rust.4.sg apply minor comment formatting and sanitize the extracted rustc version by using File.cleanString when assigning sVersion.
2026-05-06 17:42:34 +03:00
DosX
15dfcd3a0e Rename/refactor detection rule files
Rename and tidy up multiple Detect It Easy rule files. CFBF rules Microsoft_Office and Microsoft_Installer were renamed to format_Microsoft_Office.1.sg and installer_Microsoft_Installer.1.sg and had minor whitespace/mode fixes. Several ELF rule files were renamed to the compiler_* namespace (including Free_Pascal and HP_C++), Borland_Kylix.4.sg was removed and replaced with a new compiler_Borland_Kylix.4.sg that consolidates section checks with OR conditions. Minor code cleanups: IBM_AIX kernel loader newline fix, and Oracle_Solaris_Studio improvements (initialize string via String(), combine var declarations, return cleaned strings with File.cleanString(), add braces and reorder bDetected assignment).
2026-05-06 17:40:34 +03:00
DosX
d0c2f92854 Update tool_LordPE.2.sg 2026-05-06 16:02:22 +03:00
DosX
838794cf8f Improve LordPE detection logic
Replace hardcoded PE.compare hex signatures with dynamic detection using PE.getDosStubSize() and PE.isSignaturePresent at offset 0x80 searching for the '[LordPE]' marker. Sets sOptions = 'rebuilded' on detection and marks bDetected true. Also update author comment to 'Rewritten by: DosX' and remove the old hex-based checks.
2026-05-06 16:01:39 +03:00
DosX
66caa02293 Use uppercase 'X' in TASM32 version
Normalize the detected TASM32 product version string from "5.x" to "5.X" in db/PE/compiler_TASM32.4.sg. This maps TLINK32 linker version 2.25 to a consistent uppercase format for the version placeholder.
2026-05-06 10:50:34 +03:00
DosX
50c9a9f160 Enhance LordPE detection and add variant
Add contributor header and adjust PE signature matching to use an offset (pass 2) and remove the leading MZ bytes from the pattern. Also add an else-if branch to detect an additional LordPE variant (using the same offset) and mark it as detected. Keeps the original sVersion assignment for the primary match.
2026-05-06 10:48:16 +03:00
DosX
959ce342bd dbs_min update 2026-05-06 03:40:31 +03:00
DosX
55841bcab3 Enhance WannaCry detection and cmd signature
Add stricter detection for embedded WannaCry payloads by verifying an embedded PE ('MZ') and a '.wnry' marker using the resource's FileSize. For other cases (embedded ZIP and modified variants), construct a Unicode-aware cmd signature via generateUnicodeSignatureMask("%s\\ProgramData") with padding and search both .rsrc and .data sections for the 'cmd.exe /c' invocation to improve detection of modified loaders.
2026-05-06 03:40:24 +03:00
DosX
ce8e7e5efe dbs_min update 2026-05-06 00:09:48 +03:00
DosX
f357d69aa2 Add FileSize/FileOffset aliases to Section/Resource
Introduce explicit file-prefixed properties and compatibility aliases in db/PE/_init: Resource.Name/Offset/Size were renamed to FileName/FileOffset/FileSize, and both Resource and Section now expose Size and Offset mapped to the corresponding FileSize/FileOffset. This clarifies file vs virtual fields in PE parsing while preserving existing Size/Offset accessors.
2026-05-06 00:09:17 +03:00
DosX
b536bb1b5c Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-05 23:38:59 +03:00
DosX
6aba0dbdbe Prefix db/COM filenames with categories
Rename multiple files in db/COM to include category prefixes for clearer organization. Examples: Microsoft_C.4.sg -> compiler_Microsoft_C.4.sg, SPHINX_C--.4.sg -> compiler_SPHINX_C--.4.sg, Microsoft_RTL.3.sg -> library_Microsoft_RTL.3.sg, several Crypt_/Inbuild_/Maveriks_/MrHDKiller_* -> protector_*, and LHarc_SFX.1.sg -> sfx_LHarc_SFX.1.sg. These are pure path renames (no content changes).
2026-05-05 23:38:57 +03:00
Benjamin Funke
2de391084e add X11 ELF signature 2026-05-05 18:34:54 +02:00
DosX
be5b309aaf Enhance WannaCry heuristic in PE scan
Broaden resource-name check to accept three-letter uppercase names (e.g., "XIA") and include scanning the .data section (in addition to .rsrc) for the "cmd.exe /c ..." signature. Extracted the signature into a cmdSignature constant and consolidated variable declarations for clarity. These changes improve detection of variants that embed payloads in .data or use different resource naming.
2026-05-04 21:07:25 +03:00
DosX
7b5aff505d Refine WannaCry heuristic detection
Refactors the WannaCry detection path: add a guard on PE_Cached.numberOfUnmanagedResources and check the first resource name, detect embedded executables by checking PE.resource[0] for an 'MZ' header, and fall back to the previous .rsrc signature check. Uses an isWannaCryDetected flag to centralize the decision and only push the verdict when a positive indicator is found, reducing false positives and clarifying control flow.
2026-05-04 13:53:10 +03:00
DosX
e7ac4d815f Add WannaCry heuristic to PE scanner
Introduce a heuristic in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to detect WannaCry samples on x86. The new check matches a common entry-point prologue (push ebp; mov ebp, esp) and looks for a resource signature containing 'cmd.exe /c' pattern; when matched it pushes a verdict object with type "WannaCry". The check only runs if no other verdicts exist and targets x86 binaries. Reference to Malpedia added in a comment.
2026-05-04 03:19:28 +03:00
DosX
6b04d9db78 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-03 22:58:24 +03:00
DosX
f6ec672926 Enhance packer detection patterns and formatting
Add and refine section-name patterns to improve detection coverage: expand Denuvo section patterns (.xtls, .trace, .arch, .ooa), add a Themida fake-section regex entry and an Alienyze fake-section entry in validations, and tidy up various alignment/whitespace in the detection table. Also change the section warning text to separate offset/size with '/' instead of ' and ' for clearer messaging.
2026-05-03 22:58:21 +03:00
Hors
3acdbcf31b
Fix author 2026-05-03 20:38:32 +02:00
DosX
858571850b Map version code 20250 to "2.80+"
Add a new case in detect() (db/PE/packer_PECompact.2.sg) to map build code 20250 to sVersion "2.80+" so the detector recognizes newer 2.80 Blender builds.
2026-05-03 17:38:15 +03:00
DosX
b3db3c9b0b docs: tidy BUILD.md headings and formatting
Reformat BUILD.md for consistency and readability: standardize section headings (add spaces and unify Qt capitalization), move and reformat tutorial/link entries, add blank lines around blocks for clarity, and ensure newline at EOF. These are non-functional documentation edits to improve maintainability and presentation.
2026-05-03 17:13:45 +03:00
DosX
d36f2bc37b Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-03 17:11:34 +03:00
DosX
c634e3e171 Relax API checks in UPX-like heuristic
Broaden the heuristic condition when detecting UPX-like structures: require GetProcAddress plus either VirtualProtect or LoadLibraryA (previously VirtualProtect was mandatory), still combined with ExitProcess/CopyContext. This expands detection to variants that use LoadLibraryA and tweaks the condition grouping for clarity.
2026-05-03 17:11:22 +03:00
Benjamin Funke
1594020dad add openBSD build instructions 2026-05-03 15:20:47 +02:00
DosX
f748651449 Ignore files beginning with '..' in .gitignore
Add a '..*' pattern to .gitignore to exclude files that start with two dots.
2026-05-03 14:35:07 +03:00
DosX
e97264815b Add Huan detection and update packer heuristics
Add Huan cryptor signatures and file marker: include a fingerprint entry and the ".huan" extension to packer/cryptor detection. Remove a duplicated Perplex extension entry. Add ACProtect and PE-SHiELD fake-section name checks, normalize Themida entry placement and clean up duplicates in the fake-section name mappings. Includes reference URLs for Huan.
2026-05-03 14:32:21 +03:00
DosX
d17d5e2ecf Format and reorder .NET obfuscator signatures
Reformat the obfuscatorsAttributes array in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg for consistent spacing and aligned comments. Also adjust the order of a few signature entries (minor reordering of SkiDzEX/Sixxpack entries). No functional changes to the signature strings — just readability and style improvements.
2026-05-03 14:29:29 +03:00
DosX
68988806d9 Rewrite cryptor_Huan rule 2026-05-03 14:27:59 +03:00
DosX
dc87b939ed Improve Huan cryptor detection logic
Replace the simple section-name check with a stricter detection routine for the Huan cryptor: require exactly one import table, match a specific entry-point signature via PE.compareEP, and verify the first import functions are "VirtualAlloc" and "LoadLibraryA". Sets bDetected when matched and marks sOptions as "modified" if the last section name is not ".huan". This makes detection more accurate and flags renamed/modified samples.
2026-05-03 14:19:43 +03:00
DosX
aaf0e61ee5 Fix spacing and rename PE variable
Apply minor code-style adjustments and a variable rename for clarity. Added spaces after '//' in several comments (PKZIP-SFX, RAR-SFX, installer_instyler) to improve readability. In protector_PE-Shield, rename peAnakinSection to anakin98Section and update references to match the actual section name; this is a non-functional rename to make the code more consistent.
2026-05-03 14:01:54 +03:00
DosX
f6f3fb7093 Add ANAKiN98 signature for PE-SHiELD
Update packer signatures in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg: the PE-SHiELD entry now matches either "PESHiELD" or "ANAKiN98" to broaden detection of that packer variant in the heuristic scanner. Reference link preserved.
2026-05-03 13:54:56 +03:00
DosX
fd096d5ab4 Standardize Instyler name and move SFX rules
Move PKZIP-SFX and RAR-SFX detection rules from db_extra/LX to db/LX and add reference URLs. Normalize the installer name capitalization by changing "instyler" to "Instyler" in db/Binary/data_overlays.6.sg (sName) and in the installer rule meta("installer", "Instyler"). No functional behavior changes aside from metadata and comment updates.
2026-05-03 13:54:45 +03:00
DosX
98f77295ed Clean version strings and simplify detection check
Wrap PE.getString calls with File.cleanString to sanitize extracted version text (offsets +10, +19, +22). Replace the numeric comparison if (bDetected == 1) with a boolean truthiness check if (bDetected). Minor syntax/punctuation adjustments for consistency.
2026-05-03 13:46:24 +03:00
DosX
1fb558e833 Style/formatting cleanup in detection scripts
Normalize whitespace and formatting across multiple db/*.sg detection scripts: reindent code blocks, consolidate var declarations, reflow conditional expressions and comments, add missing trailing newlines, and standardize a version string to "2.71.X". Updated files include db/Binary/audio.AIFF.1.sg, db/PE/packer_RLPack.2.sg, db/PE/players.1.sg, db/PE/protector_PE-Shield.2.sg, db/PE/sfx_LZH_SFX.1.sg, db/PE/sfx_Zip_SFX.2.sg, db_extra/LX/PKZIP-SFX.1.sg, db_extra/LX/RAR-SFX.1.sg, db_extra/PE/ARDI-SFX.1.sg, db_extra/PE/installer_TInstall.1.sg, and db_extra/PE/installer_instyler.1.sg. These are primarily non-functional formatting changes; no logic alterations were intended except the noted version string normalization.
2026-05-03 13:46:04 +03:00
DosX
fec4822b31 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-03 13:40:49 +03:00
DosX
62b09bb07a Rename Denuvo rule and update meta key
Rename db/PE/protector_Denuvo.2.sg to db/PE/protection_Denuvo.5.sg and update the meta key from "protector" to "protection" for the Denuvo rule. No detection logic was modified; this aligns the file and meta naming with the current convention.
2026-05-03 13:40:43 +03:00
Benjamin Funke
42b9c7a62a add Alpine Linux build instructions 2026-05-03 10:04:20 +02:00
Benjamin Funke
282cf0272b add nixOS build instructions 2026-05-03 08:27:57 +02:00
hypn0chka
087f1cd239 new & update 2026-05-02 16:49:26 +05:00
hypn0chka
72a56fecbe ASProtect update 2026-05-02 13:24:28 +05:00
Benjamin Funke
8c78bd0f4b improve AGS detection 2026-05-02 08:30:18 +02:00
Benjamin Funke
60f1487b21 add ShFolder signature 2026-05-02 08:22:41 +02:00
Kaens
d758c85c6c AIF redo 2026-05-02 06:32:05 +02:00
Kaens
15a488f6b8 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-02 06:30:35 +02:00
hypn0chka
ea35f2ef42 Refinement 2026-05-02 01:59:50 +05:00
Benjamin Funke
5fe1d184b7 fix operand in RenderWare signature
It seems that both sections are not always be present together
2026-05-01 20:44:35 +02:00
scientificworld
b62c09be7a feat: add new signature of Safengine 2026-05-01 20:21:03 +02:00
DosX
6f28558c8b dbs_min update 2026-05-01 16:31:13 +03:00
DosX
d5d164af0f Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-01 16:30:44 +03:00
DosX
aa8efde347 Fix indentation in ARDI-SFX PE detector
Adjust indentation of sOptions and bDetected assignments in db_extra/PE/ARDI-SFX.1.sg so they are correctly nested under their respective if branches (for the 2002 and 1999 signatures). This is a whitespace-only change and does not alter logic.
2026-05-01 16:30:42 +03:00
Benjamin Funke
8ea8163c81 remove CkNet/DEV6 signature 2026-05-01 15:28:33 +02:00
DosX
ff38b86cf4 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-01 16:10:08 +03:00
DosX
995f85b04d Normalize opcode names and message formatting
Simplify substring usage for firstEpAsmOpCode and refactor opcode detection: rename strangeReadableOpCodesNearEp to strangeOpCodesNearEp, store opcodes in uppercase, and remove redundant toUpperCase() calls in comparisons. Also improve the displayed option text by capitalizing the detected opcode when adding the "near EP" message. These changes improve consistency and readability.
2026-05-01 16:10:03 +03:00
Kaens
a5353578e8 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-05-01 12:15:52 +02:00
Kaens
26d37cbb62 regression: reference to wrong codepage 2026-05-01 12:15:44 +02:00
Benjamin Funke
e59a01bd24 add DVM signature 2026-05-01 12:02:44 +02:00
Benjamin Funke
9b0bc4386d add LoadVMD signature 2026-05-01 10:01:36 +02:00
github-actions[bot]
e705c3314b style: auto-format JavaScript files in db directories 2026-05-01 07:51:47 +00:00
Benjamin Funke
27d01fd8df add DEV6 game engine signature 2026-05-01 09:51:04 +02:00
Benjamin Funke
33c55383cc add CkNet signature 2026-04-30 21:29:15 +02:00
hypn0chka
29b96e1391 fix 2026-05-01 00:03:52 +05:00
Benjamin Funke
b0465c4fe0 add new Denuvo game to list 2026-04-30 18:46:20 +02:00
Benjamin Funke
70dc43d7b1 add RenderWare signature 2026-04-30 18:40:11 +02:00
Benjamin Funke
6ed37c369d remark Unity signature as game engine 2026-04-30 17:11:15 +02:00
DosX
f08e72edf4 Annotate strange opcodes with byte sequences
Refactor the strangeReadableOpCodesNearEp array into a multiline list and add inline comments showing the instruction byte sequences for Cpuid, Rdtsc, Rdtscp, Rdrand, and Rdseed. Also combined the strangeOpCodeDetected declaration onto the same line. This is purely cosmetic/documentation—no logic changes.
2026-04-30 17:21:18 +03:00
DosX
285653d8d1 Detect RDRAND/RDSEED in PE heuristic
Add "Rdrand" and "Rdseed" to the strangeReadableOpCodesNearEp list so the generic PE heuristic flags hardware RNG instructions near the entry point as potentially suspicious. This improves detection of obfuscation/packing techniques that use RDRAND/RDSEED.
2026-04-30 17:14:00 +03:00
DosX
77b6e3f291 Replace Rdrsc with Rdtscp in opcode list
Update the strangeReadableOpCodesNearEp array in scanForObfuscations_Native to use the correct opcode name 'Rdtscp' instead of 'Rdrsc' (and adjust ordering). This fixes the heuristic used to detect unusual x86 instructions near the PE entry point.
2026-04-30 17:12:51 +03:00
DosX
968f3dc2ae Use emulation to get EP/ASM instructions
Replace direct disassembly helpers with emulation-based variants to improve accuracy when analyzing entry-point and nearby instructions. Renamed getEpAsmPattern -> emulateAndGetEpAsmPattern and getAsmInstructionByIndex -> emulateAndGetAsmInstructionByIndex, updated all callers in NET/Native heuristic scans, and adjusted getFirstEpAsmInstruction to use the emulated instruction getter. This change aims to better detect obfuscation patterns (NOP padding, CALL $+5 stack trick, CPUID checks, etc.) by leveraging emulation results.
2026-04-30 17:11:01 +03:00
DosX
aa40f4576a Clarify entrypoint opcode check comment
Update comment in scanForObfuscations_Native to state the check is for "strange opcodes" at the entry point rather than specifically CPUID. This aligns the comment with the surrounding code (isStrangeOpCodeNearEpPresent) and improves clarity.
2026-04-30 17:05:12 +03:00
DosX
cd2bdaa22e Mention native code emulation in PE heuristic
Update comment in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to include "native code emulation" among the heuristic analysis techniques and adjust surrounding wording for clarity. This is a documentation/comment-only change clarifying supported analysis methods.
2026-04-30 16:58:27 +03:00
DosX
68b80ff301 Detect multiple opcodes near EP (Cpuid/Rdtsc/Rdrsc)
Generalize CPUID detection to check for multiple suspicious opcodes near the entry point. Replaced the CPUID-specific flag with a generic isStrangeOpCodeNearEpPresent and iterate over an array of readable opcodes (Cpuid, Rdrsc, Rdtsc). For non-DLL x86 binaries the first 15 instructions are scanned (retaining the safety check); when a match is found the opcode is logged and the corresponding "<Op> near EP" option is added.
2026-04-30 16:55:57 +03:00
DosX
ddf1ddee3e Add PELock x32 heuristic pattern
Add a heuristic signature for PELock (x32) to the PE heuristic database. The pattern "6A6068........E8........BF94" was inserted into the entries array in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to improve detection of 32-bit PELock-packed samples.
2026-04-30 16:55:36 +03:00
DosX
39ed0b25a6 Add space in protector meta string
Insert a space between 'Thinstall' and '(VMware ThinApp)' in db/PE/protector_Thinstall.2.sg meta(...) for improved readability/consistency. This is a non-functional formatting change and does not alter detection logic.
2026-04-30 16:32:28 +03:00
DosX
f972e1be9d dbs_min update 2026-04-30 15:32:36 +03:00
DosX
42719daa2a Enhance MPRESS detection; normalize NT Packer sig
Update MPRESS detection logic: set default sOptions to "modified DOS", always run the non-.NET EP signature checks (removed the !bDetected guard), and add a post-detection check to mark the binary as having modified sections when section names differ from ".MPRESS1"/".MPRESS2". Also normalize the NT Packer 2.0 entry-point signature to a contiguous hex string to fix matching/parsing of the pattern.
2026-04-30 15:29:56 +03:00
DosX
2c0fcf94b4 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-30 15:29:08 +03:00
DosX
9a985f505b dbs_min update 2026-04-30 15:28:17 +03:00
horsicq
fd4f68c9b3 chore: update date to 2026-04-30 in info.ini files 2026-04-30 00:42:22 +02:00
DosX
f1dd2462d0 Add packer signatures; update Themida sections
Update PE heuristic database (db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg): add signatures for KByS (x32) and NakedPacker (x32) — "68........E8........C3C3", "60FC0FB605", and "60B8" — to improve packer detection. Also remove ".imports" from the Themida 3.XX section-name list to refine Themida detection.
2026-04-29 18:29:33 +03:00
DosX
417b9d0eaf README: remove Telegram bot link and fix link spacing
Remove the Telegram Bot entry from the contact section and normalize extra spacing in the DiE API Library link label. Minor README formatting/cleanup to tidy up links.
2026-04-29 17:57:30 +03:00
DosX
03569b69cc Allow optional segment in Denuvo export regex
Update protector_Denuvo.2.sg to relax the export-name regex used by PE.isExportFunctionPresentExp. The previous /^ANTICHEAT_OBFUSCATE_.+_CODEMARKER$/ required a middle token (and underscore), which missed names like ANTICHEAT_OBFUSCATE_CODEMARKER. The new /^ANTICHEAT_OBFUSCATE_(.+_)?CODEMARKER$/ matches both variants.
2026-04-29 01:32:14 +03:00
DosX
e91c96986d Relax Activation DLL detection regex
Update db/PE/protector_Denuvo.2.sg: broaden the PE.isLibraryPresentExp regex to match both '/' and '\\' path separators, properly escape the dot before 'dll', and add case-insensitive matching. This makes detection of Core/Activation.dll and Core\Activation64.dll more robust across platforms and case variations.
2026-04-28 20:10:19 +03:00
DosX
becaf47805 dbs_min update 2026-04-27 23:12:24 +03:00
DosX
7c35d8d024 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-27 23:11:58 +03:00
horsicq
37ec902b21 chore: update date to 2026-04-27 in info.ini files 2026-04-27 21:08:14 +02:00
github-actions[bot]
8b16fbdded style: auto-format JavaScript files in db directories 2026-04-27 17:03:09 +00:00
Benjamin Funke
f08b841be0 add Games using Denuvo to list 2026-04-27 19:02:23 +02:00
DosX
c7f4aac5c2 Add UX-Locker NET string heuristics
Enhance GenericHeuristicAnalysis_By_DosX by adding multiple PE.isNetUStringPresent checks to broaden UX-Locker detection. New signatures include memory/service messages ("\r\nMemory section at address 0x0424* is locked!", "\r\nService UXCryptor started.", "\r\n\r\n * Windows blocked!"), "lc.exe error", bypass markers ("ByPassWarnMsg", "ByPassMessage"), "ux-cryptor.exe", the ransom message "YOU ARE HACKED!\\1", and a combined pattern requiring both "_o_program" and "border_1". These additions improve detection coverage for UXCryptor/locker behaviors.
2026-04-27 00:28:50 +03:00
DosX
6dde9348d2 Simplify export name heuristic in PE scan
Replace a complex export-name check inside scanForObfuscations_Native with a simpler condition that flags exports starting with a digit or containing non-ASCII characters. Removed the additional checks for mangled names and underscore-replaced obfuscation testing. Note: the parentheses were changed, so the !isAsciiString check is now evaluated independently of the functionName truthiness (behavior may differ subtly).
2026-04-26 22:51:46 +03:00
DosX
747c154e9a dbs_min update 2026-04-26 21:07:33 +03:00
DosX
968b1054a4 Add kernel32 check; tweak NsPack flag
Update PE heuristic rules: add a kernel32 library presence check to the UPX-like detection conditional to ensure VirtualProtect is resolved from kernel32, and change NsPack detection flag from 0 to -1. Also apply non-functional formatting/comment alignment across db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg for readability.
2026-04-26 21:07:00 +03:00
DosX
655ff21045 Refine PE detection for Audiokinetic and Denuvo
Add an inline comment marking the static export option for Audiokinetic detection (sOptions = "static" // EAT). Tighten Denuvo protector detection by consolidating separate export checks into a single conditional that requires >10 imports, a d3d library import, and an export matching GetDenuvo(TimeTicketRequest|TicketLocation). This removes redundant individual export checks and reduces false positives by adding import/library heuristics.
2026-04-26 20:32:16 +03:00
DosX
2293bdca52 Improve Denuvo and SteamStub detection
Broaden Denuvo signature and add heuristics for more reliable detection. The packer signature now recognizes .etext/.xtext section names in addition to .ecode/.xcode. Added a heuristic that marks Denuvo if Core/Activation(64).dll is present or if the binary has >10 sections, >10 unmanaged imports, and either a .etext/.xtext section or exports like GetDenuvoTimeTicketRequest/GetDenuvoTicketLocation. SteamStub detection was moved earlier and now checks for the E8 stub at the entry point and a trailing .bind section. Removed duplicated older checks and added contextual comments/links.
2026-04-26 20:30:16 +03:00
DosX
721157c5aa Enhance Audiokinetic AkTlsAllocateSlot detection
Add contributor tag and refine detect() to prefer PE.isFunctionPresent("AkTlsAllocateSlot") first; if only the export exists, set sOptions = "static" and mark detection. This distinguishes static vs exported symbol cases for more accurate Audiokinetic library detection.
2026-04-26 20:27:31 +03:00
DosX
d2e77562d6 Remove AMD FidelityFX rule; lower Denuvo sections
Delete obsolete db/PE/library_AMD_FidelityFX.4.sg detection rule. Update db/PE/protector_Denuvo.2.sg to relax the section-count check from >12 to >10, broadening matches for Denuvo-protected binaries (logic and other checks unchanged).
2026-04-26 20:21:23 +03:00
DosX
5f6f853bd1 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-26 20:19:19 +03:00
Benjamin Funke
76bccddf87 add Audiokinetic signature 2026-04-26 18:22:46 +02:00
Benjamin Funke
0a1d418166 add AMD FidelityFX signature
Found in PRAGMATA demo game executable
2026-04-26 18:13:21 +02:00
DosX
7b6b7bb9e9 Refine Denuvo PE section detection regexes
Tighten and expand section-name checks in db/PE/protector_Denuvo.2.sg: require both the .[e|x](text|code) and corresponding data section when checking PE files with >12 sections, extend accepted data section name patterns (add .sx and allow .code variants and xp/xd forms), and update detection comments to include Deathloop and Immortals Fenyx Rising alongside Atomic Heart. Also includes a minor whitespace adjustment.
2026-04-26 19:09:39 +03:00
Benjamin Funke
44a180753b add Capcom KPKA archive to PAK signature 2026-04-26 18:00:52 +02:00
DosX
b362e3280b dbs_min update 2026-04-26 18:02:30 +03:00
DosX
4529a911dd Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-26 17:47:18 +03:00
DosX
b09d87dc86 Refine Denuvo PE detection & version
Adjust Denuvo detection heuristics: increase section-count threshold from >6 to >12, tighten and anchor section-name regular expressions (add '^' anchors, include 'my' and explicit .[ex]text pattern), and consolidate some checks to use isSectionNamePresentExp. Update the Atomic Heart version tag from "17.0" to "12.0-17.0+". These tweaks aim to reduce false positives and improve matching for newer builds.
2026-04-26 17:47:16 +03:00
Benjamin Funke
1d6d50bfc6 add Void game engine signature 2026-04-26 16:14:24 +02:00
DosX
dac2de79cd Add ezip signature to heuristics
Add 'ezip' (1.X) signature to scanForPackersAndCryptors list in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to improve detection of ezip-packed binaries. Signature hex: 0x174efb84.
2026-04-26 17:10:21 +03:00
DosX
0671c1599d Add NakedPacker signature to heuristics
Insert NakedPacker entry (version 1.0, id 0x64910c88) into the packers list in scanForPackersAndCryptors_NET_and_Native within db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to add detection for NakedPacker.
2026-04-26 17:10:00 +03:00
DosX
2c509cc1e7 Add NTPacker signature to heuristics
Add an NTPacker entry (version 1.0, signature 0x1a721d2d) to the packers/cryptors array in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg so the heuristic scanner can detect files packed with NTPacker.
2026-04-26 17:09:41 +03:00
DosX
611bef1fbf Add JDPack 1.01 entry, normalize name case
Insert a new signature for JDPack 1.01 (hash 0xd9380ce5) and update the existing entry to use the consistent 'JDPack' casing for the 2.00 signature (0xc002db0e) in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg. This improves packer detection accuracy and naming consistency.
2026-04-26 17:09:29 +03:00
DosX
15977d35cc Add NTPacker signature to PE heuristics
Add new signature 558BEC83C4E05333C0 to scanForPackersAndCryptors_NET_and_Native in db/PE/__GenericHeuristicAnalysis_By_DosX.7.sg to detect NTPacker (x32) samples. Improves heuristic detection coverage for this packer.
2026-04-26 17:09:01 +03:00
DosX
dcf2483238 Expand Petite packer signatures
Enhance PE heuristic DB by adding multiple detection signatures for the Petite packer: introduce a 2.1 entry with three signatures, retain the existing 2.2 entry, and add two 2.X signatures. These changes improve detection of Petite variants in the scanForPackersAndCryptors_NET_and_Native routine while preserving the original reference link.
2026-04-26 16:47:28 +03:00
DosX
e3d73da5fe Use regex for vcruntime140 detection
Replace explicit checks for vcruntime140.dll and vcruntime140_1.dll with PE.isLibraryPresentExp using a regex that matches multiple vcruntime140 naming variants (debug builds, _1, hashed suffixes, optional .dll). This broadens library detection to capture more runtime DLL name patterns while preserving the existing behavior of setting sOptions to "dynamic" and bDetected to true in db/PE/library_Microsoft_C_Runtime.4.sg.
2026-04-26 15:57:54 +03:00
DosX
e95a188319 Fix detection of non-text first PE section
Corrects the conditional in scanForObfuscations_Native so the heuristic flags when the first PE section is not ".text", ".textbss" or ".code" and a text section exists elsewhere. The previous check only triggered when the first section was exactly ".code", which missed other non-text section names and caused false negatives in the text-section-not-first detection.
2026-04-26 15:18:04 +03:00
DosX
d0a45ff469 Refine UPX-like detection split structure/IAT
Separate UPX-like structure detection from import/IAT checks by adding isUpxLikeImports. Move VirtualProtect/GetProcAddress/ExitProcess|CopyContext validation into a nested branch so we only mark IAT-like when imports are present. Update logging to show R(W) and build the option label to include "and IAT" only when import checks pass. Also require both structure and imports for the final ~packer UPX-like result to reduce false positives.
2026-04-26 15:17:49 +03:00
DosX
0d8e4d3071 Refactor licensing strings array and add DRM links
Reformatted the licesingStrings array into a multiline list for readability (entries reordered but behavior unchanged). Added inline comments linking to Denuvo and SteamStub resources above their respective detection checks to provide context for the DRM heuristics.
2026-04-26 14:14:35 +03:00
DosX
9c63f67aa2 Restrict Denuvo DLL regex to exact filenames
Replace a loose library check with a stricter, anchored regex so the heuristic only matches exact DLL names (e.g. Core/Activation.dll or Core/Activation64.dll, allowing either slash or backslash and case-insensitive). This reduces false positives when detecting Denuvo activation libraries.
2026-04-26 14:08:33 +03:00
DosX
37fc7cec7b Add SteamStub (.bind) detection
Register SteamStub as a known packer ('.bind') and detect SteamStub DRM in licensing scans. Adds a packer list entry for SteamStub and checks for the SteamStub pattern in scanForLicensingSystems by verifying the entry-point opcode via PE.compareEP("E800000000") and that the last section is named ".bind", then adds the "SteamStub DRM" option when matched.
2026-04-26 13:54:07 +03:00
DosX
5d2d941b3e dbs_min update 2026-04-26 13:18:15 +03:00
DosX
629649560c Require first PE section not be .text
Add a check in the Denuvo protector detection to ensure PE.section[0].Name !== ".text" before applying the existing heuristics (sections > 6 and special section-name patterns or .arch/.xtext/.xtls). This reduces false positives for binaries whose first section is .text and improves readability by splitting the long conditional across lines.
2026-04-26 13:18:00 +03:00
DosX
4054e429d9 Add Denuvo signature to PE heuristic DB
Introduce a Denuvo entry to the PE heuristic database in scanForPackersAndCryptors_NET_and_Native. Adds a pattern (regex for .excode/.xcode and ".ooa") so the scanner can recognize Denuvo-protected binaries and improve detection coverage.
2026-04-26 13:17:27 +03:00
DosX
29356b8c96 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-26 13:05:38 +03:00
Benjamin Funke
d20ce696f0 dbs_min update 2026-04-26 07:08:48 +02:00
Benjamin Funke
31015a813e refactor IMG signature 2026-04-25 19:36:51 +02:00
Benjamin Funke
5d4e5b7706 remove WIP status from LinXP signatures 2026-04-25 19:14:31 +02:00
Benjamin Funke
15ff60a0d0 refactor VM2 signature
Detect the version number over regex instead of hardcode an specific one
2026-04-25 17:27:11 +02:00
DosX
d0e3e4d688 Include .udata in Denuvo section regex
Update PE protector detection regex in db/PE/protector_Denuvo.2.sg to also match '.udata' sections by changing \.(e|sr|x(p|d))data$ to \.([eu]|sr|x(p|d))data$. This expands detection coverage for Denuvo-protected native PE files that use .udata sections.
2026-04-25 14:50:48 +03:00
DosX
63362afcf2 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-25 13:18:27 +03:00
Benjamin Funke
fe85108674 add more Sputm versions 2026-04-24 21:05:28 +02:00
github-actions[bot]
b747221e48 style: auto-format JavaScript files in db directories 2026-04-24 13:14:42 +00:00
Benjamin Funke
17d762f3d9 add Sputm game engine signature 2026-04-24 15:13:57 +02:00
DosX
c0fb8ecd80 Require .NET object when detecting Phoenix protector
Tighten the Phoenix PE detector by adding a PE.isNetObjectPresent("?0?") check before the existing signature match, reducing false positives for non-.NET binaries. Updates db/PE/protector_Phoenix.2.sg to only mark version 1.7-1.8 when both the .NET object and signature are present.
2026-04-24 00:13:40 +03:00
DosX
3320b2098f Rename protector rule to packer and tighten detection
Rename db/PE/protector_Sixxpack.2.sg to db/PE/packer_Sixxpack.2.sg and change meta tag from "protector" to "packer". Add an additional guard so detection only runs when PE.isNet() and PE.isNetUStringPresent("Data Error") is present, preserving existing signature checks for versions 2.2, 2.4 and 2.X.
2026-04-24 00:08:08 +03:00
DosX
53925ddbb1 Require AssemblyInfoAttribute for detection
Add a check for PE.isNetObjectPresent("AssemblyInfoAttribute") in the Crypto Obfuscator detector before matching the signature. This ensures the detection only runs for managed assemblies that include the AssemblyInfoAttribute, reducing false positives when PE.isNet() is true but the attribute is absent.
2026-04-24 00:03:14 +03:00
DosX
18bc55322a Enhance .netshrink PE detection
Refine detection for the .netshrink packer: add an "Enhanced: DosX" note, require a specific .NET object presence (PE.isNetObjectPresent("\u0002\u2001")) to reduce false positives, and add a resource-based signature ('stub_2.netrsrc.resources') to detect 2.9+ builds. Existing 2.01 Demo signature checks are preserved.
2026-04-23 23:56:24 +03:00
DosX
a9d1568e8c dbs_min update 2026-04-23 16:36:08 +03:00
DosX
c5dd72bec8 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-23 16:35:41 +03:00
DosX
4f5b5288d0 Rename MS-DOS db files to include type prefixes
Rename several files in db/MSDOS to add explicit type prefixes for clearer organization and consistency. Renamed files:
- Meridian_Ada.4.sg -> compiler_Meridian_Ada.4.sg
- Meridian_Pascal.4.sg -> compiler_Meridian_Pascal.4.sg
- Visual_Cobol.4.sg -> compiler_Visual_Cobol.4.sg
- Netware_loader.1.sg -> loader_Netware_loader.1.sg
- Black_fist.2.sg -> packer_Black_fist.2.sg
- PROPACK_SFX.1.sg -> sfx_PROPACK_SFX.1.sg
2026-04-23 16:35:33 +03:00
horsicq
082f73b1b9 chore: update database dates and cmake install 2026-04-23 15:07:33 +02:00
hypn0chka
365f4ba00d new installers 2026-04-22 22:32:12 +05:00
Benjamin Funke
871c20d446 add release dates to changelog 2026-04-22 18:56:39 +02:00
DosX
3974ca32fe Fix spelling: optimisation -> optimization
Update changelog entry to use American English spelling: changed 'Add AVX2 and SSE2 optimisation' to 'Add AVX2 and SSE2 optimization'. This is a documentation-only change with no code impact.
2026-04-22 15:00:57 +03:00
DosX
fd427c9532 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-22 14:59:06 +03:00
DosX
b02c727c99 Remove legacy WAYBACK_SUPPORT handling
Delete obsolete boolean-version check from db/language::_setLang. The early return for when version === false (WAYBACK support) was legacy compatibility and is no longer needed, simplifying the language detection control flow.
2026-04-22 14:59:04 +03:00
Benjamin Funke
9f8c9fa6c0
Update die_version.txt 2026-04-22 09:33:59 +02:00
Benjamin Funke
c506b83bc1
Update create_beta.yml 2026-04-22 08:34:09 +02:00
Benjamin Funke
7678aff0c1
add workflow_dispatch to run manual 2026-04-22 08:33:15 +02:00
horsicq
27de375a4d docs: update changelog for version 3.21 2026-04-22 00:47:40 +02:00
horsicq
3fd35281cd chore: update db date to 2026-04-21 2026-04-21 23:17:59 +02:00
Benjamin Funke
c6565004bd Update version number to 3.21 2026-04-21 17:17:05 +02:00
horsicq
1c49166821 chore: update database dates to 2026-04-20 2026-04-20 18:56:55 +02:00
Benjamin Funke
74dff012bb update changelog notes 2026-04-20 17:51:24 +02:00
horsicq
9609dd806f chore: update database dates to 2026-04-19 2026-04-19 19:18:22 +02:00
DosX
725f3f759d Reformat YARA rules indentation
Normalize indentation and spacing across multiple YARA rule files. Changes are whitespace/formatting-only (alignment of comments, blocks, and string sections) and do not modify rule logic or conditions. Updated files: yara_rules/DiE_BasicHeuristics_by_DosX.yar, yara_rules/DiE_EnhancedHeuristics_by_DosX.yar, yara_rules/DiE_InterestingThings_by_DosX.yar, yara_rules/crypto_signature.yar, yara_rules/malware_analisys.yar, yara_rules/packer.yar, yara_rules/packer_compiler_signatures.yar, yara_rules/peid.yar.
2026-04-19 13:53:40 +03:00
DosX
ecc0076979 Normalize hex wildcard groups in peid.yar
Consolidate spaced byte-wildcards across many YARA signatures in yara_rules/peid.yar (e.g. "?? ?? ??" -> "??????" and similar) to make wildcard runs consistent and more compact. This is a bulk normalization change to improve readability and ensure uniform pattern expressions across multiple rules at the PE entry-point signatures.
2026-04-19 13:46:04 +03:00
DosX
1187c3d9a9 Format YARA packer_compiler_signatures.yar
Normalize indentation and formatting in yara_rules/packer_compiler_signatures.yar: convert tabs/irregular spacing to consistent spaces, align comments and condition blocks, and standardize meta/strings formatting across many rules. This is a whitespace/style-only change — no detection logic or rule conditions were altered.
2026-04-19 13:44:47 +03:00
DosX
c88e215732 Normalize YARA patterns and meta formatting
Reformat yara_rules/packer.yar: standardize 'meta' author lines and normalize hex string patterns for readability and consistency. Consecutive 00 bytes and wildcard groups (??) were compacted/standardized, spacing in byte sequences was unified, and several pattern placeholders were adjusted to a consistent notation. No functional rule logic was changed—these are formatting/normalization edits to make maintenance of YARA signatures easier.
2026-04-19 13:42:26 +03:00
DosX
e04587d11a Inline condition clauses in YARA rules
Reformatted yara_rules/malware_analisys.yar by merging multi-line "condition:" labels and their expressions onto single lines across many rules for consistent styling and readability. These are purely formatting/whitespace changes and do not alter rule logic.
2026-04-19 13:41:45 +03:00
DosX
37ecc852ff Compact repeated hex bytes in peid.yar
Refactor many YARA rule string literals to collapse repeated byte sequences (e.g. runs of 0x00, 0x90, etc.) into compact continuous hex tokens across multiple rules. This normalizes formatting of the pe.entry_point patterns for readability and consistency without changing rule conditions or semantics.
2026-04-19 13:30:35 +03:00
DosX
fd8f26fa9d Reformat peid.yar rules to compact format
Normalize formatting in yara_rules/peid.yar by collapsing multi-line 'strings' and 'condition' blocks into single-line declarations and adjusting indentation across many rules. This is purely a stylistic/whitespace change to make the file more compact; no rule logic or signatures were modified.
2026-04-19 13:26:41 +03:00
DosX
a1c34eb6d4 dbs_min update 2026-04-19 13:15:22 +03:00
DosX
ab7e043893 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-19 00:05:12 +03:00
DosX
a718dbf74a Rename MSDOS DB files to categorized names
Standardize db/MSDOS filenames by adding type prefixes (compiler_, cryptor_, protector_, sfx_, other_PK_). Rename multiple detection rule files accordingly. Also normalize file modes for protector_DAEMON_Protect.2.sg and sfx_Disk_eXPress.1.sg (100755 -> 100644) and apply minor formatting/whitespace normalization; no detection logic changes.
2026-04-19 00:05:06 +03:00
horsicq
fd37b8ca7d chore: update db dates and workflow permissions 2026-04-18 15:38:29 +02:00
Benjamin Funke
c24037d288
Upgrade action-gh-release to version 3 for db-release 2026-04-18 12:02:43 +02:00
Benjamin Funke
5dbfde97f8
update actions/checkout to v6 2026-04-18 12:01:37 +02:00
Benjamin Funke
65a0fb112e
update softprops/action-gh-release to v3 2026-04-18 12:00:35 +02:00
Benjamin Funke
d827ae17fa merge SSH signatures in one file 2026-04-18 09:09:23 +02:00
Benjamin Funke
ca88a8f915 move file extensions to comments in Director signature 2026-04-18 08:51:28 +02:00
DosX
5325150da2 dbs_min update 2026-04-17 23:55:21 +03:00
DosX
32294fcd8d Revert "refactor: simplify PE heuristic analysis logic"
This reverts commit f16b1733d6.
2026-04-17 23:45:20 +03:00
DosX
07eadbc2ed Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-17 23:44:13 +03:00
DosX
31d0e66eb2 Add type prefixes to COM DB filenames
Rename 13 files in db/COM to include role/type prefixes (compiler_, cryptor_, packer_, protector_, self-displayer_) to better categorize entries. Examples: PC_FORTH -> compiler_PC_FORTH, Deep_Crypter -> cryptor_Deep_Crypter, simple_ansi_viewer -> self-displayer_simple_ansi_viewer.
2026-04-17 23:44:07 +03:00
horsicq
f16b1733d6 refactor: simplify PE heuristic analysis logic 2026-04-17 21:33:34 +02:00
DosX
29102edba7 dbs_min update 2026-04-17 21:56:53 +03:00
DosX
430afd6713 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-17 21:56:04 +03:00
horsicq
c6351f92b0 chore: update db dates to 2026-04-17 2026-04-17 18:16:35 +02:00
DosX
1612db3b4d Allow CopyContext and RW in UPX-like heuristic
Relax detection in scanForPackersAndCryptors_NET_and_Native(): accept the third section as read-write in addition to read, and treat CopyContext as an alternative to ExitProcess when identifying UPX-like layouts. This accommodates variants such as UPX-Patcher while preserving the original RWX/RWX/ R pattern detection logic.
2026-04-17 01:54:53 +03:00
DosX
157d41ff0b Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-17 01:51:47 +03:00
DosX
6d8417dbff Index sections using dosxSection.Number
Fix PE section lookup in tool_UPX-Patcher by using dosxSection.Number when computing fishSectionByIndex. Previously the code used dosxSection directly (which can be an object), producing an incorrect index; this change ensures a numeric index is used and prevents detection failures.
2026-04-17 01:51:43 +03:00
horsicq
ed9faf1f4b feat: add GitHub workflow and database info files 2026-04-16 21:01:09 +02:00
DosX
cfd70f86f3 Merge branch 'master' of https://github.com/horsicq/Detect-It-Easy 2026-04-16 19:13:38 +03:00
DosX
4bd43be317 dbs_min update 2026-04-16 19:13:32 +03:00
1547 changed files with 92820 additions and 52762 deletions

75
.github/workflows/db-release.yml vendored Executable file
View file

@ -0,0 +1,75 @@
name: DB Release
on:
push:
branches: ["master"]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Clone Detect-It-Easy
run: |
git clone https://github.com/horsicq/Detect-It-Easy DIE
- name: Release db
if: ${{ hashFiles('DIE/db/info.ini') != '' }}
run: |
cd DIE
zip -r ../db.zip db
cd ..
- name: Read db/info.ini
if: ${{ hashFiles('DIE/db/info.ini') != '' }}
id: db_info
run: |
DB_INFO=$(cat DIE/db/info.ini)
echo "DB_INFO<<EOF" >> $GITHUB_OUTPUT
echo "$DB_INFO" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Update db release
if: ${{ hashFiles('DIE/db/info.ini') != '' }}
uses: softprops/action-gh-release@v3
with:
files: db.zip
name: "db"
tag_name: db
body: ${{ steps.db_info.outputs.DB_INFO }}
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Create db_extra.zip
if: ${{ hashFiles('DIE/db_extra/info.ini') != '' }}
run: |
cd DIE
zip -r ../db_extra.zip db_extra
cd ..
- name: Read db_extra/info.ini
if: ${{ hashFiles('DIE/db_extra/info.ini') != '' }}
id: db_extra_info
run: |
DB_EXTRA_INFO=$(cat DIE/db_extra/info.ini)
echo "DB_EXTRA_INFO<<EOF" >> $GITHUB_OUTPUT
echo "$DB_EXTRA_INFO" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Update db_extra release
if: ${{ hashFiles('DIE/db_extra/info.ini') != '' }}
uses: softprops/action-gh-release@v3
with:
files: db_extra.zip
name: "db_extra"
tag_name: db_extra
body: ${{ steps.db_extra_info.outputs.DB_EXTRA_INFO }}
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

View file

@ -21,7 +21,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
token: ${{ secrets. RELEASE_TOKEN }}

View file

@ -81,7 +81,7 @@ jobs:
# Update the "Current database" pre-release
- name: Update Database Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v3
with:
files: |
db.zip

4
.gitignore vendored
View file

@ -1,3 +1,5 @@
DIE-engine
.idea
.compiler_cache
.compiler_cache
..*
*.die-db

View file

@ -1,7 +1,7 @@
FROM ubuntu:24.04
# Newest version of DIE, check https://github.com/horsicq/DIE-engine/releases .
ARG DIE_VERSION=3.20
ARG DIE_VERSION=3.22
RUN apt update -qq && apt upgrade -y && apt install -y wget && \
wget https://github.com/horsicq/DIE-engine/releases/download/Beta/die_${DIE_VERSION}_Ubuntu_24.04_amd64.deb && \
apt install -y ./die_${DIE_VERSION}_Ubuntu_24.04_amd64.deb && \

View file

@ -7,28 +7,28 @@
**Detect It Easy (DiE)** is a powerful tool for file type identification, popular among **malware analysts**, **cybersecurity experts**, and **reverse engineers** worldwide. Supporting both **signature-based** and **heuristic analysis**, DiE enables efficient file inspections across a broad range of platforms, including **Windows, Linux, and MacOS**. Its adaptable, script-driven detection architecture makes it one of the most versatile tools in the field, with a comprehensive list of supported OS images.
## 🚀 Getting Started
## 🚀 Getting started
- **[💎 Download release/beta](https://github.com/horsicq/DIE-engine/releases)**
- **[🧪 DiE API Library (for Developers)](https://github.com/horsicq/die_library)**
- **[🧪 DiE API Library (for Developers)](https://github.com/horsicq/die_library)**
- [📋 Changelog](https://github.com/horsicq/Detect-It-Easy/blob/master/changelog.txt)
- [💬 Contribute to Translations](https://github.com/horsicq/XTranslation)
![Screenshot](docs/1.png)
## 💡 Why Use Detect It Easy?
## 💡 Why use Detect It Easy?
Detect It Easys **flexible signature system** and **scripting capabilities** make it an essential tool for **malware analysis** and **digital forensics**. With traditional static analyzers often limited in scope and prone to false positives, DiEs customizable design enables precise integration of new detection logic, ensuring reliable results across diverse file types.
![Screenshot](docs/2.png)
### Key Advantages:
### Key advantages:
- **Flexible Signature Management**: Easily create, modify, and optimize signatures.
- **Flexible Signature Management**: Easily create, modify, and optimize detection scripts (rules).
- **Cross-Platform Support**: Runs on Windows, Linux, and MacOS.
- **Minimal False Positives**: Combined signature and heuristic analysis ensures high detection accuracy.
## 📄 Supported File Types
## 📄 Supported file types
Detect It Easy supports a wide range of executable and archive types, including:
@ -52,16 +52,16 @@ And that's not all... The list is expanding as the tool is updated
Unknown formats undergo heuristic analysis, providing identification for both known and unrecognized files.
## 🔑 Key Features
## 🔑 Key features
- **Flexible Signature Management**: Define or modify detection signatures.
- **Scripted Detection**: Use a JavaScript-like scripting language (DiE-JS runtime) for custom detection algorithms.
- **Flexible Signature Management**: Define or modify detection rules.
- **Scripted Detection**: Use a JavaScript-like scripting language (DiE-JS ES5 runtime) for custom detection algorithms.
- **Cross-Platform Compatibility**: Available for Windows, Linux, and MacOS.
- **Reduced False Positives**: Combines signature and heuristic scanning for accuracy.
## 📥 Installation
### 📦 Install via Package Managers
### 📦 Install via package managers
- **Windows**:
@ -80,11 +80,11 @@ Unknown formats undergo heuristic analysis, providing identification for both kn
> [!NOTE]
> Use **Detect It Easy** bot via **Telegram** to quickly check files: [**@detectiteasy_bot**](https://t.me/detectiteasy_bot)
### ⚙️ Build from Source
### ⚙️ Build from source
See the [BUILD.md](docs/BUILD.md) for detailed instructions.
### 🐳 Docker Installation
### 🐳 Docker installation
Run DiE in a Docker container:
@ -96,7 +96,7 @@ docker build . -t horsicq:diec
## 🖥️ Usage
Detect It Easy offers three versions:
**Detect It Easy** offers three versions:
- **die** - Graphical interface.
- **diec** - Command-line version for batch processing.
@ -104,19 +104,18 @@ Detect It Easy offers three versions:
For detailed usage, refer to the [RUN.md](docs/RUN.md).
### 🔎 Example Use Cases
### 🔎 Example use cases
- 🦠 **Malware Analysis**: Identify file types, packers, or protections.
- 🛡 **Security Audits**: Determine executable file types and potential security risks.
- 🦠 **Malware Analysis**: Identify file types, packers, or protections. Heuristic engine detects multiple malware and file virus families.
- 🛡 **Security Audits**: Determine executable potential security risks.
- 🔎 **Software Forensics**: Inspect software components and validate compliance.
## 💬 Community
## 💬 Our community
👋 **Hello! / Привет!** Welcome to the Detect It Easy community!
Have questions, ideas, or just want to chat? Here's where to find us:
- **Telegram Bot**: Send a file or just say hello to [**@detectiteasy_bot**](https://t.me/detectiteasy_bot)
- **GitHub Discussions**: Start a conversation in [Discussions](https://github.com/horsicq/Detect-It-Easy/discussions)
- **GitHub Issues**: Report bugs or request features via [Issues](https://github.com/horsicq/Detect-It-Easy/issues)

View file

@ -0,0 +1,22 @@
Copyright (c) 2015 Chris Talkington.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT
HOLDERS 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.

View file

@ -0,0 +1,22 @@
Copyright (c) 2012-2014 Chris Talkington, contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT
HOLDERS 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.

View file

@ -0,0 +1,19 @@
Copyright (c) 2010-2018 Caolan McMahon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,21 @@
(MIT)
Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Jameson Little
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,13 @@
The MIT License (MIT)
=====================
Copyright (c) 2013-2019 bl contributors
----------------------------------
*bl contributors listed at <https://github.com/rvagg/bl#contributors>*
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,19 @@
The MIT License
Copyright (c) 2013 Brian J. Brennan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Feross Aboukhadijeh, and other contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,22 @@
Copyright (c) 2014 Chris Talkington, contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT
HOLDERS 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.

View file

@ -0,0 +1,18 @@
This software is released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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 THE AUTHORS OR
COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,19 @@
Copyright Node.js contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright (C) 2014-present SheetJS LLC
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.

View file

@ -0,0 +1,22 @@
Copyright (c) 2014 Chris Talkington, contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT
HOLDERS 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.

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Mathias Buus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018 Mathias Buus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,43 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
----
This library bundles a version of the `fs.realpath` and `fs.realpathSync`
methods from Node.js v0.10 under the terms of the Node.js MIT license.
Node's license follows, also included at the header of `old.js` which contains
the licensed code:
Copyright Joyent, Inc. and other Node contributors.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,21 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
## Glob Logo
Glob's logo created by Tanya Brassie <http://tanyabrassie.com/>, licensed
under a Creative Commons Attribution-ShareAlike 4.0 International License
https://creativecommons.org/licenses/by-sa/4.0/

View file

@ -0,0 +1,15 @@
The ISC License
Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -0,0 +1,11 @@
Copyright 2008 Fair Oaks Labs, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
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.

View file

@ -0,0 +1,15 @@
The ISC License
Copyright (c) Isaac Z. Schlueter
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -0,0 +1,16 @@
The ISC License
Copyright (c) Isaac Z. Schlueter
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

View file

@ -0,0 +1,23 @@
Copyright (c) 2013 J. Pommerening, contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT
HOLDERS 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.

View file

@ -0,0 +1,47 @@
Copyright jQuery Foundation and other contributors <https://jquery.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View file

@ -0,0 +1,47 @@
Copyright jQuery Foundation and other contributors <https://jquery.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View file

@ -0,0 +1,47 @@
Copyright jQuery Foundation and other contributors <https://jquery.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View file

@ -0,0 +1,47 @@
Copyright jQuery Foundation and other contributors <https://jquery.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View file

@ -0,0 +1,47 @@
Copyright jQuery Foundation and other contributors <https://jquery.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View file

@ -0,0 +1,15 @@
The ISC License
Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014-2018, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,15 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,19 @@
# Copyright (c) 2015 Calvin Metcalf
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
**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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.**

View file

@ -0,0 +1,47 @@
Node.js is licensed for use as follows:
"""
Copyright Node.js contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.
"""
This license applies to parts of Node.js originating from the
https://github.com/joyent/node repository:
"""
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.
"""

View file

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2020 Yann Armelin
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.

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Feross Aboukhadijeh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,48 @@
Node.js is licensed for use as follows:
"""
Copyright Node.js contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.
"""
This license applies to parts of Node.js originating from the
https://github.com/joyent/node repository:
"""
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.
"""

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Mathias Buus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 THE
AUTHORS OR COPYRIGHT HOLDERS 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.

View file

@ -0,0 +1,24 @@
(The MIT License)
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT
HOLDERS 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.

View file

@ -0,0 +1,15 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -0,0 +1,22 @@
Copyright (c) 2014 Chris Talkington, contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 THE AUTHORS OR COPYRIGHT
HOLDERS 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.

16
autotools/dbcompiler/node_modules/.bin/crc32 generated vendored Normal file
View file

@ -0,0 +1,16 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../crc-32/bin/crc32.njs" "$@"
else
exec node "$basedir/../crc-32/bin/crc32.njs" "$@"
fi

17
autotools/dbcompiler/node_modules/.bin/crc32.cmd generated vendored Normal file
View file

@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\crc-32\bin\crc32.njs" %*

28
autotools/dbcompiler/node_modules/.bin/crc32.ps1 generated vendored Normal file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../crc-32/bin/crc32.njs" $args
} else {
& "$basedir/node$exe" "$basedir/../crc-32/bin/crc32.njs" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../crc-32/bin/crc32.njs" $args
} else {
& "node$exe" "$basedir/../crc-32/bin/crc32.njs" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View file

@ -4,6 +4,463 @@
"lockfileVersion": 3,
"requires": true,
"packages": {
"node_modules/archiver": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.2.tgz",
"integrity": "sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==",
"dependencies": {
"archiver-utils": "^2.1.0",
"async": "^3.2.4",
"buffer-crc32": "^0.2.1",
"readable-stream": "^3.6.0",
"readdir-glob": "^1.1.2",
"tar-stream": "^2.2.0",
"zip-stream": "^4.1.0"
},
"engines": {
"node": ">= 10"
}
},
"node_modules/archiver-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz",
"integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==",
"dependencies": {
"glob": "^7.1.4",
"graceful-fs": "^4.2.0",
"lazystream": "^1.0.0",
"lodash.defaults": "^4.2.0",
"lodash.difference": "^4.5.0",
"lodash.flatten": "^4.4.0",
"lodash.isplainobject": "^4.0.6",
"lodash.union": "^4.6.0",
"normalize-path": "^3.0.0",
"readable-stream": "^2.0.0"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/archiver-utils/node_modules/readable-stream": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"node_modules/archiver-utils/node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"node_modules/archiver-utils/node_modules/string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dependencies": {
"safe-buffer": "~5.1.0"
}
},
"node_modules/async": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",
"integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA=="
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/bl": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
"dependencies": {
"buffer": "^5.5.0",
"inherits": "^2.0.4",
"readable-stream": "^3.4.0"
}
},
"node_modules/brace-expansion": {
"version": "1.1.14",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
"integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
}
},
"node_modules/buffer-crc32": {
"version": "0.2.13",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
"integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==",
"engines": {
"node": "*"
}
},
"node_modules/compress-commons": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.2.tgz",
"integrity": "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==",
"dependencies": {
"buffer-crc32": "^0.2.13",
"crc32-stream": "^4.0.2",
"normalize-path": "^3.0.0",
"readable-stream": "^3.6.0"
},
"engines": {
"node": ">= 10"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
},
"node_modules/core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
"node_modules/crc-32": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
"integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",
"bin": {
"crc32": "bin/crc32.njs"
},
"engines": {
"node": ">=0.8"
}
},
"node_modules/crc32-stream": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.3.tgz",
"integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==",
"dependencies": {
"crc-32": "^1.2.0",
"readable-stream": "^3.4.0"
},
"engines": {
"node": ">= 10"
}
},
"node_modules/end-of-stream": {
"version": "1.4.5",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
"integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
"dependencies": {
"once": "^1.4.0"
}
},
"node_modules/fs-constants": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
},
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
},
"node_modules/ieee754": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
},
"node_modules/lazystream": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz",
"integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==",
"dependencies": {
"readable-stream": "^2.0.5"
},
"engines": {
"node": ">= 0.6.3"
}
},
"node_modules/lazystream/node_modules/readable-stream": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"node_modules/lazystream/node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"node_modules/lazystream/node_modules/string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dependencies": {
"safe-buffer": "~5.1.0"
}
},
"node_modules/lodash.defaults": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
"integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ=="
},
"node_modules/lodash.difference": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz",
"integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA=="
},
"node_modules/lodash.flatten": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
"integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g=="
},
"node_modules/lodash.isplainobject": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
"integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA=="
},
"node_modules/lodash.union": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz",
"integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw=="
},
"node_modules/minimatch": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
"integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"node_modules/readable-stream": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
"dependencies": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/readdir-glob": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz",
"integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==",
"dependencies": {
"minimatch": "^5.1.0"
}
},
"node_modules/readdir-glob/node_modules/brace-expansion": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz",
"integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==",
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/readdir-glob/node_modules/minimatch": {
"version": "5.1.9",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz",
"integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==",
"dependencies": {
"brace-expansion": "^2.0.1"
},
"engines": {
"node": ">=10"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"dependencies": {
"safe-buffer": "~5.2.0"
}
},
"node_modules/tar-stream": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
"integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
"dependencies": {
"bl": "^4.0.3",
"end-of-stream": "^1.4.1",
"fs-constants": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^3.1.1"
},
"engines": {
"node": ">=6"
}
},
"node_modules/uglify-js": {
"version": "3.19.3",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
@ -14,6 +471,49 @@
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
},
"node_modules/zip-stream": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.1.tgz",
"integrity": "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==",
"dependencies": {
"archiver-utils": "^3.0.4",
"compress-commons": "^4.1.2",
"readable-stream": "^3.6.0"
},
"engines": {
"node": ">= 10"
}
},
"node_modules/zip-stream/node_modules/archiver-utils": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-3.0.4.tgz",
"integrity": "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==",
"dependencies": {
"glob": "^7.2.3",
"graceful-fs": "^4.2.0",
"lazystream": "^1.0.0",
"lodash.defaults": "^4.2.0",
"lodash.difference": "^4.5.0",
"lodash.flatten": "^4.4.0",
"lodash.isplainobject": "^4.0.6",
"lodash.union": "^4.6.0",
"normalize-path": "^3.0.0",
"readable-stream": "^3.6.0"
},
"engines": {
"node": ">= 10"
}
}
}
}

View file

@ -0,0 +1,209 @@
/**
* archiver-utils
*
* Copyright (c) 2012-2014 Chris Talkington, contributors.
* Licensed under the MIT license.
* https://github.com/archiverjs/node-archiver/blob/master/LICENSE-MIT
*/
var fs = require('graceful-fs');
var path = require('path');
var flatten = require('lodash.flatten');
var difference = require('lodash.difference');
var union = require('lodash.union');
var isPlainObject = require('lodash.isplainobject');
var glob = require('glob');
var file = module.exports = {};
var pathSeparatorRe = /[\/\\]/g;
// Process specified wildcard glob patterns or filenames against a
// callback, excluding and uniquing files in the result set.
var processPatterns = function(patterns, fn) {
// Filepaths to return.
var result = [];
// Iterate over flattened patterns array.
flatten(patterns).forEach(function(pattern) {
// If the first character is ! it should be omitted
var exclusion = pattern.indexOf('!') === 0;
// If the pattern is an exclusion, remove the !
if (exclusion) { pattern = pattern.slice(1); }
// Find all matching files for this pattern.
var matches = fn(pattern);
if (exclusion) {
// If an exclusion, remove matching files.
result = difference(result, matches);
} else {
// Otherwise add matching files.
result = union(result, matches);
}
});
return result;
};
// True if the file path exists.
file.exists = function() {
var filepath = path.join.apply(path, arguments);
return fs.existsSync(filepath);
};
// Return an array of all file paths that match the given wildcard patterns.
file.expand = function(...args) {
// If the first argument is an options object, save those options to pass
// into the File.prototype.glob.sync method.
var options = isPlainObject(args[0]) ? args.shift() : {};
// Use the first argument if it's an Array, otherwise convert the arguments
// object to an array and use that.
var patterns = Array.isArray(args[0]) ? args[0] : args;
// Return empty set if there are no patterns or filepaths.
if (patterns.length === 0) { return []; }
// Return all matching filepaths.
var matches = processPatterns(patterns, function(pattern) {
// Find all matching files for this pattern.
return glob.sync(pattern, options);
});
// Filter result set?
if (options.filter) {
matches = matches.filter(function(filepath) {
filepath = path.join(options.cwd || '', filepath);
try {
if (typeof options.filter === 'function') {
return options.filter(filepath);
} else {
// If the file is of the right type and exists, this should work.
return fs.statSync(filepath)[options.filter]();
}
} catch(e) {
// Otherwise, it's probably not the right type.
return false;
}
});
}
return matches;
};
// Build a multi task "files" object dynamically.
file.expandMapping = function(patterns, destBase, options) {
options = Object.assign({
rename: function(destBase, destPath) {
return path.join(destBase || '', destPath);
}
}, options);
var files = [];
var fileByDest = {};
// Find all files matching pattern, using passed-in options.
file.expand(options, patterns).forEach(function(src) {
var destPath = src;
// Flatten?
if (options.flatten) {
destPath = path.basename(destPath);
}
// Change the extension?
if (options.ext) {
destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext);
}
// Generate destination filename.
var dest = options.rename(destBase, destPath, options);
// Prepend cwd to src path if necessary.
if (options.cwd) { src = path.join(options.cwd, src); }
// Normalize filepaths to be unix-style.
dest = dest.replace(pathSeparatorRe, '/');
src = src.replace(pathSeparatorRe, '/');
// Map correct src path to dest path.
if (fileByDest[dest]) {
// If dest already exists, push this src onto that dest's src array.
fileByDest[dest].src.push(src);
} else {
// Otherwise create a new src-dest file mapping object.
files.push({
src: [src],
dest: dest,
});
// And store a reference for later use.
fileByDest[dest] = files[files.length - 1];
}
});
return files;
};
// reusing bits of grunt's multi-task source normalization
file.normalizeFilesArray = function(data) {
var files = [];
data.forEach(function(obj) {
var prop;
if ('src' in obj || 'dest' in obj) {
files.push(obj);
}
});
if (files.length === 0) {
return [];
}
files = _(files).chain().forEach(function(obj) {
if (!('src' in obj) || !obj.src) { return; }
// Normalize .src properties to flattened array.
if (Array.isArray(obj.src)) {
obj.src = flatten(obj.src);
} else {
obj.src = [obj.src];
}
}).map(function(obj) {
// Build options object, removing unwanted properties.
var expandOptions = Object.assign({}, obj);
delete expandOptions.src;
delete expandOptions.dest;
// Expand file mappings.
if (obj.expand) {
return file.expandMapping(obj.src, obj.dest, expandOptions).map(function(mapObj) {
// Copy obj properties to result.
var result = Object.assign({}, obj);
// Make a clone of the orig obj available.
result.orig = Object.assign({}, obj);
// Set .src and .dest, processing both as templates.
result.src = mapObj.src;
result.dest = mapObj.dest;
// Remove unwanted properties.
['expand', 'cwd', 'flatten', 'rename', 'ext'].forEach(function(prop) {
delete result[prop];
});
return result;
});
}
// Copy obj properties to result, adding an .orig property.
var result = Object.assign({}, obj);
// Make a clone of the orig obj available.
result.orig = Object.assign({}, obj);
if ('src' in result) {
// Expose an expand-on-demand getter method as .src.
Object.defineProperty(result, 'src', {
enumerable: true,
get: function fn() {
var src;
if (!('result' in fn)) {
src = obj.src;
// If src is an array, flatten it. Otherwise, make it into an array.
src = Array.isArray(src) ? flatten(src) : [src];
// Expand src files, memoizing result.
fn.result = file.expand(expandOptions, src);
}
return fn.result;
}
});
}
if ('dest' in result) {
result.dest = obj.dest;
}
return result;
}).flatten().value();
return files;
};

View file

@ -0,0 +1,156 @@
/**
* archiver-utils
*
* Copyright (c) 2015 Chris Talkington.
* Licensed under the MIT license.
* https://github.com/archiverjs/archiver-utils/blob/master/LICENSE
*/
var fs = require('graceful-fs');
var path = require('path');
var nutil = require('util');
var lazystream = require('lazystream');
var normalizePath = require('normalize-path');
var defaults = require('lodash.defaults');
var Stream = require('stream').Stream;
var PassThrough = require('readable-stream').PassThrough;
var utils = module.exports = {};
utils.file = require('./file.js');
function assertPath(path) {
if (typeof path !== 'string') {
throw new TypeError('Path must be a string. Received ' + nutils.inspect(path));
}
}
utils.collectStream = function(source, callback) {
var collection = [];
var size = 0;
source.on('error', callback);
source.on('data', function(chunk) {
collection.push(chunk);
size += chunk.length;
});
source.on('end', function() {
var buf = new Buffer(size);
var offset = 0;
collection.forEach(function(data) {
data.copy(buf, offset);
offset += data.length;
});
callback(null, buf);
});
};
utils.dateify = function(dateish) {
dateish = dateish || new Date();
if (dateish instanceof Date) {
dateish = dateish;
} else if (typeof dateish === 'string') {
dateish = new Date(dateish);
} else {
dateish = new Date();
}
return dateish;
};
// this is slightly different from lodash version
utils.defaults = function(object, source, guard) {
var args = arguments;
args[0] = args[0] || {};
return defaults(...args);
};
utils.isStream = function(source) {
return source instanceof Stream;
};
utils.lazyReadStream = function(filepath) {
return new lazystream.Readable(function() {
return fs.createReadStream(filepath);
});
};
utils.normalizeInputSource = function(source) {
if (source === null) {
return new Buffer(0);
} else if (typeof source === 'string') {
return new Buffer(source);
} else if (utils.isStream(source) && !source._readableState) {
var normalized = new PassThrough();
source.pipe(normalized);
return normalized;
}
return source;
};
utils.sanitizePath = function(filepath) {
return normalizePath(filepath, false).replace(/^\w+:/, '').replace(/^(\.\.\/|\/)+/, '');
};
utils.trailingSlashIt = function(str) {
return str.slice(-1) !== '/' ? str + '/' : str;
};
utils.unixifyPath = function(filepath) {
return normalizePath(filepath, false).replace(/^\w+:/, '');
};
utils.walkdir = function(dirpath, base, callback) {
var results = [];
if (typeof base === 'function') {
callback = base;
base = dirpath;
}
fs.readdir(dirpath, function(err, list) {
var i = 0;
var file;
var filepath;
if (err) {
return callback(err);
}
(function next() {
file = list[i++];
if (!file) {
return callback(null, results);
}
filepath = path.join(dirpath, file);
fs.stat(filepath, function(err, stats) {
results.push({
path: filepath,
relative: path.relative(base, filepath).replace(/\\/g, '/'),
stats: stats
});
if (stats && stats.isDirectory()) {
utils.walkdir(filepath, base, function(err, res) {
res.forEach(function(dirEntry) {
results.push(dirEntry);
});
next();
});
} else {
next();
}
});
})();
});
};

View file

@ -0,0 +1 @@
module.exports = require('./lib/_stream_duplex.js');

View file

@ -0,0 +1 @@
module.exports = require('./readable').Duplex

View file

@ -0,0 +1,131 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// 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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
// Writable.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
/*<replacement>*/
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) {
keys.push(key);
}return keys;
};
/*</replacement>*/
module.exports = Duplex;
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
var Readable = require('./_stream_readable');
var Writable = require('./_stream_writable');
util.inherits(Duplex, Readable);
{
// avoid scope creep, the keys array can then be collected
var keys = objectKeys(Writable.prototype);
for (var v = 0; v < keys.length; v++) {
var method = keys[v];
if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
}
}
function Duplex(options) {
if (!(this instanceof Duplex)) return new Duplex(options);
Readable.call(this, options);
Writable.call(this, options);
if (options && options.readable === false) this.readable = false;
if (options && options.writable === false) this.writable = false;
this.allowHalfOpen = true;
if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
this.once('end', onend);
}
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._writableState.highWaterMark;
}
});
// the no-half-open enforcer
function onend() {
// if we allow half-open state, or if the writable side ended,
// then we're ok.
if (this.allowHalfOpen || this._writableState.ended) return;
// no more data can be written.
// But allow more writes to happen in this tick.
pna.nextTick(onEndNT, this);
}
function onEndNT(self) {
self.end();
}
Object.defineProperty(Duplex.prototype, 'destroyed', {
get: function () {
if (this._readableState === undefined || this._writableState === undefined) {
return false;
}
return this._readableState.destroyed && this._writableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (this._readableState === undefined || this._writableState === undefined) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._readableState.destroyed = value;
this._writableState.destroyed = value;
}
});
Duplex.prototype._destroy = function (err, cb) {
this.push(null);
this.end();
pna.nextTick(cb, err);
};

View file

@ -0,0 +1,47 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// 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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
'use strict';
module.exports = PassThrough;
var Transform = require('./_stream_transform');
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
util.inherits(PassThrough, Transform);
function PassThrough(options) {
if (!(this instanceof PassThrough)) return new PassThrough(options);
Transform.call(this, options);
}
PassThrough.prototype._transform = function (chunk, encoding, cb) {
cb(null, chunk);
};

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,214 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// 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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
// a transform stream is a readable/writable stream where you do
// something with the data. Sometimes it's called a "filter",
// but that's not a great name for it, since that implies a thing where
// some bits pass through, and others are simply ignored. (That would
// be a valid example of a transform, of course.)
//
// While the output is causally related to the input, it's not a
// necessarily symmetric or synchronous transformation. For example,
// a zlib stream might take multiple plain-text writes(), and then
// emit a single compressed chunk some time in the future.
//
// Here's how this works:
//
// The Transform stream has all the aspects of the readable and writable
// stream classes. When you write(chunk), that calls _write(chunk,cb)
// internally, and returns false if there's a lot of pending writes
// buffered up. When you call read(), that calls _read(n) until
// there's enough pending readable data buffered up.
//
// In a transform stream, the written data is placed in a buffer. When
// _read(n) is called, it transforms the queued up data, calling the
// buffered _write cb's as it consumes chunks. If consuming a single
// written chunk would result in multiple output chunks, then the first
// outputted bit calls the readcb, and subsequent chunks just go into
// the read buffer, and will cause it to emit 'readable' if necessary.
//
// This way, back-pressure is actually determined by the reading side,
// since _read has to be called to start processing a new chunk. However,
// a pathological inflate type of transform can cause excessive buffering
// here. For example, imagine a stream where every byte of input is
// interpreted as an integer from 0-255, and then results in that many
// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
// 1kb of data being output. In this case, you could write a very small
// amount of input, and end up with a very large amount of output. In
// such a pathological inflating mechanism, there'd be no way to tell
// the system to stop doing the transform. A single 4MB write could
// cause the system to run out of memory.
//
// However, even in such a pathological case, only a single written chunk
// would be consumed, and then the rest would wait (un-transformed) until
// the results of the previous transformed chunk were consumed.
'use strict';
module.exports = Transform;
var Duplex = require('./_stream_duplex');
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
util.inherits(Transform, Duplex);
function afterTransform(er, data) {
var ts = this._transformState;
ts.transforming = false;
var cb = ts.writecb;
if (!cb) {
return this.emit('error', new Error('write callback called multiple times'));
}
ts.writechunk = null;
ts.writecb = null;
if (data != null) // single equals check for both `null` and `undefined`
this.push(data);
cb(er);
var rs = this._readableState;
rs.reading = false;
if (rs.needReadable || rs.length < rs.highWaterMark) {
this._read(rs.highWaterMark);
}
}
function Transform(options) {
if (!(this instanceof Transform)) return new Transform(options);
Duplex.call(this, options);
this._transformState = {
afterTransform: afterTransform.bind(this),
needTransform: false,
transforming: false,
writecb: null,
writechunk: null,
writeencoding: null
};
// start out asking for a readable event once data is transformed.
this._readableState.needReadable = true;
// we have implemented the _read method, and done the other things
// that Readable wants before the first _read call, so unset the
// sync guard flag.
this._readableState.sync = false;
if (options) {
if (typeof options.transform === 'function') this._transform = options.transform;
if (typeof options.flush === 'function') this._flush = options.flush;
}
// When the writable side finishes, then flush out anything remaining.
this.on('prefinish', prefinish);
}
function prefinish() {
var _this = this;
if (typeof this._flush === 'function') {
this._flush(function (er, data) {
done(_this, er, data);
});
} else {
done(this, null, null);
}
}
Transform.prototype.push = function (chunk, encoding) {
this._transformState.needTransform = false;
return Duplex.prototype.push.call(this, chunk, encoding);
};
// This is the part where you do stuff!
// override this function in implementation classes.
// 'chunk' is an input chunk.
//
// Call `push(newChunk)` to pass along transformed output
// to the readable side. You may call 'push' zero or more times.
//
// Call `cb(err)` when you are done with this chunk. If you pass
// an error, then that'll put the hurt on the whole operation. If you
// never call cb(), then you'll never get another chunk.
Transform.prototype._transform = function (chunk, encoding, cb) {
throw new Error('_transform() is not implemented');
};
Transform.prototype._write = function (chunk, encoding, cb) {
var ts = this._transformState;
ts.writecb = cb;
ts.writechunk = chunk;
ts.writeencoding = encoding;
if (!ts.transforming) {
var rs = this._readableState;
if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
}
};
// Doesn't matter what the args are here.
// _transform does all the work.
// That we got here means that the readable side wants more data.
Transform.prototype._read = function (n) {
var ts = this._transformState;
if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
ts.transforming = true;
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
} else {
// mark that we need a transform, so that any data that comes in
// will get processed, now that we've asked for it.
ts.needTransform = true;
}
};
Transform.prototype._destroy = function (err, cb) {
var _this2 = this;
Duplex.prototype._destroy.call(this, err, function (err2) {
cb(err2);
_this2.emit('close');
});
};
function done(stream, er, data) {
if (er) return stream.emit('error', er);
if (data != null) // single equals check for both `null` and `undefined`
stream.push(data);
// if there's nothing in the write buffer, then that means
// that nothing more will ever be provided
if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
return stream.push(null);
}

View file

@ -0,0 +1,685 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// 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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
// A bit simpler than readable streams.
// Implement an async ._write(chunk, encoding, cb), and it'll handle all
// the drain event emission and buffering.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
module.exports = Writable;
/* <replacement> */
function WriteReq(chunk, encoding, cb) {
this.chunk = chunk;
this.encoding = encoding;
this.callback = cb;
this.next = null;
}
// It seems a linked list but it is not
// there will be only 2 of these for each stream
function CorkedRequest(state) {
var _this = this;
this.next = null;
this.entry = null;
this.finish = function () {
onCorkedFinish(_this, state);
};
}
/* </replacement> */
/*<replacement>*/
var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
/*</replacement>*/
/*<replacement>*/
var Duplex;
/*</replacement>*/
Writable.WritableState = WritableState;
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
/*<replacement>*/
var internalUtil = {
deprecate: require('util-deprecate')
};
/*</replacement>*/
/*<replacement>*/
var Stream = require('./internal/streams/stream');
/*</replacement>*/
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
return Buffer.from(chunk);
}
function _isUint8Array(obj) {
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
/*</replacement>*/
var destroyImpl = require('./internal/streams/destroy');
util.inherits(Writable, Stream);
function nop() {}
function WritableState(options, stream) {
Duplex = Duplex || require('./_stream_duplex');
options = options || {};
// Duplex streams are both readable and writable, but share
// the same options object.
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
var isDuplex = stream instanceof Duplex;
// object stream flag to indicate whether or not this stream
// contains buffers or objects.
this.objectMode = !!options.objectMode;
if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
// the point at which write() starts returning false
// Note: 0 is a valid value, means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
var writableHwm = options.writableHighWaterMark;
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
// cast to ints.
this.highWaterMark = Math.floor(this.highWaterMark);
// if _final has been called
this.finalCalled = false;
// drain event flag.
this.needDrain = false;
// at the start of calling end()
this.ending = false;
// when end() has been called, and returned
this.ended = false;
// when 'finish' is emitted
this.finished = false;
// has it been destroyed
this.destroyed = false;
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
var noDecode = options.decodeStrings === false;
this.decodeStrings = !noDecode;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// not an actual buffer we keep track of, but a measurement
// of how much we're waiting to get pushed to some underlying
// socket or file.
this.length = 0;
// a flag to see when we're in the middle of a write.
this.writing = false;
// when true all writes will be buffered until .uncork() call
this.corked = 0;
// a flag to be able to tell if the onwrite cb is called immediately,
// or on a later tick. We set this to true at first, because any
// actions that shouldn't happen until "later" should generally also
// not happen before the first write call.
this.sync = true;
// a flag to know if we're processing previously buffered items, which
// may call the _write() callback in the same tick, so that we don't
// end up in an overlapped onwrite situation.
this.bufferProcessing = false;
// the callback that's passed to _write(chunk,cb)
this.onwrite = function (er) {
onwrite(stream, er);
};
// the callback that the user supplies to write(chunk,encoding,cb)
this.writecb = null;
// the amount that is being written when _write is called.
this.writelen = 0;
this.bufferedRequest = null;
this.lastBufferedRequest = null;
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
this.pendingcb = 0;
// emit prefinish if the only thing we're waiting for is _write cbs
// This is relevant for synchronous Transform streams
this.prefinished = false;
// True if the error was already emitted and should not be thrown again
this.errorEmitted = false;
// count buffered requests
this.bufferedRequestCount = 0;
// allocate the first CorkedRequest, there is always
// one allocated and free to use, and we maintain at most two
this.corkedRequestsFree = new CorkedRequest(this);
}
WritableState.prototype.getBuffer = function getBuffer() {
var current = this.bufferedRequest;
var out = [];
while (current) {
out.push(current);
current = current.next;
}
return out;
};
(function () {
try {
Object.defineProperty(WritableState.prototype, 'buffer', {
get: internalUtil.deprecate(function () {
return this.getBuffer();
}, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
});
} catch (_) {}
})();
// Test _writableState for inheritance to account for Duplex streams,
// whose prototype chain only points to Readable.
var realHasInstance;
if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
realHasInstance = Function.prototype[Symbol.hasInstance];
Object.defineProperty(Writable, Symbol.hasInstance, {
value: function (object) {
if (realHasInstance.call(this, object)) return true;
if (this !== Writable) return false;
return object && object._writableState instanceof WritableState;
}
});
} else {
realHasInstance = function (object) {
return object instanceof this;
};
}
function Writable(options) {
Duplex = Duplex || require('./_stream_duplex');
// Writable ctor is applied to Duplexes, too.
// `realHasInstance` is necessary because using plain `instanceof`
// would return false, as no `_writableState` property is attached.
// Trying to use the custom `instanceof` for Writable here will also break the
// Node.js LazyTransform implementation, which has a non-trivial getter for
// `_writableState` that would lead to infinite recursion.
if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
return new Writable(options);
}
this._writableState = new WritableState(options, this);
// legacy.
this.writable = true;
if (options) {
if (typeof options.write === 'function') this._write = options.write;
if (typeof options.writev === 'function') this._writev = options.writev;
if (typeof options.destroy === 'function') this._destroy = options.destroy;
if (typeof options.final === 'function') this._final = options.final;
}
Stream.call(this);
}
// Otherwise people can pipe Writable streams, which is just wrong.
Writable.prototype.pipe = function () {
this.emit('error', new Error('Cannot pipe, not readable'));
};
function writeAfterEnd(stream, cb) {
var er = new Error('write after end');
// TODO: defer error events consistently everywhere, not just the cb
stream.emit('error', er);
pna.nextTick(cb, er);
}
// Checks that a user-supplied chunk is valid, especially for the particular
// mode the stream is in. Currently this means that `null` is never accepted
// and undefined/non-string values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) {
var valid = true;
var er = false;
if (chunk === null) {
er = new TypeError('May not write null values to stream');
} else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
if (er) {
stream.emit('error', er);
pna.nextTick(cb, er);
valid = false;
}
return valid;
}
Writable.prototype.write = function (chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
var isBuf = !state.objectMode && _isUint8Array(chunk);
if (isBuf && !Buffer.isBuffer(chunk)) {
chunk = _uint8ArrayToBuffer(chunk);
}
if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
if (typeof cb !== 'function') cb = nop;
if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
state.pendingcb++;
ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
}
return ret;
};
Writable.prototype.cork = function () {
var state = this._writableState;
state.corked++;
};
Writable.prototype.uncork = function () {
var state = this._writableState;
if (state.corked) {
state.corked--;
if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
}
};
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
// node::ParseEncoding() requires lower case.
if (typeof encoding === 'string') encoding = encoding.toLowerCase();
if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
this._writableState.defaultEncoding = encoding;
return this;
};
function decodeChunk(state, chunk, encoding) {
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
chunk = Buffer.from(chunk, encoding);
}
return chunk;
}
Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._writableState.highWaterMark;
}
});
// if we're already writing something, then just put this
// in the queue, and wait our turn. Otherwise, call _write
// If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
if (!isBuf) {
var newChunk = decodeChunk(state, chunk, encoding);
if (chunk !== newChunk) {
isBuf = true;
encoding = 'buffer';
chunk = newChunk;
}
}
var len = state.objectMode ? 1 : chunk.length;
state.length += len;
var ret = state.length < state.highWaterMark;
// we must ensure that previous needDrain will not be reset to false.
if (!ret) state.needDrain = true;
if (state.writing || state.corked) {
var last = state.lastBufferedRequest;
state.lastBufferedRequest = {
chunk: chunk,
encoding: encoding,
isBuf: isBuf,
callback: cb,
next: null
};
if (last) {
last.next = state.lastBufferedRequest;
} else {
state.bufferedRequest = state.lastBufferedRequest;
}
state.bufferedRequestCount += 1;
} else {
doWrite(stream, state, false, len, chunk, encoding, cb);
}
return ret;
}
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
state.writelen = len;
state.writecb = cb;
state.writing = true;
state.sync = true;
if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
state.sync = false;
}
function onwriteError(stream, state, sync, er, cb) {
--state.pendingcb;
if (sync) {
// defer the callback if we are being called synchronously
// to avoid piling up things on the stack
pna.nextTick(cb, er);
// this can emit finish, and it will always happen
// after error
pna.nextTick(finishMaybe, stream, state);
stream._writableState.errorEmitted = true;
stream.emit('error', er);
} else {
// the caller expect this to happen before if
// it is async
cb(er);
stream._writableState.errorEmitted = true;
stream.emit('error', er);
// this can emit finish, but finish must
// always follow error
finishMaybe(stream, state);
}
}
function onwriteStateUpdate(state) {
state.writing = false;
state.writecb = null;
state.length -= state.writelen;
state.writelen = 0;
}
function onwrite(stream, er) {
var state = stream._writableState;
var sync = state.sync;
var cb = state.writecb;
onwriteStateUpdate(state);
if (er) onwriteError(stream, state, sync, er, cb);else {
// Check if we're actually ready to finish, but don't emit yet
var finished = needFinish(state);
if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
clearBuffer(stream, state);
}
if (sync) {
/*<replacement>*/
asyncWrite(afterWrite, stream, state, finished, cb);
/*</replacement>*/
} else {
afterWrite(stream, state, finished, cb);
}
}
}
function afterWrite(stream, state, finished, cb) {
if (!finished) onwriteDrain(stream, state);
state.pendingcb--;
cb();
finishMaybe(stream, state);
}
// Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
// value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) {
if (state.length === 0 && state.needDrain) {
state.needDrain = false;
stream.emit('drain');
}
}
// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
state.bufferProcessing = true;
var entry = state.bufferedRequest;
if (stream._writev && entry && entry.next) {
// Fast case, write everything using _writev()
var l = state.bufferedRequestCount;
var buffer = new Array(l);
var holder = state.corkedRequestsFree;
holder.entry = entry;
var count = 0;
var allBuffers = true;
while (entry) {
buffer[count] = entry;
if (!entry.isBuf) allBuffers = false;
entry = entry.next;
count += 1;
}
buffer.allBuffers = allBuffers;
doWrite(stream, state, true, state.length, buffer, '', holder.finish);
// doWrite is almost always async, defer these to save a bit of time
// as the hot path ends with doWrite
state.pendingcb++;
state.lastBufferedRequest = null;
if (holder.next) {
state.corkedRequestsFree = holder.next;
holder.next = null;
} else {
state.corkedRequestsFree = new CorkedRequest(state);
}
state.bufferedRequestCount = 0;
} else {
// Slow case, write chunks one-by-one
while (entry) {
var chunk = entry.chunk;
var encoding = entry.encoding;
var cb = entry.callback;
var len = state.objectMode ? 1 : chunk.length;
doWrite(stream, state, false, len, chunk, encoding, cb);
entry = entry.next;
state.bufferedRequestCount--;
// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
break;
}
}
if (entry === null) state.lastBufferedRequest = null;
}
state.bufferedRequest = entry;
state.bufferProcessing = false;
}
Writable.prototype._write = function (chunk, encoding, cb) {
cb(new Error('_write() is not implemented'));
};
Writable.prototype._writev = null;
Writable.prototype.end = function (chunk, encoding, cb) {
var state = this._writableState;
if (typeof chunk === 'function') {
cb = chunk;
chunk = null;
encoding = null;
} else if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
// .end() fully uncorks
if (state.corked) {
state.corked = 1;
this.uncork();
}
// ignore unnecessary end() calls.
if (!state.ending) endWritable(this, state, cb);
};
function needFinish(state) {
return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
}
function callFinal(stream, state) {
stream._final(function (err) {
state.pendingcb--;
if (err) {
stream.emit('error', err);
}
state.prefinished = true;
stream.emit('prefinish');
finishMaybe(stream, state);
});
}
function prefinish(stream, state) {
if (!state.prefinished && !state.finalCalled) {
if (typeof stream._final === 'function') {
state.pendingcb++;
state.finalCalled = true;
pna.nextTick(callFinal, stream, state);
} else {
state.prefinished = true;
stream.emit('prefinish');
}
}
}
function finishMaybe(stream, state) {
var need = needFinish(state);
if (need) {
prefinish(stream, state);
if (state.pendingcb === 0) {
state.finished = true;
stream.emit('finish');
}
}
return need;
}
function endWritable(stream, state, cb) {
state.ending = true;
finishMaybe(stream, state);
if (cb) {
if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
}
state.ended = true;
stream.writable = false;
}
function onCorkedFinish(corkReq, state, err) {
var entry = corkReq.entry;
corkReq.entry = null;
while (entry) {
var cb = entry.callback;
state.pendingcb--;
cb(err);
entry = entry.next;
}
// reuse the free corkReq.
state.corkedRequestsFree.next = corkReq;
}
Object.defineProperty(Writable.prototype, 'destroyed', {
get: function () {
if (this._writableState === undefined) {
return false;
}
return this._writableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (!this._writableState) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._writableState.destroyed = value;
}
});
Writable.prototype.destroy = destroyImpl.destroy;
Writable.prototype._undestroy = destroyImpl.undestroy;
Writable.prototype._destroy = function (err, cb) {
this.end();
cb(err);
};

View file

@ -0,0 +1,78 @@
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Buffer = require('safe-buffer').Buffer;
var util = require('util');
function copyBuffer(src, target, offset) {
src.copy(target, offset);
}
module.exports = function () {
function BufferList() {
_classCallCheck(this, BufferList);
this.head = null;
this.tail = null;
this.length = 0;
}
BufferList.prototype.push = function push(v) {
var entry = { data: v, next: null };
if (this.length > 0) this.tail.next = entry;else this.head = entry;
this.tail = entry;
++this.length;
};
BufferList.prototype.unshift = function unshift(v) {
var entry = { data: v, next: this.head };
if (this.length === 0) this.tail = entry;
this.head = entry;
++this.length;
};
BufferList.prototype.shift = function shift() {
if (this.length === 0) return;
var ret = this.head.data;
if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
--this.length;
return ret;
};
BufferList.prototype.clear = function clear() {
this.head = this.tail = null;
this.length = 0;
};
BufferList.prototype.join = function join(s) {
if (this.length === 0) return '';
var p = this.head;
var ret = '' + p.data;
while (p = p.next) {
ret += s + p.data;
}return ret;
};
BufferList.prototype.concat = function concat(n) {
if (this.length === 0) return Buffer.alloc(0);
var ret = Buffer.allocUnsafe(n >>> 0);
var p = this.head;
var i = 0;
while (p) {
copyBuffer(p.data, ret, i);
i += p.data.length;
p = p.next;
}
return ret;
};
return BufferList;
}();
if (util && util.inspect && util.inspect.custom) {
module.exports.prototype[util.inspect.custom] = function () {
var obj = util.inspect({ length: this.length });
return this.constructor.name + ' ' + obj;
};
}

View file

@ -0,0 +1,84 @@
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
// undocumented cb() API, needed for core, not for public API
function destroy(err, cb) {
var _this = this;
var readableDestroyed = this._readableState && this._readableState.destroyed;
var writableDestroyed = this._writableState && this._writableState.destroyed;
if (readableDestroyed || writableDestroyed) {
if (cb) {
cb(err);
} else if (err) {
if (!this._writableState) {
pna.nextTick(emitErrorNT, this, err);
} else if (!this._writableState.errorEmitted) {
this._writableState.errorEmitted = true;
pna.nextTick(emitErrorNT, this, err);
}
}
return this;
}
// we set destroyed to true before firing error callbacks in order
// to make it re-entrance safe in case destroy() is called within callbacks
if (this._readableState) {
this._readableState.destroyed = true;
}
// if this is a duplex stream mark the writable part as destroyed as well
if (this._writableState) {
this._writableState.destroyed = true;
}
this._destroy(err || null, function (err) {
if (!cb && err) {
if (!_this._writableState) {
pna.nextTick(emitErrorNT, _this, err);
} else if (!_this._writableState.errorEmitted) {
_this._writableState.errorEmitted = true;
pna.nextTick(emitErrorNT, _this, err);
}
} else if (cb) {
cb(err);
}
});
return this;
}
function undestroy() {
if (this._readableState) {
this._readableState.destroyed = false;
this._readableState.reading = false;
this._readableState.ended = false;
this._readableState.endEmitted = false;
}
if (this._writableState) {
this._writableState.destroyed = false;
this._writableState.ended = false;
this._writableState.ending = false;
this._writableState.finalCalled = false;
this._writableState.prefinished = false;
this._writableState.finished = false;
this._writableState.errorEmitted = false;
}
}
function emitErrorNT(self, err) {
self.emit('error', err);
}
module.exports = {
destroy: destroy,
undestroy: undestroy
};

View file

@ -0,0 +1 @@
module.exports = require('events').EventEmitter;

View file

@ -0,0 +1 @@
module.exports = require('stream');

View file

@ -0,0 +1,52 @@
{
"name": "readable-stream",
"version": "2.3.8",
"description": "Streams3, a user-land copy of the stream library from Node.js",
"main": "readable.js",
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
},
"devDependencies": {
"assert": "^1.4.0",
"babel-polyfill": "^6.9.1",
"buffer": "^4.9.0",
"lolex": "^2.3.2",
"nyc": "^6.4.0",
"tap": "^0.7.0",
"tape": "^4.8.0"
},
"scripts": {
"test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js",
"ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
"cover": "nyc npm test",
"report": "nyc report --reporter=lcov"
},
"repository": {
"type": "git",
"url": "git://github.com/nodejs/readable-stream"
},
"keywords": [
"readable",
"stream",
"pipe"
],
"browser": {
"util": false,
"./readable.js": "./readable-browser.js",
"./writable.js": "./writable-browser.js",
"./duplex.js": "./duplex-browser.js",
"./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
},
"nyc": {
"include": [
"lib/**.js"
]
},
"license": "MIT"
}

View file

@ -0,0 +1 @@
module.exports = require('./readable').PassThrough

View file

@ -0,0 +1,7 @@
exports = module.exports = require('./lib/_stream_readable.js');
exports.Stream = exports;
exports.Readable = exports;
exports.Writable = require('./lib/_stream_writable.js');
exports.Duplex = require('./lib/_stream_duplex.js');
exports.Transform = require('./lib/_stream_transform.js');
exports.PassThrough = require('./lib/_stream_passthrough.js');

View file

@ -0,0 +1,19 @@
var Stream = require('stream');
if (process.env.READABLE_STREAM === 'disable' && Stream) {
module.exports = Stream;
exports = module.exports = Stream.Readable;
exports.Readable = Stream.Readable;
exports.Writable = Stream.Writable;
exports.Duplex = Stream.Duplex;
exports.Transform = Stream.Transform;
exports.PassThrough = Stream.PassThrough;
exports.Stream = Stream;
} else {
exports = module.exports = require('./lib/_stream_readable.js');
exports.Stream = Stream || exports;
exports.Readable = exports;
exports.Writable = require('./lib/_stream_writable.js');
exports.Duplex = require('./lib/_stream_duplex.js');
exports.Transform = require('./lib/_stream_transform.js');
exports.PassThrough = require('./lib/_stream_passthrough.js');
}

View file

@ -0,0 +1 @@
module.exports = require('./readable').Transform

View file

@ -0,0 +1 @@
module.exports = require('./lib/_stream_writable.js');

View file

@ -0,0 +1,8 @@
var Stream = require("stream")
var Writable = require("./lib/_stream_writable.js")
if (process.env.READABLE_STREAM === 'disable') {
module.exports = Stream && Stream.Writable || Writable
} else {
module.exports = Writable
}

View file

@ -0,0 +1,187 @@
declare module "safe-buffer" {
export class Buffer {
length: number
write(string: string, offset?: number, length?: number, encoding?: string): number;
toString(encoding?: string, start?: number, end?: number): string;
toJSON(): { type: 'Buffer', data: any[] };
equals(otherBuffer: Buffer): boolean;
compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
slice(start?: number, end?: number): Buffer;
writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
readUInt8(offset: number, noAssert?: boolean): number;
readUInt16LE(offset: number, noAssert?: boolean): number;
readUInt16BE(offset: number, noAssert?: boolean): number;
readUInt32LE(offset: number, noAssert?: boolean): number;
readUInt32BE(offset: number, noAssert?: boolean): number;
readInt8(offset: number, noAssert?: boolean): number;
readInt16LE(offset: number, noAssert?: boolean): number;
readInt16BE(offset: number, noAssert?: boolean): number;
readInt32LE(offset: number, noAssert?: boolean): number;
readInt32BE(offset: number, noAssert?: boolean): number;
readFloatLE(offset: number, noAssert?: boolean): number;
readFloatBE(offset: number, noAssert?: boolean): number;
readDoubleLE(offset: number, noAssert?: boolean): number;
readDoubleBE(offset: number, noAssert?: boolean): number;
swap16(): Buffer;
swap32(): Buffer;
swap64(): Buffer;
writeUInt8(value: number, offset: number, noAssert?: boolean): number;
writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
writeInt8(value: number, offset: number, noAssert?: boolean): number;
writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
fill(value: any, offset?: number, end?: number): this;
indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
/**
* Allocates a new buffer containing the given {str}.
*
* @param str String to store in buffer.
* @param encoding encoding to use, optional. Default is 'utf8'
*/
constructor (str: string, encoding?: string);
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
*/
constructor (size: number);
/**
* Allocates a new buffer containing the given {array} of octets.
*
* @param array The octets to store.
*/
constructor (array: Uint8Array);
/**
* Produces a Buffer backed by the same allocated memory as
* the given {ArrayBuffer}.
*
*
* @param arrayBuffer The ArrayBuffer with which to share memory.
*/
constructor (arrayBuffer: ArrayBuffer);
/**
* Allocates a new buffer containing the given {array} of octets.
*
* @param array The octets to store.
*/
constructor (array: any[]);
/**
* Copies the passed {buffer} data onto a new {Buffer} instance.
*
* @param buffer The buffer to copy.
*/
constructor (buffer: Buffer);
prototype: Buffer;
/**
* Allocates a new Buffer using an {array} of octets.
*
* @param array
*/
static from(array: any[]): Buffer;
/**
* When passed a reference to the .buffer property of a TypedArray instance,
* the newly created Buffer will share the same allocated memory as the TypedArray.
* The optional {byteOffset} and {length} arguments specify a memory range
* within the {arrayBuffer} that will be shared by the Buffer.
*
* @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
* @param byteOffset
* @param length
*/
static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
/**
* Copies the passed {buffer} data onto a new Buffer instance.
*
* @param buffer
*/
static from(buffer: Buffer): Buffer;
/**
* Creates a new Buffer containing the given JavaScript string {str}.
* If provided, the {encoding} parameter identifies the character encoding.
* If not provided, {encoding} defaults to 'utf8'.
*
* @param str
*/
static from(str: string, encoding?: string): Buffer;
/**
* Returns true if {obj} is a Buffer
*
* @param obj object to test.
*/
static isBuffer(obj: any): obj is Buffer;
/**
* Returns true if {encoding} is a valid encoding argument.
* Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
*
* @param encoding string to test.
*/
static isEncoding(encoding: string): boolean;
/**
* Gives the actual byte length of a string. encoding defaults to 'utf8'.
* This is not the same as String.prototype.length since that returns the number of characters in a string.
*
* @param string string to test.
* @param encoding encoding used to evaluate (defaults to 'utf8')
*/
static byteLength(string: string, encoding?: string): number;
/**
* Returns a buffer which is the result of concatenating all the buffers in the list together.
*
* If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
* If the list has exactly one item, then the first item of the list is returned.
* If the list has more than one item, then a new Buffer is created.
*
* @param list An array of Buffer objects to concatenate
* @param totalLength Total length of the buffers when concatenated.
* If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
*/
static concat(list: Buffer[], totalLength?: number): Buffer;
/**
* The same as buf1.compare(buf2).
*/
static compare(buf1: Buffer, buf2: Buffer): number;
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
* @param fill if specified, buffer will be initialized by calling buf.fill(fill).
* If parameter is omitted, buffer will be filled with zeros.
* @param encoding encoding used for call to buf.fill while initalizing
*/
static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
/**
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
* of the newly created Buffer are unknown and may contain sensitive data.
*
* @param size count of octets to allocate
*/
static allocUnsafe(size: number): Buffer;
/**
* Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
* of the newly created Buffer are unknown and may contain sensitive data.
*
* @param size count of octets to allocate
*/
static allocUnsafeSlow(size: number): Buffer;
}
}

View file

@ -0,0 +1,62 @@
/* eslint-disable node/no-deprecated-api */
var buffer = require('buffer')
var Buffer = buffer.Buffer
// alternative to using Object.keys for old browsers
function copyProps (src, dst) {
for (var key in src) {
dst[key] = src[key]
}
}
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
module.exports = buffer
} else {
// Copy properties from require('buffer')
copyProps(buffer, exports)
exports.Buffer = SafeBuffer
}
function SafeBuffer (arg, encodingOrOffset, length) {
return Buffer(arg, encodingOrOffset, length)
}
// Copy static methods from Buffer
copyProps(Buffer, SafeBuffer)
SafeBuffer.from = function (arg, encodingOrOffset, length) {
if (typeof arg === 'number') {
throw new TypeError('Argument must not be a number')
}
return Buffer(arg, encodingOrOffset, length)
}
SafeBuffer.alloc = function (size, fill, encoding) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
var buf = Buffer(size)
if (fill !== undefined) {
if (typeof encoding === 'string') {
buf.fill(fill, encoding)
} else {
buf.fill(fill)
}
} else {
buf.fill(0)
}
return buf
}
SafeBuffer.allocUnsafe = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return Buffer(size)
}
SafeBuffer.allocUnsafeSlow = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return buffer.SlowBuffer(size)
}

View file

@ -0,0 +1,37 @@
{
"name": "safe-buffer",
"description": "Safer Node.js Buffer API",
"version": "5.1.2",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
"url": "http://feross.org"
},
"bugs": {
"url": "https://github.com/feross/safe-buffer/issues"
},
"devDependencies": {
"standard": "*",
"tape": "^4.0.0"
},
"homepage": "https://github.com/feross/safe-buffer",
"keywords": [
"buffer",
"buffer allocate",
"node security",
"safe",
"safe-buffer",
"security",
"uninitialized"
],
"license": "MIT",
"main": "index.js",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "git://github.com/feross/safe-buffer.git"
},
"scripts": {
"test": "standard && tape test/*.js"
}
}

View file

@ -0,0 +1,296 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// 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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
'use strict';
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
/*</replacement>*/
var isEncoding = Buffer.isEncoding || function (encoding) {
encoding = '' + encoding;
switch (encoding && encoding.toLowerCase()) {
case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
return true;
default:
return false;
}
};
function _normalizeEncoding(enc) {
if (!enc) return 'utf8';
var retried;
while (true) {
switch (enc) {
case 'utf8':
case 'utf-8':
return 'utf8';
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return 'utf16le';
case 'latin1':
case 'binary':
return 'latin1';
case 'base64':
case 'ascii':
case 'hex':
return enc;
default:
if (retried) return; // undefined
enc = ('' + enc).toLowerCase();
retried = true;
}
}
};
// Do not cache `Buffer.isEncoding` when checking encoding names as some
// modules monkey-patch it to support additional encodings
function normalizeEncoding(enc) {
var nenc = _normalizeEncoding(enc);
if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
return nenc || enc;
}
// StringDecoder provides an interface for efficiently splitting a series of
// buffers into a series of JS strings without breaking apart multi-byte
// characters.
exports.StringDecoder = StringDecoder;
function StringDecoder(encoding) {
this.encoding = normalizeEncoding(encoding);
var nb;
switch (this.encoding) {
case 'utf16le':
this.text = utf16Text;
this.end = utf16End;
nb = 4;
break;
case 'utf8':
this.fillLast = utf8FillLast;
nb = 4;
break;
case 'base64':
this.text = base64Text;
this.end = base64End;
nb = 3;
break;
default:
this.write = simpleWrite;
this.end = simpleEnd;
return;
}
this.lastNeed = 0;
this.lastTotal = 0;
this.lastChar = Buffer.allocUnsafe(nb);
}
StringDecoder.prototype.write = function (buf) {
if (buf.length === 0) return '';
var r;
var i;
if (this.lastNeed) {
r = this.fillLast(buf);
if (r === undefined) return '';
i = this.lastNeed;
this.lastNeed = 0;
} else {
i = 0;
}
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
return r || '';
};
StringDecoder.prototype.end = utf8End;
// Returns only complete characters in a Buffer
StringDecoder.prototype.text = utf8Text;
// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
StringDecoder.prototype.fillLast = function (buf) {
if (this.lastNeed <= buf.length) {
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
}
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
this.lastNeed -= buf.length;
};
// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
// continuation byte. If an invalid byte is detected, -2 is returned.
function utf8CheckByte(byte) {
if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
return byte >> 6 === 0x02 ? -1 : -2;
}
// Checks at most 3 bytes at the end of a Buffer in order to detect an
// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
// needed to complete the UTF-8 character (if applicable) are returned.
function utf8CheckIncomplete(self, buf, i) {
var j = buf.length - 1;
if (j < i) return 0;
var nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 1;
return nb;
}
if (--j < i || nb === -2) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 2;
return nb;
}
if (--j < i || nb === -2) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) {
if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
}
return nb;
}
return 0;
}
// Validates as many continuation bytes for a multi-byte UTF-8 character as
// needed or are available. If we see a non-continuation byte where we expect
// one, we "replace" the validated continuation bytes we've seen so far with
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
// behavior. The continuation byte check is included three times in the case
// where all of the continuation bytes for a character exist in the same buffer.
// It is also done this way as a slight performance increase instead of using a
// loop.
function utf8CheckExtraBytes(self, buf, p) {
if ((buf[0] & 0xC0) !== 0x80) {
self.lastNeed = 0;
return '\ufffd';
}
if (self.lastNeed > 1 && buf.length > 1) {
if ((buf[1] & 0xC0) !== 0x80) {
self.lastNeed = 1;
return '\ufffd';
}
if (self.lastNeed > 2 && buf.length > 2) {
if ((buf[2] & 0xC0) !== 0x80) {
self.lastNeed = 2;
return '\ufffd';
}
}
}
}
// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
function utf8FillLast(buf) {
var p = this.lastTotal - this.lastNeed;
var r = utf8CheckExtraBytes(this, buf, p);
if (r !== undefined) return r;
if (this.lastNeed <= buf.length) {
buf.copy(this.lastChar, p, 0, this.lastNeed);
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
}
buf.copy(this.lastChar, p, 0, buf.length);
this.lastNeed -= buf.length;
}
// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
// partial character, the character's bytes are buffered until the required
// number of bytes are available.
function utf8Text(buf, i) {
var total = utf8CheckIncomplete(this, buf, i);
if (!this.lastNeed) return buf.toString('utf8', i);
this.lastTotal = total;
var end = buf.length - (total - this.lastNeed);
buf.copy(this.lastChar, 0, end);
return buf.toString('utf8', i, end);
}
// For UTF-8, a replacement character is added when ending on a partial
// character.
function utf8End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + '\ufffd';
return r;
}
// UTF-16LE typically needs two bytes per character, but even if we have an even
// number of bytes available, we need to check if we end on a leading/high
// surrogate. In that case, we need to wait for the next two bytes in order to
// decode the last character properly.
function utf16Text(buf, i) {
if ((buf.length - i) % 2 === 0) {
var r = buf.toString('utf16le', i);
if (r) {
var c = r.charCodeAt(r.length - 1);
if (c >= 0xD800 && c <= 0xDBFF) {
this.lastNeed = 2;
this.lastTotal = 4;
this.lastChar[0] = buf[buf.length - 2];
this.lastChar[1] = buf[buf.length - 1];
return r.slice(0, -1);
}
}
return r;
}
this.lastNeed = 1;
this.lastTotal = 2;
this.lastChar[0] = buf[buf.length - 1];
return buf.toString('utf16le', i, buf.length - 1);
}
// For UTF-16LE we do not explicitly append special replacement characters if we
// end on a partial character, we simply let v8 handle that.
function utf16End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) {
var end = this.lastTotal - this.lastNeed;
return r + this.lastChar.toString('utf16le', 0, end);
}
return r;
}
function base64Text(buf, i) {
var n = (buf.length - i) % 3;
if (n === 0) return buf.toString('base64', i);
this.lastNeed = 3 - n;
this.lastTotal = 3;
if (n === 1) {
this.lastChar[0] = buf[buf.length - 1];
} else {
this.lastChar[0] = buf[buf.length - 2];
this.lastChar[1] = buf[buf.length - 1];
}
return buf.toString('base64', i, buf.length - n);
}
function base64End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
return r;
}
// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
function simpleWrite(buf) {
return buf.toString(this.encoding);
}
function simpleEnd(buf) {
return buf && buf.length ? this.write(buf) : '';
}

View file

@ -0,0 +1,31 @@
{
"name": "string_decoder",
"version": "1.1.1",
"description": "The string_decoder module from Node core",
"main": "lib/string_decoder.js",
"dependencies": {
"safe-buffer": "~5.1.0"
},
"devDependencies": {
"babel-polyfill": "^6.23.0",
"core-util-is": "^1.0.2",
"inherits": "^2.0.3",
"tap": "~0.4.8"
},
"scripts": {
"test": "tap test/parallel/*.js && node test/verify-dependencies",
"ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js"
},
"repository": {
"type": "git",
"url": "git://github.com/nodejs/string_decoder.git"
},
"homepage": "https://github.com/nodejs/string_decoder",
"keywords": [
"string",
"decoder",
"browser",
"browserify"
],
"license": "MIT"
}

View file

@ -0,0 +1,54 @@
{
"name": "archiver-utils",
"version": "2.1.0",
"license": "MIT",
"description": "utility functions for archiver",
"homepage": "https://github.com/archiverjs/archiver-utils#readme",
"author": {
"name": "Chris Talkington",
"url": "http://christalkington.com/"
},
"repository": {
"type": "git",
"url": "https://github.com/archiverjs/archiver-utils.git"
},
"bugs": {
"url": "https://github.com/archiverjs/archiver-utils/issues"
},
"keywords": [
"archiver",
"utils"
],
"main": "index.js",
"files": [
"index.js",
"file.js"
],
"engines": {
"node": ">= 6"
},
"scripts": {
"test": "mocha --reporter dot"
},
"dependencies": {
"glob": "^7.1.4",
"graceful-fs": "^4.2.0",
"lazystream": "^1.0.0",
"lodash.defaults": "^4.2.0",
"lodash.difference": "^4.5.0",
"lodash.flatten": "^4.4.0",
"lodash.isplainobject": "^4.0.6",
"lodash.union": "^4.6.0",
"normalize-path": "^3.0.0",
"readable-stream": "^2.0.0"
},
"devDependencies": {
"chai": "^4.2.0",
"mkdirp": "^0.5.0",
"mocha": "^5.0.0",
"rimraf": "^2.6.3"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
}
}

84
autotools/dbcompiler/node_modules/archiver/index.js generated vendored Normal file
View file

@ -0,0 +1,84 @@
/**
* Archiver Vending
*
* @ignore
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
* @copyright (c) 2012-2014 Chris Talkington, contributors.
*/
var Archiver = require('./lib/core');
var formats = {};
/**
* Dispenses a new Archiver instance.
*
* @constructor
* @param {String} format The archive format to use.
* @param {Object} options See [Archiver]{@link Archiver}
* @return {Archiver}
*/
var vending = function(format, options) {
return vending.create(format, options);
};
/**
* Creates a new Archiver instance.
*
* @param {String} format The archive format to use.
* @param {Object} options See [Archiver]{@link Archiver}
* @return {Archiver}
*/
vending.create = function(format, options) {
if (formats[format]) {
var instance = new Archiver(format, options);
instance.setFormat(format);
instance.setModule(new formats[format](options));
return instance;
} else {
throw new Error('create(' + format + '): format not registered');
}
};
/**
* Registers a format for use with archiver.
*
* @param {String} format The name of the format.
* @param {Function} module The function for archiver to interact with.
* @return void
*/
vending.registerFormat = function(format, module) {
if (formats[format]) {
throw new Error('register(' + format + '): format already registered');
}
if (typeof module !== 'function') {
throw new Error('register(' + format + '): format module invalid');
}
if (typeof module.prototype.append !== 'function' || typeof module.prototype.finalize !== 'function') {
throw new Error('register(' + format + '): format module missing methods');
}
formats[format] = module;
};
/**
* Check if the format is already registered.
*
* @param {String} format the name of the format.
* @return boolean
*/
vending.isRegisteredFormat = function (format) {
if (formats[format]) {
return true;
}
return false;
};
vending.registerFormat('zip', require('./lib/plugins/zip'));
vending.registerFormat('tar', require('./lib/plugins/tar'));
vending.registerFormat('json', require('./lib/plugins/json'));
module.exports = vending;

974
autotools/dbcompiler/node_modules/archiver/lib/core.js generated vendored Normal file
View file

@ -0,0 +1,974 @@
/**
* Archiver Core
*
* @ignore
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
* @copyright (c) 2012-2014 Chris Talkington, contributors.
*/
var fs = require('fs');
var glob = require('readdir-glob');
var async = require('async');
var path = require('path');
var util = require('archiver-utils');
var inherits = require('util').inherits;
var ArchiverError = require('./error');
var Transform = require('readable-stream').Transform;
var win32 = process.platform === 'win32';
/**
* @constructor
* @param {String} format The archive format to use.
* @param {(CoreOptions|TransformOptions)} options See also {@link ZipOptions} and {@link TarOptions}.
*/
var Archiver = function(format, options) {
if (!(this instanceof Archiver)) {
return new Archiver(format, options);
}
if (typeof format !== 'string') {
options = format;
format = 'zip';
}
options = this.options = util.defaults(options, {
highWaterMark: 1024 * 1024,
statConcurrency: 4
});
Transform.call(this, options);
this._format = false;
this._module = false;
this._pending = 0;
this._pointer = 0;
this._entriesCount = 0;
this._entriesProcessedCount = 0;
this._fsEntriesTotalBytes = 0;
this._fsEntriesProcessedBytes = 0;
this._queue = async.queue(this._onQueueTask.bind(this), 1);
this._queue.drain(this._onQueueDrain.bind(this));
this._statQueue = async.queue(this._onStatQueueTask.bind(this), options.statConcurrency);
this._statQueue.drain(this._onQueueDrain.bind(this));
this._state = {
aborted: false,
finalize: false,
finalizing: false,
finalized: false,
modulePiped: false
};
this._streams = [];
};
inherits(Archiver, Transform);
/**
* Internal logic for `abort`.
*
* @private
* @return void
*/
Archiver.prototype._abort = function() {
this._state.aborted = true;
this._queue.kill();
this._statQueue.kill();
if (this._queue.idle()) {
this._shutdown();
}
};
/**
* Internal helper for appending files.
*
* @private
* @param {String} filepath The source filepath.
* @param {EntryData} data The entry data.
* @return void
*/
Archiver.prototype._append = function(filepath, data) {
data = data || {};
var task = {
source: null,
filepath: filepath
};
if (!data.name) {
data.name = filepath;
}
data.sourcePath = filepath;
task.data = data;
this._entriesCount++;
if (data.stats && data.stats instanceof fs.Stats) {
task = this._updateQueueTaskWithStats(task, data.stats);
if (task) {
if (data.stats.size) {
this._fsEntriesTotalBytes += data.stats.size;
}
this._queue.push(task);
}
} else {
this._statQueue.push(task);
}
};
/**
* Internal logic for `finalize`.
*
* @private
* @return void
*/
Archiver.prototype._finalize = function() {
if (this._state.finalizing || this._state.finalized || this._state.aborted) {
return;
}
this._state.finalizing = true;
this._moduleFinalize();
this._state.finalizing = false;
this._state.finalized = true;
};
/**
* Checks the various state variables to determine if we can `finalize`.
*
* @private
* @return {Boolean}
*/
Archiver.prototype._maybeFinalize = function() {
if (this._state.finalizing || this._state.finalized || this._state.aborted) {
return false;
}
if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {
this._finalize();
return true;
}
return false;
};
/**
* Appends an entry to the module.
*
* @private
* @fires Archiver#entry
* @param {(Buffer|Stream)} source
* @param {EntryData} data
* @param {Function} callback
* @return void
*/
Archiver.prototype._moduleAppend = function(source, data, callback) {
if (this._state.aborted) {
callback();
return;
}
this._module.append(source, data, function(err) {
this._task = null;
if (this._state.aborted) {
this._shutdown();
return;
}
if (err) {
this.emit('error', err);
setImmediate(callback);
return;
}
/**
* Fires when the entry's input has been processed and appended to the archive.
*
* @event Archiver#entry
* @type {EntryData}
*/
this.emit('entry', data);
this._entriesProcessedCount++;
if (data.stats && data.stats.size) {
this._fsEntriesProcessedBytes += data.stats.size;
}
/**
* @event Archiver#progress
* @type {ProgressData}
*/
this.emit('progress', {
entries: {
total: this._entriesCount,
processed: this._entriesProcessedCount
},
fs: {
totalBytes: this._fsEntriesTotalBytes,
processedBytes: this._fsEntriesProcessedBytes
}
});
setImmediate(callback);
}.bind(this));
};
/**
* Finalizes the module.
*
* @private
* @return void
*/
Archiver.prototype._moduleFinalize = function() {
if (typeof this._module.finalize === 'function') {
this._module.finalize();
} else if (typeof this._module.end === 'function') {
this._module.end();
} else {
this.emit('error', new ArchiverError('NOENDMETHOD'));
}
};
/**
* Pipes the module to our internal stream with error bubbling.
*
* @private
* @return void
*/
Archiver.prototype._modulePipe = function() {
this._module.on('error', this._onModuleError.bind(this));
this._module.pipe(this);
this._state.modulePiped = true;
};
/**
* Determines if the current module supports a defined feature.
*
* @private
* @param {String} key
* @return {Boolean}
*/
Archiver.prototype._moduleSupports = function(key) {
if (!this._module.supports || !this._module.supports[key]) {
return false;
}
return this._module.supports[key];
};
/**
* Unpipes the module from our internal stream.
*
* @private
* @return void
*/
Archiver.prototype._moduleUnpipe = function() {
this._module.unpipe(this);
this._state.modulePiped = false;
};
/**
* Normalizes entry data with fallbacks for key properties.
*
* @private
* @param {Object} data
* @param {fs.Stats} stats
* @return {Object}
*/
Archiver.prototype._normalizeEntryData = function(data, stats) {
data = util.defaults(data, {
type: 'file',
name: null,
date: null,
mode: null,
prefix: null,
sourcePath: null,
stats: false
});
if (stats && data.stats === false) {
data.stats = stats;
}
var isDir = data.type === 'directory';
if (data.name) {
if (typeof data.prefix === 'string' && '' !== data.prefix) {
data.name = data.prefix + '/' + data.name;
data.prefix = null;
}
data.name = util.sanitizePath(data.name);
if (data.type !== 'symlink' && data.name.slice(-1) === '/') {
isDir = true;
data.type = 'directory';
} else if (isDir) {
data.name += '/';
}
}
// 511 === 0777; 493 === 0755; 438 === 0666; 420 === 0644
if (typeof data.mode === 'number') {
if (win32) {
data.mode &= 511;
} else {
data.mode &= 4095
}
} else if (data.stats && data.mode === null) {
if (win32) {
data.mode = data.stats.mode & 511;
} else {
data.mode = data.stats.mode & 4095;
}
// stat isn't reliable on windows; force 0755 for dir
if (win32 && isDir) {
data.mode = 493;
}
} else if (data.mode === null) {
data.mode = isDir ? 493 : 420;
}
if (data.stats && data.date === null) {
data.date = data.stats.mtime;
} else {
data.date = util.dateify(data.date);
}
return data;
};
/**
* Error listener that re-emits error on to our internal stream.
*
* @private
* @param {Error} err
* @return void
*/
Archiver.prototype._onModuleError = function(err) {
/**
* @event Archiver#error
* @type {ErrorData}
*/
this.emit('error', err);
};
/**
* Checks the various state variables after queue has drained to determine if
* we need to `finalize`.
*
* @private
* @return void
*/
Archiver.prototype._onQueueDrain = function() {
if (this._state.finalizing || this._state.finalized || this._state.aborted) {
return;
}
if (this._state.finalize && this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {
this._finalize();
}
};
/**
* Appends each queue task to the module.
*
* @private
* @param {Object} task
* @param {Function} callback
* @return void
*/
Archiver.prototype._onQueueTask = function(task, callback) {
var fullCallback = () => {
if(task.data.callback) {
task.data.callback();
}
callback();
}
if (this._state.finalizing || this._state.finalized || this._state.aborted) {
fullCallback();
return;
}
this._task = task;
this._moduleAppend(task.source, task.data, fullCallback);
};
/**
* Performs a file stat and reinjects the task back into the queue.
*
* @private
* @param {Object} task
* @param {Function} callback
* @return void
*/
Archiver.prototype._onStatQueueTask = function(task, callback) {
if (this._state.finalizing || this._state.finalized || this._state.aborted) {
callback();
return;
}
fs.lstat(task.filepath, function(err, stats) {
if (this._state.aborted) {
setImmediate(callback);
return;
}
if (err) {
this._entriesCount--;
/**
* @event Archiver#warning
* @type {ErrorData}
*/
this.emit('warning', err);
setImmediate(callback);
return;
}
task = this._updateQueueTaskWithStats(task, stats);
if (task) {
if (stats.size) {
this._fsEntriesTotalBytes += stats.size;
}
this._queue.push(task);
}
setImmediate(callback);
}.bind(this));
};
/**
* Unpipes the module and ends our internal stream.
*
* @private
* @return void
*/
Archiver.prototype._shutdown = function() {
this._moduleUnpipe();
this.end();
};
/**
* Tracks the bytes emitted by our internal stream.
*
* @private
* @param {Buffer} chunk
* @param {String} encoding
* @param {Function} callback
* @return void
*/
Archiver.prototype._transform = function(chunk, encoding, callback) {
if (chunk) {
this._pointer += chunk.length;
}
callback(null, chunk);
};
/**
* Updates and normalizes a queue task using stats data.
*
* @private
* @param {Object} task
* @param {fs.Stats} stats
* @return {Object}
*/
Archiver.prototype._updateQueueTaskWithStats = function(task, stats) {
if (stats.isFile()) {
task.data.type = 'file';
task.data.sourceType = 'stream';
task.source = util.lazyReadStream(task.filepath);
} else if (stats.isDirectory() && this._moduleSupports('directory')) {
task.data.name = util.trailingSlashIt(task.data.name);
task.data.type = 'directory';
task.data.sourcePath = util.trailingSlashIt(task.filepath);
task.data.sourceType = 'buffer';
task.source = Buffer.concat([]);
} else if (stats.isSymbolicLink() && this._moduleSupports('symlink')) {
var linkPath = fs.readlinkSync(task.filepath);
var dirName = path.dirname(task.filepath);
task.data.type = 'symlink';
task.data.linkname = path.relative(dirName, path.resolve(dirName, linkPath));
task.data.sourceType = 'buffer';
task.source = Buffer.concat([]);
} else {
if (stats.isDirectory()) {
this.emit('warning', new ArchiverError('DIRECTORYNOTSUPPORTED', task.data));
} else if (stats.isSymbolicLink()) {
this.emit('warning', new ArchiverError('SYMLINKNOTSUPPORTED', task.data));
} else {
this.emit('warning', new ArchiverError('ENTRYNOTSUPPORTED', task.data));
}
return null;
}
task.data = this._normalizeEntryData(task.data, stats);
return task;
};
/**
* Aborts the archiving process, taking a best-effort approach, by:
*
* - removing any pending queue tasks
* - allowing any active queue workers to finish
* - detaching internal module pipes
* - ending both sides of the Transform stream
*
* It will NOT drain any remaining sources.
*
* @return {this}
*/
Archiver.prototype.abort = function() {
if (this._state.aborted || this._state.finalized) {
return this;
}
this._abort();
return this;
};
/**
* Appends an input source (text string, buffer, or stream) to the instance.
*
* When the instance has received, processed, and emitted the input, the `entry`
* event is fired.
*
* @fires Archiver#entry
* @param {(Buffer|Stream|String)} source The input source.
* @param {EntryData} data See also {@link ZipEntryData} and {@link TarEntryData}.
* @return {this}
*/
Archiver.prototype.append = function(source, data) {
if (this._state.finalize || this._state.aborted) {
this.emit('error', new ArchiverError('QUEUECLOSED'));
return this;
}
data = this._normalizeEntryData(data);
if (typeof data.name !== 'string' || data.name.length === 0) {
this.emit('error', new ArchiverError('ENTRYNAMEREQUIRED'));
return this;
}
if (data.type === 'directory' && !this._moduleSupports('directory')) {
this.emit('error', new ArchiverError('DIRECTORYNOTSUPPORTED', { name: data.name }));
return this;
}
source = util.normalizeInputSource(source);
if (Buffer.isBuffer(source)) {
data.sourceType = 'buffer';
} else if (util.isStream(source)) {
data.sourceType = 'stream';
} else {
this.emit('error', new ArchiverError('INPUTSTEAMBUFFERREQUIRED', { name: data.name }));
return this;
}
this._entriesCount++;
this._queue.push({
data: data,
source: source
});
return this;
};
/**
* Appends a directory and its files, recursively, given its dirpath.
*
* @param {String} dirpath The source directory path.
* @param {String} destpath The destination path within the archive.
* @param {(EntryData|Function)} data See also [ZipEntryData]{@link ZipEntryData} and
* [TarEntryData]{@link TarEntryData}.
* @return {this}
*/
Archiver.prototype.directory = function(dirpath, destpath, data) {
if (this._state.finalize || this._state.aborted) {
this.emit('error', new ArchiverError('QUEUECLOSED'));
return this;
}
if (typeof dirpath !== 'string' || dirpath.length === 0) {
this.emit('error', new ArchiverError('DIRECTORYDIRPATHREQUIRED'));
return this;
}
this._pending++;
if (destpath === false) {
destpath = '';
} else if (typeof destpath !== 'string'){
destpath = dirpath;
}
var dataFunction = false;
if (typeof data === 'function') {
dataFunction = data;
data = {};
} else if (typeof data !== 'object') {
data = {};
}
var globOptions = {
stat: true,
dot: true
};
function onGlobEnd() {
this._pending--;
this._maybeFinalize();
}
function onGlobError(err) {
this.emit('error', err);
}
function onGlobMatch(match){
globber.pause();
var ignoreMatch = false;
var entryData = Object.assign({}, data);
entryData.name = match.relative;
entryData.prefix = destpath;
entryData.stats = match.stat;
entryData.callback = globber.resume.bind(globber);
try {
if (dataFunction) {
entryData = dataFunction(entryData);
if (entryData === false) {
ignoreMatch = true;
} else if (typeof entryData !== 'object') {
throw new ArchiverError('DIRECTORYFUNCTIONINVALIDDATA', { dirpath: dirpath });
}
}
} catch(e) {
this.emit('error', e);
return;
}
if (ignoreMatch) {
globber.resume();
return;
}
this._append(match.absolute, entryData);
}
var globber = glob(dirpath, globOptions);
globber.on('error', onGlobError.bind(this));
globber.on('match', onGlobMatch.bind(this));
globber.on('end', onGlobEnd.bind(this));
return this;
};
/**
* Appends a file given its filepath using a
* [lazystream]{@link https://github.com/jpommerening/node-lazystream} wrapper to
* prevent issues with open file limits.
*
* When the instance has received, processed, and emitted the file, the `entry`
* event is fired.
*
* @param {String} filepath The source filepath.
* @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and
* [TarEntryData]{@link TarEntryData}.
* @return {this}
*/
Archiver.prototype.file = function(filepath, data) {
if (this._state.finalize || this._state.aborted) {
this.emit('error', new ArchiverError('QUEUECLOSED'));
return this;
}
if (typeof filepath !== 'string' || filepath.length === 0) {
this.emit('error', new ArchiverError('FILEFILEPATHREQUIRED'));
return this;
}
this._append(filepath, data);
return this;
};
/**
* Appends multiple files that match a glob pattern.
*
* @param {String} pattern The [glob pattern]{@link https://github.com/isaacs/minimatch} to match.
* @param {Object} options See [node-readdir-glob]{@link https://github.com/yqnn/node-readdir-glob#options}.
* @param {EntryData} data See also [ZipEntryData]{@link ZipEntryData} and
* [TarEntryData]{@link TarEntryData}.
* @return {this}
*/
Archiver.prototype.glob = function(pattern, options, data) {
this._pending++;
options = util.defaults(options, {
stat: true,
pattern: pattern
});
function onGlobEnd() {
this._pending--;
this._maybeFinalize();
}
function onGlobError(err) {
this.emit('error', err);
}
function onGlobMatch(match){
globber.pause();
var entryData = Object.assign({}, data);
entryData.callback = globber.resume.bind(globber);
entryData.stats = match.stat;
entryData.name = match.relative;
this._append(match.absolute, entryData);
}
var globber = glob(options.cwd || '.', options);
globber.on('error', onGlobError.bind(this));
globber.on('match', onGlobMatch.bind(this));
globber.on('end', onGlobEnd.bind(this));
return this;
};
/**
* Finalizes the instance and prevents further appending to the archive
* structure (queue will continue til drained).
*
* The `end`, `close` or `finish` events on the destination stream may fire
* right after calling this method so you should set listeners beforehand to
* properly detect stream completion.
*
* @return {Promise}
*/
Archiver.prototype.finalize = function() {
if (this._state.aborted) {
var abortedError = new ArchiverError('ABORTED');
this.emit('error', abortedError);
return Promise.reject(abortedError);
}
if (this._state.finalize) {
var finalizingError = new ArchiverError('FINALIZING');
this.emit('error', finalizingError);
return Promise.reject(finalizingError);
}
this._state.finalize = true;
if (this._pending === 0 && this._queue.idle() && this._statQueue.idle()) {
this._finalize();
}
var self = this;
return new Promise(function(resolve, reject) {
var errored;
self._module.on('end', function() {
if (!errored) {
resolve();
}
})
self._module.on('error', function(err) {
errored = true;
reject(err);
})
})
};
/**
* Sets the module format name used for archiving.
*
* @param {String} format The name of the format.
* @return {this}
*/
Archiver.prototype.setFormat = function(format) {
if (this._format) {
this.emit('error', new ArchiverError('FORMATSET'));
return this;
}
this._format = format;
return this;
};
/**
* Sets the module used for archiving.
*
* @param {Function} module The function for archiver to interact with.
* @return {this}
*/
Archiver.prototype.setModule = function(module) {
if (this._state.aborted) {
this.emit('error', new ArchiverError('ABORTED'));
return this;
}
if (this._state.module) {
this.emit('error', new ArchiverError('MODULESET'));
return this;
}
this._module = module;
this._modulePipe();
return this;
};
/**
* Appends a symlink to the instance.
*
* This does NOT interact with filesystem and is used for programmatically creating symlinks.
*
* @param {String} filepath The symlink path (within archive).
* @param {String} target The target path (within archive).
* @param {Number} mode Sets the entry permissions.
* @return {this}
*/
Archiver.prototype.symlink = function(filepath, target, mode) {
if (this._state.finalize || this._state.aborted) {
this.emit('error', new ArchiverError('QUEUECLOSED'));
return this;
}
if (typeof filepath !== 'string' || filepath.length === 0) {
this.emit('error', new ArchiverError('SYMLINKFILEPATHREQUIRED'));
return this;
}
if (typeof target !== 'string' || target.length === 0) {
this.emit('error', new ArchiverError('SYMLINKTARGETREQUIRED', { filepath: filepath }));
return this;
}
if (!this._moduleSupports('symlink')) {
this.emit('error', new ArchiverError('SYMLINKNOTSUPPORTED', { filepath: filepath }));
return this;
}
var data = {};
data.type = 'symlink';
data.name = filepath.replace(/\\/g, '/');
data.linkname = target.replace(/\\/g, '/');
data.sourceType = 'buffer';
if (typeof mode === "number") {
data.mode = mode;
}
this._entriesCount++;
this._queue.push({
data: data,
source: Buffer.concat([])
});
return this;
};
/**
* Returns the current length (in bytes) that has been emitted.
*
* @return {Number}
*/
Archiver.prototype.pointer = function() {
return this._pointer;
};
/**
* Middleware-like helper that has yet to be fully implemented.
*
* @private
* @param {Function} plugin
* @return {this}
*/
Archiver.prototype.use = function(plugin) {
this._streams.push(plugin);
return this;
};
module.exports = Archiver;
/**
* @typedef {Object} CoreOptions
* @global
* @property {Number} [statConcurrency=4] Sets the number of workers used to
* process the internal fs stat queue.
*/
/**
* @typedef {Object} TransformOptions
* @property {Boolean} [allowHalfOpen=true] If set to false, then the stream
* will automatically end the readable side when the writable side ends and vice
* versa.
* @property {Boolean} [readableObjectMode=false] Sets objectMode for readable
* side of the stream. Has no effect if objectMode is true.
* @property {Boolean} [writableObjectMode=false] Sets objectMode for writable
* side of the stream. Has no effect if objectMode is true.
* @property {Boolean} [decodeStrings=true] Whether or not to decode strings
* into Buffers before passing them to _write(). `Writable`
* @property {String} [encoding=NULL] If specified, then buffers will be decoded
* to strings using the specified encoding. `Readable`
* @property {Number} [highWaterMark=16kb] The maximum number of bytes to store
* in the internal buffer before ceasing to read from the underlying resource.
* `Readable` `Writable`
* @property {Boolean} [objectMode=false] Whether this stream should behave as a
* stream of objects. Meaning that stream.read(n) returns a single value instead
* of a Buffer of size n. `Readable` `Writable`
*/
/**
* @typedef {Object} EntryData
* @property {String} name Sets the entry name including internal path.
* @property {(String|Date)} [date=NOW()] Sets the entry date.
* @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
* @property {String} [prefix] Sets a path prefix for the entry name. Useful
* when working with methods like `directory` or `glob`.
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
* for reduction of fs stat calls when stat data is already known.
*/
/**
* @typedef {Object} ErrorData
* @property {String} message The message of the error.
* @property {String} code The error code assigned to this error.
* @property {String} data Additional data provided for reporting or debugging (where available).
*/
/**
* @typedef {Object} ProgressData
* @property {Object} entries
* @property {Number} entries.total Number of entries that have been appended.
* @property {Number} entries.processed Number of entries that have been processed.
* @property {Object} fs
* @property {Number} fs.totalBytes Number of bytes that have been appended. Calculated asynchronously and might not be accurate: it growth while entries are added. (based on fs.Stats)
* @property {Number} fs.processedBytes Number of bytes that have been processed. (based on fs.Stats)
*/

View file

@ -0,0 +1,40 @@
/**
* Archiver Core
*
* @ignore
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
* @copyright (c) 2012-2014 Chris Talkington, contributors.
*/
var util = require('util');
const ERROR_CODES = {
'ABORTED': 'archive was aborted',
'DIRECTORYDIRPATHREQUIRED': 'diretory dirpath argument must be a non-empty string value',
'DIRECTORYFUNCTIONINVALIDDATA': 'invalid data returned by directory custom data function',
'ENTRYNAMEREQUIRED': 'entry name must be a non-empty string value',
'FILEFILEPATHREQUIRED': 'file filepath argument must be a non-empty string value',
'FINALIZING': 'archive already finalizing',
'QUEUECLOSED': 'queue closed',
'NOENDMETHOD': 'no suitable finalize/end method defined by module',
'DIRECTORYNOTSUPPORTED': 'support for directory entries not defined by module',
'FORMATSET': 'archive format already set',
'INPUTSTEAMBUFFERREQUIRED': 'input source must be valid Stream or Buffer instance',
'MODULESET': 'module already set',
'SYMLINKNOTSUPPORTED': 'support for symlink entries not defined by module',
'SYMLINKFILEPATHREQUIRED': 'symlink filepath argument must be a non-empty string value',
'SYMLINKTARGETREQUIRED': 'symlink target argument must be a non-empty string value',
'ENTRYNOTSUPPORTED': 'entry not supported'
};
function ArchiverError(code, data) {
Error.captureStackTrace(this, this.constructor);
//this.name = this.constructor.name;
this.message = ERROR_CODES[code] || code;
this.code = code;
this.data = data;
}
util.inherits(ArchiverError, Error);
exports = module.exports = ArchiverError;

View file

@ -0,0 +1,110 @@
/**
* JSON Format Plugin
*
* @module plugins/json
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
* @copyright (c) 2012-2014 Chris Talkington, contributors.
*/
var inherits = require('util').inherits;
var Transform = require('readable-stream').Transform;
var crc32 = require('buffer-crc32');
var util = require('archiver-utils');
/**
* @constructor
* @param {(JsonOptions|TransformOptions)} options
*/
var Json = function(options) {
if (!(this instanceof Json)) {
return new Json(options);
}
options = this.options = util.defaults(options, {});
Transform.call(this, options);
this.supports = {
directory: true,
symlink: true
};
this.files = [];
};
inherits(Json, Transform);
/**
* [_transform description]
*
* @private
* @param {Buffer} chunk
* @param {String} encoding
* @param {Function} callback
* @return void
*/
Json.prototype._transform = function(chunk, encoding, callback) {
callback(null, chunk);
};
/**
* [_writeStringified description]
*
* @private
* @return void
*/
Json.prototype._writeStringified = function() {
var fileString = JSON.stringify(this.files);
this.write(fileString);
};
/**
* [append description]
*
* @param {(Buffer|Stream)} source
* @param {EntryData} data
* @param {Function} callback
* @return void
*/
Json.prototype.append = function(source, data, callback) {
var self = this;
data.crc32 = 0;
function onend(err, sourceBuffer) {
if (err) {
callback(err);
return;
}
data.size = sourceBuffer.length || 0;
data.crc32 = crc32.unsigned(sourceBuffer);
self.files.push(data);
callback(null, data);
}
if (data.sourceType === 'buffer') {
onend(null, source);
} else if (data.sourceType === 'stream') {
util.collectStream(source, onend);
}
};
/**
* [finalize description]
*
* @return void
*/
Json.prototype.finalize = function() {
this._writeStringified();
this.end();
};
module.exports = Json;
/**
* @typedef {Object} JsonOptions
* @global
*/

View file

@ -0,0 +1,167 @@
/**
* TAR Format Plugin
*
* @module plugins/tar
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
* @copyright (c) 2012-2014 Chris Talkington, contributors.
*/
var zlib = require('zlib');
var engine = require('tar-stream');
var util = require('archiver-utils');
/**
* @constructor
* @param {TarOptions} options
*/
var Tar = function(options) {
if (!(this instanceof Tar)) {
return new Tar(options);
}
options = this.options = util.defaults(options, {
gzip: false
});
if (typeof options.gzipOptions !== 'object') {
options.gzipOptions = {};
}
this.supports = {
directory: true,
symlink: true
};
this.engine = engine.pack(options);
this.compressor = false;
if (options.gzip) {
this.compressor = zlib.createGzip(options.gzipOptions);
this.compressor.on('error', this._onCompressorError.bind(this));
}
};
/**
* [_onCompressorError description]
*
* @private
* @param {Error} err
* @return void
*/
Tar.prototype._onCompressorError = function(err) {
this.engine.emit('error', err);
};
/**
* [append description]
*
* @param {(Buffer|Stream)} source
* @param {TarEntryData} data
* @param {Function} callback
* @return void
*/
Tar.prototype.append = function(source, data, callback) {
var self = this;
data.mtime = data.date;
function append(err, sourceBuffer) {
if (err) {
callback(err);
return;
}
self.engine.entry(data, sourceBuffer, function(err) {
callback(err, data);
});
}
if (data.sourceType === 'buffer') {
append(null, source);
} else if (data.sourceType === 'stream' && data.stats) {
data.size = data.stats.size;
var entry = self.engine.entry(data, function(err) {
callback(err, data);
});
source.pipe(entry);
} else if (data.sourceType === 'stream') {
util.collectStream(source, append);
}
};
/**
* [finalize description]
*
* @return void
*/
Tar.prototype.finalize = function() {
this.engine.finalize();
};
/**
* [on description]
*
* @return this.engine
*/
Tar.prototype.on = function() {
return this.engine.on.apply(this.engine, arguments);
};
/**
* [pipe description]
*
* @param {String} destination
* @param {Object} options
* @return this.engine
*/
Tar.prototype.pipe = function(destination, options) {
if (this.compressor) {
return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options);
} else {
return this.engine.pipe.apply(this.engine, arguments);
}
};
/**
* [unpipe description]
*
* @return this.engine
*/
Tar.prototype.unpipe = function() {
if (this.compressor) {
return this.compressor.unpipe.apply(this.compressor, arguments);
} else {
return this.engine.unpipe.apply(this.engine, arguments);
}
};
module.exports = Tar;
/**
* @typedef {Object} TarOptions
* @global
* @property {Boolean} [gzip=false] Compress the tar archive using gzip.
* @property {Object} [gzipOptions] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
* to control compression.
* @property {*} [*] See [tar-stream]{@link https://github.com/mafintosh/tar-stream} documentation for additional properties.
*/
/**
* @typedef {Object} TarEntryData
* @global
* @property {String} name Sets the entry name including internal path.
* @property {(String|Date)} [date=NOW()] Sets the entry date.
* @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
* @property {String} [prefix] Sets a path prefix for the entry name. Useful
* when working with methods like `directory` or `glob`.
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
* for reduction of fs stat calls when stat data is already known.
*/
/**
* TarStream Module
* @external TarStream
* @see {@link https://github.com/mafintosh/tar-stream}
*/

View file

@ -0,0 +1,120 @@
/**
* ZIP Format Plugin
*
* @module plugins/zip
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
* @copyright (c) 2012-2014 Chris Talkington, contributors.
*/
var engine = require('zip-stream');
var util = require('archiver-utils');
/**
* @constructor
* @param {ZipOptions} [options]
* @param {String} [options.comment] Sets the zip archive comment.
* @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
* @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.
* @param {Boolean} [options.namePrependSlash=false] Prepends a forward slash to archive file paths.
* @param {Boolean} [options.store=false] Sets the compression method to STORE.
* @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
*/
var Zip = function(options) {
if (!(this instanceof Zip)) {
return new Zip(options);
}
options = this.options = util.defaults(options, {
comment: '',
forceUTC: false,
namePrependSlash: false,
store: false
});
this.supports = {
directory: true,
symlink: true
};
this.engine = new engine(options);
};
/**
* @param {(Buffer|Stream)} source
* @param {ZipEntryData} data
* @param {String} data.name Sets the entry name including internal path.
* @param {(String|Date)} [data.date=NOW()] Sets the entry date.
* @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions.
* @param {String} [data.prefix] Sets a path prefix for the entry name. Useful
* when working with methods like `directory` or `glob`.
* @param {fs.Stats} [data.stats] Sets the fs stat data for this entry allowing
* for reduction of fs stat calls when stat data is already known.
* @param {Boolean} [data.store=ZipOptions.store] Sets the compression method to STORE.
* @param {Function} callback
* @return void
*/
Zip.prototype.append = function(source, data, callback) {
this.engine.entry(source, data, callback);
};
/**
* @return void
*/
Zip.prototype.finalize = function() {
this.engine.finalize();
};
/**
* @return this.engine
*/
Zip.prototype.on = function() {
return this.engine.on.apply(this.engine, arguments);
};
/**
* @return this.engine
*/
Zip.prototype.pipe = function() {
return this.engine.pipe.apply(this.engine, arguments);
};
/**
* @return this.engine
*/
Zip.prototype.unpipe = function() {
return this.engine.unpipe.apply(this.engine, arguments);
};
module.exports = Zip;
/**
* @typedef {Object} ZipOptions
* @global
* @property {String} [comment] Sets the zip archive comment.
* @property {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
* @property {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers.
* @prpperty {Boolean} [namePrependSlash=false] Prepends a forward slash to archive file paths.
* @property {Boolean} [store=false] Sets the compression method to STORE.
* @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
* to control compression.
* @property {*} [*] See [zip-stream]{@link https://archiverjs.com/zip-stream/ZipStream.html} documentation for current list of properties.
*/
/**
* @typedef {Object} ZipEntryData
* @global
* @property {String} name Sets the entry name including internal path.
* @property {(String|Date)} [date=NOW()] Sets the entry date.
* @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
* @property {Boolean} [namePrependSlash=ZipOptions.namePrependSlash] Prepends a forward slash to archive file paths.
* @property {String} [prefix] Sets a path prefix for the entry name. Useful
* when working with methods like `directory` or `glob`.
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
* for reduction of fs stat calls when stat data is already known.
* @property {Boolean} [store=ZipOptions.store] Sets the compression method to STORE.
*/
/**
* ZipStream Module
* @external ZipStream
* @see {@link https://www.archiverjs.com/zip-stream/ZipStream.html}
*/

View file

@ -0,0 +1,60 @@
{
"name": "archiver",
"version": "5.3.2",
"description": "a streaming interface for archive generation",
"homepage": "https://github.com/archiverjs/node-archiver",
"author": {
"name": "Chris Talkington",
"url": "http://christalkington.com/"
},
"repository": {
"type": "git",
"url": "https://github.com/archiverjs/node-archiver.git"
},
"bugs": {
"url": "https://github.com/archiverjs/node-archiver/issues"
},
"license": "MIT",
"main": "index.js",
"files": [
"index.js",
"lib"
],
"engines": {
"node": ">= 10"
},
"scripts": {
"test": "mocha --reporter dot",
"bench": "node benchmark/simple/pack-zip.js"
},
"dependencies": {
"archiver-utils": "^2.1.0",
"async": "^3.2.4",
"buffer-crc32": "^0.2.1",
"readable-stream": "^3.6.0",
"readdir-glob": "^1.1.2",
"tar-stream": "^2.2.0",
"zip-stream": "^4.1.0"
},
"devDependencies": {
"archiver-jsdoc-theme": "^1.1.3",
"chai": "^4.3.7",
"jsdoc": "^3.6.4",
"mkdirp": "^2.1.5",
"mocha": "^9.0.2",
"rimraf": "^4.3.1",
"stream-bench": "^0.1.2",
"tar": "^6.1.13",
"yauzl": "^2.9.0"
},
"keywords": [
"archive",
"archiver",
"stream",
"zip",
"tar"
],
"publishConfig": {
"registry": "https://registry.npmjs.org/"
}
}

119
autotools/dbcompiler/node_modules/async/all.js generated vendored Normal file
View file

@ -0,0 +1,119 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createTester = require('./internal/createTester.js');
var _createTester2 = _interopRequireDefault(_createTester);
var _eachOf = require('./eachOf.js');
var _eachOf2 = _interopRequireDefault(_eachOf);
var _awaitify = require('./internal/awaitify.js');
var _awaitify2 = _interopRequireDefault(_awaitify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Returns `true` if every element in `coll` satisfies an async test. If any
* iteratee call returns `false`, the main `callback` is immediately called.
*
* @name every
* @static
* @memberOf module:Collections
* @method
* @alias all
* @category Collection
* @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
* in the collection in parallel.
* The iteratee must complete with a boolean result value.
* Invoked with (item, callback).
* @param {Function} [callback] - A callback which is called after all the
* `iteratee` functions have finished. Result will be either `true` or `false`
* depending on the values of the async tests. Invoked with (err, result).
* @returns {Promise} a promise, if no callback provided
* @example
*
* // dir1 is a directory that contains file1.txt, file2.txt
* // dir2 is a directory that contains file3.txt, file4.txt
* // dir3 is a directory that contains file5.txt
* // dir4 does not exist
*
* const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt'];
* const withMissingFileList = ['file1.txt','file2.txt','file4.txt'];
*
* // asynchronous function that checks if a file exists
* function fileExists(file, callback) {
* fs.access(file, fs.constants.F_OK, (err) => {
* callback(null, !err);
* });
* }
*
* // Using callbacks
* async.every(fileList, fileExists, function(err, result) {
* console.log(result);
* // true
* // result is true since every file exists
* });
*
* async.every(withMissingFileList, fileExists, function(err, result) {
* console.log(result);
* // false
* // result is false since NOT every file exists
* });
*
* // Using Promises
* async.every(fileList, fileExists)
* .then( result => {
* console.log(result);
* // true
* // result is true since every file exists
* }).catch( err => {
* console.log(err);
* });
*
* async.every(withMissingFileList, fileExists)
* .then( result => {
* console.log(result);
* // false
* // result is false since NOT every file exists
* }).catch( err => {
* console.log(err);
* });
*
* // Using async/await
* async () => {
* try {
* let result = await async.every(fileList, fileExists);
* console.log(result);
* // true
* // result is true since every file exists
* }
* catch (err) {
* console.log(err);
* }
* }
*
* async () => {
* try {
* let result = await async.every(withMissingFileList, fileExists);
* console.log(result);
* // false
* // result is false since NOT every file exists
* }
* catch (err) {
* console.log(err);
* }
* }
*
*/
function every(coll, iteratee, callback) {
return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOf2.default, coll, iteratee, callback);
}
exports.default = (0, _awaitify2.default)(every, 3);
module.exports = exports.default;

46
autotools/dbcompiler/node_modules/async/allLimit.js generated vendored Normal file
View file

@ -0,0 +1,46 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createTester = require('./internal/createTester.js');
var _createTester2 = _interopRequireDefault(_createTester);
var _eachOfLimit = require('./internal/eachOfLimit.js');
var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
var _awaitify = require('./internal/awaitify.js');
var _awaitify2 = _interopRequireDefault(_awaitify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
*
* @name everyLimit
* @static
* @memberOf module:Collections
* @method
* @see [async.every]{@link module:Collections.every}
* @alias allLimit
* @category Collection
* @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
* in the collection in parallel.
* The iteratee must complete with a boolean result value.
* Invoked with (item, callback).
* @param {Function} [callback] - A callback which is called after all the
* `iteratee` functions have finished. Result will be either `true` or `false`
* depending on the values of the async tests. Invoked with (err, result).
* @returns {Promise} a promise, if no callback provided
*/
function everyLimit(coll, limit, iteratee, callback) {
return (0, _createTester2.default)(bool => !bool, res => !res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback);
}
exports.default = (0, _awaitify2.default)(everyLimit, 4);
module.exports = exports.default;

45
autotools/dbcompiler/node_modules/async/allSeries.js generated vendored Normal file
View file

@ -0,0 +1,45 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createTester = require('./internal/createTester.js');
var _createTester2 = _interopRequireDefault(_createTester);
var _eachOfSeries = require('./eachOfSeries.js');
var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
var _awaitify = require('./internal/awaitify.js');
var _awaitify2 = _interopRequireDefault(_awaitify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.
*
* @name everySeries
* @static
* @memberOf module:Collections
* @method
* @see [async.every]{@link module:Collections.every}
* @alias allSeries
* @category Collection
* @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
* in the collection in series.
* The iteratee must complete with a boolean result value.
* Invoked with (item, callback).
* @param {Function} [callback] - A callback which is called after all the
* `iteratee` functions have finished. Result will be either `true` or `false`
* depending on the values of the async tests. Invoked with (err, result).
* @returns {Promise} a promise, if no callback provided
*/
function everySeries(coll, iteratee, callback) {
return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOfSeries2.default, coll, iteratee, callback);
}
exports.default = (0, _awaitify2.default)(everySeries, 3);
module.exports = exports.default;

122
autotools/dbcompiler/node_modules/async/any.js generated vendored Normal file
View file

@ -0,0 +1,122 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createTester = require('./internal/createTester.js');
var _createTester2 = _interopRequireDefault(_createTester);
var _eachOf = require('./eachOf.js');
var _eachOf2 = _interopRequireDefault(_eachOf);
var _awaitify = require('./internal/awaitify.js');
var _awaitify2 = _interopRequireDefault(_awaitify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Returns `true` if at least one element in the `coll` satisfies an async test.
* If any iteratee call returns `true`, the main `callback` is immediately
* called.
*
* @name some
* @static
* @memberOf module:Collections
* @method
* @alias any
* @category Collection
* @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
* in the collections in parallel.
* The iteratee should complete with a boolean `result` value.
* Invoked with (item, callback).
* @param {Function} [callback] - A callback which is called as soon as any
* iteratee returns `true`, or after all the iteratee functions have finished.
* Result will be either `true` or `false` depending on the values of the async
* tests. Invoked with (err, result).
* @returns {Promise} a promise, if no callback provided
* @example
*
* // dir1 is a directory that contains file1.txt, file2.txt
* // dir2 is a directory that contains file3.txt, file4.txt
* // dir3 is a directory that contains file5.txt
* // dir4 does not exist
*
* // asynchronous function that checks if a file exists
* function fileExists(file, callback) {
* fs.access(file, fs.constants.F_OK, (err) => {
* callback(null, !err);
* });
* }
*
* // Using callbacks
* async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists,
* function(err, result) {
* console.log(result);
* // true
* // result is true since some file in the list exists
* }
*);
*
* async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists,
* function(err, result) {
* console.log(result);
* // false
* // result is false since none of the files exists
* }
*);
*
* // Using Promises
* async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists)
* .then( result => {
* console.log(result);
* // true
* // result is true since some file in the list exists
* }).catch( err => {
* console.log(err);
* });
*
* async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists)
* .then( result => {
* console.log(result);
* // false
* // result is false since none of the files exists
* }).catch( err => {
* console.log(err);
* });
*
* // Using async/await
* async () => {
* try {
* let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists);
* console.log(result);
* // true
* // result is true since some file in the list exists
* }
* catch (err) {
* console.log(err);
* }
* }
*
* async () => {
* try {
* let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists);
* console.log(result);
* // false
* // result is false since none of the files exists
* }
* catch (err) {
* console.log(err);
* }
* }
*
*/
function some(coll, iteratee, callback) {
return (0, _createTester2.default)(Boolean, res => res)(_eachOf2.default, coll, iteratee, callback);
}
exports.default = (0, _awaitify2.default)(some, 3);
module.exports = exports.default;

47
autotools/dbcompiler/node_modules/async/anyLimit.js generated vendored Normal file
View file

@ -0,0 +1,47 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createTester = require('./internal/createTester.js');
var _createTester2 = _interopRequireDefault(_createTester);
var _eachOfLimit = require('./internal/eachOfLimit.js');
var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
var _awaitify = require('./internal/awaitify.js');
var _awaitify2 = _interopRequireDefault(_awaitify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.
*
* @name someLimit
* @static
* @memberOf module:Collections
* @method
* @see [async.some]{@link module:Collections.some}
* @alias anyLimit
* @category Collection
* @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
* in the collections in parallel.
* The iteratee should complete with a boolean `result` value.
* Invoked with (item, callback).
* @param {Function} [callback] - A callback which is called as soon as any
* iteratee returns `true`, or after all the iteratee functions have finished.
* Result will be either `true` or `false` depending on the values of the async
* tests. Invoked with (err, result).
* @returns {Promise} a promise, if no callback provided
*/
function someLimit(coll, limit, iteratee, callback) {
return (0, _createTester2.default)(Boolean, res => res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback);
}
exports.default = (0, _awaitify2.default)(someLimit, 4);
module.exports = exports.default;

46
autotools/dbcompiler/node_modules/async/anySeries.js generated vendored Normal file
View file

@ -0,0 +1,46 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createTester = require('./internal/createTester.js');
var _createTester2 = _interopRequireDefault(_createTester);
var _eachOfSeries = require('./eachOfSeries.js');
var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
var _awaitify = require('./internal/awaitify.js');
var _awaitify2 = _interopRequireDefault(_awaitify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.
*
* @name someSeries
* @static
* @memberOf module:Collections
* @method
* @see [async.some]{@link module:Collections.some}
* @alias anySeries
* @category Collection
* @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
* in the collections in series.
* The iteratee should complete with a boolean `result` value.
* Invoked with (item, callback).
* @param {Function} [callback] - A callback which is called as soon as any
* iteratee returns `true`, or after all the iteratee functions have finished.
* Result will be either `true` or `false` depending on the values of the async
* tests. Invoked with (err, result).
* @returns {Promise} a promise, if no callback provided
*/
function someSeries(coll, iteratee, callback) {
return (0, _createTester2.default)(Boolean, res => res)(_eachOfSeries2.default, coll, iteratee, callback);
}
exports.default = (0, _awaitify2.default)(someSeries, 3);
module.exports = exports.default;

11
autotools/dbcompiler/node_modules/async/apply.js generated vendored Normal file
View file

@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (fn, ...args) {
return (...callArgs) => fn(...args, ...callArgs);
};
module.exports = exports.default;

57
autotools/dbcompiler/node_modules/async/applyEach.js generated vendored Normal file
View file

@ -0,0 +1,57 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _applyEach = require('./internal/applyEach.js');
var _applyEach2 = _interopRequireDefault(_applyEach);
var _map = require('./map.js');
var _map2 = _interopRequireDefault(_map);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Applies the provided arguments to each function in the array, calling
* `callback` after all functions have completed. If you only provide the first
* argument, `fns`, then it will return a function which lets you pass in the
* arguments as if it were a single function call. If more arguments are
* provided, `callback` is required while `args` is still optional. The results
* for each of the applied async functions are passed to the final callback
* as an array.
*
* @name applyEach
* @static
* @memberOf module:ControlFlow
* @method
* @category Control Flow
* @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s
* to all call with the same arguments
* @param {...*} [args] - any number of separate arguments to pass to the
* function.
* @param {Function} [callback] - the final argument should be the callback,
* called when all functions have completed processing.
* @returns {AsyncFunction} - Returns a function that takes no args other than
* an optional callback, that is the result of applying the `args` to each
* of the functions.
* @example
*
* const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket')
*
* appliedFn((err, results) => {
* // results[0] is the results for `enableSearch`
* // results[1] is the results for `updateSchema`
* });
*
* // partial application example:
* async.each(
* buckets,
* async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(),
* callback
* );
*/
exports.default = (0, _applyEach2.default)(_map2.default);
module.exports = exports.default;

View file

@ -0,0 +1,37 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _applyEach = require('./internal/applyEach.js');
var _applyEach2 = _interopRequireDefault(_applyEach);
var _mapSeries = require('./mapSeries.js');
var _mapSeries2 = _interopRequireDefault(_mapSeries);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.
*
* @name applyEachSeries
* @static
* @memberOf module:ControlFlow
* @method
* @see [async.applyEach]{@link module:ControlFlow.applyEach}
* @category Control Flow
* @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all
* call with the same arguments
* @param {...*} [args] - any number of separate arguments to pass to the
* function.
* @param {Function} [callback] - the final argument should be the callback,
* called when all functions have completed processing.
* @returns {AsyncFunction} - A function, that when called, is the result of
* appling the `args` to the list of functions. It takes no args, other than
* a callback.
*/
exports.default = (0, _applyEach2.default)(_mapSeries2.default);
module.exports = exports.default;

118
autotools/dbcompiler/node_modules/async/asyncify.js generated vendored Normal file
View file

@ -0,0 +1,118 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = asyncify;
var _initialParams = require('./internal/initialParams.js');
var _initialParams2 = _interopRequireDefault(_initialParams);
var _setImmediate = require('./internal/setImmediate.js');
var _setImmediate2 = _interopRequireDefault(_setImmediate);
var _wrapAsync = require('./internal/wrapAsync.js');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Take a sync function and make it async, passing its return value to a
* callback. This is useful for plugging sync functions into a waterfall,
* series, or other async functions. Any arguments passed to the generated
* function will be passed to the wrapped function (except for the final
* callback argument). Errors thrown will be passed to the callback.
*
* If the function passed to `asyncify` returns a Promise, that promises's
* resolved/rejected state will be used to call the callback, rather than simply
* the synchronous return value.
*
* This also means you can asyncify ES2017 `async` functions.
*
* @name asyncify
* @static
* @memberOf module:Utils
* @method
* @alias wrapSync
* @category Util
* @param {Function} func - The synchronous function, or Promise-returning
* function to convert to an {@link AsyncFunction}.
* @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be
* invoked with `(args..., callback)`.
* @example
*
* // passing a regular synchronous function
* async.waterfall([
* async.apply(fs.readFile, filename, "utf8"),
* async.asyncify(JSON.parse),
* function (data, next) {
* // data is the result of parsing the text.
* // If there was a parsing error, it would have been caught.
* }
* ], callback);
*
* // passing a function returning a promise
* async.waterfall([
* async.apply(fs.readFile, filename, "utf8"),
* async.asyncify(function (contents) {
* return db.model.create(contents);
* }),
* function (model, next) {
* // `model` is the instantiated model object.
* // If there was an error, this function would be skipped.
* }
* ], callback);
*
* // es2017 example, though `asyncify` is not needed if your JS environment
* // supports async functions out of the box
* var q = async.queue(async.asyncify(async function(file) {
* var intermediateStep = await processFile(file);
* return await somePromise(intermediateStep)
* }));
*
* q.push(files);
*/
function asyncify(func) {
if ((0, _wrapAsync.isAsync)(func)) {
return function (...args /*, callback*/) {
const callback = args.pop();
const promise = func.apply(this, args);
return handlePromise(promise, callback);
};
}
return (0, _initialParams2.default)(function (args, callback) {
var result;
try {
result = func.apply(this, args);
} catch (e) {
return callback(e);
}
// if result is Promise object
if (result && typeof result.then === 'function') {
return handlePromise(result, callback);
} else {
callback(null, result);
}
});
}
function handlePromise(promise, callback) {
return promise.then(value => {
invokeCallback(callback, null, value);
}, err => {
invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err));
});
}
function invokeCallback(callback, error, value) {
try {
callback(error, value);
} catch (err) {
(0, _setImmediate2.default)(e => {
throw e;
}, err);
}
}
module.exports = exports.default;

333
autotools/dbcompiler/node_modules/async/auto.js generated vendored Normal file
View file

@ -0,0 +1,333 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = auto;
var _once = require('./internal/once.js');
var _once2 = _interopRequireDefault(_once);
var _onlyOnce = require('./internal/onlyOnce.js');
var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
var _wrapAsync = require('./internal/wrapAsync.js');
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
var _promiseCallback = require('./internal/promiseCallback.js');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on
* their requirements. Each function can optionally depend on other functions
* being completed first, and each function is run as soon as its requirements
* are satisfied.
*
* If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence
* will stop. Further tasks will not execute (so any other functions depending
* on it will not run), and the main `callback` is immediately called with the
* error.
*
* {@link AsyncFunction}s also receive an object containing the results of functions which
* have completed so far as the first argument, if they have dependencies. If a
* task function has no dependencies, it will only be passed a callback.
*
* @name auto
* @static
* @memberOf module:ControlFlow
* @method
* @category Control Flow
* @param {Object} tasks - An object. Each of its properties is either a
* function or an array of requirements, with the {@link AsyncFunction} itself the last item
* in the array. The object's key of a property serves as the name of the task
* defined by that property, i.e. can be used when specifying requirements for
* other tasks. The function receives one or two arguments:
* * a `results` object, containing the results of the previously executed
* functions, only passed if the task has any dependencies,
* * a `callback(err, result)` function, which must be called when finished,
* passing an `error` (which can be `null`) and the result of the function's
* execution.
* @param {number} [concurrency=Infinity] - An optional `integer` for
* determining the maximum number of tasks that can be run in parallel. By
* default, as many as possible.
* @param {Function} [callback] - An optional callback which is called when all
* the tasks have been completed. It receives the `err` argument if any `tasks`
* pass an error to their callback. Results are always returned; however, if an
* error occurs, no further `tasks` will be performed, and the results object
* will only contain partial results. Invoked with (err, results).
* @returns {Promise} a promise, if a callback is not passed
* @example
*
* //Using Callbacks
* async.auto({
* get_data: function(callback) {
* // async code to get some data
* callback(null, 'data', 'converted to array');
* },
* make_folder: function(callback) {
* // async code to create a directory to store a file in
* // this is run at the same time as getting the data
* callback(null, 'folder');
* },
* write_file: ['get_data', 'make_folder', function(results, callback) {
* // once there is some data and the directory exists,
* // write the data to a file in the directory
* callback(null, 'filename');
* }],
* email_link: ['write_file', function(results, callback) {
* // once the file is written let's email a link to it...
* callback(null, {'file':results.write_file, 'email':'user@example.com'});
* }]
* }, function(err, results) {
* if (err) {
* console.log('err = ', err);
* }
* console.log('results = ', results);
* // results = {
* // get_data: ['data', 'converted to array']
* // make_folder; 'folder',
* // write_file: 'filename'
* // email_link: { file: 'filename', email: 'user@example.com' }
* // }
* });
*
* //Using Promises
* async.auto({
* get_data: function(callback) {
* console.log('in get_data');
* // async code to get some data
* callback(null, 'data', 'converted to array');
* },
* make_folder: function(callback) {
* console.log('in make_folder');
* // async code to create a directory to store a file in
* // this is run at the same time as getting the data
* callback(null, 'folder');
* },
* write_file: ['get_data', 'make_folder', function(results, callback) {
* // once there is some data and the directory exists,
* // write the data to a file in the directory
* callback(null, 'filename');
* }],
* email_link: ['write_file', function(results, callback) {
* // once the file is written let's email a link to it...
* callback(null, {'file':results.write_file, 'email':'user@example.com'});
* }]
* }).then(results => {
* console.log('results = ', results);
* // results = {
* // get_data: ['data', 'converted to array']
* // make_folder; 'folder',
* // write_file: 'filename'
* // email_link: { file: 'filename', email: 'user@example.com' }
* // }
* }).catch(err => {
* console.log('err = ', err);
* });
*
* //Using async/await
* async () => {
* try {
* let results = await async.auto({
* get_data: function(callback) {
* // async code to get some data
* callback(null, 'data', 'converted to array');
* },
* make_folder: function(callback) {
* // async code to create a directory to store a file in
* // this is run at the same time as getting the data
* callback(null, 'folder');
* },
* write_file: ['get_data', 'make_folder', function(results, callback) {
* // once there is some data and the directory exists,
* // write the data to a file in the directory
* callback(null, 'filename');
* }],
* email_link: ['write_file', function(results, callback) {
* // once the file is written let's email a link to it...
* callback(null, {'file':results.write_file, 'email':'user@example.com'});
* }]
* });
* console.log('results = ', results);
* // results = {
* // get_data: ['data', 'converted to array']
* // make_folder; 'folder',
* // write_file: 'filename'
* // email_link: { file: 'filename', email: 'user@example.com' }
* // }
* }
* catch (err) {
* console.log(err);
* }
* }
*
*/
function auto(tasks, concurrency, callback) {
if (typeof concurrency !== 'number') {
// concurrency is optional, shift the args.
callback = concurrency;
concurrency = null;
}
callback = (0, _once2.default)(callback || (0, _promiseCallback.promiseCallback)());
var numTasks = Object.keys(tasks).length;
if (!numTasks) {
return callback(null);
}
if (!concurrency) {
concurrency = numTasks;
}
var results = {};
var runningTasks = 0;
var canceled = false;
var hasError = false;
var listeners = Object.create(null);
var readyTasks = [];
// for cycle detection:
var readyToCheck = []; // tasks that have been identified as reachable
// without the possibility of returning to an ancestor task
var uncheckedDependencies = {};
Object.keys(tasks).forEach(key => {
var task = tasks[key];
if (!Array.isArray(task)) {
// no dependencies
enqueueTask(key, [task]);
readyToCheck.push(key);
return;
}
var dependencies = task.slice(0, task.length - 1);
var remainingDependencies = dependencies.length;
if (remainingDependencies === 0) {
enqueueTask(key, task);
readyToCheck.push(key);
return;
}
uncheckedDependencies[key] = remainingDependencies;
dependencies.forEach(dependencyName => {
if (!tasks[dependencyName]) {
throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', '));
}
addListener(dependencyName, () => {
remainingDependencies--;
if (remainingDependencies === 0) {
enqueueTask(key, task);
}
});
});
});
checkForDeadlocks();
processQueue();
function enqueueTask(key, task) {
readyTasks.push(() => runTask(key, task));
}
function processQueue() {
if (canceled) return;
if (readyTasks.length === 0 && runningTasks === 0) {
return callback(null, results);
}
while (readyTasks.length && runningTasks < concurrency) {
var run = readyTasks.shift();
run();
}
}
function addListener(taskName, fn) {
var taskListeners = listeners[taskName];
if (!taskListeners) {
taskListeners = listeners[taskName] = [];
}
taskListeners.push(fn);
}
function taskComplete(taskName) {
var taskListeners = listeners[taskName] || [];
taskListeners.forEach(fn => fn());
processQueue();
}
function runTask(key, task) {
if (hasError) return;
var taskCallback = (0, _onlyOnce2.default)((err, ...result) => {
runningTasks--;
if (err === false) {
canceled = true;
return;
}
if (result.length < 2) {
[result] = result;
}
if (err) {
var safeResults = {};
Object.keys(results).forEach(rkey => {
safeResults[rkey] = results[rkey];
});
safeResults[key] = result;
hasError = true;
listeners = Object.create(null);
if (canceled) return;
callback(err, safeResults);
} else {
results[key] = result;
taskComplete(key);
}
});
runningTasks++;
var taskFn = (0, _wrapAsync2.default)(task[task.length - 1]);
if (task.length > 1) {
taskFn(results, taskCallback);
} else {
taskFn(taskCallback);
}
}
function checkForDeadlocks() {
// Kahn's algorithm
// https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm
// http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html
var currentTask;
var counter = 0;
while (readyToCheck.length) {
currentTask = readyToCheck.pop();
counter++;
getDependents(currentTask).forEach(dependent => {
if (--uncheckedDependencies[dependent] === 0) {
readyToCheck.push(dependent);
}
});
}
if (counter !== numTasks) {
throw new Error('async.auto cannot execute tasks due to a recursive dependency');
}
}
function getDependents(taskName) {
var result = [];
Object.keys(tasks).forEach(key => {
const task = tasks[key];
if (Array.isArray(task) && task.indexOf(taskName) >= 0) {
result.push(key);
}
});
return result;
}
return callback[_promiseCallback.PROMISE_SYMBOL];
}
module.exports = exports.default;

182
autotools/dbcompiler/node_modules/async/autoInject.js generated vendored Normal file
View file

@ -0,0 +1,182 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = autoInject;
var _auto = require('./auto.js');
var _auto2 = _interopRequireDefault(_auto);
var _wrapAsync = require('./internal/wrapAsync.js');
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var FN_ARGS = /^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/;
var ARROW_FN_ARGS = /^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /(=.+)?(\s*)$/;
function stripComments(string) {
let stripped = '';
let index = 0;
let endBlockComment = string.indexOf('*/');
while (index < string.length) {
if (string[index] === '/' && string[index + 1] === '/') {
// inline comment
let endIndex = string.indexOf('\n', index);
index = endIndex === -1 ? string.length : endIndex;
} else if (endBlockComment !== -1 && string[index] === '/' && string[index + 1] === '*') {
// block comment
let endIndex = string.indexOf('*/', index);
if (endIndex !== -1) {
index = endIndex + 2;
endBlockComment = string.indexOf('*/', index);
} else {
stripped += string[index];
index++;
}
} else {
stripped += string[index];
index++;
}
}
return stripped;
}
function parseParams(func) {
const src = stripComments(func.toString());
let match = src.match(FN_ARGS);
if (!match) {
match = src.match(ARROW_FN_ARGS);
}
if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src);
let [, args] = match;
return args.replace(/\s/g, '').split(FN_ARG_SPLIT).map(arg => arg.replace(FN_ARG, '').trim());
}
/**
* A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent
* tasks are specified as parameters to the function, after the usual callback
* parameter, with the parameter names matching the names of the tasks it
* depends on. This can provide even more readable task graphs which can be
* easier to maintain.
*
* If a final callback is specified, the task results are similarly injected,
* specified as named parameters after the initial error parameter.
*
* The autoInject function is purely syntactic sugar and its semantics are
* otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.
*
* @name autoInject
* @static
* @memberOf module:ControlFlow
* @method
* @see [async.auto]{@link module:ControlFlow.auto}
* @category Control Flow
* @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of
* the form 'func([dependencies...], callback). The object's key of a property
* serves as the name of the task defined by that property, i.e. can be used
* when specifying requirements for other tasks.
* * The `callback` parameter is a `callback(err, result)` which must be called
* when finished, passing an `error` (which can be `null`) and the result of
* the function's execution. The remaining parameters name other tasks on
* which the task is dependent, and the results from those tasks are the
* arguments of those parameters.
* @param {Function} [callback] - An optional callback which is called when all
* the tasks have been completed. It receives the `err` argument if any `tasks`
* pass an error to their callback, and a `results` object with any completed
* task results, similar to `auto`.
* @returns {Promise} a promise, if no callback is passed
* @example
*
* // The example from `auto` can be rewritten as follows:
* async.autoInject({
* get_data: function(callback) {
* // async code to get some data
* callback(null, 'data', 'converted to array');
* },
* make_folder: function(callback) {
* // async code to create a directory to store a file in
* // this is run at the same time as getting the data
* callback(null, 'folder');
* },
* write_file: function(get_data, make_folder, callback) {
* // once there is some data and the directory exists,
* // write the data to a file in the directory
* callback(null, 'filename');
* },
* email_link: function(write_file, callback) {
* // once the file is written let's email a link to it...
* // write_file contains the filename returned by write_file.
* callback(null, {'file':write_file, 'email':'user@example.com'});
* }
* }, function(err, results) {
* console.log('err = ', err);
* console.log('email_link = ', results.email_link);
* });
*
* // If you are using a JS minifier that mangles parameter names, `autoInject`
* // will not work with plain functions, since the parameter names will be
* // collapsed to a single letter identifier. To work around this, you can
* // explicitly specify the names of the parameters your task function needs
* // in an array, similar to Angular.js dependency injection.
*
* // This still has an advantage over plain `auto`, since the results a task
* // depends on are still spread into arguments.
* async.autoInject({
* //...
* write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {
* callback(null, 'filename');
* }],
* email_link: ['write_file', function(write_file, callback) {
* callback(null, {'file':write_file, 'email':'user@example.com'});
* }]
* //...
* }, function(err, results) {
* console.log('err = ', err);
* console.log('email_link = ', results.email_link);
* });
*/
function autoInject(tasks, callback) {
var newTasks = {};
Object.keys(tasks).forEach(key => {
var taskFn = tasks[key];
var params;
var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn);
var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0;
if (Array.isArray(taskFn)) {
params = [...taskFn];
taskFn = params.pop();
newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);
} else if (hasNoDeps) {
// no dependencies, use the function as-is
newTasks[key] = taskFn;
} else {
params = parseParams(taskFn);
if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {
throw new Error("autoInject task functions require explicit parameters.");
}
// remove callback param
if (!fnIsAsync) params.pop();
newTasks[key] = params.concat(newTask);
}
function newTask(results, taskCb) {
var newArgs = params.map(name => results[name]);
newArgs.push(taskCb);
(0, _wrapAsync2.default)(taskFn)(...newArgs);
}
});
return (0, _auto2.default)(newTasks, callback);
}
module.exports = exports.default;

63
autotools/dbcompiler/node_modules/async/cargo.js generated vendored Normal file
View file

@ -0,0 +1,63 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cargo;
var _queue = require('./internal/queue.js');
var _queue2 = _interopRequireDefault(_queue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates a `cargo` object with the specified payload. Tasks added to the
* cargo will be processed altogether (up to the `payload` limit). If the
* `worker` is in progress, the task is queued until it becomes available. Once
* the `worker` has completed some tasks, each callback of those tasks is
* called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)
* for how `cargo` and `queue` work.
*
* While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers
* at a time, cargo passes an array of tasks to a single worker, repeating
* when the worker is finished.
*
* @name cargo
* @static
* @memberOf module:ControlFlow
* @method
* @see [async.queue]{@link module:ControlFlow.queue}
* @category Control Flow
* @param {AsyncFunction} worker - An asynchronous function for processing an array
* of queued tasks. Invoked with `(tasks, callback)`.
* @param {number} [payload=Infinity] - An optional `integer` for determining
* how many tasks should be processed per round; if omitted, the default is
* unlimited.
* @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can
* attached as certain properties to listen for specific events during the
* lifecycle of the cargo and inner queue.
* @example
*
* // create a cargo object with payload 2
* var cargo = async.cargo(function(tasks, callback) {
* for (var i=0; i<tasks.length; i++) {
* console.log('hello ' + tasks[i].name);
* }
* callback();
* }, 2);
*
* // add some items
* cargo.push({name: 'foo'}, function(err) {
* console.log('finished processing foo');
* });
* cargo.push({name: 'bar'}, function(err) {
* console.log('finished processing bar');
* });
* await cargo.push({name: 'baz'});
* console.log('finished processing baz');
*/
function cargo(worker, payload) {
return (0, _queue2.default)(worker, 1, payload);
}
module.exports = exports.default;

71
autotools/dbcompiler/node_modules/async/cargoQueue.js generated vendored Normal file
View file

@ -0,0 +1,71 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cargo;
var _queue = require('./internal/queue.js');
var _queue2 = _interopRequireDefault(_queue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates a `cargoQueue` object with the specified payload. Tasks added to the
* cargoQueue will be processed together (up to the `payload` limit) in `concurrency` parallel workers.
* If the all `workers` are in progress, the task is queued until one becomes available. Once
* a `worker` has completed some tasks, each callback of those tasks is
* called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)
* for how `cargo` and `queue` work.
*
* While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers
* at a time, and [`cargo`]{@link module:ControlFlow.cargo} passes an array of tasks to a single worker,
* the cargoQueue passes an array of tasks to multiple parallel workers.
*
* @name cargoQueue
* @static
* @memberOf module:ControlFlow
* @method
* @see [async.queue]{@link module:ControlFlow.queue}
* @see [async.cargo]{@link module:ControlFLow.cargo}
* @category Control Flow
* @param {AsyncFunction} worker - An asynchronous function for processing an array
* of queued tasks. Invoked with `(tasks, callback)`.
* @param {number} [concurrency=1] - An `integer` for determining how many
* `worker` functions should be run in parallel. If omitted, the concurrency
* defaults to `1`. If the concurrency is `0`, an error is thrown.
* @param {number} [payload=Infinity] - An optional `integer` for determining
* how many tasks should be processed per round; if omitted, the default is
* unlimited.
* @returns {module:ControlFlow.QueueObject} A cargoQueue object to manage the tasks. Callbacks can
* attached as certain properties to listen for specific events during the
* lifecycle of the cargoQueue and inner queue.
* @example
*
* // create a cargoQueue object with payload 2 and concurrency 2
* var cargoQueue = async.cargoQueue(function(tasks, callback) {
* for (var i=0; i<tasks.length; i++) {
* console.log('hello ' + tasks[i].name);
* }
* callback();
* }, 2, 2);
*
* // add some items
* cargoQueue.push({name: 'foo'}, function(err) {
* console.log('finished processing foo');
* });
* cargoQueue.push({name: 'bar'}, function(err) {
* console.log('finished processing bar');
* });
* cargoQueue.push({name: 'baz'}, function(err) {
* console.log('finished processing baz');
* });
* cargoQueue.push({name: 'boo'}, function(err) {
* console.log('finished processing boo');
* });
*/
function cargo(worker, concurrency, payload) {
return (0, _queue2.default)(worker, concurrency, payload);
}
module.exports = exports.default;

55
autotools/dbcompiler/node_modules/async/compose.js generated vendored Normal file
View file

@ -0,0 +1,55 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = compose;
var _seq = require('./seq.js');
var _seq2 = _interopRequireDefault(_seq);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates a function which is a composition of the passed asynchronous
* functions. Each function consumes the return value of the function that
* follows. Composing functions `f()`, `g()`, and `h()` would produce the result
* of `f(g(h()))`, only this version uses callbacks to obtain the return values.
*
* If the last argument to the composed function is not a function, a promise
* is returned when you call it.
*
* Each function is executed with the `this` binding of the composed function.
*
* @name compose
* @static
* @memberOf module:ControlFlow
* @method
* @category Control Flow
* @param {...AsyncFunction} functions - the asynchronous functions to compose
* @returns {Function} an asynchronous function that is the composed
* asynchronous `functions`
* @example
*
* function add1(n, callback) {
* setTimeout(function () {
* callback(null, n + 1);
* }, 10);
* }
*
* function mul3(n, callback) {
* setTimeout(function () {
* callback(null, n * 3);
* }, 10);
* }
*
* var add1mul3 = async.compose(mul3, add1);
* add1mul3(4, function (err, result) {
* // result now equals 15
* });
*/
function compose(...args) {
return (0, _seq2.default)(...args.reverse());
}
module.exports = exports.default;

115
autotools/dbcompiler/node_modules/async/concat.js generated vendored Normal file
View file

@ -0,0 +1,115 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _concatLimit = require('./concatLimit.js');
var _concatLimit2 = _interopRequireDefault(_concatLimit);
var _awaitify = require('./internal/awaitify.js');
var _awaitify2 = _interopRequireDefault(_awaitify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Applies `iteratee` to each item in `coll`, concatenating the results. Returns
* the concatenated list. The `iteratee`s are called in parallel, and the
* results are concatenated as they return. The results array will be returned in
* the original order of `coll` passed to the `iteratee` function.
*
* @name concat
* @static
* @memberOf module:Collections
* @method
* @category Collection
* @alias flatMap
* @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,
* which should use an array as its result. Invoked with (item, callback).
* @param {Function} [callback] - A callback which is called after all the
* `iteratee` functions have finished, or an error occurs. Results is an array
* containing the concatenated results of the `iteratee` function. Invoked with
* (err, results).
* @returns A Promise, if no callback is passed
* @example
*
* // dir1 is a directory that contains file1.txt, file2.txt
* // dir2 is a directory that contains file3.txt, file4.txt
* // dir3 is a directory that contains file5.txt
* // dir4 does not exist
*
* let directoryList = ['dir1','dir2','dir3'];
* let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4'];
*
* // Using callbacks
* async.concat(directoryList, fs.readdir, function(err, results) {
* if (err) {
* console.log(err);
* } else {
* console.log(results);
* // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]
* }
* });
*
* // Error Handling
* async.concat(withMissingDirectoryList, fs.readdir, function(err, results) {
* if (err) {
* console.log(err);
* // [ Error: ENOENT: no such file or directory ]
* // since dir4 does not exist
* } else {
* console.log(results);
* }
* });
*
* // Using Promises
* async.concat(directoryList, fs.readdir)
* .then(results => {
* console.log(results);
* // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]
* }).catch(err => {
* console.log(err);
* });
*
* // Error Handling
* async.concat(withMissingDirectoryList, fs.readdir)
* .then(results => {
* console.log(results);
* }).catch(err => {
* console.log(err);
* // [ Error: ENOENT: no such file or directory ]
* // since dir4 does not exist
* });
*
* // Using async/await
* async () => {
* try {
* let results = await async.concat(directoryList, fs.readdir);
* console.log(results);
* // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ]
* } catch (err) {
* console.log(err);
* }
* }
*
* // Error Handling
* async () => {
* try {
* let results = await async.concat(withMissingDirectoryList, fs.readdir);
* console.log(results);
* } catch (err) {
* console.log(err);
* // [ Error: ENOENT: no such file or directory ]
* // since dir4 does not exist
* }
* }
*
*/
function concat(coll, iteratee, callback) {
return (0, _concatLimit2.default)(coll, Infinity, iteratee, callback);
}
exports.default = (0, _awaitify2.default)(concat, 3);
module.exports = exports.default;

Some files were not shown because too many files have changed in this diff Show more