Datasets:
file_id stringlengths 64 64 | file_path stringlengths 61 182 | file_name stringlengths 6 66 | sha256 stringlengths 64 64 | md5 stringlengths 32 32 | file_size int64 2.05k 45.2M | platform stringclasses 1 value | os_family stringclasses 1 value | os_version stringclasses 1 value | distribution stringclasses 1 value | is_malware bool 2 classes | file_format stringclasses 1 value | architecture stringclasses 3 values | binary_type stringclasses 3 values | is_stripped bool 2 classes | is_packed bool 2 classes | is_signed bool 2 classes | sections dict | num_sections int32 0 88 | code_size int64 0 0 | data_size int64 0 0 | imports listlengths 0 100 | num_imports int32 0 1.9k | exports listlengths 0 100 | num_exports int32 0 15.4k | entropy float32 0.01 8 | token_count int32 263 9.99M | compression_ratio float32 1.35 31.7 | unique_tokens int32 148 47.7k | parse_status stringclasses 2 values | parse_warnings listlengths 0 4 | has_tokens bool 1 class | tokens listlengths 263 9.99M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbbfd15208f4d0765ec912b33ca8d21559a7ad3f5e3ba9652dea8973c410715c | "/nas4/data/glaurung-data/binaries-small/malware-bazaar/windows/pe/x86/cbbfd15208f4d0765ec912b33ca8d(...TRUNCATED) | cbbfd15208f4d0765ec912b33ca8d21559a7ad3f5e3ba9652dea8973c410715c | cbbfd15208f4d0765ec912b33ca8d21559a7ad3f5e3ba9652dea8973c410715c | f4684385ea3e4e64a8ea88449d5d09c7 | 382,424 | windows | true | PE | x86 | executable | true | false | true | {"name":[".text",".rdata",".data",".ndata",".rsrc"],"size":[25600,5120,1536,0,25088],"entropy":[6.48(...TRUNCATED) | 5 | 0 | 0 | ["KERNEL32.dll::ExitProcess","KERNEL32.dll::SetFileAttributesW","KERNEL32.dll::Sleep","KERNEL32.dll:(...TRUNCATED) | 165 | [] | 0 | 7.798648 | 258,526 | 1.479248 | 25,719 | warning | [
"high_entropy"
] | true | [53341,271,259,1407,52384,52357,51941,173,49,6149,16125,102,13293,33335,13293,33335,210,42,95,57,210(...TRUNCATED) | |||
5e23ce8eb599112ad3dab1d1be971539e063255426ed33f7b46f39d4d23aecaa | "/nas4/data/glaurung-data/binaries-small/sorel-20m/000b9c882cb40c046fd33d2c308955ee7b1389b0dd5b91631(...TRUNCATED) | 000b9c882cb40c046fd33d2c308955ee7b1389b0dd5b916310648d43181220c5 | 5e23ce8eb599112ad3dab1d1be971539e063255426ed33f7b46f39d4d23aecaa | ceab458b22bd1795078886c47401e27d | 598,174 | windows | true | PE | x86 | executable | true | false | false | {"name":[".text",".rdata",".data",".ndata",".rsrc"],"size":[25600,5120,1536,0,4096],"entropy":[6.469(...TRUNCATED) | 5 | 0 | 0 | ["KERNEL32.dll::SetEnvironmentVariableW","KERNEL32.dll::SetFileAttributesW","KERNEL32.dll::Sleep","K(...TRUNCATED) | 165 | [] | 0 | 7.975392 | 429,118 | 1.393962 | 26,738 | warning | [
"high_entropy"
] | true | [53341,271,259,1407,52384,52357,51941,173,49,6149,16125,102,13293,33335,13293,33335,210,42,95,57,210(...TRUNCATED) | |||
880748db45b75bc9d567a0ea826655869a4cb989485766b7c97ecd6cb5ef1c0d | "/nas4/data/glaurung-data/binaries-small/malware-bazaar/windows/pe/x86/880748db45b75bc9d567a0ea82665(...TRUNCATED) | 880748db45b75bc9d567a0ea826655869a4cb989485766b7c97ecd6cb5ef1c0d | 880748db45b75bc9d567a0ea826655869a4cb989485766b7c97ecd6cb5ef1c0d | cfffdaf60f52943fc3a8123c8faad8ea | 9,950,439 | windows | true | PE | x86 | executable | true | false | true | {"name":[".text",".itext",".data",".bss",".idata",".didata",".edata",".tls",".rdata",".rsrc"],"size"(...TRUNCATED) | 10 | 0 | 0 | ["kernel32.dll::GetACP","kernel32.dll::GetExitCodeProcess","kernel32.dll::CloseHandle","kernel32.dll(...TRUNCATED) | 146 | [
"dbkFCallWrapperAddr",
"__dbk_fcall_wrapper"
] | 2 | 7.974187 | 7,081,451 | 1.405141 | 34,236 | warning | [
"high_entropy"
] | true | [16301,661,29617,457,52647,371,26,271,256,267,186,351,14,34261,51772,309,17289,21940,28879,41083,422(...TRUNCATED) | |||
3fdf438dcd6a983b01378504d5f57c713145c41521c89505cd3896f66b5c30e3 | "/nas4/data/glaurung-data/binaries-small/malware-bazaar/windows/pe/x86/3fdf438dcd6a983b01378504d5f57(...TRUNCATED) | 3fdf438dcd6a983b01378504d5f57c713145c41521c89505cd3896f66b5c30e3 | 3fdf438dcd6a983b01378504d5f57c713145c41521c89505cd3896f66b5c30e3 | b25eb9089ff9de4d3a5214c571113394 | 98,304 | windows | true | PE | x86 | executable | true | false | false | {"name":[".text",".bss",".data",".idata",".gfcd",".idata",".idata"],"size":[33116,0,13304,3748,512,5(...TRUNCATED) | 7 | 0 | 0 | ["ole32.DLL::CoCreateInstance","ole32.DLL::CLSIDFromString","ole32.DLL::CoInitialize","ole32.DLL::Co(...TRUNCATED) | 123 | [] | 0 | 6.675267 | 48,371 | 2.032292 | 5,778 | ok | [] | true | [53341,271,259,525,52384,52357,51941,22837,2586,302,3796,19470,258,1476,14,1770,896,909,2910,1830,21(...TRUNCATED) | |||
abd9e7c5e894ff55f43d8fa77fa910faacce0b9cd68ba690d3e7b50fef746158 | "/nas4/data/glaurung-data/binaries-small/malware-bazaar/windows/pe/x86/abd9e7c5e894ff55f43d8fa77fa91(...TRUNCATED) | abd9e7c5e894ff55f43d8fa77fa910faacce0b9cd68ba690d3e7b50fef746158 | abd9e7c5e894ff55f43d8fa77fa910faacce0b9cd68ba690d3e7b50fef746158 | 51b3d7352868467bac0c281fff249f94 | 852,320 | windows | true | PE | x86 | executable | true | false | true | {"name":[".text",".rdata",".data",".ndata",".rsrc"],"size":[25600,5120,1024,0,28160],"entropy":[6.44(...TRUNCATED) | 5 | 0 | 0 | ["ADVAPI32.dll::RegEnumValueA","ADVAPI32.dll::RegEnumKeyA","ADVAPI32.dll::RegQueryValueExA","ADVAPI3(...TRUNCATED) | 158 | [] | 0 | 7.953278 | 609,179 | 1.399129 | 27,368 | warning | [
"high_entropy"
] | true | [53341,271,259,1193,52384,52357,51941,173,15690,17892,32284,13293,32284,13293,32284,210,42,159,48860(...TRUNCATED) | |||
caac724fc3cbacf481f1916733153150b3cdf90efa48931435175cd68caf1d1f | "/nas4/data/glaurung-data/binaries-small/malware-bazaar/windows/pe/x86/caac724fc3cbacf481f1916733153(...TRUNCATED) | caac724fc3cbacf481f1916733153150b3cdf90efa48931435175cd68caf1d1f | caac724fc3cbacf481f1916733153150b3cdf90efa48931435175cd68caf1d1f | 9ec26f5db604607894c3f31934a58c85 | 1,162,752 | windows | true | PE | x86 | executable | true | false | false | {"name":["UPX0","UPX1",".rsrc"],"size":[0,345088,816640],"entropy":[0.0,7.936398506164551,7.90680408(...TRUNCATED) | 3 | 0 | 0 | ["KERNEL32.DLL::LoadLibraryA","KERNEL32.DLL::GetProcAddress","KERNEL32.DLL::VirtualProtect","KERNEL3(...TRUNCATED) | 23 | [] | 0 | 7.930973 | 820,191 | 1.41766 | 26,740 | warning | [
"high_entropy"
] | true | [53341,271,259,1814,52384,52357,51941,83,63996,26086,199,203,169,23,199,203,169,23,199,203,169,137,1(...TRUNCATED) | |||
ecbf9e6de52105be852593472611a21989effc7d4e73acb4a0d0a01347a8d079 | "/nas4/data/glaurung-data/binaries-small/malware-bazaar/windows/pe/x86_64/ecbf9e6de52105be8525934726(...TRUNCATED) | ecbf9e6de52105be852593472611a21989effc7d4e73acb4a0d0a01347a8d079 | ecbf9e6de52105be852593472611a21989effc7d4e73acb4a0d0a01347a8d079 | d8d87c051555c6ff0337065ff828f7c6 | 3,307,792 | windows | true | PE | x86-64 | executable | false | false | true | {"name":[".text",".rdata",".data",".pdata",".rsrc",".reloc"],"size":[2273280,838144,25600,109568,153(...TRUNCATED) | 6 | 0 | 0 | ["FileReportEx.dll::LargeFileReport","SoftwareLog.dll::CreateExportObj","SoftwareLog.dll::DestroyExp(...TRUNCATED) | 349 | [] | 0 | 6.592832 | 1,319,240 | 2.507347 | 41,393 | ok | [] | true | [53341,271,259,2590,52384,52357,51941,48,22705,129,4378,90,210,4378,90,210,4378,90,210,29599,201,210(...TRUNCATED) | |||
bfa639a23311d7532f48f9fe4f19289041d5f0d29555b48f0810958bb5d6303f | "/nas4/data/glaurung-data/binaries-small/malware-bazaar/windows/pe/x86_64/bfa639a23311d7532f48f9fe4f(...TRUNCATED) | bfa639a23311d7532f48f9fe4f19289041d5f0d29555b48f0810958bb5d6303f | bfa639a23311d7532f48f9fe4f19289041d5f0d29555b48f0810958bb5d6303f | 762394c261f14b8ef892bf2e64c0d4df | 4,417,912 | windows | true | PE | x86-64 | executable | true | false | true | {"name":[".text",".rdata",".data",".pdata",".xdata",".idata",".reloc",".symtab",".rsrc"],"size":[168(...TRUNCATED) | 9 | 0 | 0 | ["kernel32.dll::WriteFile","kernel32.dll::WriteConsoleW","kernel32.dll::WerSetFlags","kernel32.dll::(...TRUNCATED) | 46 | [] | 0 | 6.604084 | 1,824,944 | 2.420848 | 37,646 | ok | [] | true | [53015,260,742,294,64,271,259,525,52384,52357,51941,64227,4810,204,1051,73,1379,630,477,17197,323,17(...TRUNCATED) | |||
760cb99df8b7f5f305daab9bb43200a197e1849d29dfc4aeaeafc5d52b84ce49 | "/nas4/data/glaurung-data/binaries-small/sorel-20m/0039dc132f18e324b55a7548a20633d4e9561f3a0a70a0cfa(...TRUNCATED) | 0039dc132f18e324b55a7548a20633d4e9561f3a0a70a0cfaaab6e1f77eee8f9 | 760cb99df8b7f5f305daab9bb43200a197e1849d29dfc4aeaeafc5d52b84ce49 | b359e807f3aa8e71606c8195827ac7bb | 559,616 | windows | true | PE | x86 | executable | false | false | true | {"name":[".text",".data",".rsrc",".reloc"],"size":[314880,28672,96256,118784],"entropy":[6.360087871(...TRUNCATED) | 4 | 0 | 0 | ["VERSION.dll::VerQueryValueW","VERSION.dll::GetFileVersionInfoSizeW","VERSION.dll::GetFileVersionIn(...TRUNCATED) | 163 | [] | 0 | 6.129345 | 225,011 | 2.487061 | 24,348 | ok | [] | true | [53341,763,165,27,156,28,263,2049,52384,52357,51941,33,54161,61036,87,62049,65405,62049,65405,62049,(...TRUNCATED) | |||
1ef8f48f8464e37887de6e318960e8814dfe2ddb6576b1a2348d838c6b687c40 | "/nas4/data/glaurung-data/binaries-small/malware-bazaar/windows/pe/x86/1ef8f48f8464e37887de6e318960e(...TRUNCATED) | 1ef8f48f8464e37887de6e318960e8814dfe2ddb6576b1a2348d838c6b687c40 | 1ef8f48f8464e37887de6e318960e8814dfe2ddb6576b1a2348d838c6b687c40 | 807e514a482fa8e142b44a26b4bd900a | 501,256 | windows | true | PE | x86 | executable | false | false | true | {"name":[".text",".rsrc",".reloc"],"size":[484352,2048,512],"entropy":[7.747921466827393,4.147038936(...TRUNCATED) | 3 | 0 | 0 | [
"mscoree.dll::_CorExeMain"
] | 1 | [] | 0 | 7.739595 | 339,823 | 1.47505 | 26,087 | warning | [
"high_entropy"
] | true | [53341,271,259,525,52384,52357,51941,22837,2586,265,15391,181,104,258,224,579,1770,1575,43794,536,35(...TRUNCATED) |
Binary-30K: Cross-Platform Binary Dataset with Stratified Splits
π Original Dataset (no splits): mjbommar/binary-30k-tokenized
This is the stratified train/validation/test split version of the Binary-30K dataset, containing 29,793 unique cross-platform binaries with pre-computed tokenization. This version provides standardized splits for reproducible machine learning research.
π― Key Features
- β Stratified 70/15/15 splits maintaining class balance across all sets
- β 4-dimensional stratification across malware/platform/format/architecture
- β 26.9% malware balance preserved in all splits (Β±0.1%)
- β Deterministic splits (seed=42) for reproducible research
- β Ready for ML - no manual splitting required
- β Pre-computed BPE tokenization for transformer models
π Dataset Splits
| Split | Samples | Malware | Benign | Malware % |
|---|---|---|---|---|
| Train | 20,849 | 5,613 | 15,236 | 26.92% |
| Validation | 4,463 | 1,200 | 3,263 | 26.89% |
| Test | 4,481 | 1,210 | 3,271 | 27.00% |
| Total | 29,793 | 8,023 | 21,770 | 26.93% |
Stratification Strategy
Splits maintain proportional representation across:
- β Malware vs. Benign (26.9% malware in each split)
- β Platform (Windows, Linux, macOS, Android, Other)
- β File Format (PE, ELF, Mach-O, APK)
- β Architecture Groups (common: x86/ARM vs. exotic: MIPS/RISC-V/PowerPC)
19 unique strata identified with proportional representation maintained across all splits.
π Quick Start
from datasets import load_dataset
# Load dataset with splits
dataset = load_dataset("mjbommar/binary-30k")
train_ds = dataset["train"] # 20,849 samples
val_ds = dataset["validation"] # 4,463 samples
test_ds = dataset["test"] # 4,481 samples
# Access pre-computed tokens
sample = train_ds[0]
print(f"Platform: {sample['platform']}")
print(f"Malware: {sample['is_malware']}")
print(f"Tokens: {len(sample['tokens'])} tokens")
Example: Malware Classification
from datasets import load_dataset
from transformers import Trainer, TrainingArguments
# Load data
dataset = load_dataset("mjbommar/binary-30k")
# Tokens are pre-computed - just truncate
def prepare_example(example):
return {
"input_ids": example["tokens"][:512],
"labels": int(example["is_malware"])
}
# Train on standard splits
train_ds = dataset["train"].map(prepare_example)
val_ds = dataset["validation"].map(prepare_example)
# Train your model...
Example: Cross-Platform Transfer Learning
# Train on Windows, test on Linux
train_windows = dataset["train"].filter(lambda x: x["platform"] == "windows")
test_linux = dataset["test"].filter(lambda x: x["platform"] == "linux")
print(f"Windows training samples: {len(train_windows)}")
print(f"Linux test samples: {len(test_linux)}")
# Evaluate cross-platform generalization...
π¦ Dataset Composition
Platform Distribution:
- Windows: 57.3% (17,239 samples) - PE32/PE32+ executables and DLLs
- Linux: 28.4% (8,452 samples) - ELF32/ELF64 from 9 distributions
- macOS: 1.9% (568 samples) - x86-64, ARM64, Universal binaries
- Android: 0.6% (164 samples) - APKs with native ARM libraries
- Other: 11.8% (3,370 samples) - Diverse formats and installers
Architecture Diversity:
- Common: x86-64 (56.4%), x86 (11.1%), ARM64 (5.9%), ARM (9.4%)
- Exotic: MIPS (2.3%), PowerPC (1.3%), RISC-V (0.1%), m68k, SuperH, ARCompact, SPARC, S/390
Malware Sources:
- SOREL-20M: 365 Windows PE malware samples (2017-2019)
- Malware Bazaar: 7,658 cross-platform malware samples (2020-2024)
- Platform-first stratified sampling
- ALL available macOS malware (560 samples)
- ALL available Android malware (164 samples)
- Balanced Windows/Linux with size stratification
π Data Structure
Each record contains 31 fields organized into seven categories:
Identification (6 fields):
file_id,file_path,file_name,sha256,md5,file_size
Platform/Source (5 fields):
platform,os_family,os_version,distribution,is_malware
File Characteristics (6 fields):
file_format,architecture,binary_type,is_stripped,is_packed,is_signed
Structural Analysis (4 fields + sections):
num_sections,code_size,data_size,sections[]
Dependencies (4 fields + imports/exports):
num_imports,num_exports,imports[],exports[]
Complexity (1 field):
entropy(Shannon entropy 0-8 scale)
Pre-computed Tokenization (4 fields):
tokens[],token_count,compression_ratio,unique_tokens
Parser Diagnostics (2 fields):
parse_status,parse_warnings[]
Pre-computed Tokenization
All binaries are tokenized using BPE tokenization (mjbommar/binary-tokenizer-001-64k):
- Average tokens per binary: ~15,000
- Compression ratio: ~4.2 bytes/token
- Vocabulary: 64K tokens
- Ready for transformers: BERT, GPT, T5, etc.
π Supported Research Tasks
- Malware Detection: Binary classification with balanced classes (26.9% malware)
- Cross-Platform Analysis: Transfer learning across Windows/Linux/macOS/Android
- Architecture-Invariant Detection: Generalization to exotic architectures (IoT/embedded)
- Mobile Malware Research: Dedicated Android and macOS malware samples
- Binary Similarity: Embedding learning for similar binary detection
- Format-Agnostic Analysis: Multi-format models (PE/ELF/Mach-O/APK)
π Comparison with Other Datasets
| Dataset | Size | Platforms | Architectures | Malware | Pre-tokenized | Splits |
|---------|------|-----------|---------------|---------|---------------|--------|
| Binary-30K | 30K | Win+Linux+macOS+Android | 15+ (incl. exotic) | 26.9% | β
| β
|
| SOREL-20M | 20M | Windows only | x86/x64 | 100% | β | β |
| EMBER | 1.1M | Windows only | x86/x64 | 50% | β (features) | β
|
| Assemblage | 1.1M | Windows+Linux | x86/x64 | 0% (benign) | β | β |
π Stratification Verification
Split Distribution Verification:
TRAIN (20,849 samples):
- Malware: 5,613 (26.92%)
- Top platforms: Windows (12,065), Linux (5,915), Other (1,200)
- Top formats: PE (12,018), ELF (5,915), Unknown (1,195)
VALIDATION (4,463 samples):
- Malware: 1,200 (26.89%)
- Top platforms: Windows (2,584), Linux (1,266), Other (256)
- Top formats: PE (2,574), ELF (1,266), Unknown (255)
TEST (4,481 samples):
- Malware: 1,210 (27.00%)
- Top platforms: Windows (2,590), Linux (1,271), Other (259)
- Top formats: PE (2,577), ELF (1,271), Unknown (258)
Statistical Tests: Chi-square tests confirm no significant deviation from proportional representation (p > 0.05 for all dimensions).
π Reproducibility
Split Generation:
- Seed: 42 (for reproducibility)
- Method: Stratified sampling with composite keys
- Date: November 15, 2025
- Tool:
binary-dataset-paper
All splits are deterministic and reproducible. Using the same seed will always produce identical splits.
π Data Sources
Linux Binaries: Alpine 3.18/3.19, Debian 11-12, Ubuntu 20.04/22.04/24.04, Fedora 39-40, CentOS Stream 9, Arch Linux, Kali Linux 2024.1, Parrot OS 6.0, BusyBox 1.37.0
Windows Binaries: Windows 8 Pro, Windows 10 21H2/22H2, Windows 11 23H2, Windows Update Catalog
Malware Samples:
- SOREL-20M dataset (Sophos-ReversingLabs, 2020)
- Malware Bazaar (abuse.ch, 2020-2024) with platform-first stratified sampling
β οΈ Important Considerations
Limitations:
- Static analysis only (no dynamic/runtime behavior)
- Some binaries cannot be parsed by LIEF
- Many binaries have stripped debug symbols
- Very large binaries produce extended token sequences
- iOS/iPadOS binaries not included
- Uneven representation of exotic architectures
Usage Notes:
- Malware samples require secure, isolated research environments
- Windows binaries subject to Microsoft licensing terms
- Fair use application depends on jurisdiction
- Splits are standardized but users may create custom splits for specific research needs
π License and Attribution
Dataset Compilation: CC-BY-4.0 license by Michael J. Bommarito II
Component Licenses:
- Linux binaries: Various open-source licenses (GPL, LGPL, MIT, BSD, Apache)
- Windows binaries: Subject to Microsoft software licenses
- SOREL-20M samples: Follow SOREL-20M License Agreement
- Malware Bazaar samples: Research use only, attribution required to abuse.ch
Malware samples are included for research purposes only. Users must comply with applicable laws and regulations when working with malware samples.
π Citation
If you use this dataset in your research, please cite:
@dataset{bommarito2025binary30k,
title={Binary-30K: A Cross-Platform, Multi-Architecture Binary Dataset with Stratified Splits},
author={Bommarito, Michael J., II},
year={2025},
publisher={HuggingFace},
url={https://huggingface.co/datasets/mjbommar/binary-30k}
}
π Related Resources
- Original dataset (no splits):
mjbommar/binary-30k-tokenized - Tokenizer:
mjbommar/binary-tokenizer-001-64k - Paper: Binary-30K: A Heterogeneous Dataset for Deep Learning in Binary Analysis and Malware Detection
- Code & Documentation: github.com/mjbommar/binary-dataset-paper
- Technical Documentation: See DATASET_SPLITS.md for detailed stratification methodology
π Contact
Author: Michael J. Bommarito II Email: michael.bommarito@gmail.com
π Updates
- 2025-11-15: Initial release with stratified train/val/test splits (70/15/15)
Last Updated: November 15, 2025
- Downloads last month
- 341