0
__asm {                         //
        push   eax                  //
            push   ecx              //
            movsx  ecx, temp_char   //
            lea    eax, EKey        //
            call   encryptX         // encrypt the character
            mov    temp_char, al    //
            pop    ecx              //
            pop    eax              //
    }
    EChars[i] = temp_char;          // Store encrypted char in the encrypted chars array
}
return;

// ---------------------------- start of ASM code ---------------------------------------------------------------encryptX:  push ecx                    //push to manipulate
    xchg eax, ecx                   //exchange values in eax and ecx / eax holds old ecx 
    neg  al                         //twos complement least most eax byte (old ecx)
    ror  al, 1                      //rotate right least most byte by 1 of eax 
    xor  al, byte ptr[ecx]          //exlcusive or least most byte against ecx value being pointed at
    push edx                        //push edx onto stack for manipulatio
    mov  edx, eax                   //move eax into edx
    xchg eax, ecx                   //swap values of ecx and eax
    rol  byte ptr[eax], 3           //rotate left the byte being pointed at 3 times
    xor  dl, byte ptr[eax]          //xor the least byte by pointed value in eax
    rol  dl, 2                      //rotate left the least byte in edx by 2
    mov  eax, edx                   //move edx value into eax
    pop  edx                        //pop values out
    pop  ecx                        //pop values out
    ret                             //return
}

我有在此代码中实现标准调用的任务 - 是 cdecl 或 std 调用

'mov eax, [ebp+8] // 获取第一个被推送的参数'

我理解推动指针位置的想法,但我不确定我会告诉指针在哪里看。

是那个 mov eax, [ebp+4/8/12] 或者你有什么

任何帮助告诉我我将如何做到这一点将不胜感激,同样,如果你们中的一个人确实解决了这个问题,可以添加解释

谢谢

4

0 回答 0