assembly MPLAB X pic构建拆解输出并 Flink 到同一目标(往返)

1tu0hz3e  于 2023-06-23  发布在  Flink
关注(0)|答案(1)|浏览(219)

我所做的一切

我已经开始了我的第一个逆向工程项目,并从Delonghi Dedica EC 685咖啡机的PIC 16 F1938处理器中提取了HEX。股票固件可以在这里找到:Delonghi Dedica EC685 Stock Firmware
我已经使用MPLabX对模拟器内存进行了编程,然后使用“输出到文件”来保存DisAssy输出。这给了我整个程序的内存和一些小的注册表名称修复,我‘希望‘这将是一个有效的汇编文件。PIC16F1938 Assembly File

问题

当我在MPLab X IDE下使用pic-as来编译它时,我得到一个错误,看起来好像是说没有足够的程序空间!?这是错误的,因为代码是从我们正在编程的设备中提取的。
主要错误似乎是error: (1347) can't find 0x2943 words (0x2943 withtotal) for psect "code" in class "CODE" (largest unused contiguous range 0x800),我无法理解。

make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'E:/Development/Pic/Pic16f1938_test.X'
make  -f nbproject/Makefile-default.mk dist/default/production/Pic16f1938_test.X.production.hex
make[2]: Entering directory 'E:/Development/Pic/Pic16f1938_test.X'
"C:\Program Files\Microchip\xc8\v2.36\pic-as\bin\pic-as.exe" -mcpu=PIC16F1938 -c \
-o build/default/production/newpic_8b_asm_func.o \
newpic_8b_asm_func.S \
  -mdfp="C:/Program Files/Microchip/MPLABX/v6.10/packs/Microchip/PIC12-16F1xxx_DFP/1.4.213/xc8"  -msummary=+mem,+psect,+class,+hex,-file,-sha1,-sha256,-xml,-xmlfull -fmax-errors=20 -mwarn=0 -xassembler-with-cpp
"C:\Program Files\Microchip\xc8\v2.36\pic-as\bin\pic-as.exe" -mcpu=PIC16F1938 build/default/production/newpic_8b_asm_func.o \
-o dist/default/production/Pic16f1938_test.X.production.hex \
  -mdfp="C:/Program Files/Microchip/MPLABX/v6.10/packs/Microchip/PIC12-16F1xxx_DFP/1.4.213/xc8"  -msummary=+mem,+psect,+class,+hex,-file,-sha1,-sha256,-xml,-xmlfull -mcallgraph=std -Wl,-Map=dist/default/production/Pic16f1938_test.X.production.map -mdownload-hex
:0:: error: (1347) can't find 0x2943 words (0x2943 withtotal) for psect "code" in class "CODE" (largest unused contiguous range 0x800)
Non line specific message::: advisory: (1493) updated 32-bit floating-point routines might trigger "can't find space" messages appearing after updating to this release; consider using the smaller 24-bit floating-point types
:0:: warning: (528) no start record; entry point defaults to zero
(908) exit status = 1
nbproject/Makefile-default.mk:121: recipe for target 'dist/default/production/Pic16f1938_test.X.production.hex' failed
make[2]: Leaving directory 'E:/Development/Pic/Pic16f1938_test.X'
nbproject/Makefile-default.mk:85: recipe for target '.build-conf' failed
make[1]: Leaving directory 'E:/Development/Pic/Pic16f1938_test.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [dist/default/production/Pic16f1938_test.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

帮助是非常感谢,因为我是新的PIC大会,但我是一个经验丰富的软件工程师分支:)

gmxoilav

gmxoilav1#

在从git仓库中创建了一个十六进制文件的PIC反汇编后,我将源文件(newpic_8b_asm_func.S)here
这是构建时的输出:

CLEAN SUCCESSFUL (total time: 14ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Public/GIT/Projects/PIC/MPLABXv5xx_pic-as_examples/Pic16f1938_test.X'
make  -f nbproject/Makefile-default.mk dist/default/production/Pic16f1938_test.X.production.hex
make[2]: Entering directory 'C:/Public/GIT/Projects/PIC/MPLABXv5xx_pic-as_examples/Pic16f1938_test.X'
"C:\PIC_dev\MPLABXC\xc8\v2.40\pic-as\bin\pic-as.exe" -mcpu=PIC16F1938 -c \
-o build/default/production/newpic_8b_asm_func.o \
newpic_8b_asm_func.S \
 -msummary=+mem,+psect,-class,-hex,-file,-sha1,-sha256,-xml,-xmlfull -fmax-errors=20 -mwarn=0 -xassembler-with-cpp -Wl,-DCODE=2,-presetVec=0h,-pisr_Vec=4h,-ppg1=1001h,-ppg2=1802h,-ppg3=2313h,-pidlocs=8000h,-peedata=F000h -Wa,-a 
"C:\PIC_dev\MPLABXC\xc8\v2.40\pic-as\bin\pic-as.exe" -mcpu=PIC16F1938 build/default/production/newpic_8b_asm_func.o \
-o dist/default/production/Pic16f1938_test.X.production.hex \
 -msummary=+mem,+psect,-class,-hex,-file,-sha1,-sha256,-xml,-xmlfull -mcallgraph=std -mdownload-hex -Wl,-DCODE=2,-presetVec=0h,-pisr_Vec=4h,-ppg1=1001h,-ppg2=1802h,-ppg3=2313h,-pidlocs=8000h,-peedata=F000h -Wa,-a 

Psect Usage Map:

 Psect    | Contents | Memory Range  | Size
----------|----------|---------------|--------------
 resetVec |          | 0000h - 0001h |    2 words  
 isr_Vec  |          | 0004h - 0FFFh |  FFC words  
 pg1      |          | 1001h - 17FFh |  7FF words  
 pg2      |          | 1802h - 1FFFh |  7FE words  
 pg3      |          | 2313h - 2942h |  630 words  
----------|----------|---------------|--------------
 eedata   |          | F000h - F0FFh |  100 bytes  
----------|----------|---------------|--------------
 config   |          | 8007h - 8008h |    2 words  
----------|----------|---------------|--------------
 idlocs   |          | 8000h - 8003h |    4 bytes  
----------|----------|---------------|--------------

Memory Summary:
    Program space        used  262Bh (  9771) of  4000h words   ( 59.6%)
    Data space           used     0h (     0) of   400h bytes   (  0.0%)
    EEPROM space         used   100h (   256) of   100h bytes   (100.0%)
    Configuration bits   used     2h (     2) of     2h words   (100.0%)
    ID Location space    used     4h (     4) of     4h bytes   (100.0%)

make[2]: Leaving directory 'C:/Public/GIT/Projects/PIC/MPLABXv5xx_pic-as_examples/Pic16f1938_test.X'
make[1]: Leaving directory 'C:/Public/GIT/Projects/PIC/MPLABXv5xx_pic-as_examples/Pic16f1938_test.X'

BUILD SUCCESSFUL (total time: 13s)
Loading code from C:/Public/GIT/Projects/PIC/MPLABXv5xx_pic-as_examples/Pic16f1938_test.X/dist/default/production/Pic16f1938_test.X.production.hex...
Program loaded with pack,PIC12-16F1xxx_DFP,1.3.90,Microchip
Loading completed

相关问题