Closed. This question needs to be more focused。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?更新问题,使其仅通过editing this post专注于一个问题。
                        
                        在11个月前关闭。
                                                                                            
                
        
我需要一个函数的帮助,我认为这并不难,有人可以将其转换为C,以便从中获取逻辑吗?

0x004011cf mov al, byte [esi]

| : 0x004011d1 and eax, 0xff

| : 0x004011d6 mul ebx

| : 0x004011d8 inc esi

| : 0x004011d9 add edi, eax

| : 0x004011db inc ebx

| : 0x004011dc dec ecx

| `=< 0x004011dd jne 0x4011cf

最佳答案

干得好:

esi显然是指向长度为ecx的某些缓冲区的指针

LOOP:
      mov al, byte [esi]    ; read byte from memory pointed by esi into low bits of eax
      and eax, 0xff         ; mask eax with 0xff
      mul ebx               ; multiply eax with ebx (wherever ebx came from...)
                            ; put result in eax
      inc esi               ; increment buffer pointer
      add edi, eax          ; add eax to edi (whereever edi came from)
      inc ebx               ; increment ebx
      dec ecx               ; decrement ecx (which is probably some counter)
      jne LOOP              ; jump to LOOP if ecx is different from 0


但是,由于没有任何上下文信息,很难说出这段代码的实际作用。

等效的C代码大致可以做到这一点:

  char *esi;    // points to some buffer...
  int ebx;      // contains some value
  int edi;      // contains some value
  int ecx;      // some counter, presubably the length of the buffer pointed by esi
  ...
  do
  {
    edi += *esi++ * ebx++;
  } while (--ecx != 0)


您需要学习x86汇编的基础知识。

关于c - 卡在拆卸中,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55183183/

10-11 22:09