nasm astrset_s函数 x86
xxx.asm
%define p1 ebp+8
%define p2 ebp+12
%define p3 ebp+16
section .text
global dllmain
export astrset_s
dllmain:
mov eax,1
ret 12
;------------------------------------------------;
; 将字符串的字符设置为字符
;------------------------------------------------;
astrset_s:
push ebp
mov ebp,esp
mov ecx,[p1] ; char* str
mov eax,[p2] ; size_t numberOfElements
mov edx,[p3] ; int c
.for:
test eax,eax
jz .return
cmp byte [ecx],0
je .return
mov [ecx],dl
inc ecx
dec eax
jmp .for
.return:
xor eax,eax
mov esp,ebp
pop ebp
ret 12
c++:
#include <iostream>
#include <Windows.h>
typedef int (CALLBACK* astrset_s_t)(char* str, size_t numberOfElements, int c);
astrset_s_t astrset_s;
int main()
{
HMODULE myDLL = LoadLibraryA("xxx.dll");
astrset_s = (astrset_s_t)GetProcAddress(myDLL, "astrset_s");
char s[12] = "abc";
_strset_s(s, sizeof(s), "x"[0]);
printf("%s\n", s); // xxx
astrset_s(s, sizeof(s), "y"[0]);
printf("%s\n", s); // yyy
return 0;
}
nasm astrset_s函数 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 astrrev函数 x86
xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...
- nasm astrrchr函数 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 ...
随机推荐
- LOJ10043
题目描述 原题来自:HNOI 2002 Tiger 最近被公司升任为营业部经理,他上任后接受公司交给的第一项任务便是统计并分析公司成立以来的营业情况. Tiger 拿出了公司的账本,账本上记录了公司成 ...
- react+ant design 项目执行yarn run eject 命令后无法启动项目
如何将内建配置全部暴露? 使用create-react-app结合antd搭建的项目中,项目目录没有该项目所有的内建配置, 1.执行yarn run eject 执行该命令后,运行项目yarn sta ...
- 三:SpringBoot-配置系统全局异常映射处理
三:SpringBoot-配置系统全局异常映射处理 1.异常分类 1.1 业务异常 1.2 系统异常 2.自定义异常处理 2.1 自定义业务异常类 2.2 自定义异常描述对象 2.3 统一异常处理格式 ...
- 前端开发规范之命名规范、html规范、css规范、js规范
在学习编程的时候,每次看到那些整齐规范的代码,心里顿时对这个程序员表示点点好感,有时,比如看到自己和朋友写的代码时,那阅读起来就是苦不堪言,所以,一些基本的开发规范是必须的,是为了自己方便阅读代码,也 ...
- Stream API处理集合
使用流来遍历集合 简介 如何工作 总结 从集合或数组创建流 简介 如何工作 结论 聚合流的值 简介 如何工作 结论 转载 使用流来遍历集合 简介: Java的集合框架,如List和Map接口及Arra ...
- 配合 jekins—springboot脚本
#!/usr/bin/bash # author : renguangyin@yingu.com current=$(cd `dirname $0`; pwd) cd ${current} ext_n ...
- 从NMEA0183到GNSS定位数据获取(一)原理篇
作者:良知犹存 转载授权以及围观:欢迎添加微信公众号:Conscience_Remains 总述 GPS我们都知道,一种用来全球定位的系统,后来俄罗斯推出了格洛纳斯定位系统,中国推出了北斗定位,欧盟有 ...
- Snapshot查询所有快照
今天使用snapshot list这个命令时查询出了所有的表,没注意下面报错: NoMethodError:undefined method '-@' for #<Array:0x54326e9 ...
- 三维CAD——基于B_rep的建模操作
内容来自高老师的<三维CAD建模>课,本文就主要介绍半边结构和欧拉操作以及代码实现. 1. 边界表示法及其数据结构 · 拓扑结构 a.拓扑元素:面.边.点.体 b.拓扑关系:9种.V{V} ...
- poj1066 线段相交简单应用(解题报告)
#include<stdio.h> #include<math.h> const double eps=1e-8; int n; struct Point { double x ...