Skip to content

Commit 3aace56

Browse files
authored
Merge pull request #44 from TheRomanXpl0it/fix-align
Fix authors alignment and add archetype
2 parents 6320c8c + d6194fe commit 3aace56

File tree

9 files changed

+88
-59
lines changed

9 files changed

+88
-59
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ RUN npm install
3333
RUN hugo mod get -u && \
3434
hugo mod tidy
3535

36+
RUN git config --global --add safe.directory /code
37+
RUN git config --global --add safe.directory /src

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ Values supported in the `social` table are:
3535

3636
## Writing a post
3737

38-
> ![TIP]
38+
You can create an empty blog post with header by using hugo:
39+
40+
```bash
41+
hugo new posts/myctf25-chall1/index.md
42+
```
43+
44+
> [!TIP]
3945
> If you need mathjax, you can add `math: true` to the frontmatter.
4046
4147
## Development setup

archetypes/posts.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
11
---
2+
# example: UIUCTF 25 - ELF Capsule
23
title: {{ .Name }}
4+
5+
# date of publication/creation
36
date: '{{ .Date }}'
7+
8+
# add link to your original blog post
9+
upstream: ""
10+
11+
# set to true to use mathjax
412
math: false
13+
14+
# for ctf writeups add the category for the ctf event
15+
# --> name of ctf + short year (example uiuctf25)
516
categories:
17+
# - namectf25
618
- writeup
19+
20+
# tag names should be mostly lowercase
21+
# please reuse tags if possible (https://theromanxpl0.it/tags/)
722
tags:
23+
# - reverse
24+
# - crypto
25+
# - forensics
26+
# - misc
27+
# - pwn
28+
# - web
29+
# - fullpwn
30+
# - hardware
31+
# - infra
32+
# ecc ecc.
33+
34+
# you can put more than one
35+
# please use the standard name in content/members
836
authors:
37+
# - myself
938
---
10-

content/posts/uiuctf25-elf_capsule/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Note: The flag consists of only printable ASCII characters.
2323
The flag has format uiuctf{...}, and inputs to program should follow this format.
2424
Your solve script shouldn't take more than 10 minutes to run.
2525

26-
author: CBCicada
26+
Author: CBCicada
2727

2828
## Analysis
2929

@@ -97,7 +97,7 @@ This exception-based dispatch mechanism lets the embedded binary implement a ful
9797

9898
## Main binary
9999

100-
as we saw earlier `sub_800001C0` contains the code of the functions that are called with codes as invalid memory addresses, there are two branches, one for operation type (load and store), that will do 2 similar operations, for example the xor operation is defined as `stack[-1] ^= a4` for the stores and `a4 = stack[-2] ^ stack[-1]` for the loads, this pattern is shared between all operations + some functions that are one, the inverse of the other (like `push` and `pop`)
100+
As we saw earlier `sub_800001C0` contains the code of the functions that are called with codes as invalid memory addresses, there are two branches, one for operation type (load and store), that will do 2 similar operations, for example the xor operation is defined as `stack[-1] ^= a4` for the stores and `a4 = stack[-2] ^ stack[-1]` for the loads, this pattern is shared between all operations + some functions that are one, the inverse of the other (like `push` and `pop`).
101101

102102
## Decompiler
103103

@@ -220,7 +220,7 @@ if lui in inst:
220220

221221
m = addi_regex.match(addi_inst)
222222
a4 = int(m.group(1), 16)
223-
223+
224224
addr += inst_size
225225
continue
226226
```
@@ -350,7 +350,7 @@ while addr < end:
350350
real_func = ld_codes.get(real_func, f'unknown_{real_func}')
351351
a5 = None
352352
inst = f'{real_func}'
353-
353+
354354
elif lui in inst:
355355
addi_inst = idc.GetDisasm(addr+inst_size)
356356
addi_insn = ida_ua.insn_t()
@@ -359,7 +359,7 @@ while addr < end:
359359

360360
m = addi_regex.match(addi_inst)
361361
a4 = int(m.group(1), 16)
362-
362+
363363
addr += inst_size
364364
continue
365365

themes/hello-friend-trx/assets/scss/_author.scss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,29 @@
2424
height: 2.2em;
2525
margin-right: 1em;
2626
}
27+
28+
.post-authors {
29+
display: flex;
30+
width: 100%;
31+
32+
&__label {
33+
flex: 0 0 auto;
34+
white-space: nowrap;
35+
}
36+
37+
&__names {
38+
display: flex;
39+
gap: 0.8em;
40+
flex: 1 1 0;
41+
min-width: 0;
42+
white-space: nowrap;
43+
overflow: hidden;
44+
45+
& .author-link {
46+
display: inline-flex;
47+
align-items: center;
48+
gap: 0.1em;
49+
flex: 0 0 auto;
50+
}
51+
}
52+
}

themes/hello-friend-trx/assets/scss/_list.scss

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -125,31 +125,3 @@
125125
}
126126
}
127127
}
128-
129-
.post-authors {
130-
display: flex;
131-
width: 100%;
132-
align-items: flex-start;
133-
134-
&__label {
135-
flex: 0 0 auto;
136-
white-space: nowrap;
137-
}
138-
139-
&__names {
140-
display: inline-block;
141-
flex: 1 1 0;
142-
min-width: 0;
143-
white-space: nowrap;
144-
overflow: hidden;
145-
text-overflow: ellipsis;
146-
147-
& .author-link {
148-
display: inline-flex;
149-
align-items: center;
150-
gap: 0.25em;
151-
flex: 0 0 auto;
152-
white-space: nowrap;
153-
}
154-
}
155-
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- $site := .site -}}
2+
<div class="post-authors">
3+
<span class="post-authors__label">{{.label}}</span>
4+
5+
<span class="post-authors__names">
6+
{{- range $index, $author := .authors -}}
7+
{{- partial "author.html" (dict "author" $author "site" $site) -}}
8+
{{- end -}}
9+
</span>
10+
</div>

themes/hello-friend-trx/layouts/partials/posts.html

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@
2222
{{ end }}
2323
</span>
2424

25-
{{- if .Params.authors -}}
26-
{{- $site := .Site -}}
27-
<div class="post-authors">
28-
<span class="post-authors__label">by</span>
29-
<span class="post-authors__names">
30-
{{- range $index, $author := .Params.authors -}}
31-
{{- partial "author.html" (dict "author" $author "site" $site) -}}
32-
&nbsp;
33-
{{- end -}}
34-
</span>
35-
</div>
36-
{{- end -}}
25+
{{ if .Params.authors }}
26+
{{- $label := "by" -}}
27+
{{- partial "authors.html" (dict "authors" .Params.authors "site" .Site "label" $label) -}}
28+
{{ end }}
3729
</div>
3830
</div>
3931
</li>

themes/hello-friend-trx/layouts/posts/single.html

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,11 @@
33

44
<div class="post-info">
55
{{ if .Params.authors }}
6-
<div>
7-
{{- $site := .Site -}}
8-
<div class="post-authors">
9-
<span class="post-authors__label">AUTHOR{{if ne (len .Params.authors) 1}}S{{end}}</span>
10-
<span class="post-authors__names">
11-
{{- range $index, $author := .Params.authors -}}
12-
{{- partial "author.html" (dict "author" $author "site" $site) -}}
13-
&nbsp;
14-
{{- end -}}
15-
</span>
16-
</div>
17-
</div>
6+
{{- $label := "AUTHORS" -}}
7+
{{- if eq (len .Params.authors) 1 -}}
8+
{{- $label = "AUTHOR" -}}
9+
{{- end -}}
10+
{{- partial "authors.html" (dict "authors" .Params.authors "site" .Site "label" $label) -}}
1811
{{ end }}
1912

2013
<br>

0 commit comments

Comments
 (0)