You should be able to find the factory service manual with a few minutes of googling, the pinouts are in the Diagnostics section under 'ECM IO Signal', they cover the STi and WRX both but have asterisks telling you what is what.
Is there any reason you're replacing the ECU rather than downloading a JDM map to the EDM ECU?