2023-07-13 14:29:58 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright:
|
|
|
|
(C) 2022-2023 Daniele 'dzonerzy' Linguaglossa - http://libdzonerzy.so
|
|
|
|
|
|
|
|
This file is part of libdzonerzy.so.
|
|
|
|
|
|
|
|
GNU GENERAL PUBLIC LICENSE
|
|
|
|
Version 3, 29 June 2007
|
|
|
|
|
|
|
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
|
|
Everyone is permitted to copy and distribute verbatim copies
|
|
|
|
of this license document, but changing it is not allowed.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define _POSIX_C_SOURCE 200809L
|
|
|
|
#include "libdzonerzy.so.h"
|
|
|
|
#include "res.h"
|
|
|
|
|
|
|
|
// this is a shared object library
|
|
|
|
|
|
|
|
#define MAIN_CSS \
|
|
|
|
CSS_COMMENT("main.css") \
|
|
|
|
CSS_NEWLINE() \
|
|
|
|
CSS_SELECTOR("html,body") \
|
|
|
|
CSS_PROPERTY("margin", "0") \
|
|
|
|
CSS_PROPERTY("padding", "0") \
|
|
|
|
CSS_PROPERTY("width", "100%") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("body") \
|
|
|
|
CSS_PROPERTY("font-family", "monospace") \
|
|
|
|
CSS_PROPERTY("font-size", "1.23em") \
|
|
|
|
CSS_PROPERTY("background-color", "#ddd") \
|
|
|
|
CSS_PROPERTY("display", "flex") \
|
|
|
|
CSS_PROPERTY("flex-direction", "column") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("#title-block-header, #TOC") \
|
|
|
|
CSS_PROPERTY("border", "1px solid #222") \
|
|
|
|
CSS_PROPERTY("border-radius", "15px") \
|
|
|
|
CSS_PROPERTY("background-color", "#ccc") \
|
|
|
|
CSS_PROPERTY("color", "#000") \
|
|
|
|
CSS_PROPERTY("margin", "1em") \
|
|
|
|
CSS_PROPERTY("padding", "1em") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("footer") \
|
|
|
|
CSS_PROPERTY("border", "1px solid #222") \
|
|
|
|
CSS_PROPERTY("border-radius", "15px") \
|
|
|
|
CSS_PROPERTY("background-color", "#ccc") \
|
|
|
|
CSS_PROPERTY("color", "#000") \
|
|
|
|
CSS_PROPERTY("margin", "1em") \
|
|
|
|
CSS_PROPERTY("padding", "1em") \
|
|
|
|
CSS_PROPERTY("flex-shrink", "0") \
|
|
|
|
CSS_PROPERTY("display", "flex") \
|
|
|
|
CSS_PROPERTY("flex-direction", "column") \
|
|
|
|
CSS_PROPERTY("justify-content", "center") \
|
|
|
|
CSS_PROPERTY("align-items", "center") \
|
|
|
|
CSS_PROPERTY("font-size", "0.9em") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("div.hearth") \
|
|
|
|
CSS_PROPERTY("display", "flex") \
|
|
|
|
CSS_PROPERTY("justify-content", "center") \
|
|
|
|
CSS_PROPERTY("align-items", "center") \
|
|
|
|
CSS_PROPERTY("margin-left", "0.2em") \
|
|
|
|
CSS_PROPERTY("margin-right", "0.2em") \
|
|
|
|
CSS_PROPERTY("font-size", "1.5em") \
|
|
|
|
CSS_PROPERTY("padding", "0px") \
|
|
|
|
CSS_PROPERTY("animation", "bounce 1s infinite") \
|
|
|
|
CSS_PROPERTY("color", "#d00000") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("b.author") \
|
|
|
|
CSS_PROPERTY("color", "#000") \
|
|
|
|
CSS_PROPERTY("text-transform", "uppercase") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("p.author::before") \
|
|
|
|
CSS_PROPERTY("text-transform", "lowercase") \
|
|
|
|
CSS_PROPERTY("font-weight", "normal") \
|
|
|
|
CSS_PROPERTY("content", "'by '") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("p.date::before") \
|
|
|
|
CSS_PROPERTY("text-transform", "lowercase") \
|
|
|
|
CSS_PROPERTY("font-weight", "normal") \
|
|
|
|
CSS_PROPERTY("content", "'written on '") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("p.date") \
|
|
|
|
CSS_PROPERTY("text-transform", "capitalize") \
|
|
|
|
CSS_PROPERTY("font-weight", "bold") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("p.author") \
|
|
|
|
CSS_PROPERTY("text-transform", "uppercase") \
|
|
|
|
CSS_PROPERTY("font-weight", "bold") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("h1.title") \
|
|
|
|
CSS_PROPERTY("text-align", "center") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("section") \
|
|
|
|
CSS_PROPERTY("margin", "1em") \
|
|
|
|
CSS_PROPERTY("flex", "1 0 auto") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("h1 h2 h3 h4 h5 h6") \
|
|
|
|
CSS_PROPERTY("font-family", "monospace") \
|
|
|
|
CSS_PROPERTY("clear", "both") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("img") \
|
|
|
|
CSS_PROPERTY("padding", "2px") \
|
|
|
|
CSS_PROPERTY("border", "2px dashed #333") \
|
|
|
|
CSS_PROPERTY("background-color", "#fff") \
|
|
|
|
CSS_PROPERTY("color", "#000") \
|
|
|
|
CSS_PROPERTY("height", "12em") \
|
|
|
|
CSS_PROPERTY("float", "right") \
|
|
|
|
CSS_PROPERTY("clear", "right") \
|
|
|
|
CSS_PROPERTY("margin-left", "1em") \
|
|
|
|
CSS_PROPERTY("margin-bottom", "1em") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("figcaption") \
|
|
|
|
CSS_PROPERTY("display", "none") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("@keyframes bounce") \
|
|
|
|
CSS_SELECTOR("from, to") \
|
|
|
|
CSS_PROPERTY("transform", "scale(1, 1)") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("25%") \
|
|
|
|
CSS_PROPERTY("transform", "scale(0.9, 1.1)") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("50%") \
|
|
|
|
CSS_PROPERTY("transform", "scale(1.1, 0.9)") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("75%") \
|
|
|
|
CSS_PROPERTY("transform", "scale(0.95, 1.05)") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("footer > span") \
|
|
|
|
CSS_PROPERTY("display", "flex") \
|
|
|
|
CSS_PROPERTY("text-align", "center") \
|
|
|
|
CSS_PROPERTY("justify-content", "center") \
|
|
|
|
CSS_PROPERTY("align-items", "center") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("pre, code") \
|
|
|
|
CSS_PROPERTY("min-width", "60vw") \
|
|
|
|
CSS_PROPERTY("max-width", "80vw") \
|
|
|
|
CSS_PROPERTY("max-height", "500px") \
|
|
|
|
CSS_PROPERTY("overflow", "auto") \
|
|
|
|
CSS_PROPERTY("font-size", "1.1em") \
|
|
|
|
CSS_PROPERTY("font-family", "monospace") \
|
|
|
|
CSS_PROPERTY("border-radius", "0.5em") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("blockquote, pre") \
|
|
|
|
CSS_PROPERTY("padding", "1em") \
|
|
|
|
CSS_PROPERTY("border", "1px solid #111") \
|
|
|
|
CSS_PROPERTY("background-color", "#9a9091") \
|
|
|
|
CSS_PROPERTY("color", "#111") \
|
|
|
|
CSS_PROPERTY("clear", "both") \
|
|
|
|
CSS_PROPERTY("padding-top", "0.25em") \
|
|
|
|
CSS_PROPERTY("padding-bottom", "0.25em") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("div.sourceCode") \
|
|
|
|
CSS_PROPERTY("display", "flex") \
|
|
|
|
CSS_PROPERTY("flex-direction", "column") \
|
|
|
|
CSS_PROPERTY("justify-content", "center") \
|
|
|
|
CSS_PROPERTY("align-items", "center") \
|
|
|
|
CSS_END_SELECTOR() \
|
|
|
|
CSS_SELECTOR("pre::-webkit-scrollbar") \
|
|
|
|
CSS_PROPERTY("display", "none") \
|
|
|
|
CSS_END_SELECTOR()
|
|
|
|
|
2023-07-13 14:50:45 +00:00
|
|
|
#define INDEX_MD \
|
|
|
|
MD_META("DZONERZY's Blog", "DZONERZY") \
|
|
|
|
MD_META_CUSTOM("Thursday 12 July 2023") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_SECTION1("About") \
|
|
|
|
MD_IMAGE("Picture of DZONERZY", "assets/dzonerzy.jpg") \
|
|
|
|
MD_TEXT("Hello world here is dzonerzy, also known as Daniele Linguaglossa,") \
|
|
|
|
MD_TEXT("I'm an offensive security researcher and developer.") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_TEXT("I'm the author of this blog, and I'm using it to share my") \
|
|
|
|
MD_TEXT("researches and my projects.") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_TEXT("I'm also the author of the library that powers this blog, ") \
|
|
|
|
MD_TEXT("yes you heard right, this blog is powered by a ") \
|
|
|
|
MD_BOLD("shared object") \
|
|
|
|
MD_TEXT(" that I wrote in C!") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_TEXT("You can find the source code of this blog on my ") \
|
|
|
|
MD_LINK("git repository", "https://git.libdzonerzy.so/dzonerzy/libdzonerzy.so") \
|
|
|
|
MD_TEXT(".") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_SECTION1("Projects") \
|
|
|
|
MD_TEXT("Here is a list of my projects, that I've made in my spare time, some of them are ") \
|
|
|
|
MD_TEXT("still in development, but I'm working hard to finish them.") \
|
|
|
|
MD_NEWLINE() \
|
2023-07-13 14:51:21 +00:00
|
|
|
MD_LIST(MD_BOLD(MD_LINK("libdzonerzy.so", "https://git.libdzonerzy.so/dzonerzy/libdzonerzy.so"))) \
|
2023-07-13 14:50:45 +00:00
|
|
|
MD_TEXT(" -- libdzonerzy.so is a shared object that I wrote in C, it's a library ") \
|
|
|
|
MD_TEXT("that I use to power this blog.") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_LIST(MD_BOLD(MD_LINK("CaptainHook", "https://git.libdzonerzy.so/dzonerzy/CaptainHook"))) \
|
|
|
|
MD_TEXT(" -- CaptainHook is the next-gen hooking framework, it's a library that ") \
|
|
|
|
MD_TEXT("allow to hook functions in a very easy way without knowing the function prototype.") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_SECTION1("FAQ") \
|
|
|
|
MD_TEXT("Here is a list of frequently asked questions, if you have any other questions ") \
|
|
|
|
MD_TEXT("feel free to contact me at ") \
|
|
|
|
MD_BOLD("dzonerzy[at]gmail.com") \
|
|
|
|
MD_TEXT(".") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_SECTION4(" ") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_LIST(MD_BOLD("Q: ") MD_TEXT("Why this blog is so ugly?")) \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_TEXT("Because I'm not a web designer, I'm a developer, and I'm not good at ") \
|
|
|
|
MD_TEXT("designing things, but I'm working on it, I promise.") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_LIST(MD_BOLD("Q: ") MD_TEXT("Why this blog is so fast?")) \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_TEXT("Actually this is a static website, so it's very fast.") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_LIST(MD_BOLD("Q: ") MD_TEXT("What do you do for living?")) \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_TEXT("I'm the lead offensive security researcher at ") \
|
|
|
|
MD_LINK("Sysdig", "https://sysdig.com") \
|
|
|
|
MD_TEXT(", a cloud security company.") \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_LIST(MD_BOLD("Q: ") MD_TEXT("Is Sysdig hiring?")) \
|
|
|
|
MD_NEWLINE() \
|
|
|
|
MD_TEXT("Yes, we are always looking for new talents, if you are interested in working ") \
|
|
|
|
MD_TEXT("with me, feel free to send your resume at ... try to find it :D , ") \
|
|
|
|
MD_TEXT("hint (") \
|
|
|
|
MD_BOLD("libdzonerzy.so") \
|
|
|
|
MD_TEXT(").") \
|
|
|
|
MD_NEWLINE() \
|
2023-07-13 14:29:58 +00:00
|
|
|
MD_TEXT("Michele is gayyyyyyyyyyyyyyyyyyyyyyyy")
|
|
|
|
|
|
|
|
#define FOOTER_MD \
|
|
|
|
MD_RAWTAG("footer", "" \
|
|
|
|
"<span>" \
|
|
|
|
"Powered by <a href=\"/libdzonerzy.so\">libdzonerzy.so</a>" \
|
|
|
|
"</span>" \
|
|
|
|
"<br>" \
|
|
|
|
"<span>made with <div class='hearth'>❤</div> by <b class='author'>dzonerzy</b></span>") \
|
|
|
|
MD_NEWLINE()
|
|
|
|
|
|
|
|
#define SITEMAP_XML \
|
|
|
|
XML_URLSET() \
|
|
|
|
XML_URL("https://libdzonerzy.so/index.html") \
|
|
|
|
XML_URL("https://libdzonerzy.so/sitemap.xml") \
|
|
|
|
XML_END_URLSET()
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
fprintf(stdout, "https://libdzonerzy.so\n");
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
// resources
|
|
|
|
SECTION("main.css")
|
|
|
|
static const char maincss[] = MAIN_CSS;
|
|
|
|
SECTION("pages/index.md")
|
|
|
|
static const char indexmd[] = INDEX_MD;
|
|
|
|
SECTION("footer.html")
|
|
|
|
static const char footermd[] = FOOTER_MD;
|
|
|
|
SECTION("sitemap.xml")
|
|
|
|
static const char sitemapxml[] = SITEMAP_XML;
|