2726|0

1

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

【求伪代码或C】以下的decode函数是ARM汇编,只求大致的意思,谢谢 [复制链接]



  1. .text:00000A58                 EXPORT decode
  2. .text:00000A58 decode                                  ; CODE XREF: com_aes_decryptMy+3Ap
  3. .text:00000A58                                         ; .text:00001270p
  4. .text:00000A58
  5. .text:00000A58 var_2C          = -0x2C
  6. .text:00000A58
  7. .text:00000A58                 PUSH    {R4-R7,LR}      ; Push registers
  8. .text:00000A5A                 MOV     R7, R11         ; Rd = Op2
  9. .text:00000A5C                 MOV     R6, R10         ; Rd = Op2
  10. .text:00000A5E                 MOV     R5, R9          ; Rd = Op2
  11. .text:00000A60                 MOV     R4, R8          ; Rd = Op2
  12. .text:00000A62                 PUSH    {R4-R7}         ; Push registers
  13. .text:00000A64                 SUB     SP, SP, #0xC    ; Rd = Op1 - Op2
  14. .text:00000A66                 MOV     R11, R1         ; Rd = Op2
  15. .text:00000A68                 MOVS    R7, R0          ; Rd = Op2
  16. .text:00000A6A                 BLX     strlen          ; Branch with Link and Exchange (immediate address)
  17. .text:00000A6E                 MOVS    R1, #0          ; Rd = Op2
  18. .text:00000A70                 MOVS    R6, R0          ; Rd = Op2
  19. .text:00000A72                 MOV     R8, R1          ; Rd = Op2
  20. .text:00000A74                 CMP     R0, #0          ; Set cond. codes on Op1 - Op2
  21. .text:00000A76                 BGT     loc_A80         ; Branch
  22. .text:00000A78                 B       loc_AF6         ; Branch
  23. .text:00000A7A ; ---------------------------------------------------------------------------
  24. .text:00000A7A
  25. .text:00000A7A loc_A7A                                 ; CODE XREF: decode+34j
  26. .text:00000A7A                 SUBS    R6, #1          ; Rd = Op1 - Op2
  27. .text:00000A7C                 CMP     R6, #0          ; Set cond. codes on Op1 - Op2
  28. .text:00000A7E                 BEQ     loc_B0A         ; Branch
  29. .text:00000A80
  30. .text:00000A80 loc_A80                                 ; CODE XREF: decode+1Ej
  31. .text:00000A80                 ADDS    R3, R7, R6      ; Rd = Op1 + Op2
  32. .text:00000A82                 SUBS    R3, #1          ; Rd = Op1 - Op2
  33. .text:00000A84                 LDRB    R0, [R3]        ; Load from Memory
  34. .text:00000A86                 BL      ignore          ; Branch with Link
  35. .text:00000A8A                 CMP     R0, #0          ; Set cond. codes on Op1 - Op2
  36. .text:00000A8C                 BNE     loc_A7A         ; Branch
  37. .text:00000A8E                 CMP     R6, #0          ; Set cond. codes on Op1 - Op2
  38. .text:00000A90                 BLE     loc_B10         ; Branch
  39. .text:00000A92                 LDR     R2, =(unk_9024 - 0xA9E) ; Load from Memory
  40. .text:00000A94                 MOVS    R1, #0          ; Rd = Op2
  41. .text:00000A96                 MOV     R8, R1          ; Rd = Op2
  42. .text:00000A98                 MOV     R10, R2         ; Rd = Op2
  43. .text:00000A9A                 ADD     R10, PC ; unk_9024 ; Rd = Op1 + Op2
  44. .text:00000A9C                 MOV     R1, R10         ; Rd = Op2
  45. .text:00000A9E                 MOVS    R4, #0          ; Rd = Op2
  46. .text:00000AA0                 STR     R1, [SP,#0x30+var_2C] ; Store to Memory
  47. .text:00000AA2
  48. .text:00000AA2 loc_AA2                                 ; CODE XREF: decode+9Cj
  49. .text:00000AA2                 ADDS    R5, R7, R4      ; Rd = Op1 + Op2
  50. .text:00000AA4
  51. .text:00000AA4 loc_AA4                                 ; CODE XREF: decode+5Cj
  52. .text:00000AA4                 LDRB    R0, [R5]        ; Load from Memory
  53. .text:00000AA6                 BL      ignore          ; Branch with Link
  54. .text:00000AAA                 CMP     R0, #0          ; Set cond. codes on Op1 - Op2
  55. .text:00000AAC                 BEQ     loc_AB8         ; Branch
  56. .text:00000AAE                 ADDS    R4, #1          ; Rd = Op1 + Op2
  57. .text:00000AB0                 ADDS    R5, #1          ; Rd = Op1 + Op2
  58. .text:00000AB2                 CMP     R4, R6          ; Set cond. codes on Op1 - Op2
  59. .text:00000AB4                 BLT     loc_AA4         ; Branch
  60. .text:00000AB6                 ADDS    R5, R7, R4      ; Rd = Op1 + Op2
  61. .text:00000AB8
  62. .text:00000AB8 loc_AB8                                 ; CODE XREF: decode+54j
  63. .text:00000AB8                 LDRB    R3, [R5]        ; Load from Memory
  64. .text:00000ABA                 MOV     R1, R10         ; Rd = Op2
  65. .text:00000ABC                 ADDS    R4, #1          ; Rd = Op1 + Op2
  66. .text:00000ABE                 LDRB    R3, [R1,R3]     ; Load from Memory
  67. .text:00000AC0                 MOV     R9, R3          ; Rd = Op2
  68. .text:00000AC2                 CMP     R4, R6          ; Set cond. codes on Op1 - Op2
  69. .text:00000AC4                 BLT     loc_ACE         ; Branch
  70. .text:00000AC6                 B       loc_B06         ; Branch
  71. .text:00000AC8 ; ---------------------------------------------------------------------------
  72. .text:00000AC8
  73. .text:00000AC8 loc_AC8                                 ; CODE XREF: decode+80j
  74. .text:00000AC8                 ADDS    R4, #1          ; Rd = Op1 + Op2
  75. .text:00000ACA                 CMP     R4, R6          ; Set cond. codes on Op1 - Op2
  76. .text:00000ACC                 BEQ     loc_B06         ; Branch
  77. .text:00000ACE
  78. .text:00000ACE loc_ACE                                 ; CODE XREF: decode+6Cj
  79. .text:00000ACE                 LDRB    R0, [R7,R4]     ; Load from Memory
  80. .text:00000AD0                 ADDS    R5, R7, R4      ; Rd = Op1 + Op2
  81. .text:00000AD2                 BL      ignore          ; Branch with Link
  82. .text:00000AD6                 CMP     R0, #0          ; Set cond. codes on Op1 - Op2
  83. .text:00000AD8                 BNE     loc_AC8         ; Branch
  84. .text:00000ADA
  85. .text:00000ADA loc_ADA                                 ; CODE XREF: decode+B0j
  86. .text:00000ADA                 MOV     R1, R9          ; Rd = Op2
  87. .text:00000ADC                 LDRB    R2, [R5]        ; Load from Memory
  88. .text:00000ADE                 LSLS    R3, R1, #4      ; Logical Shift Left
  89. .text:00000AE0                 LDR     R1, [SP,#0x30+var_2C] ; Load from Memory
  90. .text:00000AE2                 ADDS    R4, #1          ; Rd = Op1 + Op2
  91. .text:00000AE4                 LDRB    R2, [R1,R2]     ; Load from Memory
  92. .text:00000AE6                 ORRS    R3, R2          ; Rd = Op1 | Op2
  93. .text:00000AE8                 MOV     R2, R11         ; Rd = Op2
  94. .text:00000AEA                 ADD     R2, R8          ; Rd = Op1 + Op2
  95. .text:00000AEC                 STRB    R3, [R2]        ; Store to Memory
  96. .text:00000AEE                 MOVS    R3, #1          ; Rd = Op2
  97. .text:00000AF0                 ADD     R8, R3          ; Rd = Op1 + Op2
  98. .text:00000AF2                 CMP     R4, R6          ; Set cond. codes on Op1 - Op2
  99. .text:00000AF4                 BLT     loc_AA2         ; Branch
  100. .text:00000AF6
  101. .text:00000AF6 loc_AF6                                 ; CODE XREF: decode+20j
  102. .text:00000AF6                                         ; decode+B6j ...
  103. .text:00000AF6                 ADD     SP, SP, #0xC    ; Rd = Op1 + Op2
  104. .text:00000AF8                 MOV     R0, R8          ; Rd = Op2
  105. .text:00000AFA                 POP     {R2-R5}         ; Pop registers
  106. .text:00000AFC                 MOV     R8, R2          ; Rd = Op2
  107. .text:00000AFE                 MOV     R9, R3          ; Rd = Op2
  108. .text:00000B00                 MOV     R10, R4         ; Rd = Op2
  109. .text:00000B02                 MOV     R11, R5         ; Rd = Op2
  110. .text:00000B04                 POP     {R4-R7,PC}      ; Pop registers
  111. .text:00000B06 ; ---------------------------------------------------------------------------
  112. .text:00000B06
  113. .text:00000B06 loc_B06                                 ; CODE XREF: decode+6Ej
  114. .text:00000B06                                         ; decode+74j
  115. .text:00000B06                 ADDS    R5, R7, R4      ; Rd = Op1 + Op2
  116. .text:00000B08                 B       loc_ADA         ; Branch
  117. .text:00000B0A ; ---------------------------------------------------------------------------
  118. .text:00000B0A
  119. .text:00000B0A loc_B0A                                 ; CODE XREF: decode+26j
  120. .text:00000B0A                 MOVS    R3, #0          ; Rd = Op2
  121. .text:00000B0C                 MOV     R8, R3          ; Rd = Op2
  122. .text:00000B0E                 B       loc_AF6         ; Branch
  123. .text:00000B10 ; ---------------------------------------------------------------------------
  124. .text:00000B10
  125. .text:00000B10 loc_B10                                 ; CODE XREF: decode+38j
  126. .text:00000B10                 MOVS    R2, #0          ; Rd = Op2
  127. .text:00000B12                 MOV     R8, R2          ; Rd = Op2
  128. .text:00000B14                 B       loc_AF6         ; Branch
  129. .text:00000B14 ; End of function decode

复制代码
此帖出自编程基础论坛
点赞 关注
 

回复
举报
您需要登录后才可以回帖 登录 | 注册

查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/9 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表