From 4244f649ed23456afc502bfc5dc13642790afd96 Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Sat, 2 Mar 2024 23:35:04 +0100 Subject: [PATCH] inital commit, WIP --- buffer-overflow-libc/.gitignore | 15 + buffer-overflow-libc/README.md | 32 + buffer-overflow-libc/package.json | 21 + buffer-overflow-libc/pnpm-lock.yaml | 770 +++++++++++++++++++ buffer-overflow-libc/src/motion-canvas.d.ts | 1 + buffer-overflow-libc/src/project.meta | 31 + buffer-overflow-libc/src/project.ts | 10 + buffer-overflow-libc/src/scenes/code.meta | 5 + buffer-overflow-libc/src/scenes/code.tsx | 394 ++++++++++ buffer-overflow-libc/src/scenes/intro.meta | 5 + buffer-overflow-libc/src/scenes/intro.tsx | 30 + buffer-overflow-libc/src/scenes/printf.meta | 5 + buffer-overflow-libc/src/scenes/printf.tsx | 149 ++++ buffer-overflow-libc/src/scenes/program.meta | 5 + buffer-overflow-libc/src/scenes/program.tsx | 62 ++ buffer-overflow-libc/tsconfig.json | 4 + buffer-overflow-libc/vite.config.ts | 10 + pwntools/src/project.meta | 8 +- pwntools/src/scenes/main.tsx | 9 +- 19 files changed, 1557 insertions(+), 9 deletions(-) create mode 100644 buffer-overflow-libc/.gitignore create mode 100644 buffer-overflow-libc/README.md create mode 100644 buffer-overflow-libc/package.json create mode 100644 buffer-overflow-libc/pnpm-lock.yaml create mode 100644 buffer-overflow-libc/src/motion-canvas.d.ts create mode 100644 buffer-overflow-libc/src/project.meta create mode 100644 buffer-overflow-libc/src/project.ts create mode 100644 buffer-overflow-libc/src/scenes/code.meta create mode 100644 buffer-overflow-libc/src/scenes/code.tsx create mode 100644 buffer-overflow-libc/src/scenes/intro.meta create mode 100644 buffer-overflow-libc/src/scenes/intro.tsx create mode 100644 buffer-overflow-libc/src/scenes/printf.meta create mode 100644 buffer-overflow-libc/src/scenes/printf.tsx create mode 100644 buffer-overflow-libc/src/scenes/program.meta create mode 100644 buffer-overflow-libc/src/scenes/program.tsx create mode 100644 buffer-overflow-libc/tsconfig.json create mode 100644 buffer-overflow-libc/vite.config.ts diff --git a/buffer-overflow-libc/.gitignore b/buffer-overflow-libc/.gitignore new file mode 100644 index 0000000..829b1c7 --- /dev/null +++ b/buffer-overflow-libc/.gitignore @@ -0,0 +1,15 @@ +# Generated files +node_modules +output +dist + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/buffer-overflow-libc/README.md b/buffer-overflow-libc/README.md new file mode 100644 index 0000000..ca36c21 --- /dev/null +++ b/buffer-overflow-libc/README.md @@ -0,0 +1,32 @@ +# Buffer overflow presentation + +Presentation about buffer overflow including libc and canary, using pwntools. + +## Plan + +Show the binary + +Start working on python script: + +```py +from pwn import * + +# --- + +bin = ELF('../challenges/hello') +libc = ELF('/usr/lib/libc.so.6') + +# --- + +context.terminal = "kitty" +context.arch = "amd64" + +# io = process('../challenges/hello') +io = gdb.debug('../challenges/hello') + +# show GDB window + +io.interactive() + + +``` diff --git a/buffer-overflow-libc/package.json b/buffer-overflow-libc/package.json new file mode 100644 index 0000000..6220398 --- /dev/null +++ b/buffer-overflow-libc/package.json @@ -0,0 +1,21 @@ +{ + "name": "buffer-overflow-libc", + "private": true, + "version": "0.0.0", + "scripts": { + "start": "vite", + "serve": "vite", + "build": "tsc && vite build" + }, + "dependencies": { + "@motion-canvas/core": "^3.14.1", + "@motion-canvas/2d": "^3.14.2", + "@motion-canvas/ffmpeg": "^1.1.0" + }, + "devDependencies": { + "@motion-canvas/ui": "^3.14.2", + "@motion-canvas/vite-plugin": "^3.14.1", + "typescript": "^5.2.2", + "vite": "^4.0.0" + } +} \ No newline at end of file diff --git a/buffer-overflow-libc/pnpm-lock.yaml b/buffer-overflow-libc/pnpm-lock.yaml new file mode 100644 index 0000000..5950328 --- /dev/null +++ b/buffer-overflow-libc/pnpm-lock.yaml @@ -0,0 +1,770 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + '@motion-canvas/2d': + specifier: ^3.14.2 + version: 3.14.2 + '@motion-canvas/core': + specifier: ^3.14.1 + version: 3.14.1 + '@motion-canvas/ffmpeg': + specifier: ^1.1.0 + version: 1.1.1(@motion-canvas/core@3.14.1)(@motion-canvas/vite-plugin@3.14.1)(vite@4.5.2) + +devDependencies: + '@motion-canvas/ui': + specifier: ^3.14.2 + version: 3.14.2 + '@motion-canvas/vite-plugin': + specifier: ^3.14.1 + version: 3.14.1(vite@4.5.2) + typescript: + specifier: ^5.2.2 + version: 5.3.3 + vite: + specifier: ^4.0.0 + version: 4.5.2 + +packages: + + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + optional: true + + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + optional: true + + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + optional: true + + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + optional: true + + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + optional: true + + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + optional: true + + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + optional: true + + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + optional: true + + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + optional: true + + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + optional: true + + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + optional: true + + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + optional: true + + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + optional: true + + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + optional: true + + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + optional: true + + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + optional: true + + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + optional: true + + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + optional: true + + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + optional: true + + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + optional: true + + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + optional: true + + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + optional: true + + /@ffmpeg-installer/darwin-arm64@4.1.5: + resolution: {integrity: sha512-hYqTiP63mXz7wSQfuqfFwfLOfwwFChUedeCVKkBtl/cliaTM7/ePI9bVzfZ2c+dWu3TqCwLDRWNSJ5pqZl8otA==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@ffmpeg-installer/darwin-x64@4.1.0: + resolution: {integrity: sha512-Z4EyG3cIFjdhlY8wI9aLUXuH8nVt7E9SlMVZtWvSPnm2sm37/yC2CwjUzyCQbJbySnef1tQwGG2Sx+uWhd9IAw==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@ffmpeg-installer/ffmpeg@1.1.0: + resolution: {integrity: sha512-Uq4rmwkdGxIa9A6Bd/VqqYbT7zqh1GrT5/rFwCwKM70b42W5gIjWeVETq6SdcL0zXqDtY081Ws/iJWhr1+xvQg==} + optionalDependencies: + '@ffmpeg-installer/darwin-arm64': 4.1.5 + '@ffmpeg-installer/darwin-x64': 4.1.0 + '@ffmpeg-installer/linux-arm': 4.1.3 + '@ffmpeg-installer/linux-arm64': 4.1.4 + '@ffmpeg-installer/linux-ia32': 4.1.0 + '@ffmpeg-installer/linux-x64': 4.1.0 + '@ffmpeg-installer/win32-ia32': 4.1.0 + '@ffmpeg-installer/win32-x64': 4.1.0 + dev: false + + /@ffmpeg-installer/linux-arm64@4.1.4: + resolution: {integrity: sha512-dljEqAOD0oIM6O6DxBW9US/FkvqvQwgJ2lGHOwHDDwu/pX8+V0YsDL1xqHbj1DMX/+nP9rxw7G7gcUvGspSoKg==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@ffmpeg-installer/linux-arm@4.1.3: + resolution: {integrity: sha512-NDf5V6l8AfzZ8WzUGZ5mV8O/xMzRag2ETR6+TlGIsMHp81agx51cqpPItXPib/nAZYmo55Bl2L6/WOMI3A5YRg==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@ffmpeg-installer/linux-ia32@4.1.0: + resolution: {integrity: sha512-0LWyFQnPf+Ij9GQGD034hS6A90URNu9HCtQ5cTqo5MxOEc7Rd8gLXrJvn++UmxhU0J5RyRE9KRYstdCVUjkNOQ==} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@ffmpeg-installer/linux-x64@4.1.0: + resolution: {integrity: sha512-Y5BWhGLU/WpQjOArNIgXD3z5mxxdV8c41C+U15nsE5yF8tVcdCGet5zPs5Zy3Ta6bU7haGpIzryutqCGQA/W8A==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@ffmpeg-installer/win32-ia32@4.1.0: + resolution: {integrity: sha512-FV2D7RlaZv/lrtdhaQ4oETwoFUsUjlUiasiZLDxhEUPdNDWcH1OU9K1xTvqz+OXLdsmYelUDuBS/zkMOTtlUAw==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@ffmpeg-installer/win32-x64@4.1.0: + resolution: {integrity: sha512-Drt5u2vzDnIONf4ZEkKtFlbvwj6rI3kxw1Ck9fpudmtgaZIHD4ucsWB2lCZBXRxJgXR+2IMSti+4rtM4C4rXgg==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@ffprobe-installer/darwin-arm64@5.0.1: + resolution: {integrity: sha512-vwNCNjokH8hfkbl6m95zICHwkSzhEvDC3GVBcUp5HX8+4wsX10SP3B+bGur7XUzTIZ4cQpgJmEIAx6TUwRepMg==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@ffprobe-installer/darwin-x64@5.1.0: + resolution: {integrity: sha512-J+YGscZMpQclFg31O4cfVRGmDpkVsQ2fZujoUdMAAYcP0NtqpC49Hs3SWJpBdsGB4VeqOt5TTm1vSZQzs1NkhA==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@ffprobe-installer/ffprobe@2.1.2: + resolution: {integrity: sha512-ZNvwk4f2magF42Zji2Ese16SMj9BS7Fui4kRjg6gTYTxY3gWZNpg85n4MIfQyI9nimHg4x/gT6FVkp/bBDuBwg==} + engines: {node: '>=14.21.2'} + optionalDependencies: + '@ffprobe-installer/darwin-arm64': 5.0.1 + '@ffprobe-installer/darwin-x64': 5.1.0 + '@ffprobe-installer/linux-arm': 5.2.0 + '@ffprobe-installer/linux-arm64': 5.2.0 + '@ffprobe-installer/linux-ia32': 5.2.0 + '@ffprobe-installer/linux-x64': 5.2.0 + '@ffprobe-installer/win32-ia32': 5.1.0 + '@ffprobe-installer/win32-x64': 5.1.0 + dev: false + + /@ffprobe-installer/linux-arm64@5.2.0: + resolution: {integrity: sha512-X1VvWtlLs6ScP73biVLuHD5ohKJKsMTa0vafCESOen4mOoNeLAYbxOVxDWAdFz9cpZgRiloFj5QD6nDj8E28yQ==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@ffprobe-installer/linux-arm@5.2.0: + resolution: {integrity: sha512-PF5HqEhCY7WTWHtLDYbA/+rLS+rhslWvyBlAG1Fk8VzVlnRdl93o6hy7DE2kJgxWQbFaR3ZktPQGEzfkrmQHvQ==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@ffprobe-installer/linux-ia32@5.2.0: + resolution: {integrity: sha512-TFVK5sasXyXhbIG7LtPRDmtkrkOsInwKcL43iEvEw+D9vCS2rc//mn9/0Q+BR0UoJEiMK4+ApYr/3LLVUBPOCQ==} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@ffprobe-installer/linux-x64@5.2.0: + resolution: {integrity: sha512-D3UeqTLYPNs7pBWPLUYGehPdRVqU8eACox4OZy3pZUZatxye2YKlvBwEfaLdL1v2Z4FOAlLUhms0kY8m8kqSRA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@ffprobe-installer/win32-ia32@5.1.0: + resolution: {integrity: sha512-5O3vOoNRxmut0/Nu9vSazTdSHasrr+zPT2B3Hm7kjmO3QVFcIfVImS6ReQnZeSy8JPJOqXts5kX5x/3KOX54XQ==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@ffprobe-installer/win32-x64@5.1.0: + resolution: {integrity: sha512-jMGYeAgkrdn4e2vvYt/qakgHRE3CPju4bn5TmdPfoAm1BlX1mY9cyMd8gf5vSzI8gH8Zq5WQAyAkmekX/8TSTg==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@motion-canvas/2d@3.14.2: + resolution: {integrity: sha512-SaOU0gL9RjUsIRCwNwPo/DLvcLKNPfVylfUcynSocOE6bSjsHrd8ZVNumf4X9Bedf9dxajrWf44eMBNCLQpJyg==} + dependencies: + '@motion-canvas/core': 3.14.1 + code-fns: 0.8.2 + mathjax-full: 3.2.2 + parse-svg-path: 0.1.2 + dev: false + + /@motion-canvas/core@3.14.1: + resolution: {integrity: sha512-1rEys/mOa1WwUttAeHOQwDoLDcVNsFhNIO6YDVTzEGWYMGhHavEsVWdWD8YaDRbBkcHwd1uLKtIahyjERzBnjw==} + dependencies: + '@types/chroma-js': 2.4.4 + chroma-js: 2.4.2 + + /@motion-canvas/ffmpeg@1.1.1(@motion-canvas/core@3.14.1)(@motion-canvas/vite-plugin@3.14.1)(vite@4.5.2): + resolution: {integrity: sha512-w2d7oFfR3hYHXeYtFGoHp6goY+vVL0LoZ2h1b/veTH5KvE7jrLp2Kl/XPHsYJ5ZDRHUT0Nhl05DBLdXYqdSqgg==} + peerDependencies: + '@motion-canvas/core': ^3.7.0 + '@motion-canvas/vite-plugin': ^3.7.0 + vite: 4.x + dependencies: + '@ffmpeg-installer/ffmpeg': 1.1.0 + '@ffprobe-installer/ffprobe': 2.1.2 + '@motion-canvas/core': 3.14.1 + '@motion-canvas/vite-plugin': 3.14.1(vite@4.5.2) + fluent-ffmpeg: 2.1.2 + vite: 4.5.2 + dev: false + + /@motion-canvas/ui@3.14.2: + resolution: {integrity: sha512-5KujeAd+cE88ZTLlnAzvSkKvRx87z/NhBYZo5PLIls2+Z/LdllEvhiEaZfGJuXz8ZZ0f93osDrQmlpB4LI+V7Q==} + dependencies: + '@motion-canvas/core': 3.14.1 + '@preact/signals': 1.2.2(preact@10.19.6) + preact: 10.19.6 + dev: true + + /@motion-canvas/vite-plugin@3.14.1(vite@4.5.2): + resolution: {integrity: sha512-INkDrLmGRLwXlVrHSo7LMbORimYkxlE2DnBnuRdkHF6JeTxeUU+KtHTSW+vTg55cwEz2UykIIW2Tc0KicOU11Q==} + peerDependencies: + vite: 4.x || 5.x + dependencies: + fast-glob: 3.3.2 + follow-redirects: 1.15.5 + mime-types: 2.1.35 + source-map: 0.6.1 + vite: 4.5.2 + transitivePeerDependencies: + - debug + + /@nodelib/fs.scandir@2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + /@nodelib/fs.stat@2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + /@nodelib/fs.walk@1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 + + /@preact/signals-core@1.5.1: + resolution: {integrity: sha512-dE6f+WCX5ZUDwXzUIWNMhhglmuLpqJhuy3X3xHrhZYI0Hm2LyQwOu0l9mdPiWrVNsE+Q7txOnJPgtIqHCYoBVA==} + dev: true + + /@preact/signals@1.2.2(preact@10.19.6): + resolution: {integrity: sha512-ColCqdo4cRP18bAuIR4Oik5rDpiyFtPIJIygaYPMEAwTnl4buWkBOflGBSzhYyPyJfKpkwlekrvK+1pzQ2ldWw==} + peerDependencies: + preact: 10.x + dependencies: + '@preact/signals-core': 1.5.1 + preact: 10.19.6 + dev: true + + /@types/chroma-js@2.4.4: + resolution: {integrity: sha512-/DTccpHTaKomqussrn+ciEvfW4k6NAHzNzs/sts1TCqg333qNxOhy8TNIoQCmbGG3Tl8KdEhkGAssb1n3mTXiQ==} + + /@types/hast@2.3.10: + resolution: {integrity: sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==} + dependencies: + '@types/unist': 2.0.10 + dev: false + + /@types/unist@2.0.10: + resolution: {integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==} + dev: false + + /@wooorm/starry-night@1.7.0: + resolution: {integrity: sha512-ktO0nkddrovIoNW2jAUT+Cdd9n1bWjy1Ir4CdcmgTaT6E94HLlQfu7Yv62falclBEwvsuVp3bSBw23wtta1fNw==} + dependencies: + '@types/hast': 2.3.10 + import-meta-resolve: 2.2.2 + vscode-oniguruma: 1.7.0 + vscode-textmate: 9.0.0 + dev: false + + /async@3.2.5: + resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} + dev: false + + /braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + + /chroma-js@2.4.2: + resolution: {integrity: sha512-U9eDw6+wt7V8z5NncY2jJfZa+hUH8XEj8FQHgFJTrUFnJfXYf4Ml4adI2vXZOjqRDpFWtYVWypDfZwnJ+HIR4A==} + + /code-fns@0.8.2: + resolution: {integrity: sha512-3VVeq3cnWxWiWKFLsVo+XWsOXBSW2gAx2uv0ViETLNmNuygEPHlCeDAv/Zy7xXqPgXtgLZyvIJZmx+ojTgOIGA==} + dependencies: + '@wooorm/starry-night': 1.7.0 + dev: false + + /commander@9.2.0: + resolution: {integrity: sha512-e2i4wANQiSXgnrBlIatyHtP1odfUp0BbV5Y5nEGbxtIrStkEOAAzCUirvLBNXHLr7kwLvJl6V+4V3XV9x7Wd9w==} + engines: {node: ^12.20.0 || >=14} + dev: false + + /esbuild@0.18.20: + resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.18.20 + '@esbuild/android-arm64': 0.18.20 + '@esbuild/android-x64': 0.18.20 + '@esbuild/darwin-arm64': 0.18.20 + '@esbuild/darwin-x64': 0.18.20 + '@esbuild/freebsd-arm64': 0.18.20 + '@esbuild/freebsd-x64': 0.18.20 + '@esbuild/linux-arm': 0.18.20 + '@esbuild/linux-arm64': 0.18.20 + '@esbuild/linux-ia32': 0.18.20 + '@esbuild/linux-loong64': 0.18.20 + '@esbuild/linux-mips64el': 0.18.20 + '@esbuild/linux-ppc64': 0.18.20 + '@esbuild/linux-riscv64': 0.18.20 + '@esbuild/linux-s390x': 0.18.20 + '@esbuild/linux-x64': 0.18.20 + '@esbuild/netbsd-x64': 0.18.20 + '@esbuild/openbsd-x64': 0.18.20 + '@esbuild/sunos-x64': 0.18.20 + '@esbuild/win32-arm64': 0.18.20 + '@esbuild/win32-ia32': 0.18.20 + '@esbuild/win32-x64': 0.18.20 + + /esm@3.2.25: + resolution: {integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==} + engines: {node: '>=6'} + dev: false + + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + + /fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + dependencies: + reusify: 1.0.4 + + /fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + + /fluent-ffmpeg@2.1.2: + resolution: {integrity: sha512-IZTB4kq5GK0DPp7sGQ0q/BWurGHffRtQQwVkiqDgeO6wYJLLV5ZhgNOQ65loZxxuPMKZKZcICCUnaGtlxBiR0Q==} + engines: {node: '>=0.8.0'} + dependencies: + async: 3.2.5 + which: 1.3.1 + dev: false + + /follow-redirects@1.15.5: + resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + optional: true + + /glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + + /import-meta-resolve@2.2.2: + resolution: {integrity: sha512-f8KcQ1D80V7RnqVm+/lirO9zkOxjGxhaTC1IPrBGd3MEfNgmNG67tSUO9gTi2F3Blr2Az6g1vocaxzkVnWl9MA==} + dev: false + + /is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + /is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + /isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: false + + /mathjax-full@3.2.2: + resolution: {integrity: sha512-+LfG9Fik+OuI8SLwsiR02IVdjcnRCy5MufYLi0C3TdMT56L/pjB0alMVGgoWJF8pN9Rc7FESycZB9BMNWIid5w==} + dependencies: + esm: 3.2.25 + mhchemparser: 4.2.1 + mj-context-menu: 0.6.1 + speech-rule-engine: 4.0.7 + dev: false + + /merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + /mhchemparser@4.2.1: + resolution: {integrity: sha512-kYmyrCirqJf3zZ9t/0wGgRZ4/ZJw//VwaRVGA75C4nhE60vtnIzhl9J9ndkX/h6hxSN7pjg/cE0VxbnNM+bnDQ==} + dev: false + + /micromatch@4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + + /mj-context-menu@0.6.1: + resolution: {integrity: sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA==} + dev: false + + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + /parse-svg-path@0.1.2: + resolution: {integrity: sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ==} + dev: false + + /picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + /postcss@8.4.35: + resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.0.2 + + /preact@10.19.6: + resolution: {integrity: sha512-gympg+T2Z1fG1unB8NH29yHJwnEaCH37Z32diPDku316OTnRPeMbiRV9kTrfZpocXjdfnWuFUl/Mj4BHaf6gnw==} + dev: true + + /queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + /reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + /rollup@3.29.4: + resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.3 + + /run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + + /source-map-js@1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + + /source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + + /speech-rule-engine@4.0.7: + resolution: {integrity: sha512-sJrL3/wHzNwJRLBdf6CjJWIlxC04iYKkyXvYSVsWVOiC2DSkHmxsqOhEeMsBA9XK+CHuNcsdkbFDnoUfAsmp9g==} + hasBin: true + dependencies: + commander: 9.2.0 + wicked-good-xpath: 1.3.0 + xmldom-sre: 0.1.31 + dev: false + + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + + /typescript@5.3.3: + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + + /vite@4.5.2: + resolution: {integrity: sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + esbuild: 0.18.20 + postcss: 8.4.35 + rollup: 3.29.4 + optionalDependencies: + fsevents: 2.3.3 + + /vscode-oniguruma@1.7.0: + resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} + dev: false + + /vscode-textmate@9.0.0: + resolution: {integrity: sha512-Cl65diFGxz7gpwbav10HqiY/eVYTO1sjQpmRmV991Bj7wAoOAjGQ97PpQcXorDE2Uc4hnGWLY17xme+5t6MlSg==} + dev: false + + /which@1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: false + + /wicked-good-xpath@1.3.0: + resolution: {integrity: sha512-Gd9+TUn5nXdwj/hFsPVx5cuHHiF5Bwuc30jZ4+ronF1qHK5O7HD0sgmXWSEgwKquT3ClLoKPVbO6qGwVwLzvAw==} + dev: false + + /xmldom-sre@0.1.31: + resolution: {integrity: sha512-f9s+fUkX04BxQf+7mMWAp5zk61pciie+fFLC9hX9UVvCeJQfNHRHXpeo5MPcR0EUf57PYLdt+ZO4f3Ipk2oZUw==} + engines: {node: '>=0.1'} + dev: false diff --git a/buffer-overflow-libc/src/motion-canvas.d.ts b/buffer-overflow-libc/src/motion-canvas.d.ts new file mode 100644 index 0000000..067c6a4 --- /dev/null +++ b/buffer-overflow-libc/src/motion-canvas.d.ts @@ -0,0 +1 @@ +/// diff --git a/buffer-overflow-libc/src/project.meta b/buffer-overflow-libc/src/project.meta new file mode 100644 index 0000000..d15c70d --- /dev/null +++ b/buffer-overflow-libc/src/project.meta @@ -0,0 +1,31 @@ +{ + "version": 0, + "shared": { + "background": "rgb(40,44,52)", + "range": [ + 0, + null + ], + "size": { + "x": 3840, + "y": 2160 + }, + "audioOffset": 0 + }, + "preview": { + "fps": 30, + "resolutionScale": 1 + }, + "rendering": { + "fps": 60, + "resolutionScale": 1, + "colorSpace": "srgb", + "exporter": { + "name": "@motion-canvas/ffmpeg", + "options": { + "fastStart": true, + "includeAudio": true + } + } + } +} \ No newline at end of file diff --git a/buffer-overflow-libc/src/project.ts b/buffer-overflow-libc/src/project.ts new file mode 100644 index 0000000..b687c3c --- /dev/null +++ b/buffer-overflow-libc/src/project.ts @@ -0,0 +1,10 @@ +import {makeProject} from '@motion-canvas/core'; + +import intro from './scenes/intro?scene'; +import program from './scenes/program?scene'; +import code from './scenes/code?scene'; +import printf from './scenes/printf?scene'; + +export default makeProject({ + scenes: [intro, program, code, printf], +}); diff --git a/buffer-overflow-libc/src/scenes/code.meta b/buffer-overflow-libc/src/scenes/code.meta new file mode 100644 index 0000000..cb48d62 --- /dev/null +++ b/buffer-overflow-libc/src/scenes/code.meta @@ -0,0 +1,5 @@ +{ + "version": 0, + "timeEvents": [], + "seed": 2457166561 +} \ No newline at end of file diff --git a/buffer-overflow-libc/src/scenes/code.tsx b/buffer-overflow-libc/src/scenes/code.tsx new file mode 100644 index 0000000..494d9d5 --- /dev/null +++ b/buffer-overflow-libc/src/scenes/code.tsx @@ -0,0 +1,394 @@ +import {Circle, Layout, Node, Ray, Rect, Txt, makeScene2D, saturate} from '@motion-canvas/2d'; +import {DEFAULT, Direction, PossibleVector2, SignalValue, Vector2, all, beginSlide, createRef, delay, modify, slideTransition} from '@motion-canvas/core'; +import { CodeBlock, remove, insert, edit, lines, word } from '@motion-canvas/2d/lib/components/CodeBlock'; + +const BACKGROUND = '#282C34'; +const DARKER = '#21252B'; +const RED = '#E06C75'; +const GREEN = '#98C379'; +const YELLOW = '#E5C07B'; +const BLUE = '#61AFEF'; +const MAGENTA = '#C678DD'; +const CYAN = '#56B6C2'; +const GRAY = '#ABB2BF'; +const WHITE = '#FFFFFF'; +const BLACK = '#000000'; + +function fromTo(a: Node, b: Node, value: SignalValue) { + return modify(value, v => + a + .worldToParent() + .inverse() + .multiply(b.worldToParent()) + .transformPoint(new Vector2(v)), + ); + } + +export default makeScene2D(function* (view) { + const code = createRef(); + yield view.add( + ); + + yield* slideTransition(Direction.Top); + yield* beginSlide("Cleanup"); + + yield* code().edit(.4, false)` + ${edit("undefined8", "long")} main(${remove("void")}) + { + ${remove(`long lVar1; + bool bVar2; + char *pcVar3; + long in_FS_OFFSET; + `)}char name [32]; + int loop${insert(" = true")}; + + ${insert("long ")}${edit("lVar1","stackchk")} = *(long *)(in_FS_OFFSET + 0x28);${remove(` + bVar2 = true;`)} + setbuf(stdout,(char *)0x0); + setbuf(stderr,(char *)0x0); + while (${edit("bVar2","loop")}) { + printf("Enter your name: "); + ${insert("int ")}pcVar3 = gets(name); + if (${remove("(int)")}pcVar3 == 0) { + puts("Bye bye"); + ${edit("bVar2","loop")} = false; + } + else { + printf("Welcome "); + printf(name); + putchar(${edit("10", "'\\n'")}); + } + } + if (${edit("lVar1","stackchk")} != *(long *)(in_FS_OFFSET + 0x28)) {${remove(` + /* WARNING: Subroutine does not return */`)} + __stack_chk_fail(); + } + return 0; + } + `; + yield* code().edit(.4, false)` + long main() + { + ${insert(` + // undefined8 Stack[-0x10]:8 stackchk + // int Stack[-0x18]:4 loop + // char[32] Stack[-0x38] name + + `)}char name [32]; + int loop = true; + + long stackchk = *(long *)(in_FS_OFFSET + 0x28); + setbuf(stdout,(char *)0x0); + setbuf(stderr,(char *)0x0); + while (loop) { + printf("Enter your name: "); + int pcVar3 = gets(name); + if (pcVar3 == 0) { + puts("Bye bye"); + loop = false; + } + else { + printf("Welcome "); + printf(name); + putchar('\\n'); + } + } + if (stackchk != *(long *)(in_FS_OFFSET + 0x28)) { + __stack_chk_fail(); + } + return 0; + } + `; + yield* code().edit(.4, false)` + long main() + { + // ${edit("undefined8", "long ")} Stack[-0x10]:8 stackchk + // int Stack[-0x18]:4 loop + // char[32] Stack[-0x38] name + + char name [32]; + int loop = true; + + long stackchk = *(long *)(in_FS_OFFSET + 0x28); + setbuf(stdout,(char *)0x0); + setbuf(stderr,(char *)0x0); + while (loop) { + printf("Enter your name: "); + int pcVar3 = gets(name); + if (pcVar3 == 0) { + puts("Bye bye"); + loop = false; + } + else { + printf("Welcome "); + printf(name); + putchar('\\n'); + } + } + if (stackchk != *(long *)(in_FS_OFFSET + 0x28)) { + __stack_chk_fail(); + } + return 0; + } + `; + + yield* beginSlide("Add stack"); + + const stackTitle = createRef(); + const rect = createRef(); + const innerLayout = createRef(); + const prevFrame = createRef(); + const rip = createRef(); + const rbp = createRef(); + + view.add(<> + + + + + + + + + + + + + + + + [rect().x() - rect().width()/2 + 144/2 + 20, -950]} + opacity={rect().opacity} + fontFamily="monospace" + fill={GRAY} + /> + ); + + yield* all( + rect().x(3840/4, .3), + rect().opacity(1, .3), + code().x(-3840/4, .3), + rect().shadowBlur(20, .3), + rect().shadowOffset(10, .3), + delay(.2, all( + rect().shadowColor(BLACK + "50", .3), + prevFrame().opacity(0).opacity(1, .2), + prevFrame().margin([200,0,0,0]).margin(0, .2), + delay(.2, all( + rip().opacity(0).opacity(1, .2), + rip().margin([200,0,0,0]).margin(0, .2), + delay(.2, all( + rbp().opacity(0).opacity(1, .2), + rbp().margin([200,0,0,0]).margin(0, .2), + )) + )) + )) + ); + + yield* beginSlide("Add canary to stack"); + + const paddingNotif = createRef(); + const canary = createRef(); + + innerLayout().add(<> + + + + + + + + + ); + + yield* all( + paddingNotif().opacity(0).opacity(1, .3), + paddingNotif().margin([200,0,0,0]).margin(0, .3), + delay(.2, all( + canary().opacity(0).opacity(1, .3), + canary().margin([200,0,0,0]).margin(0, .3), + )) + ); + + yield* beginSlide("Add locals to stack"); + + const loop = createRef(); + const name = createRef(); + + innerLayout().add(<> + + + + + + + + + ); + + yield* all( + loop().opacity(0).opacity(1, .3), + loop().margin([200,0,0,0]).margin(0, .3), + delay(.2, all( + name().opacity(0).opacity(1, .3), + name().margin([200,0,0,0]).margin(0, .3), + )) + ); + + yield* beginSlide("the bug"); + + yield* all( + code().selection([ + ...word(14, 25, 10) + ], .3), + prevFrame().filters.saturate(.3, .3), + rip().filters.saturate(.3, .3), + rbp().filters.saturate(.3, .3), + loop().filters.saturate(.3, .3), + canary().filters.saturate(.3, .3), + paddingNotif().opacity(.5, .3), + ); + + yield* beginSlide("printf"); + + yield* code().selection([ + ...word(21, 15, 13) + ], .3); + + yield* beginSlide("stackchk"); + + yield* all( + code().selection([ + ...lines(9), + ...lines(25, 27) + ], .3), + canary().filters.saturate(1, .3), + name().filters.saturate(.3, .3) + ); + + yield* beginSlide("writing"); + + const ray = createRef(); + view.add(<> + rect().x() - rect().width()/2 - 100} + toX={() => rect().x() - rect().width()/2 - 100} + fromY={() => rect().y() + rect().height()/2} + toY={() => rect().y() - rect().height()/2} + stroke={GRAY} + lineDash={[40, 40]} + lineWidth={4} + /> + ); + + yield* all( + code().selection(DEFAULT, .3), + name().filters.saturate(1, .3), + canary().filters.saturate(.3, .3), + ray().to.y(rect().y() + rect().height()/2).to.y(rect().y() + rect().height()/2 - 700, .3) + ); + + yield* beginSlide("printf"); + + yield* all( + ray().to.y(ray().to.y() - 300, .3), + ray().from.y(ray().to.y, .3), + code().selection(lines(21), .3) + ); + + yield* beginSlide("printf stack"); +}); diff --git a/buffer-overflow-libc/src/scenes/intro.meta b/buffer-overflow-libc/src/scenes/intro.meta new file mode 100644 index 0000000..9d449e5 --- /dev/null +++ b/buffer-overflow-libc/src/scenes/intro.meta @@ -0,0 +1,5 @@ +{ + "version": 0, + "timeEvents": [], + "seed": 3803042645 +} \ No newline at end of file diff --git a/buffer-overflow-libc/src/scenes/intro.tsx b/buffer-overflow-libc/src/scenes/intro.tsx new file mode 100644 index 0000000..cd2375d --- /dev/null +++ b/buffer-overflow-libc/src/scenes/intro.tsx @@ -0,0 +1,30 @@ +import {Circle, makeScene2D} from '@motion-canvas/2d'; +import {Direction, beginSlide, createRef, slideTransition} from '@motion-canvas/core'; +import { CodeBlock, remove, insert, edit, lines } from '@motion-canvas/2d/lib/components/CodeBlock'; + +const BACKGROUND = '#282C34'; +const RED = '#E06C75'; +const GREEN = '#98C379'; +const YELLOW = '#E5C07B'; +const BLUE = '#61AFEF'; +const MAGENTA = '#C678DD'; +const CYAN = '#56B6C2'; +const GRAY = '#ABB2BF'; +const WHITE = '#FFFFFF'; +const BLACK = '#000000'; + +export default makeScene2D(function* (view) { + const code = createRef(); + yield view.add( + ); + + yield* beginSlide("Intro"); +}); diff --git a/buffer-overflow-libc/src/scenes/printf.meta b/buffer-overflow-libc/src/scenes/printf.meta new file mode 100644 index 0000000..fd2083e --- /dev/null +++ b/buffer-overflow-libc/src/scenes/printf.meta @@ -0,0 +1,5 @@ +{ + "version": 0, + "timeEvents": [], + "seed": 3508620439 +} \ No newline at end of file diff --git a/buffer-overflow-libc/src/scenes/printf.tsx b/buffer-overflow-libc/src/scenes/printf.tsx new file mode 100644 index 0000000..5820532 --- /dev/null +++ b/buffer-overflow-libc/src/scenes/printf.tsx @@ -0,0 +1,149 @@ +import {Circle, Layout, Node, Ray, Rect, Txt, makeScene2D, saturate} from '@motion-canvas/2d'; +import {DEFAULT, Direction, PossibleVector2, SignalValue, Vector2, all, beginSlide, createRef, delay, modify, slideTransition} from '@motion-canvas/core'; +import { CodeBlock, remove, insert, edit, lines, word } from '@motion-canvas/2d/lib/components/CodeBlock'; + +const BACKGROUND = '#282C34'; +const DARKER = '#21252B'; +const RED = '#E06C75'; +const GREEN = '#98C379'; +const YELLOW = '#E5C07B'; +const BLUE = '#61AFEF'; +const MAGENTA = '#C678DD'; +const CYAN = '#56B6C2'; +const GRAY = '#ABB2BF'; +const WHITE = '#FFFFFF'; +const BLACK = '#000000'; + +export default makeScene2D(function* (view) { + const code = createRef(); + yield view.add( + ); + + yield* slideTransition(Direction.Bottom); + + yield* beginSlide("Add assembly"); + + yield* code().edit(.3)` + printf("%s", text) + ${insert(` + move rdi, text + mov rax, "%s" + call printf + `)}`; + + yield* beginSlide("Add params"); + + yield* all( + code().edit(.3, false)` + printf("%s", text${insert(", 1..6")}) + ${insert(`push 6 +mov r9d, 5 +mov r8d, 4 +mov ecx, 3 +mov edx, 2 +mov esi, 1 +`)}mov rdi, text + mov rax, "%s + call printf + `, + code().selection(lines(1, 10), .3) + ); + + yield* beginSlide("Add stack"); + + const stackTitle = createRef(); + const rect = createRef(); + const innerLayout = createRef(); + const prevFrame = createRef(); + const rip = createRef(); + const rbp = createRef(); + + view.add(<> + + + + + + + + + + + + + + + + [rect().x() - rect().width()/2 + 144/2 + 20, -950]} + opacity={rect().opacity} + fontFamily="monospace" + fill={GRAY} + /> + ); + + + yield* all( + rect().x(3840/4, .3), + rect().opacity(1, .3), + code().x(-3840/4, .3), + rect().shadowBlur(20, .3), + rect().shadowOffset(10, .3), + delay(.2, all( + rect().shadowColor(BLACK + "50", .3), + prevFrame().opacity(0).opacity(1, .2), + prevFrame().margin([200,0,0,0]).margin(0, .2), + delay(.2, all( + rip().opacity(0).opacity(1, .2), + rip().margin([200,0,0,0]).margin(0, .2), + delay(.2, all( + rbp().opacity(0).opacity(1, .2), + rbp().margin([200,0,0,0]).margin(0, .2), + )) + )) + )) + ); + + yield* beginSlide("Add text"); +}); diff --git a/buffer-overflow-libc/src/scenes/program.meta b/buffer-overflow-libc/src/scenes/program.meta new file mode 100644 index 0000000..452bb75 --- /dev/null +++ b/buffer-overflow-libc/src/scenes/program.meta @@ -0,0 +1,5 @@ +{ + "version": 0, + "timeEvents": [], + "seed": 1499371786 +} \ No newline at end of file diff --git a/buffer-overflow-libc/src/scenes/program.tsx b/buffer-overflow-libc/src/scenes/program.tsx new file mode 100644 index 0000000..b0a6a16 --- /dev/null +++ b/buffer-overflow-libc/src/scenes/program.tsx @@ -0,0 +1,62 @@ +import {Circle, makeScene2D} from '@motion-canvas/2d'; +import {Direction, all, beginSlide, createRef, slideTransition} from '@motion-canvas/core'; +import { CodeBlock, remove, insert, edit, lines } from '@motion-canvas/2d/lib/components/CodeBlock'; + +const BACKGROUND = '#282C34'; +const RED = '#E06C75'; +const GREEN = '#98C379'; +const YELLOW = '#E5C07B'; +const BLUE = '#61AFEF'; +const MAGENTA = '#C678DD'; +const CYAN = '#56B6C2'; +const GRAY = '#ABB2BF'; +const WHITE = '#FFFFFF'; +const BLACK = '#000000'; + +export default makeScene2D(function* (view) { + const code = createRef(); + yield view.add( + ); + yield* slideTransition(Direction.Bottom); + + yield* beginSlide("program"); + + yield* code().edit(.3)` + $ ./hello + ${insert(` + Enter your name: + `)}`; + + yield* beginSlide("enter name"); + + yield* code().edit(.3)` + $ ./hello + Enter your name:${insert(` test`)} + `; + + yield* beginSlide("entered name"); + + yield* + all( + code().edit(.3, false)` + $ ./hello + Enter your name: test + ${insert(`Welcome test +Enter your name: + `)}`, + code().selection(lines(2), .3) + ); + + yield* beginSlide("welcome"); + + yield* code().selection(lines(3), .3); + + yield* beginSlide("repeat"); +}); diff --git a/buffer-overflow-libc/tsconfig.json b/buffer-overflow-libc/tsconfig.json new file mode 100644 index 0000000..e7d5347 --- /dev/null +++ b/buffer-overflow-libc/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "@motion-canvas/2d/tsconfig.project.json", + "include": ["src"] +} diff --git a/buffer-overflow-libc/vite.config.ts b/buffer-overflow-libc/vite.config.ts new file mode 100644 index 0000000..42d9d68 --- /dev/null +++ b/buffer-overflow-libc/vite.config.ts @@ -0,0 +1,10 @@ +import {defineConfig} from 'vite'; +import motionCanvas from '@motion-canvas/vite-plugin'; +import ffmpeg from '@motion-canvas/ffmpeg'; + +export default defineConfig({ + plugins: [ + motionCanvas(), + ffmpeg(), + ], +}); diff --git a/pwntools/src/project.meta b/pwntools/src/project.meta index 5ebc5fc..b604d8d 100644 --- a/pwntools/src/project.meta +++ b/pwntools/src/project.meta @@ -1,14 +1,14 @@ { "version": 0, "shared": { - "background": "rgb(40,44,52)", + "background": "rgb(200,25,85)", "range": [ 0, null ], "size": { - "x": 1920, - "y": 1080 + "x": 3840, + "y": 2160 }, "audioOffset": 0 }, @@ -17,7 +17,7 @@ "resolutionScale": 1 }, "rendering": { - "fps": 60, + "fps": 10, "resolutionScale": 1, "colorSpace": "srgb", "exporter": { diff --git a/pwntools/src/scenes/main.tsx b/pwntools/src/scenes/main.tsx index ac05bb4..77cc1a1 100644 --- a/pwntools/src/scenes/main.tsx +++ b/pwntools/src/scenes/main.tsx @@ -20,7 +20,7 @@ export default makeScene2D(function* (view) { code={"from pwm import *"} language='python' ref={cref} - fontSize={30} + fontSize={56} />); yield* beginSlide("first"); @@ -103,9 +103,7 @@ code = int(line.strip(), 16) `)}`; yield* beginSlide("code") - - yield* cref().fontSize(24, .5) - + yield* cref().fontSize(48, .5); yield* cref().edit(.5, lines(19,23))`from pwm import * @@ -242,7 +240,8 @@ io.sendline(rop.chain()) yield* beginSlide("send rop") - yield* cref().edit(.5, lines(34))`from pwm import * + yield* cref().edit(.5, lines(33))` +from pwm import * context.arch = "amd64" context.terminal = ["tmux", "splitw", "-h"]