jclehner / bcm2-utils

Utilities for Broadcom-based cable modems
GNU General Public License v3.0
142 stars 23 forks source link

MIPS ABI #27

Open stdw opened 4 years ago

stdw commented 4 years ago

In rwcode2.c, I saw the comment about using a 5th argument. From what I've seen on the BCM3383 at least it seems to use EABI which uses t0-t3 for extra args which is how everything in the bootloader and ecos are on my device. I tried n32 also but was getting bad instructions. I've had the best results with -march=mips32 and -mabi=eabi.

I have a repo on my profile with with some of my RE stuff if you're interested

jclehner commented 4 years ago

Hi! You're right, I'm getting the desired results with -mips32 -mno-abicalls -mabi=eabi -msoft-float!

I have a repo on my profile with with some of my RE stuff if you're interested.

Thanks, I've already considered using a linker script to make rwcode2 a bit less awkward to use. Function addresses can't be hard-coded however, as the code needs to be portable across all firmware versions.