首页
社区
课程
招聘
[旧帖] [求助]这个汇编怎么写? 0.00雪花
发表于: 2007-5-8 19:10 5245

[旧帖] [求助]这个汇编怎么写? 0.00雪花

2007-5-8 19:10
5245

在 004F1235处有字符串:"ABCD"
在 004F124F处有字符串:"EFGH"
我现在要把这两处的字符串加在一起就是:"ABCDEFGH"并把它放在 004F404F处.
用汇编应该怎么写?

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (11)
雪    币: 216
活跃值: (2407)
能力值: ( LV10,RANK:170 )
在线值:
发帖
回帖
粉丝
2
lstrcat,lstrcpy函数
2007-5-8 19:31
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
我在API32中查不到这两个函数.能告诉我这两个函数的参数吗?
在DELPHI中有concat函数
2007-5-8 19:51
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
edit3.Text:=lstrcat(pchar(edit1.Text),pchar(edit2.Text));
在DELPHI中能编译通过.
但运行时,出堆栈溢出.
上传的附件:
2007-5-8 21:26
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
没人回答,自己顶一下。
2007-5-8 23:34
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
再顶一下,希望有人能回答下.
2007-5-9 12:48
0
雪    币: 207
活跃值: (41)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
7
不知你是不是想用汇编写,下面是汇编代码,我也没有测试过,呵呵
push eax
push ebx
mov ebx,004F404F
mov eax,dword ptr ds:[004F1235]
mov dword ptr ds:[ebx],eax
add ebx,4
mov eax,dword ptr ds:[004F124F]
mov dword ptr ds:[ebx],eax
add ebx,4
mov byte ptr ds:[ebx],0
pop ebx
pop eax
2007-5-10 00:41
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
多谢楼上朋友,我在一个CAD程序中补丁代码,通过两个INI文件读取路径,把两个路径字串加在一起。现在字串已经读入到程序中的两个空白处我想把它们加起来。
明天上班时试一下。
2007-5-10 21:17
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
TO njzzzzzz

等不及了,刚去试了下,不行
2007-5-10 21:51
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
TO njzzzzzz
通不过啊,请老大帮帮忙!
2007-5-11 12:34
0
雪    币: 2899
活跃值: (1753)
能力值: ( LV9,RANK:850 )
在线值:
发帖
回帖
粉丝
11
function Concat(s1 [, s2,..., sn]: string): string;

Description

In Delphi code, use Concat to concatenate an arbitrary number of strings. Each parameter is a string-type expression. The result is the concatenation of all the string parameters.

Using the plus (+) operator has the same effect on two strings as using the Concat function:

S := 'ABC' + 'DEF';

Tip:        The plus operator is faster than Concat.

=================================================================
procedure TForm1.Button1Click(Sender: TObject);
var
  a,b:string;
begin
  a:=edit1.Text;
  b:=edit2.Text;
  edit3.Text:=concat(a,b);
//function concat(a:string,b:string,c:string..Sn:string):string;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  a,b:pchar;
begin
  getmem(a,255);        //用到指针函数,你总得分配内存吧
  getmem(b,255);
  lstrcpy(a,pchar(edit1.Text));
  lstrcpy(b,pchar(edit2.Text));
  (*
  asm
    push b
    push a
    call lstrcat
  end;
  *)
  lstrcat(a,b);  //这一句和上面的汇编代码调用的作用是一样的
  edit3.text:=strpas(a);
  //lstrcat,lstrcpy 都是针对指针操作的API函数
end;

//两段代码执行后,都会在Edit3中显示你所需要的,你提到的3个函数都用演示了一遍,还满意否?
2007-5-11 16:01
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
12
to wofan[ocn]
对第三个非常满意.多谢.
2007-5-11 21:41
0
游客
登录 | 注册 方可回帖
返回
//