]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - bootrom/fromflash.c
Eradicate all occurences of hardcoded memory addresses from all sources files, except...
[proxmark3-svn] / bootrom / fromflash.c
index 0065e19e81cfb52101ac0ed05a87057bbf823b7d..6b41c408c3a6968711675ac0a343100a578f5f2e 100644 (file)
@@ -1,11 +1,13 @@
 #include <proxmark3.h>\r
 \r
+extern char __bootphase2_src_start__, __bootphase2_start__, __bootphase2_end__;\r
 void __attribute__((section(".bootphase1"))) CopyBootToRAM(void)\r
 {\r
        int i;\r
 \r
-       volatile DWORD *s = (volatile DWORD *)0x200;\r
-       volatile DWORD *d = (volatile DWORD *)0x200000;\r
+       volatile DWORD *s = (volatile DWORD *)&__bootphase2_src_start__;\r
+       volatile DWORD *d = (volatile DWORD *)&__bootphase2_start__;\r
+       unsigned int l = (int)&__bootphase2_end__ - (int)&__bootphase2_start__;\r
 \r
-       for(i = 0; i < 1024; i++) *d++ = *s++;\r
+       for(i = 0; i < l/sizeof(DWORD); i++) *d++ = *s++;\r
 }\r
Impressum, Datenschutz