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 ...
随机推荐
- forEach、for in、for of三者区别
forEach更多的用来遍历数组for in 一般常用来遍历对象或jsonfor of数组对象都可以遍历,遍历对象需要通过和Object.keys()for in循环出的是key,for of循环出的 ...
- SpringMVC听课笔记(一:SpringMVC概述)
地址 :https://www.bilibili.com/video/av14907450 版本:4.x 概述: 概要: 一:SpringMVC概述 二:SpringMVC的 HelloWorld 三 ...
- 虚拟局域网(VLAN)__语音VLAN
1.语音VLAN特性使得访问端口能够携带来自IP电话的IP语音流量.当交换机连接到Cisco IP电话时,IP电话就用第3层IP优先级(precedence)和第2层服务级别(class of ser ...
- Web APP和原生 APP的不同
我们现在手机中的APP,大部分都是混合APP,也就是既用到了原生APP的基础,又用到了Web APP的基础,混合的比例从0%到100%之间不等.更好的了解APP的类型,有助于我们学则合适的测试策略.今 ...
- B - How Many Tables (多少桌)
题目大致意思: 有n个人在一起吃饭,有些人互相认识.认识的人想坐在一起,不想跟陌生人坐.例如A认识B,B认识C,那么A.B.C会坐在一张桌子上. 给出认识的人,问需要多少张桌子 Today is Ig ...
- Codeforces Round #631 (Div. 2)
Contest Info Practice Link Solved A B C D E F 4/6 O O Ø O 在比赛中通过 Ø 赛后通过 ! 尝试了但是失败了 - 没有尝试 Solu ...
- C. New Year Book Reading
New Year is coming, and Jaehyun decided to read many books during 2015, unlike this year. He has n b ...
- C# TCP应用编程三 异步TCP应用编程
利用TcpListener和TcpClient类在同步方式下接收.发送数据以及监听客户端连接时,在操作没有完成之前一直处于阻塞状态,这对于接受.发送数据量不大的情况或者操作勇士较短的情况下是比较方便的 ...
- java实现定时任务解决方案
在线corn表达式 1. 总结常见的实现定时任务的几种方法 thread实现 [原理:通过创建一个线程,让他在while循环里面一直运行,用sleep() 方法让其休眠从而达到定时任务的效果.] Ti ...
- 国产smartbits版本-minismb测试高恪路由器IP限速
Minismb测试仪表是复刻smartbits的国产版本,是一款专门用于测试智能路由器,网络交换机的性能和稳定性的软硬件相结合的工具.可以通过此工具测试任何ip网络设备的端口吞吐率,带宽,并发连接数和 ...