Skip to content

Instantly share code, notes, and snippets.

View kabbi's full-sized avatar

Dmitry Kabak kabbi

View GitHub Profile
# vim:fileencoding=utf-8:ft=conf:foldmethod=marker
#: Fonts {{{
#: kitty has very powerful font management. You can configure
#: individual font faces and even specify special fonts for particular
#: characters.
font_family Fira Code
bold_font auto
write: 18,1E
read: 18,00,00,00,00
write: 18,1C
read: 18,00,00
write: 18,00
read: 18,11
write: 18,7E,B6
write: 18,7C
read: 18,03
write: 18,7C,02
@kabbi
kabbi / log.md
Last active September 13, 2024 10:32
Yeelight xiaomi mesh light bulb auth sequence dump

Service UUID 0000fe95-0000-1000-8000-00805f9b34fb

Model MJDP09UL, yeelink.light.mbulb3

Connection sequence:

  • read version
  • mtu to 247
  • write to [0010] a4
  • notified [0016] 0000040006f2
@kabbi
kabbi / connect.js
Created August 16, 2020 01:32
Yeelight mesh bulb ble connection / auth PoC
const noble = require('@abandonware/noble');
const EC = require('elliptic').ec;
const hkdf = require('futoin-hkdf');
const { crc32 } = require('crc');
const ccm = require('aes-ccm');
const ec = EC('p256');
noble.on('stateChange', async (state) => {
if (state === 'poweredOn') {

V3 part list

#include <stdbool.h>
#include <stdint.h>
#include "api.h"
#include "mesh.h"
#include "libc.h"
#define KABBI_COMPANY_ID 0x9832
#define KABBI_STRIP_MODEL_ID 0x0001
@kabbi
kabbi / file.c
Created November 24, 2022 15:44
undefined4 WhatXX(byte *data,int v)
{
uint uVar1;
int iVar2;
uVar1 = 0x80;
for (iVar2 = 0; iVar2 < v % 8; iVar2 = iVar2 + 1) {
uVar1 = uVar1 >> 1;
Answer the following questions as best you can. You have access to the following tools:
calculator: Useful for getting the result of a math expression. The input to this tool should be a valid mathmatical expression that could be executed by a simple calculator.
Use the following format:
Question: the input question you must answer
Thought: you should always think about what to do
Action: the action to take, should be one of [calculator]
Action Input: the input to the action