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 ...
随机推荐
- spark join 广告用户特征 与广告特征的 join 拿到训练集
spark join 广告特征做广播
- Excel三个下拉互斥
Excel三个下拉互斥 描述:Excel有三个下拉列表,若选择了其中任意一个下拉,其他两个均不可以在选择. 尝试了很多种办法,级联,数据有效性等等,最后都没实现. 老大,最后用VBA实现. 附上代码: ...
- 设计模式c++(3)——观察者模式
观察者模式定义了对象之间的一对多依赖,这样一来,当一个对象改变状态时,它的所有依赖着都会收到通知并自动更新. 当两个对象之间松耦合,他们依然可以交互,但是不太清楚彼此的细节.观察者模式提供了一种对象设 ...
- Linux-服务管理命令chkconfig
Linux-服务管理命令chkconfig 一 chkconfig简介 chkconfig命令主要用来更新(启动或停止)和查询系统服务的运行级信息.谨记chkconfig不是立即自动禁止或激活一个服 ...
- Linux Bash编程
在Linux系统介绍中,介绍了shell的多个版本,现在的Linux发行版基本都默认使用bash(Bourne Again shell),兼容Bourne shell (sh),本文将简要介绍Bash ...
- shell脚本的使用该熟练起来了,你说呢?(篇四)
继续前一篇的文章: shell脚本的使用该熟练起来了,你说呢?(篇一) shell脚本的使用该熟练起来了,你说呢?(篇二) shell脚本的使用该熟练起来了,你说呢?(篇三) 文章里面测试的命令脚本文 ...
- CPU中的程序是怎么运行起来的
总述 最近一位朋友问我,开发的代码是怎么在芯片运行起来的,我就开始给他介绍代码的预编译.汇编.编译.链接然后到一般的文件属性,再到代码运行.但是大佬问了我一句,CPU到底是怎么执行到每一个逻辑的,就讲 ...
- KMP:补齐循环节
首先要明白:如果一个串需要至少添加x(x>=0)个字符才能是有>=2个循环节的串,那么我可以只在串末尾添加,不需要去串头添加.(比如串cabc,循环节是abc,我可以在尾部添加ab即可.) ...
- P1435 回文字串(DP)
题目描述 回文词是一种对称的字符串.任意给定一个字符串,通过插入若干字符,都可以变成回文词.此题的任务是,求出将给定字符串变成回文词所需要插入的最少字符数. 比如 "Ab3bd"插 ...
- AtCoder Beginner Contest 179 E - Sequence Sum (模拟)
题意:\(f(x,m)\)表示\(x\ mod\ m\),\(A_{1}=1\),而\(A_{n+1}=f(A^{2}_{n},M)\),求\(\sum^{n}_{i=1}A_{i}\). 题解:多算 ...