Skip to content

Commit

Permalink
mkfw: Removed magic numbers, switched to 1D50:602B
Browse files Browse the repository at this point in the history
  • Loading branch information
makestuff committed Jul 16, 2013
1 parent d5e9c93 commit 09708ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mkfw/main.c
Expand Up @@ -54,15 +54,20 @@ void dumpWords(const uint16 *ptr, uint16 numWords) {
printf("\n");
}

#define VID_MSB 0x1D
#define VID_LSB 0x50
#define PID_MSB 0x60
#define PID_LSB 0x2B

int dumpCode(const char *progName, const char *name, const struct Buffer *buf) {
int retVal = 0;
uint32 i;
uint32 vp = 0;

for ( i = 1; i < buf->length; i++ ) {
if (
buf->data[i] == 0xB4 && buf->data[i+1] == 0x04 &&
buf->data[i+2] == 0x13 && buf->data[i+3] == 0x86 )
buf->data[i] == VID_LSB && buf->data[i+1] == VID_MSB &&
buf->data[i+2] == PID_LSB && buf->data[i+3] == PID_MSB )
{
if ( vp ) {
fprintf(stderr, "%s: Refusing to override VID:PID@%04X with %04X\n", progName, vp, i);
Expand Down

0 comments on commit 09708ff

Please sign in to comment.