Skip to content

Allow additional ports 0x25c and 0x25d in is_port_allowed for EC mailbox#58

Merged
namazso merged 2 commits into
namazso:mainfrom
Undervoltologist:main
Jun 11, 2026
Merged

Allow additional ports 0x25c and 0x25d in is_port_allowed for EC mailbox#58
namazso merged 2 commits into
namazso:mainfrom
Undervoltologist:main

Conversation

@Undervoltologist

@Undervoltologist Undervoltologist commented May 18, 2026

Copy link
Copy Markdown
Contributor

Hey there namazso,

This PR adds the ports 0x25C 0x25D for the EC mailbox on Asus laptops, for fan control and various other functions.

// Allow fixed ports 0x25C and 0x25D
    if (port == 0x25C || port == 0x25D)
        return true;

@namazso

namazso commented May 21, 2026

Copy link
Copy Markdown
Owner

Hi,

Do you have any resources or docs about this? I looked and couldn't find any.

@Undervoltologist

Copy link
Copy Markdown
Contributor Author

Hi,

Well this is a result of my own reverse engineering of the Asus drivers, that's why there are no resources about this. What do you need? I could tell you more about it.

@namazso

namazso commented May 22, 2026

Copy link
Copy Markdown
Owner

A link to the driver or how to get it would help.

@Undervoltologist

Copy link
Copy Markdown
Contributor Author

It's AsIO3.sys, used to be called AsusSAIO.sys.
AsIO3.zip

It's the Asus laptop kernel driver. Comes installed in all Asus laptops by default, as it's mostly used to log EC info alongside reading and writing to the EC by Asus's apps.

@Undervoltologist

Copy link
Copy Markdown
Contributor Author

For now I obviously have to use winring for this which has been really horrible, but other than that I replicate the driver's behaviour for EC access and it's been really easy. I need this for an app I'm making.

You can see the ports being handled in the driver if you want:
image

@namazso

namazso commented May 22, 2026

Copy link
Copy Markdown
Owner

I think you posted the wrong driver, there isn't a function at 140001734:

image

@Undervoltologist

Undervoltologist commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

You're right, my bad.
AsusSAIO.zip

Here you go ^^

Function 140001828 is the handler for the read/write of the EC mailbox.

@namazso

namazso commented May 22, 2026

Copy link
Copy Markdown
Owner

This is a tough one, this is the first driver I see that has any synchronization, with a proper KMUTANT even. How do you plan to handle cooperation with this driver?

@Undervoltologist

Undervoltologist commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

Well, this worked perfectly for me and I've done multiple PoC's with it and tried it on many Asus laptops.. I write and read from the ports directly and handle the logic, I've also reverse engineered many Asus EC firmwares to confirm the endpoints are basically copy pasted. It doesn't need mutex as it's handled inside the EC, and the IBF and OBF. I even tried to spam write and was never able to cause any crashes as the EC will just return 0 if it's busy.
image

@Undervoltologist

Copy link
Copy Markdown
Contributor Author

Any updates on this?

@namazso

namazso commented May 30, 2026

Copy link
Copy Markdown
Owner

Apologies, I planned to look into what exactly the original driver needs (besides synchronization, for which I'll add a comment to avoid having the original driver loaded) to allow the ports, but haven't gotten around to do that yet.

@Undervoltologist

Undervoltologist commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks a lot! I understand what you mean but yeah, theoratically I've tried all sorts of stress testing, e.g spam writing to the ports while another app was already writing to the ports via the driver while I was also accessing the EC through the 2e/2f (or 4e/4f) ports. So there's definitely an EC level hardware mutex as well, but putting a warning comment is better regardless.

@Undervoltologist

Copy link
Copy Markdown
Contributor Author

By the way, I'm raising this so that G-Helper also gets access to these ports. Currently it uses the ports via the driver but it's bringing up too many issues, using these ports will make it so much better.

@namazso namazso merged commit 074e506 into namazso:main Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants