那位高手能把这段汇编翻译成DELPHI,谢谢了 ( 积分: 200 )

  • 主题发起人 主题发起人 冬月
  • 开始时间 开始时间

冬月

Unregistered / Unconfirmed
GUEST, unregistred user!
.text:004F08E0 sub_4F08E0 proc near
CODE XREF: sub_4F0940+19p
.text:004F08E0
.text:004F08E0 arg_0 = dword ptr 4
.text:004F08E0 arg_4 = dword ptr 8
.text:004F08E0 arg_8 = dword ptr 0Ch
.text:004F08E0
.text:004F08E0 mov ecx, [esp+arg_0]
.text:004F08E4 push ebx
.text:004F08E5 mov eax, [esp+4+arg_4]
.text:004F08E9 push esi
.text:004F08EA mov esi, ecx
.text:004F08EC push edi
.text:004F08ED mov edi, [esp+0Ch+arg_8]
.text:004F08F1 and esi, 3
.text:004F08F4 shr ecx, 2
.text:004F08F7 mov edx, [edi]
.text:004F08F9 mov ebx, ecx
.text:004F08FB dec ecx
.text:004F08FC test ebx, ebx
.text:004F08FE jbe short loc_4F090E
.text:004F0900 inc ecx
.text:004F0901
.text:004F0901 loc_4F0901:
CODE XREF: sub_4F08E0+2Cj
.text:004F0901 mov ebx, [eax]
.text:004F0903 add eax, 4
.text:004F0906 xor ebx, edx
.text:004F0908 dec ecx
.text:004F0909 mov [eax-4], ebx
.text:004F090C jnz short loc_4F0901
.text:004F090E
.text:004F090E loc_4F090E:
CODE XREF: sub_4F08E0+1Ej
.text:004F090E mov ecx, esi
.text:004F0910 dec esi
.text:004F0911 test ecx, ecx
.text:004F0913 jbe short loc_4F0925
.text:004F0915 lea ecx, [esi+1]
.text:004F0918
.text:004F0918 loc_4F0918:
CODE XREF: sub_4F08E0+43j
.text:004F0918 mov bl, [eax]
.text:004F091A xor bl, dl
.text:004F091C mov [eax], bl
.text:004F091E inc eax
.text:004F091F shr edx, 8
.text:004F0922 dec ecx
.text:004F0923 jnz short loc_4F0918
.text:004F0925
.text:004F0925 loc_4F0925:
CODE XREF: sub_4F08E0+33j
.text:004F0925 mov eax, [edi]
.text:004F0927 mov edx, eax
.text:004F0929 shl edx, 5
.text:004F092C sub edx, eax
.text:004F092E mov eax, 1
.text:004F0933 add edx, 8088405h
.text:004F0939 mov [edi], edx
.text:004F093B pop edi
.text:004F093C pop esi
.text:004F093D pop ebx
.text:004F093E retn
.text:004F093E sub_4F08E0 endp

 
.text:004F08E0 sub_4F08E0 proc near
CODE XREF: sub_4F0940+19p
.text:004F08E0
.text:004F08E0 arg_0 = dword ptr 4
.text:004F08E0 arg_4 = dword ptr 8
.text:004F08E0 arg_8 = dword ptr 0Ch
.text:004F08E0
.text:004F08E0 mov ecx, [esp+arg_0]
.text:004F08E4 push ebx
.text:004F08E5 mov eax, [esp+4+arg_4]
.text:004F08E9 push esi
.text:004F08EA mov esi, ecx
.text:004F08EC push edi
.text:004F08ED mov edi, [esp+0Ch+arg_8]
.text:004F08F1 and esi, 3
.text:004F08F4 shr ecx, 2
.text:004F08F7 mov edx, [edi]
.text:004F08F9 mov ebx, ecx
.text:004F08FB dec ecx
.text:004F08FC test ebx, ebx
.text:004F08FE jbe short loc_4F090E
.text:004F0900 inc ecx
.text:004F0901
.text:004F0901 loc_4F0901:
CODE XREF: sub_4F08E0+2Cj
.text:004F0901 mov ebx, [eax]
.text:004F0903 add eax, 4
.text:004F0906 xor ebx, edx
.text:004F0908 dec ecx
.text:004F0909 mov [eax-4], ebx
.text:004F090C jnz short loc_4F0901
.text:004F090E
.text:004F090E loc_4F090E:
CODE XREF: sub_4F08E0+1Ej
.text:004F090E mov ecx, esi
.text:004F0910 dec esi
.text:004F0911 test ecx, ecx
.text:004F0913 jbe short loc_4F0925
.text:004F0915 lea ecx, [esi+1]
.text:004F0918
.text:004F0918 loc_4F0918:
CODE XREF: sub_4F08E0+43j
.text:004F0918 mov bl, [eax]
.text:004F091A xor bl, dl
.text:004F091C mov [eax], bl
.text:004F091E inc eax
.text:004F091F shr edx, 8
.text:004F0922 dec ecx
.text:004F0923 jnz short loc_4F0918
.text:004F0925
.text:004F0925 loc_4F0925:
CODE XREF: sub_4F08E0+33j
.text:004F0925 mov eax, [edi]
.text:004F0927 mov edx, eax
.text:004F0929 shl edx, 5
.text:004F092C sub edx, eax
.text:004F092E mov eax, 1
.text:004F0933 add edx, 8088405h
.text:004F0939 mov [edi], edx
.text:004F093B pop edi
.text:004F093C pop esi
.text:004F093D pop ebx
.text:004F093E retn
.text:004F093E sub_4F08E0 endp

 
分多了给我一些
 
delphi可以内嵌汇编的.
 
我一点也看不懂。希望有高手来这儿看看
 
asm
***
***
end;
 
asm
//asm code
end;

内嵌的代码和标准的ASM有区别!得符合BASM的格式,DELPHI源代码分析里有一章专门讲BASM的,你可以看看!
 
看了个大概,好像是个加密算法。等等我吃完饭回来给你解。
 
呵呵,有IDA就是方便
 
输入::
BUF1Len:BUF1的长度
BUF1:B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 ....
BUF2:B1 B2 B3 B4.是一个DWORD
运算:
两个循环:
BUF1:B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 ....
XOR
BUF2:B1 B2 B3 B4 B1 B2 B3 B4 B1 B2 B3 ....

BUF1:B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 ....
最后:
BUF2 := BUF2 * 31 + 8088405h
 
p1是长度,p2是buf1,p3是buf2:
procedure _Fun1(p1:integer;p2:pointer;p3:pointer);stdcall;
const
arg_0 = 4 ;
arg_4 = 8 ;
arg_8 = 12;

begin
asm
PUSH ESI
PUSH EDI
PUSH EAX
PUSH EBX
PUSH ECX
PUSH EDX

mov ecx, p1//[esp+arg_0]
mov eax, p2//[esp+arg_4]
mov esi, ecx
mov edi, p3//[esp+arg_8]
and esi, 3
shr ecx, 2
mov edx, [edi]
mov ebx, ecx

dec ecx
test ebx, ebx
jbe @@loc_4F090E
inc ecx

@@loc_4F0901:
mov ebx, [eax]
add eax, 4
xor ebx, edx
dec ecx
mov [eax-4], ebx
jnz @@loc_4F0901



@@loc_4F090E:
mov ecx, esi
dec esi
test ecx, ecx
jbe @@loc_4F0925
lea ecx, [esi+1]

@@loc_4F0918:
mov bl, [eax]
xor bl, dl
mov [eax], bl
inc eax
shr edx, 8
dec ecx
jnz @@loc_4F0918

@@loc_4F0925:
mov eax, [edi]
mov edx, eax
shl edx, 5
sub edx, eax
mov eax, 1
add edx, 8088405h
mov [edi], edx

POP EDX
POP ECX
POP EBX
POP EAX
POP EDI
POP ESI
end;
end;
 
请问crossrowman,我在MEMO1中放入BUF1:A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 ....,在MEMO2中放入BUF2:B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 ....,BUTTON1按钮按了以后在MEMO3中显示结果,该如何做,谢谢,能加我QQ吗82881358
 
给我点分。
 
你要先写个程序把他们转换成2进制数。
 
crossrowman,能帮忙做个DEMO吗,谢谢
 
var
s:string;
w:DWORD;

s:=......;
w:=......;
_Fun1(length(s),pchar(s),@w);
 
后退
顶部