用VC写Assembly代码(5) --函数调用(二)

VC9 32位运行库完整安装指南:解决DLL缺失与系统兼容性问题 动态链接库(DLL)是Windows系统中实现代码共享的核心机制,程序通过动态链接调用共享库函数以减小体积。然而,DLL版本冲突曾导致著名的“DLL地狱”问题。微软引入Side-by-Side Assembly技术,通过清单文件和WinSxS目录实现多版本库共存,从而解决了这一难题。Visual C++运行库作为典型的SxS程序集,为C++程序提供必要的运行时支持。其中,VC9(Visual C++ 2008)运行库因其稳定的ABI接口,至今仍是许多老旧系统和行业软件(如工控软件、经典游戏)的必备组件。在W 阅读详情

终于知道如何用LoadLibrary,但不知为什么!
我自己写的例子是:


#include <windows.h>

int main(int argc, char* argv[])
{
  char *msvcrt = "msvcrt.dll";
  __asm
  {
    mov eax, msvcrt
    push eax
    call dword ptr[LoadLibrary]
  }
  return 0;
}

哎,笨蛋试的例子.
为什么
printf
和
LoadLibrary
的调用方法不一样呢?
call dword ptr[printf]
会出错,而
call print
则正确.

原来是这样:

LoadLibrary是动态链接
printf是静态链接
静态链接只须call xxxxxxxx即可
动态链接必须call DWORD ptr [xxxxxxxx]

谢谢虾爷!

System.IO.FileNotFoundException: Could not load file or assembly ‘xx.dll‘ or one of its dependencies fff 阅读详情

相关推荐

Windows 7环境下VC2005安装与运行库配置完整指南

VC2005 或许已经老去,但它承载的技术遗产仍在影响今天的世界。我们不需要抛弃它,而是要学会如何与它共存。一套完整的解决方案应包括:✅ 自动检测✅ 智能安装✅ 日志审计✅ 兼容加固✅ 渐进迁移这才是真正的工程思维:既尊重历史,也面向未来。所以,下次当客户说“我这儿打不开你的程序”,你可以微微一笑,掏出那个绿色图标的小工具,轻轻一点——“好了,试试看。😎💻✨本文还有配套的精品资源,点击获取。

weixin_36289813的博客 869

C#反射Assembly 详细说明

转载自:http://blog.youkuaiyun.com/lyncai/article/details/8621880 1、对C#反射机制的理解 2、概念理解后,必须找到方法去完成,给出管理的主要语法 3、最终给出实用的例子,反射出来dll中的方法 反射是一个程序集发现及运行的过程,通过反射可以得到*.exe或*.dll等程序集内部的信息。使用反射可以看到一个程序集内部的接口、类、方法

游子的博客 4943

FOC项目知识点总结三 | 完全搞懂 Clarke 与 Park 变换(附动图,仿真文件以及详细讲解数学推导过程)

本文目的,最终可以完整推算两种变换 Clarke 变换 首先先看我们需要用到的两种坐标系 1. 自然坐标系 abcabcabc 我们知道,通过三相逆变电路,我们可以画出一个自然坐标系 abcabcabc ,即三相电压的坐标系,通入的电流在这三轴坐标系中变化: 将三个矢量相加合并在一起就如下图所展现: 使用三个坐标轴来表示十分的麻烦与不直观,因为其是非正交的,于是乎我们想要将其转化成使用两个正交的坐标轴来表示,于是乎便有了 Clarke变换。 Clarke 变换的作用: 将基于三轴二维的定子静止坐标系的各

Wilson Huang的博客 3万+

C#反射的Assembly的简单应用

反射(Reflection)是.NET中的重要机制,通过反射,可以在运行时获得.NET中每一个类型(包括类、结构、委托、接口和枚举等)的成员,包括方法、属性、事件,以及构造函数等。还可以获得每个成员的名称、限定符和参数等。有了反射,即可对每一个类型了如指掌。如果获得了构造函数的信息,即可直接创建对象,即使这个对象的类型在编译时还不知道。 Assembly就是反应反射的一种应用,它定义和加载程序集

杨友山 1万+

从数据到图片:手把手构建FMCW雷达人体行为识别数据集(行走、跌倒、喝水等6类动作)

本文详细解析了如何利用FMCW雷达构建人体行为识别数据集,涵盖行走、跌倒、喝水等6类动作。通过多普勒特征可视化、图像标准化处理和自动化流水线设计,将原始雷达信号转化为高质量时频图像数据集,为智能家居和健康监护等应用提供可靠数据支持。

weixin_30706691的博客 385

(程序设计方法与实践)达拉崩吧的酒宴

达拉崩吧的酒宴 Description 很久很久以前,巨龙突然出现,带来灾难带走了公主又消失不见,王国十分危险,世间谁最勇敢,一位勇者赶来大声喊:“我要带上最好的剑,翻过最高的山,闯进最深的森林,把公主带回到面前”……最后,英雄 达拉崩巴斑得贝迪卜多比鲁翁 ,他战胜了巨龙 昆图库塔卡提考特苏瓦西拉松 ,国王把公主 米娅莫拉苏娜丹妮谢莉红 嫁给了 达拉崩巴斑得贝迪卜多比鲁翁 。 于是国王第二天要在 蒙达鲁克硫斯伯古比奇巴勒城 举办酒宴,一共准备了 N 桶酒。此时一位忠诚的仆人来报,有人在其中一桶酒里下毒,

What_If_I的博客 894

用VC写Assembly代码(5) --函数调用(三)

没什么好说的啦,看代码就是啦#include void main(){ char *a = (char*)MessageBox; __asm {  push 0  push 0  push 0  push 0  mov ebx, 77d5050bh  call ebx } printf("%0x/n", a);} 顺便转一篇有关SHELLCODE的文章,看起来很简单,但是测试就是不成功

小发猫 1979

IEC61850实战:从ICD文件解析到模型构建

本文深入解析IEC61850标准中的ICD文件结构,从Header、IED到DataTypeTemplates部分,详细介绍了如何构建电力自动化设备的数据模型。通过实战案例展示ICD文件的创建过程,并分享常见问题的调试技巧,帮助工程师快速掌握IEC61850建模方法,提升电力系统自动化项目的实施效率。

weixin_26841743的博客 497

用VC写Assembly代码

各位好,最近我在研究SHELLCODE 的编写,因为需要ASM的基础,所以用VC写一些ASM代码.有兴趣的朋友可以一起讨论.我们都欢迎你. 用VC写Assembly代码(1) 用VC写Assembly代码(2) 用VC写Assembly代码(3)  用VC写Assembly代码(4) 用VC写Assembly代码(5) --字符串 用VC写Assem

小发猫 4101

平衡电桥在高压绝缘检测中的动态切换策略与误差优化

本文深入探讨了平衡电桥在高压绝缘检测中的动态切换策略与误差优化方法。通过分析四种基本切换模式及智能切换时序设计,显著提升检测精度与范围。结合电阻选型黄金法则和软件补偿技术,有效降低测量误差,为电动汽车电池管理系统提供可靠的安全保障。

weixin_30275415的博客 474

大模型风电功率预测:短期,超短期,中长期的完整实现与代码详解

本文全面介绍了基于深度学习大模型的风电功率预测方法,涵盖超短期(15分钟-1小时)、短期(1-6小时)和中长期(1天-1周)三种时间尺度。文章详细阐述了数据准备与特征工程,包括数据收集、预处理和可视化分析。针对不同时间尺度,分别介绍了Temporal Fusion Transformer (TFT)、Informer和N-BEATS模型的构建、训练与评估方法,并提供了完整的开源代码实现。此外,文章还探讨了模型部署与生产环境集成,包括模型保存与加载、实时预测API以及模型监控与再训练。最后,文章总结了关键创新

专注AI大模型,软件混淆,授权 1894

用VC写Assembly代码(5) --函数调用(一)

用C写一个加载msvcrt.dll的方法如下:#include #include void main(){  char *msvcrt = "msvcrt.dll";  HINSTANCE h = LoadLibrary(msvcrt);}反汇编得到的代码是:5:    #include 6:    #include 7:8:    void main()9:    {0040B4B0 55   

小发猫 2680

49、Linux内核内存管理:MGLRU、DAMON与OOM杀手详解

本文详细解析了Linux内核内存管理中的三大核心机制:MGLRU(多代LRU)页面追踪与回收机制、DAMON数据访问监控工具及其在内存优化中的应用,以及OOM(内存不足)杀手的工作原理和触发方式。同时,文章还介绍了VM overcommit_memory策略的设置及其对内存分配的影响,帮助开发者和系统管理员更好地理解Linux内存管理机制,从而优化系统性能和稳定性。

dropout6artist的博客 108

用VC写Assembly代码(3)

不知为什么,对这种编程方法越来越大越有兴趣.先写个使用参数的例子(十分简单,适用于任何懂C的人)给各位参考一下吧:#include int asm(int s){ int t=0; __asm {  mov eax, DWORD PTR [ebp+8] ;把s的值传给eax  mov t, eax     ;把eax的值传给t } printf("- %d -", t);//把T显示出来}

小发猫 2456

计算机视觉教程2-3:图解双线性插值算法&最近邻插值算法

提出此算法的背景是基于图片的缩放,在图片缩放的过程中,实质上就是将原图像像素矩阵像素值,填到目标图像像素矩阵中,目标图像像素矩阵可能比原图像像素矩阵大(图片放大),也可能小(图片缩小)。我们假设图片的宽(WidthWidthWidth)和高(HeightHeightHeight)是按同比例缩放的,那么 srcXsrcWidth=dstXdstWidth\frac{srcX}{srcWidth}= \frac{dstX}{dstWidth}srcWidthsrcX​=dstWidthdstX​ ...

FRIGIDWINTER的博客 7286

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

用VC写Assembly代码(5) --一些宏的使用(二)

目前我知道vc++ inline assembler 有这几个宏 LENGTH、SIZE、TYPE,他们使用简单,下面个个例子:void main(){ int k[10]; int a,b,c; __asm {  mov eax, LENGTH k  mov ebx, SIZE k  mov ecx, TYPE k  mov a, eax  mov b, ebx  mov c, ecx } 

小发猫 2328

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

用VC写Assembly代码(5) --字符串

是有几个朋友也喜欢这种编城方法的,前几天听我一个朋友说:"真正的高手是懂C,而不是C++",想想也是.几乎所有代码最后还是有汇编代码组成的,只是效率的问题,汇编和机器语言11对应,这使汇编可以叫机器做机器能做的所有事.所以学好汇编对任何高级语言的理解很有好处.希望编程爱好者也能学习.没事做, 写了短字符串处理的代码:#include #include int main(int ar

小发猫 2961

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

vc调用c#写的dll

转自:http://www.codeproject.com/csharp/ManagedCOM.asp   Download source - 5.21 Kb Preface COM Interoperability is the

wangsheng8888的专栏 2035

用VC写Assembly代码(5) --循环的使用(一)

如果用C语言写循环,很简单,用for,while之类的语句就可以实现,但inline assembler就有点难,刚开始有点迷失,但找了下资料,现在会用了,先看个例子吧:#include void myfun(){ printf("aaaaaaaa/n");}void main(){ __asm {  mov ecx, 10  ttttt:  push ecx  call myfun  p

小发猫 2153

用VC写Assembly代码(6)--附录1[堆和栈的区别]

堆和栈的区别一、预备知识—程序的内存分配一个由c/C++编译的程序占用的内存分为以下几个部分1、栈区(stack)— 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其操作方式类似于数据结构中的栈。2、堆区(heap) — 一般由程序员分配释放, 若程序员不释放,程序结束时可能由OS回收 。注意它与数据结构中的堆是两回事,分配方式倒是类似于链表,呵呵。3、全局区(静态区)(static)

小发猫 2491

VC6.0 编译常见错误

 VC6.0编译常见错误第一部分 语法错误1、变量没有区分大小写    例如:变量X 与x 不同;2、关键字写错   例如:void 写成了viod等,cout写成count等3、把英文符号写成了中文符号   例如:常见的错误包括单引号、双引号、分号等4、混肴了“=”与“==”的区别5、复合语句没有使用{ }6、把“x>5 && x”写成“5” 

jianbisb的专栏 1393

VC2008 下 R6030错误

REF 一个解决方法,实验通过 #pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='X86' publicKeyToken='1fc8b3b9a1e18e3b' language='*'

lcmssd 2075

VC Studio 使用技巧大全

VC Studio 使用技巧大全 2.0版本   这是我网上东抓一条西抓一条,看起来真累,再加上一些自已的心得,所以今天再次进行整理出来与大家分享!  黄森堂(vcmfc). 1.检测程序中的括号是否匹配   把光标移动到需要检测的括号(如大括号{}、方括号[]、圆括号()和尖括号 2.查看一个宏(或变量、函数)的宏定义   把光标移动到你想知道的一个宏上,就比如说最常见的DEC

沙狼的博客 853

Resolve Partial Assembly 为 Microsoft.VC90.ATL 失败。引发蓝屏

今早刚到公司,就听到同事报故障,说开机后3-5分钟就蓝屏。 还是老规矩,查看下系统日志,吓一跳。 截图如下: 这么多啊,一地的鸡皮疙瘩,进去看下。 在看下,原来如此啊。如图 原来是暴风影音在作怪,没办法,早上好事情比较多,工作要紧,只能先卸载了。 随后在网上查了一下,有人说删掉dll文件、也有人说是版...

weixin_34004750的博客 529

VC Studio 使用技巧大全 2.0版本

VC Studio 使用技巧大全 2.0版本  这是我网上东抓一条西抓一条,看起来真累,再加上一些自已的心得,所以今天再次进行整理出来与大家分享!  黄森堂(vcmfc).1.检测程序中的括号是否匹配  把光标移动到需要检测的括号(如大括号{}、方括号[]、圆括号()和尖括号2.查看一个宏(或变量、函数)的宏定义  把光标移动到你想知道的一个宏上

huntjap的专栏 744

vc7.1的编译选项-转

http://www.tekinginfo.com/coding/forum/cndevforum0209_0309/subject_31270.htm-优化-??/O1 最小化空间 minimize space /Op[-] 改善浮点数一致性 improve floating-pt consistency /O2 最大化速度 maximize speed /Os??优选代码空间??favor c

Leo's WorkShop 1126
上一篇: 用VC写Assembly代码(5) --字符串
下一篇: 用VC写Assembly代码(5) --函数调用(一)
普通网友
博客等级 码龄22年 1万+粉丝 3156原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值