xxx.asm:

%define p1 ebp+8
%define p2 ebp+12
%define p3 ebp+16 section .text
global dllmain
export astrchr dllmain:
mov eax,1
ret 12 astrchr:
push ebp
mov ebp,esp mov eax,[p1] ; char ptr
mov ecx,[p2] ; char .for:
;-------------------------------------------;
; 找到后返回第一次出现的指针
;-------------------------------------------;
cmp [eax],cl
je .return
inc eax ;-------------------------------------------;
; 如果找不到该字符,则该函数返回空指针
;-------------------------------------------;
cmp byte [eax],0
je .error
jmp .for .error:
xor eax,eax .return:
mov esp,ebp
pop ebp
ret 8

c++:

#include <iostream>
#include <Windows.h> typedef char*(CALLBACK* astrchr_t)(const char* str, int character); astrchr_t astrchr; int main()
{
HMODULE myDLL = LoadLibraryA("xxx.dll");
astrchr = (astrchr_t)GetProcAddress(myDLL, "astrchr"); char str[] = "hello world"; char* pch = strchr(str, 'l');
printf("%s\n", pch); // llo world char* pch2 = astrchr(str, 'l');
printf("%s\n", pch2); // llo world //==============================// char* pch3 = strchr(str, 'b');
printf("%s\n", pch3); // (null) char* pch4 = astrchr(str, 'b');
printf("%s\n", pch4); // (null)
return 0;
}

nasm astrchr函数 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 astrlen函数 x86

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

  4. nasm aat函数 x86

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

  5. nasm astrstr函数 x86

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

  6. nasm astrset_s函数 x86

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

  7. nasm astrrev函数 x86

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

  8. nasm astrrchr函数 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. Spring常见问题总结

    1. 什么是 Spring 框架? Spring 是一种轻量级开发框架,旨在提高开发人员的开发效率以及系统的可维护性.Spring 官网:https://spring.io/. 我们一般说 Sprin ...

  2. LOJ10102旅游航道

    题目描述 SGOI 旅游局在 SG-III 星团开设了旅游业务,每天有数以万计的地球人来这里观光,包括联合国秘书长,各国总统和 SGOI 总局局长等.旅游线路四通八达,每天都有众多的载客太空飞船在星团 ...

  3. Web漏洞扫描-AWVS

    Web漏洞扫描-AWVS 一.AWVS概述 二.功能以及特点 三.AWVS界面 四.AWVS使用 相关优质博文: CSDN:帽子不够白:WEB渗透测试之三大漏扫神器 一.AWVS概述 Acunetix ...

  4. 希尔伯特曲线python3实现

    需要OpenGL库:https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopengl #coding:utf-8 from OpenGL.GL import * ...

  5. 函数式编程(hashlib模块)

      hashlib模块 一.hashlib模块 hashlib模块,主要用于加密相关的操作,在python3的版本里,代替了md5和sha模块,主要提供 SHA1, SHA224, SHA256, S ...

  6. 查看linux系统 公网ip

    查公网IP时候, 百度输入 IP可看 linux 系统(无界面) : curl cip.cc

  7. Spring boot 异步线程池

    package com.loan.msg.config; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandle ...

  8. 虚拟局域网(VLAN)__语音VLAN

    1.语音VLAN特性使得访问端口能够携带来自IP电话的IP语音流量.当交换机连接到Cisco IP电话时,IP电话就用第3层IP优先级(precedence)和第2层服务级别(class of ser ...

  9. 第2层交换和生成树协议(STP)__MAC地址表

    1.MAC(Media Access Control, 介质访问控制)地址是识别LAN节点的标识.网卡的物理地址通常是由网卡生产厂家烧入网卡的EPROM(一种闪存芯片,通常可以通过程序擦写),它存储的 ...

  10. SpringBoot - 实现文件上传2(多文件上传、常用上传参数配置)

    在前文中我介绍了 Spring Boot 项目如何实现单文件上传,而多文件上传逻辑和单文件上传基本一致,下面通过样例进行演示. 多文件上传 1,代码编写 1)首先在 static 目录中创建一个 up ...