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 ...
随机推荐
- 切片声明 切片在内存中的组织方式 reslice
数组是具有相同 唯一类型 的一组已编号且长度固定的数据项序列(这是一种同构的数据结构),[5]int和[10]int是属于不同类型的.数组的编译时值初始化是按照数组顺序完成的(如下). 切片声明方式, ...
- 洛谷 P3704 SDOI2017 数字表格
题意: 给定两个整数 \(n, m\),求: \[\prod_{i = 1} ^ n \prod_{j = 1} ^ m \operatorname{Fib}_{\gcd\left(n, m\righ ...
- Java面试题及解析(判断题)
1.代码差错,判断代码对错,并指出错误处 abstract class Name{ private String name; public abstract Boolean isStupidName( ...
- Java 8教程(知识内容详细,快速学习Java 8)
允许在接口中有默认方法实现 Lambda表达式 函数式接口 方法和构造函数引用 Lambda的范围 内置函数式接口 Predicates Functions Suppliers Consumers C ...
- dedecms织梦搜索页错乱的解决方法
在使用DEDE程序所架设的网站时,使用搜索结果页展示的问题上,由于font样式飘红问题,导致页面错乱,今天来解决这个问题. 织梦程序的搜索结果原理很简单,利用font加入颜色样式赋予搜索结果,所以显示 ...
- cassandra权威指南读书笔记--Cassandra架构(2)
环和令牌cassandra的数据管理是用一个环来表示.为环中的每个节点分配一or多个数据范围,用token描述.token由64位整数ID表示,范围-2^(63)~2^(63)-1.使用对分区键进行一 ...
- TcaplusDB 10周年 风雨兼程破浪行 自研存储见成长
从找不到需求险些被叫停,到支撑亿级DAU的数据库行业标杆,腾讯云数据库TcaplusDB在风雨中走过了整整10年.辉映日月破风浪,十年一剑破九天.百万行代码就像淙淙流淌的数据溪流,终于在十年后汇成不可 ...
- jdk 安装过程配置环境变量 error 的解决过程
jdk 安装过程配置环境变量 error 的解决过程 问题背景: 我在安装 jdk 过程中在JAVA_HOME和path中添加路径后, cmd 中输入java 和javac均出现错误,因为之前在 D ...
- Codeforces Round #655 (Div. 2) A. Omkar and Completion
题目链接:https://codeforces.com/contest/1372/problem/A 题意 构造一个大小为 $n$ 的数组 $a$,要求满足 $1 \le a_i \le n$,且不存 ...
- HDU 2176 取(m堆)石子游戏 && HDU1850 Being a Good Boy in Spring Festivaly
HDU2176题意: m堆石子,两人轮流取.只能在1堆中取.取完者胜.先取者负输出No.先取者胜输出Yes,然后输出怎样取子. 通过 SG定理 我们可以知道每一个数的SG值,等于这个数到达不了的前面数 ...