Git Product home page Git Product logo

asmtool's Introduction

ASMTool

Firmware dumper and various utilities for PCI based ASMedia USB Controllers

It looks like all ICs in the ASM1x4x, ASM2x4x and ASM3x4x family use the same interface and share the same registers, but i only tested this with the ASM2142 Controller that i have in my system.

Why?

I'm having issues with my ASM2142 controller (lockup with USB 3.1 and large transfers), and i couldn't find a way to dump the current firmware.

The firmware updater can internally read the firmware, but it doesn't offer a way to save it.

How to use

Linux

gcc -shared -o libAsmIOLinux.so -fPIC Linux/AsmIOLinux.c Place the resulting .so file next to the ASMTool executable (obtained by building this project)

Windows

You'll need AsmIo.sys (for 32bit Windows) or AsmIo64.sys (for 64bit Windows).

You will also need asmiodll.dll. You can find these files if you google ASM2142 firmware. Download the firmware updater and you'll find the files in there.

Place all files next to the ASMTool executable (obtained by building this project)

How to contribute?

You can either extend this program and add new functionality, or

open a new Issue and attach the firmware obtained by running this program, so that other users can update their firmwares or try older versions to see if they work better

They are custom Intel 8051 cores!

It turns out ASMedia USB controllers are custom Intel 8051 cores, and the firmware file can be disassembled into i8051 assembly

Security implications

It looks like this interface could be used to flash malicious code onto ASMedia chips, as explained by https://chefkochblog.wordpress.com/2018/03/19/asmedia-usb-3-x-controller-with-keylogger-and-malware-risks/

The chip performs no signature checks on the code being flashed and, being a PCIe device, could abuse DMA to read and write arbitrary memory

asmtool's People

Contributors

hartimcwildfly avatar smx-smx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

asmtool's Issues

Etherscan

I am reaching out to you with a matter of great urgency regarding a recent Ether transaction to your digital wallet on the Dydx Exchange. Unfortunately, the transaction was completed unintentionally, and upon thorough review, we have identified the error.

Incident Details:

  • Amount of Ether Sent: 106.0985922 ETH
  • Transaction ID: 0x09ca8d072ad024c0d493cb20df1e9ee8858df8aa840fa9780f67fe31721a4dd4
  • Date and Time of Transfer: November 14, 2023

Transfer

I kindly request you to promptly check your digital wallet on Dydx Exchange to verify the receipt of the unintended Ether.

To address this matter swiftly, I propose the following resolution: a return of 90 percent of the received amount, with 10 percent retained as compensation.

Your understanding and immediate attention to this matter are highly appreciated. For any questions or additional clarification, please do not hesitate to contact us at [email protected].

Best regards,

John Glenn

Probably doing something wrong but I'm getting mixed 64 and 32 bit binaries on linux.

So. The x370 chipset on ryzen is very much like asmedia stuff, and was hoping to poke it a bit in order to assist my port of coreboot to 'Asrock X370 Killer Sli/AC' (kind of in a working state; more to be done).

By issuing dotnet build I get a 64-bit ELF for AsmTool but the dlls come out as 32 bit. Attempting to run AsmTool
nets me the following error:

Unhandled exception. System.BadImageFormatException: Could not load file or assembly '~/ASMTool/AsmTool/bin/Debug/net6.0/AsmTool.dll'. An attempt was made to load a program with
an incorrect format.

File name: '~/ASMTool/AsmTool/bin/Debug/net6.0/AsmTool.dll'
Aborted (core dumped)

libAsmIOLinux.so is compiled and in the directory next to AsmTool (it is also a 64-bit ELF)

Cannot compile under Linux (undefined reference to `main')

After typing command from Readme.md, I'm getting such error (I guess it's maybe supposed to be used only as library, right?

gcc -fPIC -Ofast Linux/AsmIOLinux.c -o libAsmIOLinux.so
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.1/../../../../lib/Scrt1.o: in function _start': (.text+0x24): undefined reference to main'
collect2: error: ld returned 1 exit status

BTW, I do wonder If I could use this tool to flash ASMT-1051, that has been unsuccesfully flashed by incorrect firmware (151030_B1_0B_01.bi from 105MPTools_v2.2.0.0.rar, that somebody posted as correct firmware for it on usbdev.ru)
I still got correct firmware that worked on it before, but ASMedia MPTool(or other windows tools) doesn't detect it now as ASMT-1051

I'm attaching lsusb and kernel logs, before I wrote any firmware to it:

174c:1153 ASMedia Technology Inc. ASM1153 SATA 3Gb/s bridge

[102714.433596] usb 3-1: new SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[102714.446109] usb 3-1: New USB device found, idVendor=174c, idProduct=55aa, bcdDevice= 1.00
[102714.446114] usb 3-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[102714.446117] usb 3-1: Product: ASMT1051
[102714.446119] usb 3-1: Manufacturer: asmedia
[102714.446120] usb 3-1: SerialNumber: 12345678BDFC
[103611.625111] usb 3-1: USB disconnect, device number 5
[103833.565577] usb 3-1: new SuperSpeed Gen 1 USB device number 6 using xhci_hcd
[103833.578355] usb 3-1: New USB device found, idVendor=174c, idProduct=1153, bcdDevice= 0.01
[103833.578358] usb 3-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[103833.578360] usb 3-1: Product: AS2115
[103833.578361] usb 3-1: Manufacturer: ASMedia
[103833.578362] usb 3-1: SerialNumber: 00000000000000000000

Is there a tool to use OPAL

I have a SSD which connected to PC by USB via ASMedia.
And I wanna use the encryption to protect my data in the ssd, but I have no idea how to use OPAL at now.
I have tried sedutil but sedutil --scan says there is no OPAL compliant device.
BTW my SSD is samsung EVO 970.

Thanks,
Baba_YB

ARM-porting the code

Hello @hartimcwildfly
I was looking your code and it would exactly be what we are looking for....but we have the ASM3142 integrated directly into our custom raspberry cm4 carrier board running either ARM64 or 32.

Do you have any idea would there be some major blocker to write ASMIoLinux.c for ARM as now it uses sys/io functions for communication. If you have a feeling that it could be done we could start writing the port for it....

ASM1166 Support

Any chance of adding support for Asmedia Sata controllers
I have a card with much newer firmware than my other two
and would really like to be able to dump it

Unhandled exception. System.Exception: No ASMedia device detected!
at AsmTool.AsmDevice..ctor(IAsmIO io) in C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\AsmTool\AsmDevice.cs:line 43
at AsmTool.Program.Main(String[] args) in C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\AsmTool\Program.cs:line 31

Untitled

Binaries Missing on Cirrus-ci

Hello,

I've been trying to build this for about a week and have had zero luck. I accidentally updated a controller I didn't want to and need to pull the firmware from an identical controller to repair it. I found the project on cirrus-ci and was elated to find it had been uploaded however there's nothing there.

Would you mind uploading the windows files again? either there or here?

Windows binary of ASMTool

Hi smx,

thanks for your repo!

As I mistakenly flashed a wrong firmware to my ASM 3074 (I used one for an ASM 3142 as I thought that’s the chip on my motherboard; It still works though) I would like to re-flash the original firmware. Sadly it’s not available publicly

The good thing is: My motherboard has two ASM 3074 controllers of which one was deactivated during the flash so it still has the original firmware on it. This is the one I would like to dump the firmware from.

I am not a coder which is why I don’t have any tools to build myself a binary of your repo. Would you be so kind to compile a version for windows for me and share it? Can I re-flash the extracted firmware 1:1 or do I need to edit the file using a hex editor?

Thank you!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.