Skip to content

Commit

Permalink
add new page invoke-custom
Browse files Browse the repository at this point in the history
- Refactor Contents
- Fix Contact element
  • Loading branch information
AbhiTheModder committed Nov 8, 2024
1 parent 0a0b263 commit 9d6f04b
Show file tree
Hide file tree
Showing 8 changed files with 502 additions and 30 deletions.
20 changes: 16 additions & 4 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
import { Router, Route } from "svelte-routing";
import Home from "./routes/Home.svelte";
import About from "./routes/about.svelte";
import NewInstance from "./routes/new-instance.svelte";
import Contents from "./routes/Contents.svelte";
import Days from "./routes/Days.svelte";
import Instructions from "./routes/Instructions.svelte";
let days = Array.from({ length: 7 }, (_, i) => i + 1);
let instructions = ["invoke-custom", "new-instance"];
let loadComponent = (path) => () => import(`./routes/days/${path}.svelte`);
let loadComponentInstructions = (path) => () =>
import(`./routes/instructions/${path}.svelte`);
let url = "";
const dayTitles = {
Expand All @@ -28,8 +32,9 @@
} else if (path.startsWith("/days/")) {
const day = path.split("/").pop();
document.title = dayTitles[day] || `Day ${day} - Understand Smali`;
} else if (path === "/new-instance") {
document.title = "Instructions - new-instance";
} else if (path.startsWith("/instructions/")) {
const instruction = path.split("/").pop();
document.title = `Instructions - ${instruction}`;
} else if (path === "/days") {
document.title = "Days Overview - Understand Smali";
} else {
Expand All @@ -46,8 +51,15 @@
{#each days as day}
<Route path={`/days/${day}`} component={loadComponent(day)} />
{/each}
<Route path="/new-instance" component={NewInstance} />
{#each instructions as instruction}
<Route
path={`/instructions/${instruction}`}
component={loadComponentInstructions(instruction)}
/>
{/each}
<Route path="/contents" component={Contents} />
<Route path="/days" component={Days} />
<Route path="/instructions" component={Instructions} />
<Route path="*"><h1>Not found</h1></Route>
</div>
</Router>
24 changes: 4 additions & 20 deletions src/lib/Menu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{#if open}
<div class="menu">
{#each ["Home", "Days", "About", "Contact"] as mainlink, i}
{#each ["Home", "Contents", "About", "Contact"] as mainlink, i}
<p>
{#if mainlink === "Contact"}
<a
Expand Down Expand Up @@ -37,19 +37,9 @@
{/if}

{#if showContactMe}
<div class="contact-form">
<h3>Contact Me</h3>
<p>Just Comment at the bottom of any <br /> page of this website.</p>
<p class="contact-form button">
<a href="#chirpy-comment">
<button> Click Here </button>
</a>
</p>
</div>
<div
class="bar"
transition:scale={{ duration: 850, easing: quadOut, opacity: 1 }}
/>
<script>
window.open("https://t.me/AbhiTheM0dder", "_blank");
</script>
{/if}

<style>
Expand All @@ -61,12 +51,6 @@
padding-top: 0;
color: rgb(64, 64, 85);
}
.contact-form {
text-align: center;
font-weight: 50;
letter-spacing: 0.15em;
padding-top: 0;
}
p {
cursor: pointer;
Expand Down
79 changes: 79 additions & 0 deletions src/routes/Contents.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<script>
import { Footer, FooterCopyright } from "flowbite-svelte";
</script>

<main>
<h1 class="title">Table of Contents</h1>
<li id="li"><a href="/days">Days</a></li>
<li id="li">
<a href="/instructions">Instructions</a>
</li>
<p class="home">
<a href="/about" aria-label="Go To Home Page">
<button> Back to Home </button>
</a>
</p>
</main>

<Footer>
<div class="footer">
<FooterCopyright
aClass="hover:underline"
href="https://github.com/AbhiTheModder"
by="AbhiTheModder"
year={2024}
copyrightMessage=""
/>
</div>
</Footer>

<style>
.title {
font-weight: 800;
font-size: larger;
/* top:0; */
left: 0;
right: 0;
text-align: center;
text-decoration: underline;
margin-top: 20px;
position: fixed;
margin: -100px;
}
#li {
list-style-type: square;
text-decoration: dotted underline;
font-weight: 500;
font-size: medium;
text-align: center;
position: inherit;
margin-top: 5px;
margin: 0;
padding: 5px;
}
.home {
padding: 5px;
position: fixed;
left: 0;
right: 0;
bottom: 0;
margin-top: 20px;
margin-bottom: 70px;
text-align: center;
}
.footer {
position: fixed;
left: 0;
bottom: 0;
margin-bottom: 5px;
margin-right: 5px;
width: 100%;
color: white;
text-align: center;
}
@media (prefers-color-scheme: light) {
.footer {
color: black;
}
}
</style>
5 changes: 2 additions & 3 deletions src/routes/Days.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
</script>

<main>
<h1 class="title">Table of Contents</h1>
<h1 class="title">Days</h1>
<li id="li"><a href="/days/1">Day 1 - Introduction</a></li>
<li id="li"><a href="/days/2">Day 2 - Basics</a></li>
<li id="li"><a href="/days/3">Day 3 - Registers</a></li>
<li id="li"><a href="/days/4">Day 4 - Registers Conti...</a></li>
<li id="li"><a href="/days/5">Day 5 - Examples</a></li>
<li id="li"><a href="/days/5">Day 6 - CrackMe's</a></li>
<li id="li"><a href="/new-instance">Instructions - new-instance</a></li>
<p class="home">
<a href="/" aria-label="Go To Home Page">
<a href="/about" aria-label="Go To Home Page">
<button> Back to Home </button>
</a>
</p>
Expand Down
77 changes: 77 additions & 0 deletions src/routes/Instructions.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<script>
import { Footer, FooterCopyright } from "flowbite-svelte";
</script>

<main>
<h1 class="title">Instructions</h1>
<li id="li"><a href="/instructions/new-instance">new-instance</a></li>
<li id="li"><a href="/instructions/invoke-custom">invoke-custom</a></li>
<p class="home">
<a href="/about" aria-label="Go To Home Page">
<button> Back to Home </button>
</a>
</p>
</main>

<Footer>
<div class="footer">
<FooterCopyright
aClass="hover:underline"
href="https://github.com/AbhiTheModder"
by="AbhiTheModder"
year={2024}
copyrightMessage=""
/>
</div>
</Footer>

<style>
.title {
font-weight: 800;
font-size: larger;
/* top:0; */
left: 0;
right: 0;
text-align: center;
text-decoration: underline;
margin-top: 20px;
position: fixed;
margin: -100px;
}
#li {
list-style-type: square;
text-decoration: dotted underline;
font-weight: 500;
font-size: medium;
text-align: center;
position: inherit;
margin-top: 5px;
margin: 0;
padding: 5px;
}
.home {
padding: 5px;
position: fixed;
left: 0;
right: 0;
bottom: 0;
margin-top: 20px;
margin-bottom: 70px;
text-align: center;
}
.footer {
position: fixed;
left: 0;
bottom: 0;
margin-bottom: 5px;
margin-right: 5px;
width: 100%;
color: white;
text-align: center;
}
@media (prefers-color-scheme: light) {
.footer {
color: black;
}
}
</style>
4 changes: 2 additions & 2 deletions src/routes/days/6.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ print(
<code class="code">FlagGuard</code>
class. To Understand <code class="code">new-instance</code> better you can
read
<a href="https://smali.pages.dev/new-instance">new-instance</a> i&#39;ve made
<a href="https://smali.pages.dev/instructions/new-instance">new-instance</a> i&#39;ve made
sure to use this same example to make it easier for you to understand.
</p>
<p>
Expand Down Expand Up @@ -859,7 +859,7 @@ invoke-direct {`{v0}`}, Ljava/lang/StringBuilder;-><init>()V"
class object, which will be used to build the final unscrambled string. Again
if you want to know about <code class="code">new-instance</code> you can
refer to
<a href="https://smali.pages.dev/new-instance">new-instance</a>.
<a href="https://smali.pages.dev/instructions/new-instance">new-instance</a>.
</p>
<Highlight
language={smali}
Expand Down
Loading

0 comments on commit 9d6f04b

Please sign in to comment.