]> gitweb.ps.run Git - ouroboros-slides/blob - pres.md
add generated html to repo
[ouroboros-slides] / pres.md

title: Ouroboros Flash Reader author: Patrick Schönberger date: 16.07.2025 transition: none revealjs-url: https://cdn.jsdelivr.net/npm/reveal.js@5.2.1 slideNumber: true navigationMode: linear

Introduction

::: notes

##

The Problem

How to access data on Shelly devices?

##

::: notes

##

::: notes

Talking to the ESP

::: notes

##

::: notes

##

##

##

::: notes

##

https://docs.espressif.com/projects/esptool/en/latest/esp32/advanced-topics/serial-protocol.html

::: notes

Reading Flash Memory

::: notes

##

```txt $ cloc esp-flasher-stub/

Language files blank comment code

Rust 12 327 78 1863 Logos 14 32 0 249 YAML 3 34 12 214 Markdown 1 34 0 89 TOML 4 8 2 61

SUM: 34 435 92 2476

```

##

```txt $ cloc esp-hal

Language files blank comment code

Rust 492 18739 26120 115809 Linker Script 51 499 1404 11315 Markdown 66 2014 12 5262 TOML 43 505 412 4481 Logos 44 229 15 1105 YAML 13 151 67 1054 Jinja Template 3 52 0 255 JSON 2 0 0 48 CSV 3 0 0 21 SVG 1 0 0 4

SUM: 718 22189 28030 139354

```

##

```txt $ cloc esptool-legacy-flasher-stub/

Language files blank comment code

Linker Script 32 787 1188 18751 C 6 1284 636 7689 C/C++ Header 8 463 557 1687 make 1 36 33 130 YAML 4 19 0 114 Python 2 25 21 80 Markdown 3 58 0 76 Bourne Shell 2 9 8 23 TOML 1 1 0 20 Jinja Template 1 4 2 14

SUM: 60 2686 2445 28584

```

::: notes

##

::: notes

Serial Protocol

::: notes

##

##

https://docs.espressif.com/projects/esptool/en/latest/esp32/advanced-topics/serial-protocol.html

Steps to Read Flash

::: notes

Modifying the Flash Loader

::: notes

Uploading the Flash Loader

::: notes

## ```c const unsigned char *elf_esp32_text_buffer = (unsigned char[]){0x08,0x00,0xf4,...}; const unsigned long elf_esp32_text_size = 2100; const unsigned long elf_esp32_text_addr = 1074520064;

const unsigned char *elf_esp32_data_buffer = (unsigned char[]){0x9b,0xe6,0x0b,...}; const unsigned long elf_esp32_data_size = 60; const unsigned long elf_esp32_data_addr = 1073561756;

const unsigned long elf_esp32_entry = 1074521000; ```

Different ESP Versions

::: notes

Boot Mode

::: notes

Summary

::: notes what is left:

Extracting File Systems

::: notes

Shelly Plus 1 File System

txt api_math.js ca.pem // signing CA conf0.json // empty configuration conf3.json // initial configuration conf9.json // current configuration index.html.gz // web frontend init.js rpc_acl_auth.json // list of rpc endpoints rpc_acl_no_auth.json shelly_cloud.pem // Shelly Cloud certificate shelly_plugin_api.js storage.json // user data tzinfo updater.dat

conf9.json

txt { "wifi": { "sta": { "enable": true, "ssid": "SSID", "pass": "PASSWORD" "last_bssid": "aa:17:5d:15:ae:03", }, }, "shelly": { "cloud": { "enable": true, "server": "192.168.112.231:6022/jrpc", "token": "eyJhbGciOiJIUzI1NiIsInR..." }, }, ... }

::: notes

shelly_cloud.pem

txt Subject: O = Allterco Not Before: Aug 4 12:03:41 2020 GMT Not After : Aug 2 12:03:41 2030 GMT -----BEGIN CERTIFICATE----- MIICrTCCAZUCFCuIEEAQJOFLZuEtr/CWkvxi9YPAMA0GCSqGSIb3DQEBCwUAMBMx ETAPBgNVBAoMCEFsbHRlcmNvMB4XDTIwMDgwNDEyMDM0MVoXDTMwMDgwMjEyMDM0 MVowEzERMA8GA1UECgwIQWxsdGVyY28wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQDHGDBDHpPUbtC9QAAjX3bi487AVY5JgYB2gyp6R9cjdsNGMbYnWdxn BmsIUKJPg7B5NcQObiMe6djUvwo0c2Xl9L+P9LOskP2WNDdpquX3XJu580hXHHVB mwOgJ0fi+5U9mOFHhc1gYGLmhO9oqsE80SgpmsPQHloMIqmcaolLzgC9PWGu8nSD ToJq+dXyNFHzLVyBEugHQpeIR8Fq0do4dtlsfTWvv9U+fpGPegjdkPenSxGrOVwd syFzNahxQGKmpZE/1fsq5QSh9+ZgwpdDChVNpkj9TBC1ApDTUasNco/6Meb/0Xur pxpWPNfkIpZ7ebtGHVd/ZkGTPUnL7FXHAgMBAAEwDQYJKoZIhvcNAQELBQADggEB ADwbvD7Mf7SOinV8JkOue8D/tvp+OiYTYLHYppzCLcBK3D1kQ7aqla2T8ebEFbLh hpau7MxJcizVWZs4vJvFYxEwBTQldobhmG5lHnoKQcOSxis1kWr5xdKhji/QYo6T wS/cird9hAcuc+RmLCMdpEDyia/vX+vvvRdyKsmB7A6Vkdu8s2B2jlhQNkitYzvq UDKogJrWe6fQUTpTThMyGbqhp9cQ64M4DJG1cwSBZ/hiUAMKO/y5WVNWFbXIb/Om xwkXgof2RXN1AjjqMcBh3GNVK4ZV5XM9WCocZjOCi2yZxaxaRWyuGR7EqAQZ+wdr P5XrzYspeVl1WtBzwGFssPc= -----END CERTIFICATE-----

::: notes certificate verifying shelly cloud server :::

Thank You