xxx.asm

  1. %define p1 ebp+8
  2. %define p2 ebp+12
  3. %define p3 ebp+16
  4. section .text
  5. global dllmain
  6. export astrset_s
  7. dllmain:
  8. mov eax,1
  9. ret 12
  10. ;------------------------------------------------;
  11. ; 将字符串的字符设置为字符
  12. ;------------------------------------------------;
  13. astrset_s:
  14. push ebp
  15. mov ebp,esp
  16. mov ecx,[p1] ; char* str
  17. mov eax,[p2] ; size_t numberOfElements
  18. mov edx,[p3] ; int c
  19. .for:
  20. test eax,eax
  21. jz .return
  22. cmp byte [ecx],0
  23. je .return
  24. mov [ecx],dl
  25. inc ecx
  26. dec eax
  27. jmp .for
  28. .return:
  29. xor eax,eax
  30. mov esp,ebp
  31. pop ebp
  32. ret 12

c++:

  1. #include <iostream>
  2. #include <Windows.h>
  3. typedef int (CALLBACK* astrset_s_t)(char* str, size_t numberOfElements, int c);
  4. astrset_s_t astrset_s;
  5. int main()
  6. {
  7. HMODULE myDLL = LoadLibraryA("xxx.dll");
  8. astrset_s = (astrset_s_t)GetProcAddress(myDLL, "astrset_s");
  9. char s[12] = "abc";
  10. _strset_s(s, sizeof(s), "x"[0]);
  11. printf("%s\n", s); // xxx
  12. astrset_s(s, sizeof(s), "y"[0]);
  13. printf("%s\n", s); // yyy
  14. return 0;
  15. }

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

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

  4. nasm astrlen函数 x86

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

  5. nasm aat函数 x86

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

  6. nasm astrstr函数 x86

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

  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. JAXB学习(二): 对JAXB支持的主要注解的说明

    我们在上一篇中对JAXB有了一个大致的认识,现在我们来了解JAXB的一些主要注解. 顶层元素:XmlRootElement 表示整个XML文档的类应该使用XmlRootElement修饰,其实就像之前 ...

  2. cookie中的domain和path

    div.example { background-color: rgba(229, 236, 243, 1); color: rgba(0, 0, 0, 1); padding: 0.5em; mar ...

  3. MySql(五)SQL优化-优化SQL语句的一般步骤

    MySql(五)SQL优化-优化SQL语句的一般步骤 一.优化SQL语句的一般步骤 1.1 通过show status命令了解各种SQL的执行频率 1.2 定位执行效率较低的SQL语句 1.3 通过e ...

  4. WPF 一种带有多个子集的类ComBox 解决方法

    在最近的工作中遇到很多,类似这种layUI风格的Combox: 因为WPF原本的控件,并不具备这种功能,尝试重写Combox的模板,发现无从下手. 于是尝试从多个控件组合来实现这个功能. 这里使用了P ...

  5. ElasticSearch的查询(二)

    一.Query String search 添加测试数据 PUT test_search { "mappings": { "test_type": { &quo ...

  6. 阿里新晋 CNCF TOC 委员张磊:“云原生”为什么对云计算生态充满吸引力?

    简介: 美国当地时间 2021 年 2 月 2 日,全球顶级开源社区云原生计算基金会(Cloud Native Computing Foundation,简称 CNCF)正式宣布其新一届技术监督委员会 ...

  7. Codeforces Global Round 8 B. Codeforces Subsequences(构造)

    题目链接:https://codeforces.com/contest/1368/problem/B 题意 构造最短的至少含有 $k$ 个 $codeforces$ 子序列的字符串. 题解 如下表: ...

  8. poj 2007 凸包构造和极角排序输出(模板题)

    Scrambled Polygon Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 10841   Accepted: 508 ...

  9. Educational Codeforces Round 96 (Rated for Div. 2) E. String Reversal (思维,逆序对)

    题意:给你一个字符串,每次可以调换现字符串的相邻两个字符,问最少操作多少次使得这个字符串等于其反转过来的字符串. 题解:先考虑字符串中没有相同字符的情况,那么我们每次将目前字符串的最后一个字符一直调换 ...

  10. Codeforces Round #479 (Div. 3) E. Cyclic Components (思维,DFS)

    题意:给你\(n\)个顶点和\(m\)条边,问它们有多少个单环(无杂环),例如图中第二个就是一个杂环. 题解:不难发现,如果某几个点能够构成单环,那么每个点一定只能连两条边.所以我们先构建邻接表,然后 ...