Gianluca Pacchiellahttps://ktln2.org/Notes and experiments. Don't expect much quality :PenContents © 2021 <a href="mailto:gp@ktln2.org">Gianluca Pacchiella</a> Fri, 02 Jul 2021 10:33:31 GMTNikola (getnikola.com)http://blogs.law.harvard.edu/tech/rss- Reusing old shit: laptop keyboardhttps://ktln2.org/reusing-old-keyboard/Gianluca Pacchiella<div><p>Here we are with another experiment in reusing otherwise trash-destined
electronics material; in this episode we are going to refurbish a keyboard,
from the recovering of the internal "matrix" to the design of the PCB destined
as the controller board, to finally reworking of an existing firmware to create
a new USB keyboard.</p>
<p><a href="https://ktln2.org/reusing-old-keyboard/">Read more…</a> (9 min remaining to read)</p></div>arduinoAVRkeyboardWIPhttps://ktln2.org/reusing-old-keyboard/Fri, 02 Jul 2021 00:00:00 GMT
- blog migration to Nikolahttps://ktln2.org/blog-migration-to-nikola/Gianluca Pacchiella<div><p>After running for a couple of years using <code>jekill</code> as a static site generator
I decided to switch to <a href="https://getnikola.com/"><code>nikola</code></a> for a couple of reasons: first of all because
is implemented in <code>python</code>, a language that I know more than <code>ruby</code> and this
allows me to improve the platform and customize it more to suite my needs.</p>
<p><a href="https://ktln2.org/blog-migration-to-nikola/">Read more…</a> (1 min remaining to read)</p></div>metahttps://ktln2.org/blog-migration-to-nikola/Thu, 01 Jul 2021 07:27:25 GMT
- Reusing old shit: creating a BSP using Yocto for the Samsung Galaxy S (S5PV210)https://ktln2.org/2021/01/31/yocto-samsung-galaxy-s/Gianluca Pacchiella<div><p>In this post I'll describe my esperiments in reusing my old Samsung Galaxy S;
don't expected anything sophisticated, it's more a brain dump.</p>
<p><a href="https://ktln2.org/2021/01/31/yocto-samsung-galaxy-s/">Read more…</a> (21 min remaining to read)</p></div>embeddedWIPyoctohttps://ktln2.org/2021/01/31/yocto-samsung-galaxy-s/Sun, 31 Jan 2021 00:00:00 GMT
- Reusing old shit: lcd screenhttps://ktln2.org/2021/01/31/reuse-old-laptop-screen/Gianluca Pacchiella<div><p>It's happened in the past that someone gifted me of very old (and not working
anymore) laptops that otherwise would have been thrown in the garbage; my idea
for them was of reusing some parts that are more valuable: battery, disks,
keyboards, etc...</p>
<p><a href="https://ktln2.org/2021/01/31/reuse-old-laptop-screen/">Read more…</a> (3 min remaining to read)</p></div>LCDLVDSold shitWIPhttps://ktln2.org/2021/01/31/reuse-old-laptop-screen/Sun, 31 Jan 2021 00:00:00 GMT
- Modern cryptography: exercises chapter 3 'Private-key encryption'https://ktln2.org/2020/12/31/modern-crypto-exercises-chapter-3/Gianluca Pacchiella<div><p>These are some solved exercises of chapter 3 of the book <a href="http://www.cs.umd.edu/~jkatz/imc.html">"Introduction to
modern cryptography"</a> (second edition) by Jonathan Katz and Yehuda Lindell.
For chapter 2 go <a href="https://ktln2.org/2018/02/06/modern-crypto-exercise-chapter2/">here</a>.</p>
<p><a href="https://ktln2.org/2020/12/31/modern-crypto-exercises-chapter-3/">Read more…</a> (10 min remaining to read)</p></div>cryptographyexercisesWIPhttps://ktln2.org/2020/12/31/modern-crypto-exercises-chapter-3/Thu, 31 Dec 2020 00:00:00 GMT
- Notes on JavaScriptCorehttps://ktln2.org/2020/08/25/javascriptcore/Gianluca Pacchiella<div><p>In this post I want to add some pratical notes (and maybe a new tool) to the
<a href="http://phrack.com/papers/attacking_javascript_engines.html">paper from saelo</a>
about exploiting modern browsers; in particular I'll focus on Webkit and as in
his paper, I'll deep dive into the source code of that version of webkit.</p>
<p><a href="https://ktln2.org/2020/08/25/javascriptcore/">Read more…</a> (30 min remaining to read)</p></div>browsergdbWebkitWIPhttps://ktln2.org/2020/08/25/javascriptcore/Tue, 25 Aug 2020 00:00:00 GMT
- Configuring an IpSec VPN (fortigate client)https://ktln2.org/2020/07/28/vpn/Gianluca Pacchiella<div><p>I was in need to have a working VPN with Fortigate and here I'm going to
recollect the procedure that has permited to accomplish such simple but
incredibly complex task.</p>
<p><a href="https://ktln2.org/2020/07/28/vpn/">Read more…</a> (3 min remaining to read)</p></div>LinuxVPNhttps://ktln2.org/2020/07/28/vpn/Tue, 28 Jul 2020 00:00:00 GMT
- VGA controller simulation with verilatorhttps://ktln2.org/2020/05/24/vga-controller-simulation/Gianluca Pacchiella<div><p>In my two previous posts I implemented a <a href="https://ktln2.org/2018/01/23/implementing-vga-in-verilog/">simple VGA controller</a> and <a href="https://ktln2.org/2018/06/17/vga-text-mode-verilog/">one with the text mode</a> but now I want to explore
the possibility to simulate it using <code>verilator</code>.</p>
<p><a href="https://ktln2.org/2020/05/24/vga-controller-simulation/">Read more…</a> (8 min remaining to read)</p></div>verilatorverilogVGAhttps://ktln2.org/2020/05/24/vga-controller-simulation/Sun, 24 May 2020 00:00:00 GMT
- Reversing the USB update process of a devicehttps://ktln2.org/2020/05/04/reversing-usb-update-process/Gianluca Pacchiella<div><p>I'm again at it: I have a device that I want to know how it works and I started
to reverse it, this time without any particular reason if not curiosity.</p>
<p>What I couldn't know was that I was entering a rabbit hole of biblic proportion
and this post is only the tip of the iceberg.</p>
<p>In this post I want to describe without any particular order, how to reverse
a C++ application and the USB protocol that it uses to update the firmware
on the device. I don't think this will be useful to anyone, let me know in
case it has changed your life :)</p>
<p><a href="https://ktln2.org/2020/05/04/reversing-usb-update-process/">Read more…</a> (18 min remaining to read)</p></div>C++ghidraMFCreversingwindowsWIPhttps://ktln2.org/2020/05/04/reversing-usb-update-process/Mon, 04 May 2020 00:00:00 GMT
- QED formularyhttps://ktln2.org/2020/04/29/qed-formulary/Gianluca Pacchiella<div><p>\(\def\Tr{\hbox{Tr}}\)
\(\def\slashme#1{\rlap{\backslash}{#1}}\)
\(\def\pslash{\rlap{\backslash}{p}}\)
\(\def\partialslash{\rlap{\backslash}{\partial}}\)</p>
<p>This post is personal: I found some notes taken more than 10 years ago
and I'm worried to lost them, so I write it down here in order to preserve
the memory; maybe one day I'll write a post about the physics behind this stuff.</p>
<div>
$$
\int d^Nq\,\left(q^2 + \mu^2 -i\epsilon\right)^{-\alpha} = i{\pi^{N/2}\over 2}{\Gamma(N/2)\Gamma(\alpha - N/2)\over\Gamma(\alpha)}\left(\mu^2\right)^{N/2 - \alpha}
$$
</div>
<div>
$$
{1\over\Pi^N_{i=1}a_i} =
\Gamma(N)\int^1_0 dx_1\,
\int_0^{x_1} dx_2
\dots\int^{x_{N - 2} }_0
dx_{N - 1}
\left[a_N x_{N - 1} + \dots + \Bigl(x_{N - 2} - x_{N - 1}\Bigr)a_{N - 1} + \dots + \left(1 - x_1\right)a_1\right]^{-N}
$$
</div>
<p>$$
\Gamma(\epsilon) = {1\over\epsilon} - \gamma + O(\epsilon)
$$</p>
<p>$$
a^\epsilon = 1 + \epsilon\ln a + o(\epsilon)
$$</p>
<p>$$
\int d^4k\,\theta(k_0)\delta(k^2 + m^2) \sim \int{d^3k\over2 k_0}
$$</p>
<h3>Tensorial integrals</h3>
<p>For some informations see this <a href="http://hanka.hluchy.sk/pdf/Svit-lecture.pdf">slides</a>.</p>
<div>
$$
\eqalign{
J_0 &= \int d^Nq\,{1\over\left(q^2 + 2kq+\mu^2\right)^\alpha} = i\pi^{N/2}{\Gamma(\alpha - N/2)\over\Gamma(\alpha)}\left(\mu^2 - k^2\right)^{N/2 - \alpha} \cr
J_\mu(k) &= \int d^Nq\,{q_\mu\over\left(q^2 + 2kq+\mu^2\right)^\alpha} = -J_0 k_\mu\cr
J_{\mu\nu}(k) &= \int d^Nq{q_\mu q_\nu\over\left(q^2 + 2kq+\mu^2\right)^\alpha} = -J_0\left(k_\mu k_\nu + {1\over2}{\mu^2 - k^2\over\alpha - 1 - N/2}\delta_{\mu\nu}\right)\cr
}
$$
</div>
<h3>Gamma matrices</h3>
<p>Suppose \(D\) is the dimensionality of the space-time</p>
<div>
$$
\eqalign{
\Tr(\mathbf{I}_{n}) &= 4\cr
\left\{\gamma^\mu,\gamma^\nu\right\} &= 2g^{\mu\nu}\mathbf{I}_{n} \cr
\gamma^\mu\gamma_\mu &= g^\mu_\mu = D \cr
Tr(\gamma^\mu\gamma^\nu) &= 4g^{\mu\nu} \cr
Tr(\gamma^\mu\gamma^\nu\gamma^\rho\gamma^\sigma) &= 4\left(g^{\mu\nu}g^{\rho\sigma} - g^{\mu\rho}g^{\nu\sigma} + g^{\mu\sigma}g^{\nu\rho}\right) \cr
Tr(\gamma^\mu\gamma^\nu\gamma^\sigma\gamma^\rho\gamma^\xi) &= \epsilon^{\mu\nu\sigma}\quad\hbox{(TO FIX)}\cr
}
$$
</div>
<h3>Spinors</h3>
<div>
$$
\eqalign{
\pslash &= \gamma^\mu p_\mu \cr
\left(i\pslash + m\right)u(\vec{p}) &= 0 \cr
\left(-i\pslash + m\right)v(\vec{p}) &= 0 \cr
\sum_{\hbox{spin}}u(p)\bar{u}(p) = {1\over2 p_0}\left(-i\pslash + m\right) \cr
\sum_{\hbox{spin}}v(p)\bar{v}(p) = {1\over2 p_0}\left(i\pslash + m\right) \cr
}
$$
</div>
<h3>Lagrangian</h3>
<p>$$
L = -{1\over4} F_{\mu\nu}F_{\mu\nu} - {1\over2}\left(\partial_\mu A_\mu\right)^2 - \bar\psi\left(\partialslash + m \right)\psi + ie A_\mu\bar\psi\gamma^\mu\psi
$$</p>
<h3>1loop photon</h3>
<p>$$
\eqalign{
\Pi_{\mu\nu} &= e^2\int d^nq{1\over \left(q^2 + m^2\right)\left(\left(q+p\right)^2 + m^2\right)}\Tr\left\{\gamma^\mu\left(-i\slashme{q} + m\right)\gamma^\nu\left(-i\left(\slashme{p} + \slashme{q}\right) + m\right)\right\} \cr
&= -i8\pi^2e^2 \int^1_0dx\,J_0\left(p^2\delta_{\mu\nu} - p_\mu p_\nu\right) x(1 - x)\cr
&\sim -i8\pi^2e^2 \int_0^1 dx\,\left(\Delta - \ln \mu^2\right) x\left(1 - x\right)\left(p^2 \delta_\mu\nu - p_\mu p_\nu\right) \cr
}
$$</p>
<h3>QED renormalization</h3>
<p>From an analysis using the propagators of photons and fermions and the vertex we can tell that the
global degree of divergence of a diagram is given by</p>
<p>$$
D(G) = 4 - {3\over2}E_e - E_\gamma\quad\left\{\eqalign{
&D(G) < 0\quad\hbox{converges} \cr
&D(G) \ge0\quad\hbox{diverges} \cr
}\right.
$$</p>
<h4>Weinberg theorem</h4>
<p>Given a \(G\) such that \(D(G) < 0\) and for all its subdiagrams
then \(G\) converges.</p></div>mathematicsphysicshttps://ktln2.org/2020/04/29/qed-formulary/Wed, 29 Apr 2020 00:00:00 GMT