nasm astrlwr_s函数 x86
xxx.asm
%define p1 ebp+8
%define p2 ebp+12
%define p3 ebp+16
section .text
global dllmain
export astrlwr_s
dllmain:
mov eax,1
ret 12
;-----------------------------------------;
; 将字符串转换为小写
;-----------------------------------------;
astrlwr_s:
push ebp
mov ebp,esp
mov eax,[p1] ; str ptr
mov ecx,[p2] ; numberOfElements
.for:
test ecx,ecx
jz .return
mov dl,[eax]
test dl,dl
jz .return
;----------------------------------------;
; 如果 < 0x41 next
;----------------------------------------;
cmp dl,41h
jb .next
;----------------------------------------;
; 如果 > 0x5A next
;----------------------------------------;
cmp dl,5Ah
ja .next
add dl,20h
mov [eax],dl
.next:
dec ecx
inc eax
jmp .for
.return:
xor eax,eax
mov esp,ebp
pop ebp
ret 8
c++:
#include <iostream>
#include <Windows.h>
typedef int (CALLBACK* astrlwr_s_t)(char* str, size_t numberOfElements);
astrlwr_s_t astrlwr_s;
int main()
{
HMODULE myDLL = LoadLibraryA("xxx.dll");
astrlwr_s = (astrlwr_s_t)GetProcAddress(myDLL, "astrlwr_s");
char a[10] = "aBcD";
printf("%d, %s\n", _strlwr_s(a, 10), a); // abcd
char b[10] = "aBcD";
printf("%d, %s\n", astrlwr_s(b, 10), b); // abcd
return 0;
}
nasm astrlwr_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 astrset_s函数 x86
xxx.asm %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export ast ...
- 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 ...
随机推荐
- 使用 Tye 辅助开发 k8s 应用竟如此简单(一)
最近正巧在进行 Newbe.Claptrap 新版本的开发,其中使用到了 Tye 来辅助 k8s 应用的开发.该系列我们就来简单了解一下其用法. Newbe.Claptrap 是一个用于轻松应对并发问 ...
- 有趣的css—隐藏元素的7种思路
css隐藏元素的7种思路 前言 display.visibility.opacity三个属性隐藏元素之间的异同点一直是前端面试面试的常考题. 属性 值 是否在页面上显示 注册点击事件是否有效 是否存在 ...
- (30)Linux文本处理
1.cat命令:连接文件并打印输出到标准输出设备 cat 命令可以用来显示文本文件的内容(类似于 DOS 下的 type 命令),也可以把几个文件内容附加到另一个文件中,即连接合并文件. cat 命令 ...
- npm qs 模块(中文)
本文基本使用谷歌翻译加上自己的理解,权当加深记忆. npm 简介 qs 是一个增加了一些安全性的查询字符串解析和序列化字符串的库.主要维护者:Jordan Harband最初创建者和维护者:TJ Ho ...
- SPOJ1812 LCS2 - Longest Common Substring II【SAM LCS】
LCS2 - Longest Common Substring II 多个字符串找最长公共子串 以其中一个串建\(SAM\),然后用其他串一个个去匹配,每次的匹配方式和两个串找\(LCS\)一样,就是 ...
- Educational Codeforces Round 89 (Rated for Div. 2) A Shovels and Swords B、Shuffle
题目链接:A.Shovels and Swords 题意: 你需要一个木棍和两个钻石可以造出来一把剑 你需要两个木棍和一个钻石可以造出来一把铁锹 你现在有a个木棍,b个钻石,问你最多可以造出来几件东西 ...
- codeforces 128B. String
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
- Codeforces Round #531 (Div. 3) B. Array K-Coloring (结构体排序)
题意:给你\(n\)个数字,用\(k\)种颜色给他们涂色,要求每个数字都要涂,每种颜色都要用,相同的数字不能涂一样的颜色. 题解:用结构体读入每个数字和它的位置,然后用桶记录每个数字出现的次数,判断是 ...
- solidity的函数修改器(modifier)
内容:modifier的定义.modifier对函数参数的操作.modifier执行的顺序 modifier的定义 官方文档:modifier可以改变函数的行为.可以被继承和重写. 其实modifie ...
- Windows Terminal 更换主题
1. 打开设置,是个json文件 2. 在此处获取主题配置:https://atomcorp.github.io/themes/ 3.将主题配置粘贴到schemes节点(可以增加N个) 4.配置每个命 ...