-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explainer for out-of-bounds-read exploit (#24)
* WIP explainer with both slides and svg versions * Improve aspect ratio handling and remove slides version * Reorg components and reset bug version
- Loading branch information
1 parent
e9a92a6
commit 0863167
Showing
21 changed files
with
137 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
src/assets/images/out-of-bounds-read-explainer/OutOfBoundsReadImages.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Image_01 from './01.svg' | ||
import Image_02 from './02.svg' | ||
import Image_03 from './03.svg' | ||
import Image_04 from './04.svg' | ||
import Image_05 from './05.svg' | ||
import Image_06 from './06.svg' | ||
import Image_07 from './07.svg' | ||
import Image_08 from './08.svg' | ||
import Image_09 from './09.svg' | ||
import Image_10 from './10.svg' | ||
import Image_11 from './11.svg' | ||
import Image_12 from './12.svg' | ||
import Image_13 from './13.svg' | ||
import Image_14 from './14.svg' | ||
|
||
export default [ | ||
Image_01, | ||
Image_02, | ||
Image_03, | ||
Image_04, | ||
Image_05, | ||
Image_06, | ||
Image_07, | ||
Image_08, | ||
Image_09, | ||
Image_10, | ||
Image_11, | ||
Image_12, | ||
Image_13, | ||
Image_14, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
import Header from './Header' | ||
|
||
const ExplainerWrapper = styled.div` | ||
width: min( | ||
calc(100vw - 20vw), | ||
calc((100vh - 10vh - 164px) * ${({ aspectRatio }) => aspectRatio}) | ||
); | ||
height: min( | ||
calc(100vh - 10vh - 164px), | ||
calc((100vw - 20vw) / ${({ aspectRatio }) => aspectRatio}) | ||
); | ||
overflow: hidden; | ||
align-self: center; | ||
justify-self: center; | ||
` | ||
|
||
const ExplainerImage = styled.img` | ||
width: 100%; | ||
height: 100%; | ||
` | ||
|
||
export default function Explainer(props) { | ||
const { images, nativeSize } = props | ||
const [currentSlide, setCurrentSlide] = React.useState(0) | ||
|
||
const imageCount = images.length | ||
const prevSlide = React.useCallback(() => { | ||
if (currentSlide !== 0) { | ||
setCurrentSlide(currentSlide - 1) | ||
} | ||
}, [currentSlide]) | ||
const nextSlide = React.useCallback(() => { | ||
if (currentSlide !== imageCount - 1) { | ||
setCurrentSlide(currentSlide + 1) | ||
} | ||
}, [currentSlide, imageCount]) | ||
|
||
React.useEffect(() => { | ||
const eventListener = (event) => { | ||
switch (event.key) { | ||
case 'ArrowRight': | ||
return nextSlide() | ||
case 'ArrowLeft': | ||
return prevSlide() | ||
default: | ||
return | ||
} | ||
} | ||
window.addEventListener('keydown', eventListener) | ||
return () => { | ||
window.removeEventListener('keydown', eventListener) | ||
} | ||
}, [nextSlide, prevSlide]) | ||
|
||
return ( | ||
<> | ||
<Header {...props} showClose={true} /> | ||
<ExplainerWrapper aspectRatio={nativeSize.width / nativeSize.height}> | ||
<ExplainerImage | ||
src={images[currentSlide]} | ||
width={nativeSize.width} | ||
height={nativeSize.height} | ||
onClick={nextSlide} | ||
/> | ||
</ExplainerWrapper> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters