xxx.asm

%define p1 ebp+8
%define p2 ebp+12
%define p3 ebp+16 section .text
global dllmain
export astrrchr dllmain:
mov eax,1
ret 12 ;------------------------------------------------;
; 扫描字符串以查找字符的最后一次出现。
;------------------------------------------------;
astrrchr:
push ebp
mov ebp,esp
push ebx mov ecx,[p1] ; const char *str
mov eax,[p2] ; int c .for:
mov dl,[ecx]
test dl,dl
jz .return
cmp dl,al
jne .next
mov ebx,ecx
.next:
inc ecx
jmp .for .return:
mov eax,ebx
pop ebx
mov esp,ebp
pop ebp
ret 8

c++:

#include <iostream>
#include <Windows.h>
#include <tchar.h>
#include <string> typedef int (CALLBACK* astrrchr_t)(const char* str, int c); astrrchr_t astrrchr; int main()
{
HMODULE myDLL = LoadLibraryA("xxx.dll");
astrrchr = (astrrchr_t)GetProcAddress(myDLL, "astrrchr"); printf("%s\n", strrchr( "hello world", "o"[0])); // orld
printf("%s\n", astrrchr("hello world", "o"[0])); // orld printf("%s\n", strrchr( "hello world", "l"[0])); // ld
printf("%s\n", astrrchr("hello world", "l"[0])); // ld
return 0;
}

nasm astrrchr函数 x86的更多相关文章

  1. nasm astrspn函数 x86

    xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...

  2. nasm astrcspn函数 x86

    xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...

  3. nasm astrchr函数 x86

    xxx.asm: %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export as ...

  4. nasm astrlen函数 x86

    xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...

  5. nasm aat函数 x86

    xxx.asm: %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain dllmain: ...

  6. nasm astrstr函数 x86

    xxx.asm: %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export as ...

  7. nasm astrset_s函数 x86

    xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...

  8. nasm astrrev函数 x86

    xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...

  9. nasm astrncmp函数 x86

    xxx.asm: %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export as ...

随机推荐

  1. Redis击穿、穿透、雪崩产生原因以及解决思路

    击穿 大家都知道,计算机的瓶颈之一就是IO,为了解决内存与磁盘速度不匹配的问题,产生了缓存,将一些热点数据放在内存中,随用随取,降低连接到数据库的请求链接,避免数据库挂掉.需要注意的是,无论是击穿还是 ...

  2. 《进击吧!Blazor!》第一章 3.页面制作

    作者介绍 陈超超Ant Design Blazor 项目贡献者拥有十多年从业经验,长期基于.Net技术栈进行架构与开发产品的工作,Ant Design Blazor 项目贡献者,现就职于正泰集团 写专 ...

  3. how2j SpringMVC学习心得

    http://how2j.cn/k/springmvc/springmvc-form/618.html 注意 addProduct.jsp 是放在了WebContent(即web目录)下,访问的时候, ...

  4. Zookeeper语法

    ZooKeeper 是一个典型的分布式数据一致性解决方案,分布式应用程序可以基于 ZooKeeper 实现诸如数据发布/订阅.负载均衡.命名服务.分布式协调/通知.集群管理.Master 选举.分布式 ...

  5. Spring MVC接收参数(Map,List,JSON,Date,2个Bean)(记录一次面试惨状)

    题目Spring MVC 接收参数 MapListDate2个BeanJSON Spring MVC接收参数 -Map Spring MVC接收参数 -List Spring MVC接收参数 -dat ...

  6. ubuntu14.04 ssh允许root用户远程登录

    vi /etc/ssh/sshd_config #注释掉 #PermitRootLogin without-password # Authentication: LoginGraceTime 120 ...

  7. 第2层交换和生成树协议(STP)__第2层的3种交换功能

    地址学习(Address Learning):第2层交换机和网桥能够记住在一个接口上所收到的每个帧的源设备硬件地址,而且它们会将这个硬件地址信息输入到被称为转发/过滤表的MAC数据库中. 转发/过滤决 ...

  8. dedecms织梦的安全问题解决办法

    很多新手用户在使用织梦CMS程序过程中,难免会碰到挂马中毒现象,所以事先我们要对网站及服务器安全做好预防备份处理. 织梦作为国内第一大开源免费CMS程序,无疑是很多HACK研究的对象,在本身不安全的互 ...

  9. PTA 乙 1001

    1001 害死人不偿命的(3n+1)猜想 题目描述 卡拉兹(Callatz)猜想: 对任何一个正整数 n,如果它是偶数,那么把它砍掉一半:如果它是奇数,那么把 (3n+1) 砍掉一半.这样一直反复砍下 ...

  10. Codeforces Round #681 (Div. 2, based on VK Cup 2019-2020 - Final) B. Saving the City (贪心,模拟)

    题意:给你一个\(01\)串,需要将所有的\(1\)给炸掉,每次炸都可以将一整个\(1\)的联通块炸掉,每炸一次消耗\(a\),可以将\(0\)转化为\(1\),消耗\(b\),问将所有\(1\)都炸 ...