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. 常用shell命令及其用法

    ls(lsit) ​ 1.作用:列出文件列表 ​ 2.用法:ls [-a|-A--] [filename|directory] ​ ls ​ ls -a:查看隐藏文件 ​ ls -l:查看文件详细信息 ...

  2. Redis 实战 —— 12. 降低内存占用

    简介 降低 Redis 的内存占用有助于减少创建快照和加载快照所需的时间.提升载入 AOF 文件和重写 AOF 文件时的效率.缩短从服务器进行同步所需的时间(快照. AOF 文件重写在 持久化选项 中 ...

  3. HTML 5 学习第二课

    元素:<p>+++++++++</P> 全部内容 标签:<P></P> 属性:标签内部的内容 eg:<img src=" "& ...

  4. 性能优化(CSS优化)

    高质量的CSS代码体现在三个方面:可读性和可维护性和高性能.对于"前端工程师"来说如何平衡"追求高性能"和"可维护性"是很值得思考的问题. ...

  5. Go语言学习笔记(2)——零散的话题(反射)

    这部分是<Go语言编程>这本书的第9章的内容.书中给该章节的定位是一个文章集,其包含了一些Go语言中比较少涉及,或是比较深入的讨论的内容.因为第一节就是反射,而反射在我看来是比较重要的内容 ...

  6. Django(图书管理系统)

    图书管理系统 注意事项 1.models 要创建好,规划好自己的表,以及各种表关系 2.url正则要写好 3.settings的配置 4.利用bootstarp 进行布局更漂亮哦 5.注意orm  各 ...

  7. centos6.5安装KVM,并在KVM中安装虚拟6.5系统

    =============================环境搭建================================================== 1.检查CPU信息 KVM 需要 ...

  8. mysql:如何利用覆盖索引避免回表优化查询

    说到覆盖索引之前,先要了解它的数据结构:B+树. 先建个表演示(为了简单,id按顺序建): id name 1 aa 3 kl 5 op 8 aa 10 kk 11 kl 14 jk 16 ml 17 ...

  9. Wormholes (spfa)

    一种路是双向的,路的长度是正值:另一种路是单向的,路的长度是负值:  如果有负环输出YES:否则输出NO:不同的路可能有相同的起点和终点:必须用邻接表 While exploring his many ...

  10. Codeforces Round #673 (Div. 2) A. Copy-paste(贪心)

    题目链接:https://codeforces.com/contest/1417/problem/A 题意 给出一个大小为 $n$ 的数组 $a$,每次操作可以选择两个数,然后将一个数加到另一个数上, ...