Iβm currently working (Iβm just at the beginning, and Iβm quite slow) on a personal project that will use Keepass files (kdb and kdbx).
I tried to find some documentation about .kdb and .kdbx format, but I didnβt find anything, even in the Keepass official website. I you want to know how these file formats are structured, you must read Keepassβs source code. So I wrote this article that explains how Keepass file format are structured, maybe it will help someone.
This file contains hidden or 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.
Learn more about bidirectional Unicode characters
| Convention: Byte array notation as it would appear in a hexeditor. | |
| = Layout= | |
| KDBX files, the keepass database files, are layout as follows: | |
| 1) Bytes 0-3: Primary identifier, common across all kdbx versions: | |
| private static $sigByte1=[0x03,0xD9,0xA2,0x9A]; | |
| 2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1) |
This file contains hidden or 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.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <stdbool.h> | |
| #include <strings.h> | |
| char* readline() { | |
| size_t alloc_length = 1024; | |
| size_t data_length = 0; |
All the next steps are performed on RaspberryPi machine in console
- Download the latest version of
neovimfrom official repository. At the moment of writing the manual the latest version is0.9.2
cd ~ && mkdir neovim-install && cd !$wget 'https://github.com/neovim/neovim/archive/refs/tags/v0.9.2.tar.gz'- Extract the downloaded archive and navigate inside
All next stepts are performed in Raspberry Pi environment
- Create a temporary directory
cd ~ && mkdir swift5.9 && cd !$- Download the latest Swift version for ARM architecture(
aarch64). On the moment of preparing the manual the latest version is5.9
wget https://download.swift.org/swift-5.9-branch/ubuntu2004-aarch64/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-09-21-a/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-09-21-a-ubuntu20.04-aarch64.tar.gz- Extract the acrhive
This file contains hidden or 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.
Learn more about bidirectional Unicode characters
| import Foundation | |
| // TASK | |
| // Complete function `process(...)` | |
| func processData(_ v: Int) async throws -> Int { | |
| print("<-start \"\(v)\"...") | |
| let s: Int = 5 // .random(in: 0...10) | |
| try await Task.sleep(for: .seconds(s)) | |
| print("->finish \"\(v)\" (took \(s) sec).") |
This file contains hidden or 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.
Learn more about bidirectional Unicode characters
| use std::{collections::HashMap, env, fs, io}; | |
| use unicode_general_category::GeneralCategory; | |
| use unicode_general_category::get_general_category; | |
| fn main() { | |
| if env::args().len() != 2 { | |
| println!("Use {} <FILE_PATH>", env::args().nth(0).unwrap()); | |
| return; | |
| } |
This file contains hidden or 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.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import Synchronization | |
| // The problem repeats the LC problem '1114. Print in Order' | |
| // https://leetcode.com/problems/print-in-order | |
| // Implement your solution inside the `Foo` class. | |
| // Test with: swift main.swift | |
| final class Foo: Sendable { | |
| init() { |
This file contains hidden or 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.
Learn more about bidirectional Unicode characters
| // Inspired from Medium post | |
| // Decrypt Go: Why Is Goβs Regexp So Slow, and Why Thatβs Actually Smart | |
| // | |
| // https://pub.huizhou92.com/decrypt-go-why-is-gos-regexp-so-slow-and-why-that-s-actually-smart-32fedad4bd9c | |
| // | |
| // to run: | |
| // swift package init --type executable --name ReDoS | |
| // cp curr_gist Sources/ReDoS/ReDoS.swift | |
| // swift run -c release -q ReDoS |
This file contains hidden or 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.
Learn more about bidirectional Unicode characters
| // | |
| // The problem repeats the LC problem '1115. Print FooBar Alternately' | |
| // https://leetcode.com/problems/print-in-order | |
| // Implement your solution inside the `FooBar` class. | |
| // Test with: swift main.swift | |
| final class FooBar: Sendable { | |
| let n: Int |
OlderNewer