assembly - Changing c++ for loop into x86 -


currently learning x86 assembly 1 of uni modules, have program written in c++ takes string of 6 characters , encrypts them based on encryption key.

the code encrypt_chars :

void encrypt_chars(int length, char ekey) {     char temp_char;                     // char temporary store     (int = 0; < length; i++)    // encrypt characters 1 @ time     {         temp_char = ochars[i];          //         __asm {                         //             push eax             push ecx             lea eax, ekey             push temp_char             push eax             call encrypt21             mov temp_char, al             add esp, 8             pop ecx             pop eax         }      echars[i] = temp_char;          // store encrypted char in encrypted chars array     } return; } 

i love on how change loop @ top of code assembly language, thank you.

read jmp , reading variables byte after byte saving registers. give example, read variable var(,%esi,4) var name of yor variable, esi incremented register, 4 how long word. @ intel documentation


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -