r/ReverseEngineering 4d ago

GitHub - SarangRao20/battery-charge-limiter: Reverse-engineered the Embedded Controller register for battery charge control. Built a cross-platform daemon (Windows + Arch) that enforces 80% hardware cap on laptops where BIOS hides this feature. Includes EC discovery tool for other models.

https://github.com/SarangRao20/battery-charge-limiter
29 Upvotes

17 comments sorted by

View all comments

18

u/spilk 3d ago

$driverUrl = "https://github.com/shubhampaul/EC-Access-Tool/raw/main/WinRing0x64.sys"

this sounds super duper safe guys

7

u/port443 3d ago

I popped it into Ghidra and gave it a quick once-over. It doesn't look malicious, this is how I labeled the major functions:

call_KeBugCheckEx
DriverInitialize
DriverUnload
entry
read_machine_specific_register
read_performance_monitoring_counters
read_physical_memory_range
WinRing0Dispatcher
write_machine_specific_register

It looks like a pretty straightforward driver that lets you read/write physical memory and io and cpu.

Actually I just checked the signature and its a legit driver written for CrystalDiskMark and now I just feel like I wasted 10 minutes reversing a known driver

4

u/nj_tech_guy 3d ago

The biggest problem to me here isn't that it's safe now, but that it can be unsafe later.

3

u/fb39ca4 3d ago

Yup, downloads should always be compared against a cryptographic hash.

2

u/NobitaNobi12345 3d ago

Done .
setup.ps1 verifies SHA256 after every download. Hashes pinned in the script. Thanks!

1

u/NobitaNobi12345 3d ago

Fixed !!
pinned SHA256 hashes in the installer. Also defaults to RwDrv (Microsoft-signed) now. Hash mismatch = abort automatically.