nasm astrrchr函数 x86
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的更多相关文章
- nasm astrspn函数 x86
xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...
- nasm astrcspn函数 x86
xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...
- nasm astrchr函数 x86
xxx.asm: %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export as ...
- nasm astrlen函数 x86
xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...
- nasm aat函数 x86
xxx.asm: %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain dllmain: ...
- nasm astrstr函数 x86
xxx.asm: %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export as ...
- nasm astrset_s函数 x86
xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...
- nasm astrrev函数 x86
xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...
- nasm astrncmp函数 x86
xxx.asm: %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export as ...
随机推荐
- .axios的特点有哪些
从浏览器中创建XMLHttpRequests:node.js创建http请求:支持Promise API:拦截请求和响应:转换请求数据和响应数据:取消请求:自动换成json.axios中的发送字段的参 ...
- Spark踩坑填坑-聚合函数-序列化异常
Spark踩坑填坑-聚合函数-序列化异常 一.Spark聚合函数特殊场景 二.spark sql group by 三.Spark Caused by: java.io.NotSerializable ...
- Spring Boot 两种多数据源配置:JdbcTemplate、Spring-data-jpa
多数据源配置 JdbcTemplate支持 Spring-data-jpa支持 多数据源配置 创建一个Spring配置类,定义两个DataSource用来读取application.propertie ...
- centos安装、升级新火狐最新版 31
1.登录火狐主页 下载最新版本firefox-31.0.tar.bz2 解压: tar -jxvf firefox-31.0.tar.bz2 2.然后把旧版本的firefox卸掉 # yum eras ...
- maven高级笔记
Maven高级 1.maven基础知识回顾 1.1 maven介绍 maven 是一个项目管理工具,主要作用是在项目开发阶段对Java项目进行依赖管理和项目构建. 依赖管理:就是对jar包的管理.通过 ...
- Linux Bash编程
在Linux系统介绍中,介绍了shell的多个版本,现在的Linux发行版基本都默认使用bash(Bourne Again shell),兼容Bourne shell (sh),本文将简要介绍Bash ...
- springboot源码解析-管中窥豹系列之web服务器(七)
一.前言 Springboot源码解析是一件大工程,逐行逐句的去研究代码,会很枯燥,也不容易坚持下去. 我们不追求大而全,而是试着每次去研究一个小知识点,最终聚沙成塔,这就是我们的springboot ...
- linux终端的快捷命令汇总
作者:良知犹存 转载授权以及围观:欢迎添加微信公众号:Conscience_Remains 总述 今天来一篇介绍文哈,关于Linux终端的快捷键的介绍.也是有起因的,最近在移植yocto在服务 ...
- Python3列表、元组及之间的区别和转换
文章目录 1. 列表(list) 1.1 列表创建.切片.删除.检索 1.2 列表常用函数 2. 元组(tuple) 3. 列表与元组区别及转换 1. 列表(list) 1.1 列表创建.切片.删除. ...
- hdu3559 Frost Chain (概率dp+记忆化搜索)
Problem Description In the unimaginable popular DotA game, the hero Lich has a wonderful skill: Fros ...