Показать сообщение отдельно

  #8  
Старый 20.05.2010, 00:52
d_x
Reservists Of Antichat - Level 6
Регистрация: 25.03.2008
Сообщений: 670
Провел на форуме:
4137635

Репутация: 2407


По умолчанию

Pashkela, там реально пример на чистом СИ, и из windows.h там используется отсилы слово TRUE и ZeroMemory.

Этот код я переписал тебе под gcc:

PHP код:
#include "stdio.h" 

int main(int argccharargv[]) 

  static 
char szPassword[256];
  static 
char szAlphabet[256]; 
  static 
unsigned char bAlphabet[256]; 
  
  
memset(szPassword0sizeof(szPassword)); 
  
strcpy(szAlphabet"ABC"); 
  
memset(bAlphabet0sizeof(bAlphabet)); 

  
int i 00
  while (
1
  { 
    
bAlphabet[k] = (unsigned char)szAlphabet[i]; 
    if (!
szAlphabet[i]) 
      break; 
      
    
= (unsigned char)szAlphabet[i]; 
    
i++; 
  } 

  while (
1
  {
      
__asm
      
(
      
".intel_syntax noprefix\n"
      "pushad\n"
      "L1:\n"
      "movzx eax,byte ptr [edi]\n"
      "xlat\n"
      "test al,al\n"
      "jz L3\n"
      "mov [edi],al\n"
      "jmp LL5\n"
      
      "L3:\n"
      "xlat\n"
      "stosb\n"
      "jmp L1\n"
      
      "LL5:\n"
      "popad\n"
      ".att_syntax\n"
      

      : 
"D" (&szPassword), "b" (&bAlphabet)

      );

    
printf("%s\n"szPassword); 
  } 

  return 
0