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. TCMalloc源码学习(一)

    打算一边学习tcmalloc的源码一边写总结文章.先从转述TCMalloc的一篇官方文档开始(TCMalloc : Thread-Caching Malloc). 为什么用TCMalloc TCMal ...

  2. java判断是否为整数

    /** * 判断是否为整数 * * @param str 传入的字符串 * @return 是整数返回true,否则返回false */ public static boolean isInteger ...

  3. shell (颜色输出)

    摘自https://www.cnblogs.com/t-road/p/10257296.html #!/bin/bash # #下面是字体输出颜色及终端格式控制 #字体色范围:30-37 echo - ...

  4. The Department of Redundancy Department

    Write a program that will remove all duplicates from a sequence of integers and print the list of un ...

  5. 2019牛客暑期多校训练营(第七场)H.Pair(数位dp)

    题意:给你三个数A,B,C 现在要你找到满足  A and B >C 或者 A 异或 B < C 的对数. 思路:我们可以走对立面 把既满足 A and B <= C 也满足 A 异 ...

  6. hdu3480 Division

    Problem Description Little D is really interested in the theorem of sets recently. There's a problem ...

  7. 使用networkx库可视化对称矩阵的网络图形

    首先我的数据是.mat格式,讲讲如何用python读取.mat格式的数据(全套来) 我是python3版本 第一种读取方法: import h5py features_struct = h5py.Fi ...

  8. SpringBoot 启动慢的解决办法

    项目集成了很多内容,有 700 多个类,IDEA 中启动一次需要 70 秒,非常影响开发效率. 研究问题原因发现有以下几种情况会导致启动速度慢,优化后启动只需 26 秒左右了: 1. 和网卡有关,禁用 ...

  9. Nginx基础 - 配置静态web服务

    1.静态参数配置1)文件读取高效sendfile Syntax: sendfile on | off; Default: sendfile off; Context: http, server, lo ...

  10. 国内centos/windows10安装minikube

    centos/windows10安装minikube 目录 centos/windows10安装minikube A win10安装minikube 1 下载安装kubectl.exe 1.1 准备目 ...