nasm astrlen函数 x86
xxx.asm
%define p1 ebp+8
%define p2 ebp+12
%define p3 ebp+16
section .text
global dllmain
export astrlen
dllmain:
mov eax,1
ret 12
astrlen:
push ebp
mov ebp,esp
mov ecx,[p1] ; char ptr
xor eax,eax
.for:
cmp byte [ecx],0
je .return
inc ecx
inc eax
jmp .for
.return:
mov esp,ebp
pop ebp
ret 4
link.fil:
/entry dllmain
/dll
xxx.obj
c++
#include <iostream>
#include <Windows.h>
typedef int (CALLBACK* astrlen_t)(const char*);
astrlen_t astrlen;
int main()
{
HMODULE myDLL = LoadLibraryA("xxx.dll");
astrlen = (astrlen_t)GetProcAddress(myDLL, "astrlen");
printf("%d\n", astrlen("hello world")); // 11
printf("%d\n", astrlen("nasm")); // 4
return 0;
}
nasm astrlen函数 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 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 ...
- nasm astrncmp函数 x86
xxx.asm: %define p1 ebp+8 %define p2 ebp+12 %define p3 ebp+16 section .text global dllmain export as ...
随机推荐
- 并发编程(Process对象的join方法)(
一. Process对象的join方法 在主进程运行过程中如果想并发地执行其他的任务,我们可以开启子进程,此时主进程的任务与子进程的任务分两种情况 情况一:在主进程的任务与子进程的任务彼此独立的情况下 ...
- 查看linux系统 公网ip
查公网IP时候, 百度输入 IP可看 linux 系统(无界面) : curl cip.cc
- liux 常用操作命令
tail -f /home/jyapp/apache-tomcat-7.0.59/logs/catalina.out //查看实施日志 //删除临时目录并且启动服务器 rm -rf /home/jy ...
- BGP总结(一)
0.AS 狭义:在RIP.OSPF和EIGRP等IGP协议中,AS表示只运行此单种协议的路由域 广义:运行多个IGP协议的路由域,多个IGP协议之间通过路由重发布来实现通信,AS和AS之间通过BGP来 ...
- (24)bzip2命令:压缩文件(.bz2格式)&&bunzip2命令:bz2格式的解压缩命令
1.bzip2 命令同 gzip 命令类似,只能对文件进行压缩(或解压缩),对于目录只能压缩(或解压缩)该目录及子目录下的所有文件.当执行压缩任务完成后,会生成一个以".bz2"为 ...
- Java复习整理 Day02
1 package demo01; 2 3 import java.util.Scanner; 4 5 public class ScannerDemo01 { 6 public static voi ...
- 微信支付V3 SDK Payment Spring Boot 1.0.6 发布,实现留守红包,助力抗疫
春节将至,为防控疫情,多地政府提倡员工.外来务工者留守本地过年,并鼓励企业向员工发放"留守红包".为此,微信支付推出"春节留守红包"能力,希望可以协助有发放需求 ...
- HDU-4773 Problem of Apollonius (圆的反演)
参考: https://oi-wiki.org/geometry/inverse/ https://blog.csdn.net/acdreamers/article/details/16966369 ...
- Testing Beta Round (Unrated)
比赛链接:https://codeforces.com/contest/1390 A. 123-sequence 题意 给出一个只含有 $1,2,3$ 的数组,问使所有元素相同至少要替换多少元素. 题 ...
- hdu3555 Bomb(要49)
Problem Description The counter-terrorists found a time bomb in the dust. But this time the terroris ...