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 ...
随机推荐
- JAXB学习(二): 对JAXB支持的主要注解的说明
我们在上一篇中对JAXB有了一个大致的认识,现在我们来了解JAXB的一些主要注解. 顶层元素:XmlRootElement 表示整个XML文档的类应该使用XmlRootElement修饰,其实就像之前 ...
- cookie中的domain和path
div.example { background-color: rgba(229, 236, 243, 1); color: rgba(0, 0, 0, 1); padding: 0.5em; mar ...
- MySql(五)SQL优化-优化SQL语句的一般步骤
MySql(五)SQL优化-优化SQL语句的一般步骤 一.优化SQL语句的一般步骤 1.1 通过show status命令了解各种SQL的执行频率 1.2 定位执行效率较低的SQL语句 1.3 通过e ...
- WPF 一种带有多个子集的类ComBox 解决方法
在最近的工作中遇到很多,类似这种layUI风格的Combox: 因为WPF原本的控件,并不具备这种功能,尝试重写Combox的模板,发现无从下手. 于是尝试从多个控件组合来实现这个功能. 这里使用了P ...
- ElasticSearch的查询(二)
一.Query String search 添加测试数据 PUT test_search { "mappings": { "test_type": { &quo ...
- 阿里新晋 CNCF TOC 委员张磊:“云原生”为什么对云计算生态充满吸引力?
简介: 美国当地时间 2021 年 2 月 2 日,全球顶级开源社区云原生计算基金会(Cloud Native Computing Foundation,简称 CNCF)正式宣布其新一届技术监督委员会 ...
- Codeforces Global Round 8 B. Codeforces Subsequences(构造)
题目链接:https://codeforces.com/contest/1368/problem/B 题意 构造最短的至少含有 $k$ 个 $codeforces$ 子序列的字符串. 题解 如下表: ...
- poj 2007 凸包构造和极角排序输出(模板题)
Scrambled Polygon Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 10841 Accepted: 508 ...
- Educational Codeforces Round 96 (Rated for Div. 2) E. String Reversal (思维,逆序对)
题意:给你一个字符串,每次可以调换现字符串的相邻两个字符,问最少操作多少次使得这个字符串等于其反转过来的字符串. 题解:先考虑字符串中没有相同字符的情况,那么我们每次将目前字符串的最后一个字符一直调换 ...
- Codeforces Round #479 (Div. 3) E. Cyclic Components (思维,DFS)
题意:给你\(n\)个顶点和\(m\)条边,问它们有多少个单环(无杂环),例如图中第二个就是一个杂环. 题解:不难发现,如果某几个点能够构成单环,那么每个点一定只能连两条边.所以我们先构建邻接表,然后 ...