CINXE.COM

Unprotect the App-Bound Encryption Key via an RPC call to Google Chrome Elevation Service (PoC) 路 GitHub

<!DOCTYPE html> <html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system" data-a11y-link-underlines="true" > <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-74231a1f3bbb.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-8a995f0bacd4.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-f37fb7684b1f.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-9ac301c3ebe5.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-cd826e8636dc.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-f91b0f603451.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-83beb16e0ecf.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-6e122dab64fc.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-18119e682df0.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-primitives-225433424a87.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-aaa714e5674d.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-7eaba1d4847c.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-ea73c9cb5377.css" /> <script type="application/json" id="client-env">{"locale":"en","featureFlags":["a11y_quote_reply_fix","copilot_immersive_issue_preview","copilot_new_references_ui","copilot_chat_repo_custom_instructions_preview","copilot_no_floating_button","copilot_topics_as_references","copilot_read_shared_conversation","copilot_duplicate_thread","copilot_buffered_streaming","dotcom_chat_client_side_skills","experimentation_azure_variant_endpoint","failbot_handle_non_errors","fgpat_form_ui_updates","geojson_azure_maps","ghost_pilot_confidence_truncation_25","ghost_pilot_confidence_truncation_40","github_models_o3_mini_streaming","insert_before_patch","issues_react_remove_placeholders","issues_react_blur_item_picker_on_close","marketing_pages_search_explore_provider","primer_react_css_modules_ga","react_data_router_pull_requests","remove_child_patch","sample_network_conn_type","swp_enterprise_contact_form","site_proxima_australia_update","viewscreen_sandbox","issues_react_create_milestone","issues_react_cache_fix_workaround","lifecycle_label_name_updates","copilot_task_oriented_assistive_prompts","issue_types_prevent_private_type_creation","refresh_image_video_src","react_router_dispose_on_disconnect","codespaces_prebuild_region_target_update","turbo_app_id_restore","copilot_code_review_sign_up_closed"]}</script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-78acda12a57e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover_js-9da652f58479.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_arianotify-polyfill_ariaNotify-polyfill_js-node_modules_github_mi-3abb8f-46b9f4874d95.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_failbot_failbot_ts-75968cfb5298.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-f04cb2a9fc8c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_index_mjs-0dbb79f97f8f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-f690fd9ae3d5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-62d275b7ddd9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_text-expander-element_dist_index_js-78748950cb0c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-8e9f78-a90ac05d2469.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-b5f1d7-a1760ffda83d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_markdown-toolbar-element_dist_index_js-ceef33f593fa.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-c44a69-efa32db3a345.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-394f8eb34f19.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-8206a1f1fc89.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_braintree_browser-detection_dist_browser-detection_js-node_modules_githu-2906d7-2a07a295af40.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-be8cb88f481b.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_morphdom_dist_morphdom-e-7c534c-a4a1922eb55f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_turbo_dist_turbo_es2017-esm_js-a03ee12d659a.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-893f9f-b6294cf703b7.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-e3180fe3bcb3.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_quote-selection_dist_index_js-node_modules_github_session-resume_-947061-e7a6c4a19f98.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_updatable-content_updatable-content_ts-2a55124d5c52.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_task-list_ts-app_assets_modules_github_sso_ts-ui_packages-900dde-768abe60b1f8.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-3e000c5d31a9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-87a4ae-b8865f653f6b.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-e429cff6ceb1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-c1f5beceda17.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-f6223d90c7ba.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-01e85cd1be94.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_remote-form_dist_-364c09-4bdc7a460fab.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_diffs_blob-lines_ts-app_assets_modules_github_diffs_linkable-line-n-b8c0ea-90d580abff98.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/gist-8fac1096aa53.js"></script> <title>Unprotect the App-Bound Encryption Key via an RPC call to Google Chrome Elevation Service (PoC) 路 GitHub</title> <meta name="route-pattern" content="/:user_id/:gist_id(.:format)" data-turbo-transient> <meta name="route-controller" content="gists_gists" data-turbo-transient> <meta name="route-action" content="show" data-turbo-transient> <meta name="current-catalog-service-hash" content="56253a530ab9027b25719525dcbe6007461a3202218f6f5dfce5a601c121cbcb"> <meta name="request-id" content="975C:32FEBC:46A8F9:552ECA:67E4D3FD" data-pjax-transient="true"/><meta name="html-safe-nonce" content="86d3d3d72934dd4009ca29ef11e1a00c2729bba39f3e6e40b4dff69649e2823a" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzVDOjMyRkVCQzo0NkE4Rjk6NTUyRUNBOjY3RTREM0ZEIiwidmlzaXRvcl9pZCI6IjEwMjczODAyMjIxNzMxNzI3MzMiLCJyZWdpb25fZWRnZSI6InNvdXRoZWFzdGFzaWEiLCJyZWdpb25fcmVuZGVyIjoic291dGhlYXN0YXNpYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="174fa911ca103d20d0a8eda0e91ce531fcb4487b4ca7617812473a466dd5e9d2" data-pjax-transient="true"/> <meta name="github-keyboard-shortcuts" content="copilot" data-turbo-transient="true" /> <meta name="selected-link" value="gist_code" data-turbo-transient> <link rel="assets" href="https://github.githubassets.com/"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/&lt;user-name&gt;/&lt;gist-id&gt;" data-turbo-transient="true" /><meta name="octolytics-location" content="/&lt;user-name&gt;/&lt;gist-id&gt;" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="Unprotect the App-Bound Encryption Key via an RPC call to Google Chrome Elevation Service (PoC) - elevator_decrypt_key.cpp"> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch-gist.xml" title="Gist"> <link rel="fluid-icon" href="https://gist.github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824" /> <meta name="twitter:image" content="https://github.githubassets.com/assets/gist-og-image-54fd7dc0713e.png" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="Unprotect the App-Bound Encryption Key via an RPC call to Google Chrome Elevation Service (PoC)" /><meta name="twitter:description" content="Unprotect the App-Bound Encryption Key via an RPC call to Google Chrome Elevation Service (PoC) - elevator_decrypt_key.cpp" /> <meta property="og:image" content="https://github.githubassets.com/assets/gist-og-image-54fd7dc0713e.png" /><meta property="og:image:alt" content="Unprotect the App-Bound Encryption Key via an RPC call to Google Chrome Elevation Service (PoC) - elevator_decrypt_key.cpp" /><meta property="og:site_name" content="Gist" /><meta property="og:type" content="article" /><meta property="og:title" content="Unprotect the App-Bound Encryption Key via an RPC call to Google Chrome Elevation Service (PoC)" /><meta property="og:url" content="https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824" /><meta property="og:description" content="Unprotect the App-Bound Encryption Key via an RPC call to Google Chrome Elevation Service (PoC) - elevator_decrypt_key.cpp" /><meta property="article:author" content="262588213843476" /><meta property="article:publisher" content="262588213843476" /> <meta name="hostname" content="gist.github.com"> <meta name="expected-hostname" content="gist.github.com"> <meta http-equiv="x-pjax-version" content="43d48ebc0aeb8da7e24d76441cdfec8f763d3d20c2dfbe2992450531b9b0cecf" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="77190eb53eb47fc30bd2fcc17a7eefa2dfd8505869fee9299ba911be3a40a9eb" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="911af613659f2a8ff08d51fd492330c9e8a6ed8f0c4eb3c6632db43599431d16" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="a512f9408e2c6e7c4ac5f57e22ffd863dc2e264e38455c3024733302983fa082" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <link href="/snovvcrash.atom" rel="alternate" title="atom" type="application/atom+xml"> <meta name="robots" content="noindex, follow" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/gist-f06c9416fa76.css" /> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="release" content="5e3ae745f1047f7944b974613819873f4d1a808a"> <link rel="mask-icon" href="https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg" data-base-href="https://github.githubassets.com/favicons/favicon"> <meta name="theme-color" content="#1e2327"> <meta name="color-scheme" content="light dark" /> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative header-wrapper js-header-wrapper "> <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a> <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full"> <span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span> </span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/primer-react-dee7fde768ad.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-core-a18127980111.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-lib-f1bca44e0926.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/octicons-react-cf2f2ab8dab4.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_emotion_is-prop-valid_dist_emotion-is-prop-valid_esm_js-node_modules_emo-62da9f-2df2f32ec596.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-e7dcdd-9a233856b02c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover-fn_js-55fea94174bf.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_ui-commands_ui-commands_ts-2ea4e93613c0.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/keyboard-shortcuts-dialog-33dfb803e078.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.2708311ccb5cb34358b1.module.css" /> <react-partial partial-name="keyboard-shortcuts-dialog" data-ssr="false" data-attempted-ssr="false" > <script type="application/json" data-target="react-partial.embeddedData">{"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}</script> <div data-target="react-partial.reactRoot"></div> </react-partial> <div class="Header js-details-container Details flex-wrap flex-md-nowrap p-responsive" role="banner" > <div class="Header-item d-none d-md-flex"> <a class="Header-link" data-hotkey="g d" aria-label="Gist Homepage " href="/"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github v-align-middle d-inline-block d-md-none"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> <svg aria-hidden="true" height="24" viewBox="0 0 68 24" version="1.1" width="68" data-view-component="true" class="octicon octicon-logo-github v-align-middle d-none d-md-inline-block"> <path d="M27.8 17.908h-.03c.013 0 .022.014.035.017l.01-.002-.016-.015Zm.005.017c-.14.001-.49.073-.861.073-1.17 0-1.575-.536-1.575-1.234v-4.652h2.385c.135 0 .24-.12.24-.283V9.302c0-.133-.12-.252-.24-.252H25.37V5.913c0-.119-.075-.193-.21-.193h-3.24c-.136 0-.21.074-.21.193V9.14s-1.636.401-1.741.416a.255.255 0 0 0-.195.253v2.021c0 .164.12.282.255.282h1.665v4.876c0 3.627 2.55 3.998 4.29 3.998.796 0 1.756-.252 1.906-.327.09-.03.135-.134.135-.238v-2.23a.264.264 0 0 0-.219-.265Zm35.549-3.272c0-2.69-1.095-3.047-2.25-2.928-.9.06-1.62.505-1.62.505v5.232s.735.506 1.83.536c1.545.044 2.04-.506 2.04-3.345ZM67 14.415c0 5.099-1.665 6.555-4.576 6.555-2.46 0-3.78-1.233-3.78-1.233s-.06.683-.135.773c-.045.089-.12.118-.21.118h-2.22c-.15 0-.286-.119-.286-.252l.03-16.514a.26.26 0 0 1 .255-.252h3.196a.26.26 0 0 1 .255.252v5.604s1.23-.788 3.03-.788l-.015-.03c1.8 0 4.456.67 4.456 5.767ZM53.918 9.05h-3.15c-.165 0-.255.119-.255.282v8.086s-.826.58-1.95.58c-1.126 0-1.456-.506-1.456-1.62v-7.06a.262.262 0 0 0-.255-.254h-3.21a.262.262 0 0 0-.256.253v7.596c0 3.27 1.846 4.087 4.381 4.087 2.085 0 3.78-1.145 3.78-1.145s.076.58.12.67c.03.074.136.133.24.133h2.011a.243.243 0 0 0 .255-.253l.03-11.103c0-.133-.12-.252-.285-.252Zm-35.556-.015h-3.195c-.135 0-.255.134-.255.297v10.91c0 .297.195.401.45.401h2.88c.3 0 .375-.134.375-.401V9.287a.262.262 0 0 0-.255-.252ZM16.787 4.01c-1.155 0-2.07.907-2.07 2.051 0 1.145.915 2.051 2.07 2.051a2.04 2.04 0 0 0 2.04-2.05 2.04 2.04 0 0 0-2.04-2.052Zm24.74-.372H38.36a.262.262 0 0 0-.255.253v6.08H33.14v-6.08a.262.262 0 0 0-.255-.253h-3.196a.262.262 0 0 0-.255.253v16.514c0 .133.135.252.255.252h3.196a.262.262 0 0 0 .255-.253v-7.06h4.966l-.03 7.06c0 .134.12.253.255.253h3.195a.262.262 0 0 0 .255-.253V3.892a.262.262 0 0 0-.255-.253Zm-28.31 7.313v8.532c0 .06-.015.163-.09.193 0 0-1.875 1.323-4.966 1.323C4.426 21 0 19.84 0 12.2S3.87 2.986 7.651 3c3.27 0 4.59.728 4.8.862.06.075.09.134.09.208l-.63 2.646c0 .134-.134.297-.3.253-.54-.164-1.35-.49-3.255-.49-2.205 0-4.575.623-4.575 5.543s2.25 5.5 3.87 5.5c1.38 0 1.875-.164 1.875-.164V13.94H7.321c-.165 0-.285-.12-.285-.253v-2.735c0-.134.12-.252.285-.252h5.61c.166 0 .286.118.286.252Z"></path> </svg> <svg aria-hidden="true" height="24" viewBox="0 0 38 24" version="1.1" width="38" data-view-component="true" class="octicon octicon-logo-gist v-align-middle d-none d-md-inline-block"> <path d="M7.05 13.095v-1.5h5.28v8.535c-1.17.555-2.925.96-5.385.96C1.665 21.09 0 17.055 0 12.045S1.695 3 6.945 3c2.43 0 3.96.495 4.92.99v1.575c-1.83-.75-3-1.095-4.92-1.095-3.855 0-5.22 3.315-5.22 7.59s1.365 7.575 5.205 7.575c1.335 0 2.97-.105 3.795-.51v-6.03H7.05Zm16.47 1.035h.045c3.33.3 4.125 1.425 4.125 3.345 0 1.815-1.14 3.615-4.71 3.615-1.125 0-2.745-.285-3.495-.585v-1.41c.705.255 1.83.54 3.495.54 2.43 0 3.09-1.035 3.09-2.13 0-1.065-.33-1.815-2.655-2.01-3.39-.3-4.095-1.5-4.095-3.12 0-1.665 1.08-3.465 4.38-3.465 1.095 0 2.34.135 3.375.585v1.41c-.915-.3-1.83-.54-3.405-.54-2.325 0-2.82.855-2.82 2.01 0 1.035.42 1.56 2.67 1.755Zm12.87-4.995v1.275h-3.63v7.305c0 1.425.795 2.01 2.25 2.01.3 0 .63 0 .915-.045v1.335c-.255.045-.75.075-1.035.075-1.965 0-3.75-.9-3.75-3.195v-7.5H28.8v-.72l2.34-.66V5.85l1.62-.465v3.75h3.63ZM16.635 9.09v9.615c0 .81.285 1.05 1.005 1.05v1.335c-1.71 0-2.58-.705-2.58-2.58V9.09h1.575Zm.375-3.495c0 .66-.51 1.17-1.17 1.17a1.14 1.14 0 0 1-1.155-1.17c0-.66.48-1.17 1.155-1.17s1.17.51 1.17 1.17Z"></path> </svg> </a> </div> <div class="Header-item d-md-none"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="Header-link js-details-target btn-link"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-three-bars"> <path d="M3.75 5.25a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Zm0 6a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Zm0 6a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Z"></path> </svg> </button> </div> <div class="Header-item Header-item--full js-site-search flex-column flex-md-row width-full flex-order-2 flex-md-order-none mr-0 mr-md-3 mt-3 mt-md-0 Details-content--hidden-not-important d-md-flex"> <div class="header-search flex-self-stretch flex-md-self-auto mr-0 mr-md-3 mb-3 mb-md-0"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form data-turbo="false" action="/search" accept-charset="UTF-8" method="get"> <div class="d-flex"> <primer-text-field class="FormControl width-full FormControl--fullWidth"> <label class="sr-only FormControl-label" for="q"> Search Gists </label> <div class="FormControl-input-wrap"> <input placeholder="Search..." aria-describedby="validation-5deacbeb-5902-4967-9a76-554621aad02b" data-target="primer-text-field.inputElement " class="form-control FormControl-input FormControl-medium rounded-right-0" type="text" name="q" id="q" /> </div> <div class="FormControl-inlineValidation" id="validation-5deacbeb-5902-4967-9a76-554621aad02b" hidden="hidden"> <span class="FormControl-inlineValidation--visual" data-target="primer-text-field.validationSuccessIcon" hidden><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-check-circle-fill"> <path d="M6 0a6 6 0 1 1 0 12A6 6 0 0 1 6 0Zm-.705 8.737L9.63 4.403 8.392 3.166 5.295 6.263l-1.7-1.702L2.356 5.8l2.938 2.938Z"></path> </svg></span> <span class=" FormControl-inlineValidation--visual" data-target="primer-text-field.validationErrorIcon"><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill"> <path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path> </svg></span> <span></span> </div> </primer-text-field> <button id="icon-button-76d5d61d-c43e-490c-b802-7b5fe3ae8968" aria-labelledby="tooltip-27a111c0-db81-4b16-85d8-1d116c48fa75" type="submit" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--medium rounded-left-0"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search Button-visual"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </button><tool-tip id="tooltip-27a111c0-db81-4b16-85d8-1d116c48fa75" for="icon-button-76d5d61d-c43e-490c-b802-7b5fe3ae8968" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Search Gists</tool-tip> </form> </div> </div> <nav aria-label="Global" class="d-flex flex-column flex-md-row flex-self-stretch flex-md-self-auto"> <a class="Header-link mr-0 mr-md-3 py-2 py-md-0 border-top border-md-top-0 border-white-fade" data-ga-click="Header, go to all gists, text:all gists" href="/discover">All gists</a> <a class="Header-link mr-0 mr-md-3 py-2 py-md-0 border-top border-md-top-0 border-white-fade" data-ga-click="Header, go to GitHub, text:Back to GitHub" href="https://github.com">Back to GitHub</a> <a class="Header-link d-block d-md-none mr-0 mr-md-3 py-2 py-md-0 border-top border-md-top-0 border-white-fade" data-ga-click="Header, sign in" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist header&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="80727a3537cee498d16901b014d50282a9c52714959727229dc3764062db784e" href="https://gist.github.com/auth/github?return_to=https%3A%2F%2Fgist.github.com%2Fsnovvcrash%2Fcaded55a318bbefcb6cc9ee30e82f824"> Sign in </a> <a class="Header-link d-block d-md-none mr-0 mr-md-3 py-2 py-md-0 border-top border-md-top-0 border-white-fade" data-ga-click="Header, sign up" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist header&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="08b2fb7d1deefef48a9ac775712fcb01696e9ec476cd3376d2243487e89e4a7c" href="/join?return_to=https%3A%2F%2Fgist.github.com%2Fsnovvcrash%2Fcaded55a318bbefcb6cc9ee30e82f824&amp;source=header-gist"> Sign up </a></nav> </div> <div class="Header-item Header-item--full flex-justify-center d-md-none position-relative"> <a class="Header-link" data-hotkey="g d" aria-label="Gist Homepage " href="/"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github v-align-middle d-inline-block d-md-none"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> <svg aria-hidden="true" height="24" viewBox="0 0 68 24" version="1.1" width="68" data-view-component="true" class="octicon octicon-logo-github v-align-middle d-none d-md-inline-block"> <path d="M27.8 17.908h-.03c.013 0 .022.014.035.017l.01-.002-.016-.015Zm.005.017c-.14.001-.49.073-.861.073-1.17 0-1.575-.536-1.575-1.234v-4.652h2.385c.135 0 .24-.12.24-.283V9.302c0-.133-.12-.252-.24-.252H25.37V5.913c0-.119-.075-.193-.21-.193h-3.24c-.136 0-.21.074-.21.193V9.14s-1.636.401-1.741.416a.255.255 0 0 0-.195.253v2.021c0 .164.12.282.255.282h1.665v4.876c0 3.627 2.55 3.998 4.29 3.998.796 0 1.756-.252 1.906-.327.09-.03.135-.134.135-.238v-2.23a.264.264 0 0 0-.219-.265Zm35.549-3.272c0-2.69-1.095-3.047-2.25-2.928-.9.06-1.62.505-1.62.505v5.232s.735.506 1.83.536c1.545.044 2.04-.506 2.04-3.345ZM67 14.415c0 5.099-1.665 6.555-4.576 6.555-2.46 0-3.78-1.233-3.78-1.233s-.06.683-.135.773c-.045.089-.12.118-.21.118h-2.22c-.15 0-.286-.119-.286-.252l.03-16.514a.26.26 0 0 1 .255-.252h3.196a.26.26 0 0 1 .255.252v5.604s1.23-.788 3.03-.788l-.015-.03c1.8 0 4.456.67 4.456 5.767ZM53.918 9.05h-3.15c-.165 0-.255.119-.255.282v8.086s-.826.58-1.95.58c-1.126 0-1.456-.506-1.456-1.62v-7.06a.262.262 0 0 0-.255-.254h-3.21a.262.262 0 0 0-.256.253v7.596c0 3.27 1.846 4.087 4.381 4.087 2.085 0 3.78-1.145 3.78-1.145s.076.58.12.67c.03.074.136.133.24.133h2.011a.243.243 0 0 0 .255-.253l.03-11.103c0-.133-.12-.252-.285-.252Zm-35.556-.015h-3.195c-.135 0-.255.134-.255.297v10.91c0 .297.195.401.45.401h2.88c.3 0 .375-.134.375-.401V9.287a.262.262 0 0 0-.255-.252ZM16.787 4.01c-1.155 0-2.07.907-2.07 2.051 0 1.145.915 2.051 2.07 2.051a2.04 2.04 0 0 0 2.04-2.05 2.04 2.04 0 0 0-2.04-2.052Zm24.74-.372H38.36a.262.262 0 0 0-.255.253v6.08H33.14v-6.08a.262.262 0 0 0-.255-.253h-3.196a.262.262 0 0 0-.255.253v16.514c0 .133.135.252.255.252h3.196a.262.262 0 0 0 .255-.253v-7.06h4.966l-.03 7.06c0 .134.12.253.255.253h3.195a.262.262 0 0 0 .255-.253V3.892a.262.262 0 0 0-.255-.253Zm-28.31 7.313v8.532c0 .06-.015.163-.09.193 0 0-1.875 1.323-4.966 1.323C4.426 21 0 19.84 0 12.2S3.87 2.986 7.651 3c3.27 0 4.59.728 4.8.862.06.075.09.134.09.208l-.63 2.646c0 .134-.134.297-.3.253-.54-.164-1.35-.49-3.255-.49-2.205 0-4.575.623-4.575 5.543s2.25 5.5 3.87 5.5c1.38 0 1.875-.164 1.875-.164V13.94H7.321c-.165 0-.285-.12-.285-.253v-2.735c0-.134.12-.252.285-.252h5.61c.166 0 .286.118.286.252Z"></path> </svg> <svg aria-hidden="true" height="24" viewBox="0 0 38 24" version="1.1" width="38" data-view-component="true" class="octicon octicon-logo-gist v-align-middle d-none d-md-inline-block"> <path d="M7.05 13.095v-1.5h5.28v8.535c-1.17.555-2.925.96-5.385.96C1.665 21.09 0 17.055 0 12.045S1.695 3 6.945 3c2.43 0 3.96.495 4.92.99v1.575c-1.83-.75-3-1.095-4.92-1.095-3.855 0-5.22 3.315-5.22 7.59s1.365 7.575 5.205 7.575c1.335 0 2.97-.105 3.795-.51v-6.03H7.05Zm16.47 1.035h.045c3.33.3 4.125 1.425 4.125 3.345 0 1.815-1.14 3.615-4.71 3.615-1.125 0-2.745-.285-3.495-.585v-1.41c.705.255 1.83.54 3.495.54 2.43 0 3.09-1.035 3.09-2.13 0-1.065-.33-1.815-2.655-2.01-3.39-.3-4.095-1.5-4.095-3.12 0-1.665 1.08-3.465 4.38-3.465 1.095 0 2.34.135 3.375.585v1.41c-.915-.3-1.83-.54-3.405-.54-2.325 0-2.82.855-2.82 2.01 0 1.035.42 1.56 2.67 1.755Zm12.87-4.995v1.275h-3.63v7.305c0 1.425.795 2.01 2.25 2.01.3 0 .63 0 .915-.045v1.335c-.255.045-.75.075-1.035.075-1.965 0-3.75-.9-3.75-3.195v-7.5H28.8v-.72l2.34-.66V5.85l1.62-.465v3.75h3.63ZM16.635 9.09v9.615c0 .81.285 1.05 1.005 1.05v1.335c-1.71 0-2.58-.705-2.58-2.58V9.09h1.575Zm.375-3.495c0 .66-.51 1.17-1.17 1.17a1.14 1.14 0 0 1-1.155-1.17c0-.66.48-1.17 1.155-1.17s1.17.51 1.17 1.17Z"></path> </svg> </a> </div> <div class="Header-item f4 mr-0" role="navigation" aria-label="Sign in or sign up"> <a class="Header-link no-underline mr-3" data-ga-click="Header, sign in" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist header&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="80727a3537cee498d16901b014d50282a9c52714959727229dc3764062db784e" href="https://gist.github.com/auth/github?return_to=https%3A%2F%2Fgist.github.com%2Fsnovvcrash%2Fcaded55a318bbefcb6cc9ee30e82f824"> Sign&nbsp;in </a> <a class="Header-link d-inline-block no-underline border color-border-default rounded px-2 py-1" data-ga-click="Header, sign up" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist header&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="08b2fb7d1deefef48a9ac775712fcb01696e9ec476cd3376d2243487e89e4a7c" href="/join?return_to=https%3A%2F%2Fgist.github.com%2Fsnovvcrash%2Fcaded55a318bbefcb6cc9ee30e82f824&amp;source=header-gist"> Sign&nbsp;up </a> </div> </div> <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span class="js-stale-session-flash-signed-in" hidden>You signed in with another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-signed-out" hidden>You signed out in another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-switched" hidden>You switched accounts on another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <button id="icon-button-ebca95bc-9f8f-4190-8880-b0e51b8b2154" aria-labelledby="tooltip-688eb7a1-3fd7-4991-a747-87f811650795" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button><tool-tip id="tooltip-688eb7a1-3fd7-4991-a747-87f811650795" for="icon-button-ebca95bc-9f8f-4190-8880-b0e51b8b2154" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Dismiss alert</tool-tip> </div> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" class="flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div> </div> </template> </div> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled data-project-hovercards-enabled > <div itemscope itemtype="http://schema.org/Code"> <main id="gist-pjax-container"> <div class="gist-detail-intro gist-banner pb-3"> <div class="text-center container-lg px-3"> <p class="lead"> Instantly share code, notes, and snippets. </p> </div> </div> <div class="gisthead pagehead pb-0 pt-3 mb-4"> <div class="px-0"> <div class="mb-3 d-flex px-3 px-md-3 px-lg-5"> <div class="flex-auto min-width-0 width-fit mr-3"> <div class="d-flex"> <div class="d-none d-md-block"> <a class="mr-2 flex-shrink-0" data-hovercard-type="user" data-hovercard-url="/users/snovvcrash/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/snovvcrash"><img class="avatar avatar-user" src="https://avatars.githubusercontent.com/u/23141800?s=64&amp;v=4" width="32" height="32" alt="@snovvcrash" /></a> </div> <div class="d-flex flex-column width-full"> <div class="d-flex flex-row width-full"> <h1 class="wb-break-word f3 text-normal mb-md-0 mb-1"> <span class="author"><a data-hovercard-type="user" data-hovercard-url="/users/snovvcrash/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/snovvcrash">snovvcrash</a></span><!-- --><span class="mx-1 color-fg-muted">/</span><!-- --><strong itemprop="name" class="css-truncate-target mr-1" style="max-width: 410px"><a href="/snovvcrash/caded55a318bbefcb6cc9ee30e82f824">elevator_decrypt_key.cpp</a></strong> <span title="Only those with the link can see this gist." data-view-component="true" class="Label v-align-middle"> Secret </span> </h1> </div> <div class="note m-0"> Last active <relative-time tense="past" datetime="2025-03-24T02:17:14Z" data-view-component="true">March 24, 2025 02:17</relative-time> </div> </div> </div> </div> <ul class="d-md-flex pagehead-actions float-none mr-2"> </ul> <div class="d-inline-block d-md-none ml-auto"> <action-menu data-select-variant="none" data-view-component="true" class="flex-self-start ml-auto d-inline-block"> <focus-group direction="vertical" mnemonics retain> <button id="gist_options-button" popovertarget="gist_options-overlay" aria-controls="gist_options-list" aria-haspopup="true" aria-labelledby="tooltip-2b7264fa-9147-4dc6-815d-e08077ba7c79" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--small"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal Button-visual"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> </svg> </button><tool-tip id="tooltip-2b7264fa-9147-4dc6-815d-e08077ba7c79" for="gist_options-button" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Show Gist options</tool-tip> <anchored-position data-target="action-menu.overlay" id="gist_options-overlay" anchor="gist_options-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone"> <action-list> <div data-view-component="true"> <ul aria-labelledby="gist_options-button" id="gist_options-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap"> <li rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;DOWNLOAD_ZIP&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="991449ba408ca6190e172f7ba23fc572997dbb564650643b51087183c30c39be" data-ga-click="Gist, download zip, location:gist overview" data-targets="action-list.items" data-item-id="download_from_gist_options" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-5fd4fd48-0b34-4070-9763-54a381f387fb" href="/snovvcrash/caded55a318bbefcb6cc9ee30e82f824/archive/b7e3d79704db12bc871cc1ee2912f843af671274.zip" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-download"> <path d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"></path><path d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Download ZIP </span> </a> </li> </ul> </div></action-list> </div> </div></anchored-position> </focus-group> </action-menu> </div> <ul class="d-md-flex d-none pagehead-actions float-none"> <li> <a id="gist-star-button" href="/login?return_to=https%3A%2F%2Fgist.github.com%2Fsnovvcrash%2Fcaded55a318bbefcb6cc9ee30e82f824" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist star button&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="a532e0dca209c51f2da1f7a8b00c302175c5ce7aeb1ea28e9f4b0a72e93ca2b5" aria-label="You must be signed in to star a gist" data-view-component="true" class="btn-with-count Button--secondary Button--small Button"> <span class="Button-content"> <span class="Button-visual Button-leadingVisual"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> </span> <span class="Button-label">Star</span> <span class="Button-visual Button-trailingVisual"> <span class="d-flex" aria-hidden="true"><span title="33" data-view-component="true" class="Counter">33</span></span> <span class="sr-only">(<span title="33" data-view-component="true" class="Counter">33</span>)</span> </span> </span> </a><tool-tip id="tooltip-14b2976b-88cf-4cc1-9678-0cf2e991d07e" for="gist-star-button" popover="manual" data-direction="n" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to star a gist</tool-tip> </li> <li> <a id="gist-fork-button" href="/login?return_to=https%3A%2F%2Fgist.github.com%2Fsnovvcrash%2Fcaded55a318bbefcb6cc9ee30e82f824" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist fork button&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="daa7ed049e7378c68e09b2ce7829ad791ccefc032e03998fca4ab9382a7b69fe" aria-label="You must be signed in to fork a gist" data-view-component="true" class="btn-with-count Button--secondary Button--small Button"> <span class="Button-content"> <span class="Button-visual Button-leadingVisual"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg> </span> <span class="Button-label">Fork</span> <span class="Button-visual Button-trailingVisual"> <span class="d-flex" aria-hidden="true"><span title="18" data-view-component="true" class="Counter">18</span></span> <span class="sr-only">(<span title="18" data-view-component="true" class="Counter">18</span>)</span> </span> </span> </a><tool-tip id="tooltip-b03f6eae-0d86-4ce0-8cc7-aef863a3dca1" for="gist-fork-button" popover="manual" data-direction="n" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to fork a gist</tool-tip> </li> </ul> </div> <ul class="d-flex d-md-none px-3 mb-2 pagehead-actions float-none" > <li> <div data-view-component="true" class="flex-items-center d-inline-flex"> <action-menu data-menu-input="gist-share-url-sized-down" data-select-variant="single" data-dynamic-label="" data-view-component="true" class="flex-shrink-0"> <focus-group direction="vertical" mnemonics retain> <button id="action-menu-d1bb0c5b-ab18-430c-a43b-1a76969c3caa-button" popovertarget="action-menu-d1bb0c5b-ab18-430c-a43b-1a76969c3caa-overlay" aria-controls="action-menu-d1bb0c5b-ab18-430c-a43b-1a76969c3caa-list" aria-haspopup="true" type="button" data-view-component="true" class="rounded-right-0 border-right-0 Button--secondary Button--small Button"> <span class="Button-content"> <span class="Button-label">Embed</span> </span> <span class="Button-visual Button-trailingAction"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </span> </button> <anchored-position data-target="action-menu.overlay" id="action-menu-d1bb0c5b-ab18-430c-a43b-1a76969c3caa-overlay" anchor="action-menu-d1bb0c5b-ab18-430c-a43b-1a76969c3caa-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone"> <action-list> <div data-view-component="true"> <ul aria-labelledby="action-menu-d1bb0c5b-ab18-430c-a43b-1a76969c3caa-button" id="action-menu-d1bb0c5b-ab18-430c-a43b-1a76969c3caa-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap"> <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <button value="&lt;script src=&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824.js&quot;&gt;&lt;/script&gt;" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;EMBED&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="7038c5e792b19826adabb27096a70e5a6c64022077055253ab730fbc04f71b20" id="item-5f488123-f6f3-45fb-adae-5a590ed67d6b" type="button" role="menuitemradio" aria-checked="true" data-view-component="true" class="ActionListContent"> <span class="ActionListItem-visual ActionListItem-action--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-descriptionWrap"> <span data-view-component="true" class="ActionListItem-label"> Embed </span> <span data-view-component="true" class="ActionListItem-description">Embed this gist in your website.</span> </span></button> </li> <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <button value="https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;SHARE&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="5b60b7b346e8d082fb5cee946e6643fd211f478a933ed055c024ab0654de4d52" id="item-40bf7e51-79d1-4fa4-9938-1fd855dbded9" type="button" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent"> <span class="ActionListItem-visual ActionListItem-action--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-descriptionWrap"> <span data-view-component="true" class="ActionListItem-label"> Share </span> <span data-view-component="true" class="ActionListItem-description">Copy sharable link for this gist.</span> </span></button> </li> <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <button value="https://gist.github.com/caded55a318bbefcb6cc9ee30e82f824.git" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;USE_HTTPS&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="58232edfe6fbee957154baa7be6434831b5f2b40d6f9c225ffe24892a31ee958" id="item-dd9f4520-fa10-468c-b5db-5c3259a5975d" type="button" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent"> <span class="ActionListItem-visual ActionListItem-action--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-descriptionWrap"> <span data-view-component="true" class="ActionListItem-label"> Clone via HTTPS </span> <span data-view-component="true" class="ActionListItem-description">Clone using the web URL.</span> </span></button> </li> <li role="presentation" aria-hidden="true" data-view-component="true" class="ActionList-sectionDivider"></li> <li target="_blank" rel="noopener noreferrer" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-23c3c0a1-af37-4c07-bcbd-ba02b79e627f" href="https://docs.github.com/articles/which-remote-url-should-i-use" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-action--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </span> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-question"> <path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.92 6.085h.001a.749.749 0 1 1-1.342-.67c.169-.339.436-.701.849-.977C6.845 4.16 7.369 4 8 4a2.756 2.756 0 0 1 1.637.525c.503.377.863.965.863 1.725 0 .448-.115.83-.329 1.15-.205.307-.47.513-.692.662-.109.072-.22.138-.313.195l-.006.004a6.24 6.24 0 0 0-.26.16.952.952 0 0 0-.276.245.75.75 0 0 1-1.248-.832c.184-.264.42-.489.692-.661.103-.067.207-.132.313-.195l.007-.004c.1-.061.182-.11.258-.161a.969.969 0 0 0 .277-.245C8.96 6.514 9 6.427 9 6.25a.612.612 0 0 0-.262-.525A1.27 1.27 0 0 0 8 5.5c-.369 0-.595.09-.74.187a1.01 1.01 0 0 0-.34.398ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Learn more about clone URLs </span> </a> </li> </ul> </div></action-list> </div> </div></anchored-position> </focus-group> </action-menu> <primer-text-field class="FormControl width-full FormControl--fullWidth"> <label for="gist-share-url-sized-down" class="sr-only FormControl-label"> Clone this repository at &amp;lt;script src=&amp;quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; </label> <div class="FormControl-input-wrap FormControl-input-wrap--small"> <input id="gist-share-url-sized-down" aria-label="Clone this repository at &amp;lt;script src=&amp;quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;" value="&lt;script src=&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824.js&quot;&gt;&lt;/script&gt;" readonly="readonly" data-autoselect="true" data-target="primer-text-field.inputElement " aria-describedby="validation-7342f66c-69c7-45df-bea5-d7aa4d020074" class="form-control FormControl-monospace FormControl-input FormControl-small rounded-left-0 rounded-right-0 border-right-0" type="text" name="gist-share-url-sized-down" /> </div> <div class="FormControl-inlineValidation" id="validation-7342f66c-69c7-45df-bea5-d7aa4d020074" hidden="hidden"> <span class="FormControl-inlineValidation--visual" data-target="primer-text-field.validationSuccessIcon" hidden><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-check-circle-fill"> <path d="M6 0a6 6 0 1 1 0 12A6 6 0 0 1 6 0Zm-.705 8.737L9.63 4.403 8.392 3.166 5.295 6.263l-1.7-1.702L2.356 5.8l2.938 2.938Z"></path> </svg></span> <span class=" FormControl-inlineValidation--visual" data-target="primer-text-field.validationErrorIcon"><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill"> <path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path> </svg></span> <span></span> </div> </primer-text-field> <span data-view-component="true"> <clipboard-copy id="clipboard-button" aria-label="Copy" for="gist-share-url-sized-down" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;COPY_URL&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="07d1bcded85a857cac2f13a881fe345505fba0764a203e78ad2448f7b02b599e" type="button" data-view-component="true" class="rounded-left-0 Button--secondary Button--small Button"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg style="display: none;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check color-fg-success"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> <div aria-live="polite" aria-atomic="true" class="sr-only" data-clipboard-copy-feedback></div> </span> </div> </li> <li> <button href="https://desktop.github.com" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;OPEN_IN_DESKTOP&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="d5b65cdce0439a3ce5298b8426a3ab74869e109589f8bc8ec2fdf7b9f7de7ee2" data-platforms="windows,mac" id="icon-button-022c3426-ae83-478c-a423-2da662078781" aria-labelledby="tooltip-e31e393f-0857-457e-a2f1-63ffbd7bca0b" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--small js-remove-unless-platform"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-desktop-download Button-visual"> <path d="m4.927 5.427 2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 5H8.75V.75a.75.75 0 1 0-1.5 0V5H5.104a.25.25 0 0 0-.177.427Z"></path><path d="M1.573 2.573a.25.25 0 0 0-.073.177v7.5a.25.25 0 0 0 .25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25h-3a.75.75 0 1 1 0-1.5h3A1.75 1.75 0 0 1 16 2.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.75.75 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5A1.75 1.75 0 0 1 1.75 1h3a.75.75 0 0 1 0 1.5h-3a.25.25 0 0 0-.177.073ZM6.982 12a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5H6.982Z"></path> </svg> </button><tool-tip id="tooltip-e31e393f-0857-457e-a2f1-63ffbd7bca0b" for="icon-button-022c3426-ae83-478c-a423-2da662078781" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Save snovvcrash/caded55a318bbefcb6cc9ee30e82f824 to your computer and use it in GitHub Desktop.</tool-tip> </li> </ul> <div class="d-flex flex-md-row flex-column px-0 pr-md-3 px-lg-5"> <div class="flex-md-order-1 flex-order-2 flex-auto"> <nav class="UnderlineNav box-shadow-none px-3 px-lg-0" aria-label="Gist" data-pjax="#gist-pjax-container"> <div class="UnderlineNav-body"> <a class="js-selected-navigation-item selected UnderlineNav-item" data-pjax="true" data-hotkey="g c" aria-current="page" data-selected-links="gist_code /snovvcrash/caded55a318bbefcb6cc9ee30e82f824" href="/snovvcrash/caded55a318bbefcb6cc9ee30e82f824"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> Code </a> <a class="js-selected-navigation-item UnderlineNav-item" data-pjax="true" data-hotkey="g r" data-selected-links="gist_revisions /snovvcrash/caded55a318bbefcb6cc9ee30e82f824/revisions" href="/snovvcrash/caded55a318bbefcb6cc9ee30e82f824/revisions"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-commit UnderlineNav-octicon"> <path d="M11.93 8.5a4.002 4.002 0 0 1-7.86 0H.75a.75.75 0 0 1 0-1.5h3.32a4.002 4.002 0 0 1 7.86 0h3.32a.75.75 0 0 1 0 1.5Zm-1.43-.75a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z"></path> </svg> Revisions <span title="7" data-view-component="true" class="Counter">7</span> </a> <a class="js-selected-navigation-item UnderlineNav-item" data-pjax="true" data-hotkey="g s" data-selected-links="gist_stars /snovvcrash/caded55a318bbefcb6cc9ee30e82f824/stargazers" href="/snovvcrash/caded55a318bbefcb6cc9ee30e82f824/stargazers"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star UnderlineNav-octicon"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> Stars <span title="33" data-view-component="true" class="Counter">33</span> </a> <a class="js-selected-navigation-item UnderlineNav-item" data-pjax="true" data-hotkey="g f" data-selected-links="gist_forks /snovvcrash/caded55a318bbefcb6cc9ee30e82f824/forks" href="/snovvcrash/caded55a318bbefcb6cc9ee30e82f824/forks"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch UnderlineNav-octicon"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path> </svg> Forks <span title="18" data-view-component="true" class="Counter">18</span> </a> </div> </nav> </div> <div class="d-md-flex d-none flex-items-center flex-md-order-2 flex-order-1" data-multiple> <div data-view-component="true" class="flex-items-center d-inline-flex"> <action-menu data-menu-input="gist-share-url-original" data-select-variant="single" data-dynamic-label="" data-view-component="true" class="flex-shrink-0"> <focus-group direction="vertical" mnemonics retain> <button id="action-menu-9aec5b27-ecd7-4d03-a68f-a60cd9c0567a-button" popovertarget="action-menu-9aec5b27-ecd7-4d03-a68f-a60cd9c0567a-overlay" aria-controls="action-menu-9aec5b27-ecd7-4d03-a68f-a60cd9c0567a-list" aria-haspopup="true" type="button" data-view-component="true" class="rounded-right-0 border-right-0 Button--secondary Button--small Button"> <span class="Button-content"> <span class="Button-label">Embed</span> </span> <span class="Button-visual Button-trailingAction"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </span> </button> <anchored-position data-target="action-menu.overlay" id="action-menu-9aec5b27-ecd7-4d03-a68f-a60cd9c0567a-overlay" anchor="action-menu-9aec5b27-ecd7-4d03-a68f-a60cd9c0567a-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone"> <action-list> <div data-view-component="true"> <ul aria-labelledby="action-menu-9aec5b27-ecd7-4d03-a68f-a60cd9c0567a-button" id="action-menu-9aec5b27-ecd7-4d03-a68f-a60cd9c0567a-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap"> <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <button value="&lt;script src=&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824.js&quot;&gt;&lt;/script&gt;" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;EMBED&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="7038c5e792b19826adabb27096a70e5a6c64022077055253ab730fbc04f71b20" id="item-40252ea5-c833-4aa6-b2d0-1e74c7ba76c5" type="button" role="menuitemradio" aria-checked="true" data-view-component="true" class="ActionListContent"> <span class="ActionListItem-visual ActionListItem-action--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-descriptionWrap"> <span data-view-component="true" class="ActionListItem-label"> Embed </span> <span data-view-component="true" class="ActionListItem-description">Embed this gist in your website.</span> </span></button> </li> <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <button value="https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;SHARE&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="5b60b7b346e8d082fb5cee946e6643fd211f478a933ed055c024ab0654de4d52" id="item-65355693-af28-4ffa-8ff2-fa32e083a968" type="button" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent"> <span class="ActionListItem-visual ActionListItem-action--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-descriptionWrap"> <span data-view-component="true" class="ActionListItem-label"> Share </span> <span data-view-component="true" class="ActionListItem-description">Copy sharable link for this gist.</span> </span></button> </li> <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <button value="https://gist.github.com/caded55a318bbefcb6cc9ee30e82f824.git" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;USE_HTTPS&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="58232edfe6fbee957154baa7be6434831b5f2b40d6f9c225ffe24892a31ee958" id="item-fca96e4d-6494-42c6-8be1-e1ca5716602e" type="button" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent"> <span class="ActionListItem-visual ActionListItem-action--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-descriptionWrap"> <span data-view-component="true" class="ActionListItem-label"> Clone via HTTPS </span> <span data-view-component="true" class="ActionListItem-description">Clone using the web URL.</span> </span></button> </li> <li role="presentation" aria-hidden="true" data-view-component="true" class="ActionList-sectionDivider"></li> <li target="_blank" rel="noopener noreferrer" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-10a6fec1-06d3-495d-b26e-9257ef98dbc9" href="https://docs.github.com/articles/which-remote-url-should-i-use" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-action--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </span> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-question"> <path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.92 6.085h.001a.749.749 0 1 1-1.342-.67c.169-.339.436-.701.849-.977C6.845 4.16 7.369 4 8 4a2.756 2.756 0 0 1 1.637.525c.503.377.863.965.863 1.725 0 .448-.115.83-.329 1.15-.205.307-.47.513-.692.662-.109.072-.22.138-.313.195l-.006.004a6.24 6.24 0 0 0-.26.16.952.952 0 0 0-.276.245.75.75 0 0 1-1.248-.832c.184-.264.42-.489.692-.661.103-.067.207-.132.313-.195l.007-.004c.1-.061.182-.11.258-.161a.969.969 0 0 0 .277-.245C8.96 6.514 9 6.427 9 6.25a.612.612 0 0 0-.262-.525A1.27 1.27 0 0 0 8 5.5c-.369 0-.595.09-.74.187a1.01 1.01 0 0 0-.34.398ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Learn more about clone URLs </span> </a> </li> </ul> </div></action-list> </div> </div></anchored-position> </focus-group> </action-menu> <primer-text-field class="FormControl width-full FormControl--fullWidth"> <label for="gist-share-url-original" class="sr-only FormControl-label"> Clone this repository at &amp;lt;script src=&amp;quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; </label> <div class="FormControl-input-wrap FormControl-input-wrap--small"> <input id="gist-share-url-original" aria-label="Clone this repository at &amp;lt;script src=&amp;quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;" value="&lt;script src=&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824.js&quot;&gt;&lt;/script&gt;" readonly="readonly" data-autoselect="true" data-target="primer-text-field.inputElement " aria-describedby="validation-8e4b08b4-eae5-4e72-9d96-2dc931eb4006" class="form-control FormControl-monospace FormControl-input FormControl-small rounded-left-0 rounded-right-0 border-right-0" type="text" name="gist-share-url-original" /> </div> <div class="FormControl-inlineValidation" id="validation-8e4b08b4-eae5-4e72-9d96-2dc931eb4006" hidden="hidden"> <span class="FormControl-inlineValidation--visual" data-target="primer-text-field.validationSuccessIcon" hidden><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-check-circle-fill"> <path d="M6 0a6 6 0 1 1 0 12A6 6 0 0 1 6 0Zm-.705 8.737L9.63 4.403 8.392 3.166 5.295 6.263l-1.7-1.702L2.356 5.8l2.938 2.938Z"></path> </svg></span> <span class=" FormControl-inlineValidation--visual" data-target="primer-text-field.validationErrorIcon"><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill"> <path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path> </svg></span> <span></span> </div> </primer-text-field> <span data-view-component="true"> <clipboard-copy id="clipboard-button" aria-label="Copy" for="gist-share-url-original" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;COPY_URL&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="07d1bcded85a857cac2f13a881fe345505fba0764a203e78ad2448f7b02b599e" type="button" data-view-component="true" class="rounded-left-0 Button--secondary Button--small Button"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg style="display: none;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check color-fg-success"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> <div aria-live="polite" aria-atomic="true" class="sr-only" data-clipboard-copy-feedback></div> </span> </div> <div class="ml-2"> <button href="https://desktop.github.com" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;OPEN_IN_DESKTOP&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="d5b65cdce0439a3ce5298b8426a3ab74869e109589f8bc8ec2fdf7b9f7de7ee2" data-platforms="windows,mac" id="icon-button-f3410a86-65a4-41e6-9f01-d9cbe150153c" aria-labelledby="tooltip-b2ac804e-5e7a-4fbc-87e3-6905a4e8fcc0" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--small js-remove-unless-platform"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-desktop-download Button-visual"> <path d="m4.927 5.427 2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 5H8.75V.75a.75.75 0 1 0-1.5 0V5H5.104a.25.25 0 0 0-.177.427Z"></path><path d="M1.573 2.573a.25.25 0 0 0-.073.177v7.5a.25.25 0 0 0 .25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25h-3a.75.75 0 1 1 0-1.5h3A1.75 1.75 0 0 1 16 2.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.75.75 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5A1.75 1.75 0 0 1 1.75 1h3a.75.75 0 0 1 0 1.5h-3a.25.25 0 0 0-.177.073ZM6.982 12a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5H6.982Z"></path> </svg> </button><tool-tip id="tooltip-b2ac804e-5e7a-4fbc-87e3-6905a4e8fcc0" for="icon-button-f3410a86-65a4-41e6-9f01-d9cbe150153c" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Save snovvcrash/caded55a318bbefcb6cc9ee30e82f824 to your computer and use it in GitHub Desktop.</tool-tip> </div> <div class="ml-2"> <a class="btn btn-sm" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;DOWNLOAD_ZIP&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:132972553,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="991449ba408ca6190e172f7ba23fc572997dbb564650643b51087183c30c39be" data-ga-click="Gist, download zip, location:gist overview" href="/snovvcrash/caded55a318bbefcb6cc9ee30e82f824/archive/b7e3d79704db12bc871cc1ee2912f843af671274.zip">Download ZIP</a> </div> </div> </div> </div> </div> <div class="container-lg px-3"> <div class="repository-content gist-content" > <div> <div itemprop="about"> Unprotect the App-Bound Encryption Key via an RPC call to Google Chrome Elevation Service (PoC) </div> <div class="js-gist-file-update-container js-task-list-container"> <div id="file-elevator_decrypt_key-cpp" class="file my-2"> <div class="file-header d-flex flex-md-items-center flex-items-start"> <div class="file-actions flex-order-2 pt-0"> <a href="/snovvcrash/caded55a318bbefcb6cc9ee30e82f824/raw/b7e3d79704db12bc871cc1ee2912f843af671274/elevator_decrypt_key.cpp" data-view-component="true" class="Button--secondary Button--small Button"> <span class="Button-content"> <span class="Button-label">Raw</span> </span> </a> </div> <div class="file-info pr-4 d-flex flex-md-items-center flex-items-start flex-order-1 flex-auto"> <span class="mr-1"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-square color-fg-muted"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25Zm7.47 3.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L10.69 8 9.22 6.53a.75.75 0 0 1 0-1.06ZM6.78 6.53 5.31 8l1.47 1.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </span> <a class="wb-break-all" href="#file-elevator_decrypt_key-cpp"> <strong class="user-select-contain gist-blob-name css-truncate-target"> elevator_decrypt_key.cpp </strong> </a> </div> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper data type-c gist-border-0" style="overflow: auto" tabindex="0" role="region" aria-label="elevator_decrypt_key.cpp content, created by snovvcrash on 05:15PM on September 27, 2024." > <div class="js-check-bidi js-blob-code-container blob-code-content"> <template class="js-file-alert-template"> <div data-view-component="true" class="flash flash-warn flash-full d-flex flex-items-center"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span> 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. <a class="Link--inTextBlock" href="https://github.co/hiddenchars" target="_blank">Learn more about bidirectional Unicode characters</a> </span> <div data-view-component="true" class="flash-action"> <a href="{{ revealButtonHref }}" data-view-component="true" class="btn-sm btn"> Show hidden characters </a> </div> </div></template> <template class="js-line-alert-template"> <span aria-label="This line has hidden Unicode characters" data-view-component="true" class="line-alert tooltipped tooltipped-e"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </span></template> <table data-hpc class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip data-tagsearch-path="elevator_decrypt_key.cpp"> <tr> <td id="file-elevator_decrypt_key-cpp-L1" class="blob-num js-line-number js-blob-rnum" data-line-number="1"></td> <td id="file-elevator_decrypt_key-cpp-LC1" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L2" class="blob-num js-line-number js-blob-rnum" data-line-number="2"></td> <td id="file-elevator_decrypt_key-cpp-LC2" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Chrome App-Bound Encryption Service:</span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L3" class="blob-num js-line-number js-blob-rnum" data-line-number="3"></td> <td id="file-elevator_decrypt_key-cpp-LC3" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * https://security.googleblog.com/2024/07/improving-security-of-chrome-cookies-on.html</span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L4" class="blob-num js-line-number js-blob-rnum" data-line-number="4"></td> <td id="file-elevator_decrypt_key-cpp-LC4" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * https://drive.google.com/file/d/1xMXmA0UJifXoTHjHWtVir2rb94OsxXAI/view</span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L5" class="blob-num js-line-number js-blob-rnum" data-line-number="5"></td> <td id="file-elevator_decrypt_key-cpp-LC5" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L6" class="blob-num js-line-number js-blob-rnum" data-line-number="6"></td> <td id="file-elevator_decrypt_key-cpp-LC6" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L7" class="blob-num js-line-number js-blob-rnum" data-line-number="7"></td> <td id="file-elevator_decrypt_key-cpp-LC7" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>Windows.h<span class="pl-pds">&gt;</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L8" class="blob-num js-line-number js-blob-rnum" data-line-number="8"></td> <td id="file-elevator_decrypt_key-cpp-LC8" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>wrl/client.h<span class="pl-pds">&gt;</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L9" class="blob-num js-line-number js-blob-rnum" data-line-number="9"></td> <td id="file-elevator_decrypt_key-cpp-LC9" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>iostream<span class="pl-pds">&gt;</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L10" class="blob-num js-line-number js-blob-rnum" data-line-number="10"></td> <td id="file-elevator_decrypt_key-cpp-LC10" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>fstream<span class="pl-pds">&gt;</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L11" class="blob-num js-line-number js-blob-rnum" data-line-number="11"></td> <td id="file-elevator_decrypt_key-cpp-LC11" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>sstream<span class="pl-pds">&gt;</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L12" class="blob-num js-line-number js-blob-rnum" data-line-number="12"></td> <td id="file-elevator_decrypt_key-cpp-LC12" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>iomanip<span class="pl-pds">&gt;</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L13" class="blob-num js-line-number js-blob-rnum" data-line-number="13"></td> <td id="file-elevator_decrypt_key-cpp-LC13" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>vector<span class="pl-pds">&gt;</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L14" class="blob-num js-line-number js-blob-rnum" data-line-number="14"></td> <td id="file-elevator_decrypt_key-cpp-LC14" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>string<span class="pl-pds">&gt;</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L15" class="blob-num js-line-number js-blob-rnum" data-line-number="15"></td> <td id="file-elevator_decrypt_key-cpp-LC15" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L16" class="blob-num js-line-number js-blob-rnum" data-line-number="16"></td> <td id="file-elevator_decrypt_key-cpp-LC16" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">pragma</span> comment(lib, &quot;ole32.lib&quot;)</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L17" class="blob-num js-line-number js-blob-rnum" data-line-number="17"></td> <td id="file-elevator_decrypt_key-cpp-LC17" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">pragma</span> comment(lib, &quot;comsuppw.lib&quot;)</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L18" class="blob-num js-line-number js-blob-rnum" data-line-number="18"></td> <td id="file-elevator_decrypt_key-cpp-LC18" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L19" class="blob-num js-line-number js-blob-rnum" data-line-number="19"></td> <td id="file-elevator_decrypt_key-cpp-LC19" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">//</span> https://github.com/chromium/chromium/blob/225f82f8025e4f93981310fd33daa71dc972bfa9/chrome/elevation_service/elevation_service_idl.idl</span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L20" class="blob-num js-line-number js-blob-rnum" data-line-number="20"></td> <td id="file-elevator_decrypt_key-cpp-LC20" class="blob-code blob-code-inner js-file-line"><span class="pl-k">const</span> CLSID CLSID_Elevator = { <span class="pl-c1">0x708860E0</span>, <span class="pl-c1">0xF641</span>, <span class="pl-c1">0x4611</span>, {<span class="pl-c1">0x88</span>, <span class="pl-c1">0x95</span>, <span class="pl-c1">0x7D</span>, <span class="pl-c1">0x86</span>, <span class="pl-c1">0x7D</span>, <span class="pl-c1">0xD3</span>, <span class="pl-c1">0x67</span>, <span class="pl-c1">0x5B</span>} };</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L21" class="blob-num js-line-number js-blob-rnum" data-line-number="21"></td> <td id="file-elevator_decrypt_key-cpp-LC21" class="blob-code blob-code-inner js-file-line"><span class="pl-k">const</span> IID IID_IElevator = { <span class="pl-c1">0x463ABECF</span>, <span class="pl-c1">0x410D</span>, <span class="pl-c1">0x407F</span>, {<span class="pl-c1">0x8A</span>, <span class="pl-c1">0xF5</span>, <span class="pl-c1">0x0D</span>, <span class="pl-c1">0xF3</span>, <span class="pl-c1">0x5A</span>, <span class="pl-c1">0x00</span>, <span class="pl-c1">0x5C</span>, <span class="pl-c1">0xC8</span>} };</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L22" class="blob-num js-line-number js-blob-rnum" data-line-number="22"></td> <td id="file-elevator_decrypt_key-cpp-LC22" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L23" class="blob-num js-line-number js-blob-rnum" data-line-number="23"></td> <td id="file-elevator_decrypt_key-cpp-LC23" class="blob-code blob-code-inner js-file-line"><span class="pl-k">typedef</span> <span class="pl-k">enum</span> ProtectionLevel</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L24" class="blob-num js-line-number js-blob-rnum" data-line-number="24"></td> <td id="file-elevator_decrypt_key-cpp-LC24" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L25" class="blob-num js-line-number js-blob-rnum" data-line-number="25"></td> <td id="file-elevator_decrypt_key-cpp-LC25" class="blob-code blob-code-inner js-file-line"> PROTECTION_NONE = <span class="pl-c1">0</span>,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L26" class="blob-num js-line-number js-blob-rnum" data-line-number="26"></td> <td id="file-elevator_decrypt_key-cpp-LC26" class="blob-code blob-code-inner js-file-line"> PROTECTION_PATH_VALIDATION_OLD = <span class="pl-c1">1</span>,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L27" class="blob-num js-line-number js-blob-rnum" data-line-number="27"></td> <td id="file-elevator_decrypt_key-cpp-LC27" class="blob-code blob-code-inner js-file-line"> PROTECTION_PATH_VALIDATION = <span class="pl-c1">2</span>,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L28" class="blob-num js-line-number js-blob-rnum" data-line-number="28"></td> <td id="file-elevator_decrypt_key-cpp-LC28" class="blob-code blob-code-inner js-file-line"> PROTECTION_MAX = <span class="pl-c1">3</span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L29" class="blob-num js-line-number js-blob-rnum" data-line-number="29"></td> <td id="file-elevator_decrypt_key-cpp-LC29" class="blob-code blob-code-inner js-file-line">} ProtectionLevel;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L30" class="blob-num js-line-number js-blob-rnum" data-line-number="30"></td> <td id="file-elevator_decrypt_key-cpp-LC30" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L31" class="blob-num js-line-number js-blob-rnum" data-line-number="31"></td> <td id="file-elevator_decrypt_key-cpp-LC31" class="blob-code blob-code-inner js-file-line"><span class="pl-en">MIDL_INTERFACE</span>(<span class="pl-s"><span class="pl-pds">&quot;</span>A949CB4E-C4F9-44C4-B213-6BF8AA9AC69C<span class="pl-pds">&quot;</span></span>)</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L32" class="blob-num js-line-number js-blob-rnum" data-line-number="32"></td> <td id="file-elevator_decrypt_key-cpp-LC32" class="blob-code blob-code-inner js-file-line">IElevator : public IUnknown</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L33" class="blob-num js-line-number js-blob-rnum" data-line-number="33"></td> <td id="file-elevator_decrypt_key-cpp-LC33" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L34" class="blob-num js-line-number js-blob-rnum" data-line-number="34"></td> <td id="file-elevator_decrypt_key-cpp-LC34" class="blob-code blob-code-inner js-file-line"><span class="pl-k">public:</span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L35" class="blob-num js-line-number js-blob-rnum" data-line-number="35"></td> <td id="file-elevator_decrypt_key-cpp-LC35" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">virtual</span> HRESULT STDMETHODCALLTYPE <span class="pl-smi">RunRecoveryCRXElevated</span>(</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L36" class="blob-num js-line-number js-blob-rnum" data-line-number="36"></td> <td id="file-elevator_decrypt_key-cpp-LC36" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [string][in] <span class="pl-c">*/</span></span> <span class="pl-k">const</span> WCHAR * crx_path,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L37" class="blob-num js-line-number js-blob-rnum" data-line-number="37"></td> <td id="file-elevator_decrypt_key-cpp-LC37" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [string][in] <span class="pl-c">*/</span></span> <span class="pl-k">const</span> WCHAR * browser_appid,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L38" class="blob-num js-line-number js-blob-rnum" data-line-number="38"></td> <td id="file-elevator_decrypt_key-cpp-LC38" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [string][in] <span class="pl-c">*/</span></span> <span class="pl-k">const</span> WCHAR * browser_version,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L39" class="blob-num js-line-number js-blob-rnum" data-line-number="39"></td> <td id="file-elevator_decrypt_key-cpp-LC39" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [string][in] <span class="pl-c">*/</span></span> <span class="pl-k">const</span> WCHAR * session_id,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L40" class="blob-num js-line-number js-blob-rnum" data-line-number="40"></td> <td id="file-elevator_decrypt_key-cpp-LC40" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [in] <span class="pl-c">*/</span></span> DWORD caller_proc_id,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L41" class="blob-num js-line-number js-blob-rnum" data-line-number="41"></td> <td id="file-elevator_decrypt_key-cpp-LC41" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [out] <span class="pl-c">*/</span></span> ULONG_PTR * proc_handle) = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L42" class="blob-num js-line-number js-blob-rnum" data-line-number="42"></td> <td id="file-elevator_decrypt_key-cpp-LC42" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L43" class="blob-num js-line-number js-blob-rnum" data-line-number="43"></td> <td id="file-elevator_decrypt_key-cpp-LC43" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">virtual</span> HRESULT STDMETHODCALLTYPE <span class="pl-smi">EncryptData</span>(</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L44" class="blob-num js-line-number js-blob-rnum" data-line-number="44"></td> <td id="file-elevator_decrypt_key-cpp-LC44" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [in] <span class="pl-c">*/</span></span> ProtectionLevel protection_level,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L45" class="blob-num js-line-number js-blob-rnum" data-line-number="45"></td> <td id="file-elevator_decrypt_key-cpp-LC45" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [in] <span class="pl-c">*/</span></span> <span class="pl-k">const</span> BSTR plaintext,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L46" class="blob-num js-line-number js-blob-rnum" data-line-number="46"></td> <td id="file-elevator_decrypt_key-cpp-LC46" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [out] <span class="pl-c">*/</span></span> BSTR* ciphertext,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L47" class="blob-num js-line-number js-blob-rnum" data-line-number="47"></td> <td id="file-elevator_decrypt_key-cpp-LC47" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [out] <span class="pl-c">*/</span></span> DWORD* last_error) = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L48" class="blob-num js-line-number js-blob-rnum" data-line-number="48"></td> <td id="file-elevator_decrypt_key-cpp-LC48" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L49" class="blob-num js-line-number js-blob-rnum" data-line-number="49"></td> <td id="file-elevator_decrypt_key-cpp-LC49" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">//</span> https://github.com/chromium/chromium/blob/225f82f8025e4f93981310fd33daa71dc972bfa9/chrome/elevation_service/elevator.cc#L155</span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L50" class="blob-num js-line-number js-blob-rnum" data-line-number="50"></td> <td id="file-elevator_decrypt_key-cpp-LC50" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">virtual</span> HRESULT STDMETHODCALLTYPE <span class="pl-smi">DecryptData</span>(</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L51" class="blob-num js-line-number js-blob-rnum" data-line-number="51"></td> <td id="file-elevator_decrypt_key-cpp-LC51" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [in] <span class="pl-c">*/</span></span> <span class="pl-k">const</span> BSTR ciphertext,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L52" class="blob-num js-line-number js-blob-rnum" data-line-number="52"></td> <td id="file-elevator_decrypt_key-cpp-LC52" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [out] <span class="pl-c">*/</span></span> BSTR* plaintext,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L53" class="blob-num js-line-number js-blob-rnum" data-line-number="53"></td> <td id="file-elevator_decrypt_key-cpp-LC53" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> [out] <span class="pl-c">*/</span></span> DWORD* last_error) = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L54" class="blob-num js-line-number js-blob-rnum" data-line-number="54"></td> <td id="file-elevator_decrypt_key-cpp-LC54" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L55" class="blob-num js-line-number js-blob-rnum" data-line-number="55"></td> <td id="file-elevator_decrypt_key-cpp-LC55" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L56" class="blob-num js-line-number js-blob-rnum" data-line-number="56"></td> <td id="file-elevator_decrypt_key-cpp-LC56" class="blob-code blob-code-inner js-file-line"><span class="pl-k">constexpr</span> <span class="pl-c1">size_t</span> KEY_SIZE = <span class="pl-c1">32</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L57" class="blob-num js-line-number js-blob-rnum" data-line-number="57"></td> <td id="file-elevator_decrypt_key-cpp-LC57" class="blob-code blob-code-inner js-file-line"><span class="pl-k">const</span> <span class="pl-c1">uint8_t</span> <span class="pl-c1">kCryptAppBoundKeyPrefix</span>[] = { <span class="pl-s"><span class="pl-pds">&#39;</span>A<span class="pl-pds">&#39;</span></span>, <span class="pl-s"><span class="pl-pds">&#39;</span>P<span class="pl-pds">&#39;</span></span>, <span class="pl-s"><span class="pl-pds">&#39;</span>P<span class="pl-pds">&#39;</span></span>, <span class="pl-s"><span class="pl-pds">&#39;</span>B<span class="pl-pds">&#39;</span></span> };</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L58" class="blob-num js-line-number js-blob-rnum" data-line-number="58"></td> <td id="file-elevator_decrypt_key-cpp-LC58" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L59" class="blob-num js-line-number js-blob-rnum" data-line-number="59"></td> <td id="file-elevator_decrypt_key-cpp-LC59" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">const</span> std::string BASE64_CHARS =</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L60" class="blob-num js-line-number js-blob-rnum" data-line-number="60"></td> <td id="file-elevator_decrypt_key-cpp-LC60" class="blob-code blob-code-inner js-file-line"><span class="pl-s"><span class="pl-pds">&quot;</span>ABCDEFGHIJKLMNOPQRSTUVWXYZ<span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L61" class="blob-num js-line-number js-blob-rnum" data-line-number="61"></td> <td id="file-elevator_decrypt_key-cpp-LC61" class="blob-code blob-code-inner js-file-line"><span class="pl-s"><span class="pl-pds">&quot;</span>abcdefghijklmnopqrstuvwxyz<span class="pl-pds">&quot;</span></span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L62" class="blob-num js-line-number js-blob-rnum" data-line-number="62"></td> <td id="file-elevator_decrypt_key-cpp-LC62" class="blob-code blob-code-inner js-file-line"><span class="pl-s"><span class="pl-pds">&quot;</span>0123456789+/<span class="pl-pds">&quot;</span></span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L63" class="blob-num js-line-number js-blob-rnum" data-line-number="63"></td> <td id="file-elevator_decrypt_key-cpp-LC63" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L64" class="blob-num js-line-number js-blob-rnum" data-line-number="64"></td> <td id="file-elevator_decrypt_key-cpp-LC64" class="blob-code blob-code-inner js-file-line"><span class="pl-k">inline</span> <span class="pl-k">bool</span> <span class="pl-en">isBase64</span>(<span class="pl-k">unsigned</span> <span class="pl-k">char</span> c) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L65" class="blob-num js-line-number js-blob-rnum" data-line-number="65"></td> <td id="file-elevator_decrypt_key-cpp-LC65" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-c1">isalnum</span>(c) || (c == <span class="pl-s"><span class="pl-pds">&#39;</span>+<span class="pl-pds">&#39;</span></span>) || (c == <span class="pl-s"><span class="pl-pds">&#39;</span>/<span class="pl-pds">&#39;</span></span>));</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L66" class="blob-num js-line-number js-blob-rnum" data-line-number="66"></td> <td id="file-elevator_decrypt_key-cpp-LC66" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L67" class="blob-num js-line-number js-blob-rnum" data-line-number="67"></td> <td id="file-elevator_decrypt_key-cpp-LC67" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L68" class="blob-num js-line-number js-blob-rnum" data-line-number="68"></td> <td id="file-elevator_decrypt_key-cpp-LC68" class="blob-code blob-code-inner js-file-line">std::vector&lt;<span class="pl-c1">uint8_t</span>&gt; <span class="pl-en">Base64Decode</span>(<span class="pl-k">const</span> std::string&amp; encoded_string) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L69" class="blob-num js-line-number js-blob-rnum" data-line-number="69"></td> <td id="file-elevator_decrypt_key-cpp-LC69" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> in_len = encoded_string.<span class="pl-c1">size</span>();</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L70" class="blob-num js-line-number js-blob-rnum" data-line-number="70"></td> <td id="file-elevator_decrypt_key-cpp-LC70" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> i = <span class="pl-c1">0</span>, j = <span class="pl-c1">0</span>, in_ = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L71" class="blob-num js-line-number js-blob-rnum" data-line-number="71"></td> <td id="file-elevator_decrypt_key-cpp-LC71" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">uint8_t</span> char_array_4[<span class="pl-c1">4</span>]{}, char_array_3[<span class="pl-c1">3</span>]{};</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L72" class="blob-num js-line-number js-blob-rnum" data-line-number="72"></td> <td id="file-elevator_decrypt_key-cpp-LC72" class="blob-code blob-code-inner js-file-line"> std::vector&lt;<span class="pl-c1">uint8_t</span>&gt; decoded_data;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L73" class="blob-num js-line-number js-blob-rnum" data-line-number="73"></td> <td id="file-elevator_decrypt_key-cpp-LC73" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L74" class="blob-num js-line-number js-blob-rnum" data-line-number="74"></td> <td id="file-elevator_decrypt_key-cpp-LC74" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (in_len-- &amp;&amp; (encoded_string[in_] != <span class="pl-s"><span class="pl-pds">&#39;</span>=<span class="pl-pds">&#39;</span></span>) &amp;&amp; <span class="pl-c1">isBase64</span>(encoded_string[in_])) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L75" class="blob-num js-line-number js-blob-rnum" data-line-number="75"></td> <td id="file-elevator_decrypt_key-cpp-LC75" class="blob-code blob-code-inner js-file-line"> char_array_4[i++] = encoded_string[in_]; in_++;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L76" class="blob-num js-line-number js-blob-rnum" data-line-number="76"></td> <td id="file-elevator_decrypt_key-cpp-LC76" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (i == <span class="pl-c1">4</span>) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L77" class="blob-num js-line-number js-blob-rnum" data-line-number="77"></td> <td id="file-elevator_decrypt_key-cpp-LC77" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (i = <span class="pl-c1">0</span>; i &lt; <span class="pl-c1">4</span>; i++) char_array_4[i] = BASE64_CHARS.<span class="pl-c1">find</span>(char_array_4[i]);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L78" class="blob-num js-line-number js-blob-rnum" data-line-number="78"></td> <td id="file-elevator_decrypt_key-cpp-LC78" class="blob-code blob-code-inner js-file-line"> char_array_3[<span class="pl-c1">0</span>] = (char_array_4[<span class="pl-c1">0</span>] &lt;&lt; <span class="pl-c1">2</span>) + ((char_array_4[<span class="pl-c1">1</span>] &amp; <span class="pl-c1">0x30</span>) &gt;&gt; <span class="pl-c1">4</span>);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L79" class="blob-num js-line-number js-blob-rnum" data-line-number="79"></td> <td id="file-elevator_decrypt_key-cpp-LC79" class="blob-code blob-code-inner js-file-line"> char_array_3[<span class="pl-c1">1</span>] = ((char_array_4[<span class="pl-c1">1</span>] &amp; <span class="pl-c1">0xf</span>) &lt;&lt; <span class="pl-c1">4</span>) + ((char_array_4[<span class="pl-c1">2</span>] &amp; <span class="pl-c1">0x3c</span>) &gt;&gt; <span class="pl-c1">2</span>);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L80" class="blob-num js-line-number js-blob-rnum" data-line-number="80"></td> <td id="file-elevator_decrypt_key-cpp-LC80" class="blob-code blob-code-inner js-file-line"> char_array_3[<span class="pl-c1">2</span>] = ((char_array_4[<span class="pl-c1">2</span>] &amp; <span class="pl-c1">0x3</span>) &lt;&lt; <span class="pl-c1">6</span>) + char_array_4[<span class="pl-c1">3</span>];</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L81" class="blob-num js-line-number js-blob-rnum" data-line-number="81"></td> <td id="file-elevator_decrypt_key-cpp-LC81" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (i = <span class="pl-c1">0</span>; i &lt; <span class="pl-c1">3</span>; i++) decoded_data.<span class="pl-c1">push_back</span>(char_array_3[i]);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L82" class="blob-num js-line-number js-blob-rnum" data-line-number="82"></td> <td id="file-elevator_decrypt_key-cpp-LC82" class="blob-code blob-code-inner js-file-line"> i = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L83" class="blob-num js-line-number js-blob-rnum" data-line-number="83"></td> <td id="file-elevator_decrypt_key-cpp-LC83" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L84" class="blob-num js-line-number js-blob-rnum" data-line-number="84"></td> <td id="file-elevator_decrypt_key-cpp-LC84" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L85" class="blob-num js-line-number js-blob-rnum" data-line-number="85"></td> <td id="file-elevator_decrypt_key-cpp-LC85" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L86" class="blob-num js-line-number js-blob-rnum" data-line-number="86"></td> <td id="file-elevator_decrypt_key-cpp-LC86" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (i) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L87" class="blob-num js-line-number js-blob-rnum" data-line-number="87"></td> <td id="file-elevator_decrypt_key-cpp-LC87" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (j = i; j &lt; <span class="pl-c1">4</span>; j++) char_array_4[j] = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L88" class="blob-num js-line-number js-blob-rnum" data-line-number="88"></td> <td id="file-elevator_decrypt_key-cpp-LC88" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (j = <span class="pl-c1">0</span>; j &lt; <span class="pl-c1">4</span>; j++) char_array_4[j] = BASE64_CHARS.<span class="pl-c1">find</span>(char_array_4[j]);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L89" class="blob-num js-line-number js-blob-rnum" data-line-number="89"></td> <td id="file-elevator_decrypt_key-cpp-LC89" class="blob-code blob-code-inner js-file-line"> char_array_3[<span class="pl-c1">0</span>] = (char_array_4[<span class="pl-c1">0</span>] &lt;&lt; <span class="pl-c1">2</span>) + ((char_array_4[<span class="pl-c1">1</span>] &amp; <span class="pl-c1">0x30</span>) &gt;&gt; <span class="pl-c1">4</span>);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L90" class="blob-num js-line-number js-blob-rnum" data-line-number="90"></td> <td id="file-elevator_decrypt_key-cpp-LC90" class="blob-code blob-code-inner js-file-line"> char_array_3[<span class="pl-c1">1</span>] = ((char_array_4[<span class="pl-c1">1</span>] &amp; <span class="pl-c1">0xf</span>) &lt;&lt; <span class="pl-c1">4</span>) + ((char_array_4[<span class="pl-c1">2</span>] &amp; <span class="pl-c1">0x3c</span>) &gt;&gt; <span class="pl-c1">2</span>);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L91" class="blob-num js-line-number js-blob-rnum" data-line-number="91"></td> <td id="file-elevator_decrypt_key-cpp-LC91" class="blob-code blob-code-inner js-file-line"> char_array_3[<span class="pl-c1">2</span>] = ((char_array_4[<span class="pl-c1">2</span>] &amp; <span class="pl-c1">0x3</span>) &lt;&lt; <span class="pl-c1">6</span>) + char_array_4[<span class="pl-c1">3</span>];</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L92" class="blob-num js-line-number js-blob-rnum" data-line-number="92"></td> <td id="file-elevator_decrypt_key-cpp-LC92" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (j = <span class="pl-c1">0</span>; j &lt; i - <span class="pl-c1">1</span>; j++) decoded_data.<span class="pl-c1">push_back</span>(char_array_3[j]);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L93" class="blob-num js-line-number js-blob-rnum" data-line-number="93"></td> <td id="file-elevator_decrypt_key-cpp-LC93" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L94" class="blob-num js-line-number js-blob-rnum" data-line-number="94"></td> <td id="file-elevator_decrypt_key-cpp-LC94" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L95" class="blob-num js-line-number js-blob-rnum" data-line-number="95"></td> <td id="file-elevator_decrypt_key-cpp-LC95" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> decoded_data;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L96" class="blob-num js-line-number js-blob-rnum" data-line-number="96"></td> <td id="file-elevator_decrypt_key-cpp-LC96" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L97" class="blob-num js-line-number js-blob-rnum" data-line-number="97"></td> <td id="file-elevator_decrypt_key-cpp-LC97" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L98" class="blob-num js-line-number js-blob-rnum" data-line-number="98"></td> <td id="file-elevator_decrypt_key-cpp-LC98" class="blob-code blob-code-inner js-file-line">std::vector&lt;<span class="pl-c1">uint8_t</span>&gt; <span class="pl-en">RetrieveEncryptedKey</span>(<span class="pl-k">const</span> std::string&amp; filepath) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L99" class="blob-num js-line-number js-blob-rnum" data-line-number="99"></td> <td id="file-elevator_decrypt_key-cpp-LC99" class="blob-code blob-code-inner js-file-line"> std::ifstream <span class="pl-smi">file</span>(filepath);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L100" class="blob-num js-line-number js-blob-rnum" data-line-number="100"></td> <td id="file-elevator_decrypt_key-cpp-LC100" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!file.<span class="pl-c1">is_open</span>()) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L101" class="blob-num js-line-number js-blob-rnum" data-line-number="101"></td> <td id="file-elevator_decrypt_key-cpp-LC101" class="blob-code blob-code-inner js-file-line"> std::cerr &lt;&lt; <span class="pl-s"><span class="pl-pds">&quot;</span>Error: Could not find the key file.<span class="pl-pds">&quot;</span></span> &lt;&lt; std::endl;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L102" class="blob-num js-line-number js-blob-rnum" data-line-number="102"></td> <td id="file-elevator_decrypt_key-cpp-LC102" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">exit</span>(EXIT_FAILURE);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L103" class="blob-num js-line-number js-blob-rnum" data-line-number="103"></td> <td id="file-elevator_decrypt_key-cpp-LC103" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L104" class="blob-num js-line-number js-blob-rnum" data-line-number="104"></td> <td id="file-elevator_decrypt_key-cpp-LC104" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L105" class="blob-num js-line-number js-blob-rnum" data-line-number="105"></td> <td id="file-elevator_decrypt_key-cpp-LC105" class="blob-code blob-code-inner js-file-line"> std::string <span class="pl-smi">base64_encrypted_key</span>((std::istreambuf_iterator&lt;<span class="pl-k">char</span>&gt;(file)),</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L106" class="blob-num js-line-number js-blob-rnum" data-line-number="106"></td> <td id="file-elevator_decrypt_key-cpp-LC106" class="blob-code blob-code-inner js-file-line"> std::istreambuf_iterator&lt;<span class="pl-k">char</span>&gt;());</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L107" class="blob-num js-line-number js-blob-rnum" data-line-number="107"></td> <td id="file-elevator_decrypt_key-cpp-LC107" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L108" class="blob-num js-line-number js-blob-rnum" data-line-number="108"></td> <td id="file-elevator_decrypt_key-cpp-LC108" class="blob-code blob-code-inner js-file-line"> std::vector&lt;<span class="pl-c1">uint8_t</span>&gt; encrypted_key_with_header = <span class="pl-c1">Base64Decode</span>(base64_encrypted_key);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L109" class="blob-num js-line-number js-blob-rnum" data-line-number="109"></td> <td id="file-elevator_decrypt_key-cpp-LC109" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L110" class="blob-num js-line-number js-blob-rnum" data-line-number="110"></td> <td id="file-elevator_decrypt_key-cpp-LC110" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">std::equal</span>(<span class="pl-c1">std::begin</span>(<span class="pl-c1">kCryptAppBoundKeyPrefix</span>), <span class="pl-c1">std::end</span>(<span class="pl-c1">kCryptAppBoundKeyPrefix</span>), encrypted_key_with_header.<span class="pl-c1">begin</span>())) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L111" class="blob-num js-line-number js-blob-rnum" data-line-number="111"></td> <td id="file-elevator_decrypt_key-cpp-LC111" class="blob-code blob-code-inner js-file-line"> std::cerr &lt;&lt; <span class="pl-s"><span class="pl-pds">&quot;</span>Error: Invalid key header.<span class="pl-pds">&quot;</span></span> &lt;&lt; std::endl;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L112" class="blob-num js-line-number js-blob-rnum" data-line-number="112"></td> <td id="file-elevator_decrypt_key-cpp-LC112" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">exit</span>(EXIT_FAILURE);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L113" class="blob-num js-line-number js-blob-rnum" data-line-number="113"></td> <td id="file-elevator_decrypt_key-cpp-LC113" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L114" class="blob-num js-line-number js-blob-rnum" data-line-number="114"></td> <td id="file-elevator_decrypt_key-cpp-LC114" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L115" class="blob-num js-line-number js-blob-rnum" data-line-number="115"></td> <td id="file-elevator_decrypt_key-cpp-LC115" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> std::vector&lt;<span class="pl-c1">uint8_t</span>&gt;(encrypted_key_with_header.<span class="pl-c1">begin</span>() + <span class="pl-k">sizeof</span>(<span class="pl-c1">kCryptAppBoundKeyPrefix</span>), encrypted_key_with_header.<span class="pl-c1">end</span>());</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L116" class="blob-num js-line-number js-blob-rnum" data-line-number="116"></td> <td id="file-elevator_decrypt_key-cpp-LC116" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L117" class="blob-num js-line-number js-blob-rnum" data-line-number="117"></td> <td id="file-elevator_decrypt_key-cpp-LC117" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L118" class="blob-num js-line-number js-blob-rnum" data-line-number="118"></td> <td id="file-elevator_decrypt_key-cpp-LC118" class="blob-code blob-code-inner js-file-line">std::string <span class="pl-en">BytesToHexString</span>(<span class="pl-k">const</span> BYTE* byteArray, <span class="pl-c1">size_t</span> size) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L119" class="blob-num js-line-number js-blob-rnum" data-line-number="119"></td> <td id="file-elevator_decrypt_key-cpp-LC119" class="blob-code blob-code-inner js-file-line"> std::ostringstream oss;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L120" class="blob-num js-line-number js-blob-rnum" data-line-number="120"></td> <td id="file-elevator_decrypt_key-cpp-LC120" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (<span class="pl-c1">size_t</span> i = <span class="pl-c1">0</span>; i &lt; size; ++i)</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L121" class="blob-num js-line-number js-blob-rnum" data-line-number="121"></td> <td id="file-elevator_decrypt_key-cpp-LC121" class="blob-code blob-code-inner js-file-line"> oss &lt;&lt; std::hex &lt;&lt; <span class="pl-c1">std::setw</span>(<span class="pl-c1">2</span>) &lt;&lt; <span class="pl-c1">std::setfill</span>(<span class="pl-s"><span class="pl-pds">&#39;</span>0<span class="pl-pds">&#39;</span></span>) &lt;&lt; <span class="pl-k">static_cast</span>&lt;<span class="pl-k">int</span>&gt;(byteArray[i]);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L122" class="blob-num js-line-number js-blob-rnum" data-line-number="122"></td> <td id="file-elevator_decrypt_key-cpp-LC122" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L123" class="blob-num js-line-number js-blob-rnum" data-line-number="123"></td> <td id="file-elevator_decrypt_key-cpp-LC123" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> oss.<span class="pl-c1">str</span>();</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L124" class="blob-num js-line-number js-blob-rnum" data-line-number="124"></td> <td id="file-elevator_decrypt_key-cpp-LC124" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L125" class="blob-num js-line-number js-blob-rnum" data-line-number="125"></td> <td id="file-elevator_decrypt_key-cpp-LC125" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L126" class="blob-num js-line-number js-blob-rnum" data-line-number="126"></td> <td id="file-elevator_decrypt_key-cpp-LC126" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">//</span> https://github.com/chromium/chromium/blob/67975166cf99a9e7f7354a259bf672a65f0b9968/chrome/browser/os_crypt/app_bound_encryption_provider_win.cc#L92</span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L127" class="blob-num js-line-number js-blob-rnum" data-line-number="127"></td> <td id="file-elevator_decrypt_key-cpp-LC127" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">//</span> https://github.com/chromium/chromium/blob/225f82f8025e4f93981310fd33daa71dc972bfa9/chrome/browser/os_crypt/app_bound_encryption_win.cc#L140</span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L128" class="blob-num js-line-number js-blob-rnum" data-line-number="128"></td> <td id="file-elevator_decrypt_key-cpp-LC128" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L129" class="blob-num js-line-number js-blob-rnum" data-line-number="129"></td> <td id="file-elevator_decrypt_key-cpp-LC129" class="blob-code blob-code-inner js-file-line"><span class="pl-k">int</span> <span class="pl-en">main</span>() {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L130" class="blob-num js-line-number js-blob-rnum" data-line-number="130"></td> <td id="file-elevator_decrypt_key-cpp-LC130" class="blob-code blob-code-inner js-file-line"> HRESULT hr = <span class="pl-c1">CoInitializeEx</span>(<span class="pl-c1">nullptr</span>, COINIT_APARTMENTTHREADED);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L131" class="blob-num js-line-number js-blob-rnum" data-line-number="131"></td> <td id="file-elevator_decrypt_key-cpp-LC131" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">FAILED</span>(hr)) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L132" class="blob-num js-line-number js-blob-rnum" data-line-number="132"></td> <td id="file-elevator_decrypt_key-cpp-LC132" class="blob-code blob-code-inner js-file-line"> std::cerr &lt;&lt; <span class="pl-s"><span class="pl-pds">&quot;</span>Failed to initialize COM.<span class="pl-pds">&quot;</span></span> &lt;&lt; std::endl;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L133" class="blob-num js-line-number js-blob-rnum" data-line-number="133"></td> <td id="file-elevator_decrypt_key-cpp-LC133" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L134" class="blob-num js-line-number js-blob-rnum" data-line-number="134"></td> <td id="file-elevator_decrypt_key-cpp-LC134" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L135" class="blob-num js-line-number js-blob-rnum" data-line-number="135"></td> <td id="file-elevator_decrypt_key-cpp-LC135" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L136" class="blob-num js-line-number js-blob-rnum" data-line-number="136"></td> <td id="file-elevator_decrypt_key-cpp-LC136" class="blob-code blob-code-inner js-file-line"> Microsoft::WRL::ComPtr&lt;IElevator&gt; elevator;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L137" class="blob-num js-line-number js-blob-rnum" data-line-number="137"></td> <td id="file-elevator_decrypt_key-cpp-LC137" class="blob-code blob-code-inner js-file-line"> DWORD last_error = ERROR_GEN_FAILURE;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L138" class="blob-num js-line-number js-blob-rnum" data-line-number="138"></td> <td id="file-elevator_decrypt_key-cpp-LC138" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L139" class="blob-num js-line-number js-blob-rnum" data-line-number="139"></td> <td id="file-elevator_decrypt_key-cpp-LC139" class="blob-code blob-code-inner js-file-line"> hr = <span class="pl-c1">CoCreateInstance</span>(CLSID_Elevator, <span class="pl-c1">nullptr</span>, CLSCTX_LOCAL_SERVER, IID_IElevator, (<span class="pl-k">void</span>**)&amp;elevator);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L140" class="blob-num js-line-number js-blob-rnum" data-line-number="140"></td> <td id="file-elevator_decrypt_key-cpp-LC140" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">FAILED</span>(hr)) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L141" class="blob-num js-line-number js-blob-rnum" data-line-number="141"></td> <td id="file-elevator_decrypt_key-cpp-LC141" class="blob-code blob-code-inner js-file-line"> std::cerr &lt;&lt; <span class="pl-s"><span class="pl-pds">&quot;</span>Failed to create IElevator instance.<span class="pl-pds">&quot;</span></span> &lt;&lt; std::endl;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L142" class="blob-num js-line-number js-blob-rnum" data-line-number="142"></td> <td id="file-elevator_decrypt_key-cpp-LC142" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">CoUninitialize</span>();</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L143" class="blob-num js-line-number js-blob-rnum" data-line-number="143"></td> <td id="file-elevator_decrypt_key-cpp-LC143" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L144" class="blob-num js-line-number js-blob-rnum" data-line-number="144"></td> <td id="file-elevator_decrypt_key-cpp-LC144" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L145" class="blob-num js-line-number js-blob-rnum" data-line-number="145"></td> <td id="file-elevator_decrypt_key-cpp-LC145" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L146" class="blob-num js-line-number js-blob-rnum" data-line-number="146"></td> <td id="file-elevator_decrypt_key-cpp-LC146" class="blob-code blob-code-inner js-file-line"> hr = <span class="pl-c1">CoSetProxyBlanket</span>(</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L147" class="blob-num js-line-number js-blob-rnum" data-line-number="147"></td> <td id="file-elevator_decrypt_key-cpp-LC147" class="blob-code blob-code-inner js-file-line"> elevator.<span class="pl-c1">Get</span>(),</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L148" class="blob-num js-line-number js-blob-rnum" data-line-number="148"></td> <td id="file-elevator_decrypt_key-cpp-LC148" class="blob-code blob-code-inner js-file-line"> RPC_C_AUTHN_DEFAULT,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L149" class="blob-num js-line-number js-blob-rnum" data-line-number="149"></td> <td id="file-elevator_decrypt_key-cpp-LC149" class="blob-code blob-code-inner js-file-line"> RPC_C_AUTHZ_DEFAULT,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L150" class="blob-num js-line-number js-blob-rnum" data-line-number="150"></td> <td id="file-elevator_decrypt_key-cpp-LC150" class="blob-code blob-code-inner js-file-line"> COLE_DEFAULT_PRINCIPAL,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L151" class="blob-num js-line-number js-blob-rnum" data-line-number="151"></td> <td id="file-elevator_decrypt_key-cpp-LC151" class="blob-code blob-code-inner js-file-line"> RPC_C_AUTHN_LEVEL_PKT_PRIVACY,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L152" class="blob-num js-line-number js-blob-rnum" data-line-number="152"></td> <td id="file-elevator_decrypt_key-cpp-LC152" class="blob-code blob-code-inner js-file-line"> RPC_C_IMP_LEVEL_IMPERSONATE,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L153" class="blob-num js-line-number js-blob-rnum" data-line-number="153"></td> <td id="file-elevator_decrypt_key-cpp-LC153" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">nullptr</span>,</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L154" class="blob-num js-line-number js-blob-rnum" data-line-number="154"></td> <td id="file-elevator_decrypt_key-cpp-LC154" class="blob-code blob-code-inner js-file-line"> EOAC_DYNAMIC_CLOAKING</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L155" class="blob-num js-line-number js-blob-rnum" data-line-number="155"></td> <td id="file-elevator_decrypt_key-cpp-LC155" class="blob-code blob-code-inner js-file-line"> );</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L156" class="blob-num js-line-number js-blob-rnum" data-line-number="156"></td> <td id="file-elevator_decrypt_key-cpp-LC156" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L157" class="blob-num js-line-number js-blob-rnum" data-line-number="157"></td> <td id="file-elevator_decrypt_key-cpp-LC157" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">FAILED</span>(hr)) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L158" class="blob-num js-line-number js-blob-rnum" data-line-number="158"></td> <td id="file-elevator_decrypt_key-cpp-LC158" class="blob-code blob-code-inner js-file-line"> std::cerr &lt;&lt; <span class="pl-s"><span class="pl-pds">&quot;</span>Failed to set proxy blanket.<span class="pl-pds">&quot;</span></span> &lt;&lt; std::endl;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L159" class="blob-num js-line-number js-blob-rnum" data-line-number="159"></td> <td id="file-elevator_decrypt_key-cpp-LC159" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">CoUninitialize</span>();</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L160" class="blob-num js-line-number js-blob-rnum" data-line-number="160"></td> <td id="file-elevator_decrypt_key-cpp-LC160" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L161" class="blob-num js-line-number js-blob-rnum" data-line-number="161"></td> <td id="file-elevator_decrypt_key-cpp-LC161" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L162" class="blob-num js-line-number js-blob-rnum" data-line-number="162"></td> <td id="file-elevator_decrypt_key-cpp-LC162" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L163" class="blob-num js-line-number js-blob-rnum" data-line-number="163"></td> <td id="file-elevator_decrypt_key-cpp-LC163" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> std::string filepath = <span class="pl-s"><span class="pl-pds">&quot;</span>app_bound_encrypted_key.txt<span class="pl-pds">&quot;</span></span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L164" class="blob-num js-line-number js-blob-rnum" data-line-number="164"></td> <td id="file-elevator_decrypt_key-cpp-LC164" class="blob-code blob-code-inner js-file-line"> std::vector&lt;<span class="pl-c1">uint8_t</span>&gt; encrypted_key = <span class="pl-c1">RetrieveEncryptedKey</span>(filepath);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L165" class="blob-num js-line-number js-blob-rnum" data-line-number="165"></td> <td id="file-elevator_decrypt_key-cpp-LC165" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L166" class="blob-num js-line-number js-blob-rnum" data-line-number="166"></td> <td id="file-elevator_decrypt_key-cpp-LC166" class="blob-code blob-code-inner js-file-line"> BSTR ciphertext_data = <span class="pl-c1">SysAllocStringByteLen</span>(<span class="pl-k">reinterpret_cast</span>&lt;<span class="pl-k">const</span> <span class="pl-k">char</span>*&gt;(encrypted_key.<span class="pl-c1">data</span>()), encrypted_key.<span class="pl-c1">size</span>());</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L167" class="blob-num js-line-number js-blob-rnum" data-line-number="167"></td> <td id="file-elevator_decrypt_key-cpp-LC167" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!ciphertext_data) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L168" class="blob-num js-line-number js-blob-rnum" data-line-number="168"></td> <td id="file-elevator_decrypt_key-cpp-LC168" class="blob-code blob-code-inner js-file-line"> std::cerr &lt;&lt; <span class="pl-s"><span class="pl-pds">&quot;</span>Failed to allocate BSTR for encrypted key.<span class="pl-pds">&quot;</span></span> &lt;&lt; std::endl;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L169" class="blob-num js-line-number js-blob-rnum" data-line-number="169"></td> <td id="file-elevator_decrypt_key-cpp-LC169" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">CoUninitialize</span>();</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L170" class="blob-num js-line-number js-blob-rnum" data-line-number="170"></td> <td id="file-elevator_decrypt_key-cpp-LC170" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L171" class="blob-num js-line-number js-blob-rnum" data-line-number="171"></td> <td id="file-elevator_decrypt_key-cpp-LC171" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L172" class="blob-num js-line-number js-blob-rnum" data-line-number="172"></td> <td id="file-elevator_decrypt_key-cpp-LC172" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L173" class="blob-num js-line-number js-blob-rnum" data-line-number="173"></td> <td id="file-elevator_decrypt_key-cpp-LC173" class="blob-code blob-code-inner js-file-line"> BSTR plaintext_data = <span class="pl-c1">nullptr</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L174" class="blob-num js-line-number js-blob-rnum" data-line-number="174"></td> <td id="file-elevator_decrypt_key-cpp-LC174" class="blob-code blob-code-inner js-file-line"> hr = elevator-&gt;<span class="pl-c1">DecryptData</span>(ciphertext_data, &amp;plaintext_data, &amp;last_error);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L175" class="blob-num js-line-number js-blob-rnum" data-line-number="175"></td> <td id="file-elevator_decrypt_key-cpp-LC175" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L176" class="blob-num js-line-number js-blob-rnum" data-line-number="176"></td> <td id="file-elevator_decrypt_key-cpp-LC176" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">SUCCEEDED</span>(hr)) {</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L177" class="blob-num js-line-number js-blob-rnum" data-line-number="177"></td> <td id="file-elevator_decrypt_key-cpp-LC177" class="blob-code blob-code-inner js-file-line"> BYTE* decrypted_key = <span class="pl-k">new</span> BYTE[KEY_SIZE];</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L178" class="blob-num js-line-number js-blob-rnum" data-line-number="178"></td> <td id="file-elevator_decrypt_key-cpp-LC178" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(decrypted_key, (<span class="pl-k">void</span>*)plaintext_data, KEY_SIZE);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L179" class="blob-num js-line-number js-blob-rnum" data-line-number="179"></td> <td id="file-elevator_decrypt_key-cpp-LC179" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">SysFreeString</span>(plaintext_data);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L180" class="blob-num js-line-number js-blob-rnum" data-line-number="180"></td> <td id="file-elevator_decrypt_key-cpp-LC180" class="blob-code blob-code-inner js-file-line"> std::cout &lt;&lt; <span class="pl-s"><span class="pl-pds">&quot;</span>Decrypted key: <span class="pl-pds">&quot;</span></span> &lt;&lt; <span class="pl-c1">BytesToHexString</span>(decrypted_key, KEY_SIZE) &lt;&lt; std::endl;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L181" class="blob-num js-line-number js-blob-rnum" data-line-number="181"></td> <td id="file-elevator_decrypt_key-cpp-LC181" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L182" class="blob-num js-line-number js-blob-rnum" data-line-number="182"></td> <td id="file-elevator_decrypt_key-cpp-LC182" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span></td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L183" class="blob-num js-line-number js-blob-rnum" data-line-number="183"></td> <td id="file-elevator_decrypt_key-cpp-LC183" class="blob-code blob-code-inner js-file-line"> std::cerr &lt;&lt; <span class="pl-s"><span class="pl-pds">&quot;</span>Decryption failed. Last error: <span class="pl-pds">&quot;</span></span> &lt;&lt; last_error &lt;&lt; std::endl;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L184" class="blob-num js-line-number js-blob-rnum" data-line-number="184"></td> <td id="file-elevator_decrypt_key-cpp-LC184" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L185" class="blob-num js-line-number js-blob-rnum" data-line-number="185"></td> <td id="file-elevator_decrypt_key-cpp-LC185" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">SysFreeString</span>(ciphertext_data);</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L186" class="blob-num js-line-number js-blob-rnum" data-line-number="186"></td> <td id="file-elevator_decrypt_key-cpp-LC186" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">CoUninitialize</span>();</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L187" class="blob-num js-line-number js-blob-rnum" data-line-number="187"></td> <td id="file-elevator_decrypt_key-cpp-LC187" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="file-elevator_decrypt_key-cpp-L188" class="blob-num js-line-number js-blob-rnum" data-line-number="188"></td> <td id="file-elevator_decrypt_key-cpp-LC188" class="blob-code blob-code-inner js-file-line">}</td> </tr> </table> </div> </div> </div> </div> <a name="comments"></a> <div class="js-quote-selection-container" data-quote-markdown=".js-comment-body"> <div class="js-discussion " > <div class="ml-md-6 pl-md-3 ml-0 pl-0"> <!-- Rendered timeline since 2025-03-23 19:17:14 --> <div id="partial-timeline-marker" class="js-timeline-marker js-updatable-content" data-last-modified="Mon, 24 Mar 2025 02:17:14 GMT" > </div> </div> <div class="discussion-timeline-actions"> <div data-view-component="true" class="flash flash-warn mt-3"> <a rel="nofollow" class="btn btn-primary" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;signed out comment&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="57ad555eea5fe01098da64e816c4913f5e757d90b1db151ddff7910657c5168b" href="/join?source=comment-gist">Sign up for free</a> <strong>to join this conversation on GitHub</strong>. Already have an account? <a rel="nofollow" class="Link--inTextBlock" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;signed out comment&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="420f7e3f9c33f591f0a19c57a60947d5e9373b5fdb3b1bd498c4cd89d807a2b9" data-test-selector="comments-sign-in-link" href="/login?return_to=https%3A%2F%2Fgist.github.com%2Fsnovvcrash%2Fcaded55a318bbefcb6cc9ee30e82f824">Sign in to comment</a> </div> </div> </div> </div> </div> </div> </div><!-- /.container --> </main> </div> </div> <footer class="footer pt-8 pb-6 f6 color-fg-muted p-responsive" role="contentinfo" > <h2 class='sr-only'>Footer</h2> <div class="d-flex flex-justify-center flex-items-center flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap"> <div class="d-flex flex-items-center flex-shrink-0 mx-2"> <a aria-label="Homepage" title="GitHub" class="footer-octicon mr-2" href="https://github.com"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> </a> <span> &copy; 2025 GitHub,&nbsp;Inc. </span> </div> <nav aria-label="Footer"> <h3 class="sr-only" id="sr-footer-heading">Footer navigation</h3> <ul class="list-style-none d-flex flex-justify-center flex-wrap mb-2 mb-lg-0" aria-labelledby="sr-footer-heading"> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to Terms&quot;,&quot;label&quot;:&quot;text:terms&quot;}" href="https://docs.github.com/site-policy/github-terms/github-terms-of-service" data-view-component="true" class="Link--secondary Link">Terms</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to privacy&quot;,&quot;label&quot;:&quot;text:privacy&quot;}" href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement" data-view-component="true" class="Link--secondary Link">Privacy</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to security&quot;,&quot;label&quot;:&quot;text:security&quot;}" href="https://github.com/security" data-view-component="true" class="Link--secondary Link">Security</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to status&quot;,&quot;label&quot;:&quot;text:status&quot;}" href="https://www.githubstatus.com/" data-view-component="true" class="Link--secondary Link">Status</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to docs&quot;,&quot;label&quot;:&quot;text:docs&quot;}" href="https://docs.github.com/" data-view-component="true" class="Link--secondary Link">Docs</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to contact&quot;,&quot;label&quot;:&quot;text:contact&quot;}" href="https://support.github.com?tags=dotcom-footer" data-view-component="true" class="Link--secondary Link">Contact</a> </li> <li class="mx-2" > <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;cookies&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;cookies_link_subfooter_footer&quot;}" > Manage cookies </button> </cookie-consent-link> </li> <li class="mx-2"> <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;dont_share_info&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;dont_share_info_link_subfooter_footer&quot;}" > Do not share my personal information </button> </cookie-consent-link> </li> </ul> </nav> </div> </footer> <ghcc-consent id="ghcc" class="position-fixed bottom-0 left-0" style="z-index: 999999" data-initial-cookie-consent-allowed="" data-cookie-consent-required="false"></ghcc-consent> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> You can鈥檛 perform that action at this time. </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details> </template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div> </div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> <template id="snippet-clipboard-copy-button-unpositioned"> <div class="zeroclipboard-container"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> </div> <div id="js-global-screen-reader-notice" class="sr-only mt-n1" aria-live="polite" aria-atomic="true" ></div> <div id="js-global-screen-reader-notice-assertive" class="sr-only mt-n1" aria-live="assertive" aria-atomic="true"></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10