VC++6.0调试篇:远程调试续--DLL篇

VC++开发简单DLL并调用 win7, vc6; 新建一个win32 动态链接库工程;名为 dlltest; 空工程 ; 添加Cpp和h文件; #include "test.h" int iadd(int x, int y) { return x + y; } #ifndef LIB_H #define LIB_H extern "C" int __declspec(dllexport) iadd(int x, int y); #endif 然后生成一下工程; 新建一个MFC 单文档工程; ... 阅读详情

        在上一篇文章中提到exe的远程调试后,有人问怎么远程调试动态库,所以再发个远程调试的续篇补充一下。

 

        基本流程还是一样的,只不过调试动态库的话,除了需要动态库本身外,还需要调用该动态库的执行程序。这里假设要调试的动态库为TestDLL.dll,其中导出一个函数int Add(int a, int b);在可执行程序TestCSDN.exe中会调用TestDll中的Add函数。

 

        调试步骤如下:

        1.在编译完动态库TestDll.dll和可执行程序TestCSDN.exe之后,将这俩复制到目标机器上,比如目标机器的D:/DebugEasy/RemoteDebugDll目录下。

       

        2.设置好本机和目标机器的远程调试选项

        参见前一篇blog: VC++6.0调试篇:远程调试http://blog.csdn.net/coding_hello/archive/2008/11/23/3357384.aspx

 

        3.在本机打开TestDll工程,在Build --> Project and Setting菜单中作设置:

       

本机远程调试动态库

 

        上面是本机中TestCSDN.exe所在的位置,下面是远程目标机器上程序所在的位置。注意,这里都是设置的可执行文件的名字,而不是我们要调试的动态库的名字。

 

        4.点OK后,在Add函数中打个断点,然后按F5开始调试。会提示要定位动态库位置,第一个一般是NTDLL.dll,如图:

Host_For_Dll_Symbol

        如果我们是调试EXE,那么去掉"Try to locate other DLLs"选项,点OK就行了。但是我们这次的目标是调试TestDLL.dll,所以请有点耐心,直接点OK。可能有很多,直到看到你想要的:

Host_For_TargetDll_Symbol

看到没,提示要目标机器上的Testdll.dll文件在本机中的位置,点Browse,选中本机中的位置:

Locate_Local_Module

找到本机中的位置后,点"打开",剩下的DLL就都忽略吧,信息已经足够了。F5之~

 

        6.守得云开见月明:

Debug_In_DLL

        断点生效了噢,都能看到变量a的值是100了。

 

        嗯,过程应该比较清楚了吧,bless~~

远程调用DLL函数 进程A调用进程B中某一个DLL中的函数. Debug Code. 代码来源 http://www.cnblogs.com/BeginGame/archive/2011/08/20/2147440.html 感谢作者的分享. 立即下载

相关推荐

Dll远程调用说明

dll远程调用用于平台调用用户自定义dll.由于业务流程采用脚本方式加 载,脚本的功能和灵活性不是很强,故提供一套dll远程调用机制,供用户来处 理比较复杂或者计算操作比较繁琐的功能

DLL的远程注入技术

转载自: http://blog.csdn.net/bai_bzl/article/details/1801023   一、DLL注入 DLL的远程注入技术是目前Win32病毒广泛使用的一种技术。使用这种技术的病毒体通常位于一个DLL中,在系统启动的时候,一个EXE程序会将这个DLL加载至某些系统进程(如Explorer.exe)中运行。 这样一来,普通的进程管理器就很难发现这种病毒了,而

chenyujing1234的专栏 2万+

单细胞测序数据分析——细胞通讯 CellChat

cellchat

G2530051386的博客 1万+

【Windows核心编程学习笔记】远程注入DLL

远程注入DLL 一、概述 为了隐藏自身的进程信息,我们希望将进程作为一个合法进程的线程运行。由于系统进程间不允许直接操作资源,因而我们需要在合法进程内部创建一个线程,为其指定要执行的代码。一种简单的方式是令远程线程载入一个我们编写的DLL,通过DllMain()函数执行我们需要的代码。基本思路是将LoadLibrary()函数作为一个线程函数来调用: CreateRemoteThread()

我是guyue,guyue就是我O(∩_∩)O 1050

QWEN 2.5模型结构解析与代码解读

对Qwen2.5大模型的代码进行研究

4372

Vscode远程免密连接Linux虚拟机,并配置C/C++运行环境

目前想要深入学习在Linux,也为了方便编写C/C++程序。Linux的环境里一般自带有c++的编译环境,如果没有安装gcc和g++等编译器也比较便利。但是在虚拟机里用vim编写C++程序又不得劲,因此打算使用vscode远程连接Linux虚拟机进行学习。为了防止自己以后还要再配置,重复踩坑,因此写下这篇博客用做记录。环境:windows11、VMware17、rocky linux9.1 ( 开源的CentOS9 )

m0_56779872的博客 8691

VC6中的DLL调试

其实VC6中的DLL调试也不是太难的, 只是有时莫名其妙的不能进DLL里面的断点. 这里记录一下 1. 创建DLL工程 // TTTTDDD.cpp : Defines the entry point for the DLL application. #include "s

cay22的专栏 2800

嵌入式系统存储体系

主要分为三种:高速缓存(cache)、主存和外存。

weixin_43586667的博客 2270

在VC中调用BCB编写的标准DLL函数库

在VC6中调用BCB6编写的DLL函数库,是完全可能的。但是调用的时候,要注意导入库的格式不兼容。需要做一点修改。 (1)C++builder中声明函数原型为: extern "C" __declspec(dllimport) bool __stdcall Open(const char *xktype,char* devCom , char* szSetup); (2)编译生成DLL文

chinayu2007的专栏 1312

Unity中基于SkinMeshRenderer的骨骼动画换装系统优化实践

本文深入探讨了Unity中基于SkinnedMeshRenderer的骨骼动画换装系统优化实践。针对换装卡顿、显示错误等常见问题,文章剖析了SkinnedMeshRenderer的核心数据原理,对比了“数据替换”与“实体替换”两种主流方案的性能差异,并详细阐述了通过骨骼字典缓存、对象池管理、材质合并与Draw Call优化等实战技巧,构建高性能、高稳定性的生产级换装系统。

weixin_29008055的博客 319

1.4 点云数据获取方式——结构光相机

与此同时,利用相机从特定角度捕捉变形后的图案,基于三角测量原理,通过精确计算相机与投影仪之间的几何关系以及图案的变形程度,就能准确计算出物体表面各点的三维坐标,从而获取高精度的三维点云数据。在高端制造业中,对于微小零部件的尺寸测量和缺陷检测,结构光相机能够提供极其精确的数据,确保产品质量符合严格的标准。时序编码:这类相机通过序列投射多幅不同图案,如格雷码、相移条纹等,通过对这一系列图案的时间序列进行解码分析,就能够获取亚像素级精度的三维信息,其单点误差能够控制在≤0.1mm,展现出极高的测量精度。

qq625924821的博客 926

VC++6.0调试篇:远程调试收藏

 VC++6.0调试篇:远程调试收藏   VC开发环境之所以提供远程调试的能力,是因为有些情况下单机调试会让你崩溃掉。。。比如,调试GUI程序的WM_PAINT消息,因为要单步调试,所以调试器会对界面的重绘产生副作用(Heisenberg不确定性原理)。当然还有些别的情况也适用,比如程序在测试环境运行的好好的,但是在客户那行为总是异常,这时候如果可以TCP远程连接上去维护的话,就能通过

AZHANG00000的专栏 887

Altium Designer 超详细入门教程

本文是一份Altium Designer新手入门教程,详细介绍了从软件基础到PCB制版的全流程。主要内容包括:软件界面介绍与工程创建方法;原理图设计中的元件放置、电气连线、标注添加等操作;PCB设计的布局布线、铺铜和DRC检查;Gerber和钻孔文件的导出方法。教程还提供了分类整理的实用快捷键表和新手避坑指南,强调原理图编译和DRC检查的重要性。通过本教程,新手可以快速掌握AD基本操作,完成简单电路板的设计与制版文件导出。

学习中...... 892

VC++6.0调试篇:远程调试

<br /> VC++6.0调试篇:远程调试<br />         VC开发环境之所以提供远程调试的能力,是因为有些情况下单机调试会让你崩溃掉。。。比如,调试GUI程序的WM_PAINT消息,因为要单步调试,所以调试器会对界面的重绘产生副作用(Heisenberg不确定性原理)。当然还有些别的情况也适用,比如程序在测试环境运行的好好的,但是在客户那行为总是异常,这时候如果可以TCP远程连接上去维护的话,就能通过远程调试的特性在出现状况的系统环境中排错~<br /> <br />        下面来说

Augusdi的专栏 1391

2、微软 Power Automate 入门指南

本文是一篇关于微软 Power Automate 的入门指南,详细介绍了 Power Automate 的基本概念、相关术语、登录方式以及如何创建一个简单的自动化流。文章还探讨了 Power Automate 在业务流程中的应用场景和优势,并展望了其高级功能和未来发展。适合希望快速入门 Power Automate 并提升业务自动化效率的读者。

corn8的博客 451

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

VC++6.0远程调试(亲试成功)

0 前言   VS2008及以上远程调试上篇已经讲过,这里再讲下VC++6.0开发环境下的远程调试能力,仅需下面4步即可,更方便的就接着后面的5-6步。   因为目标程序需要在有采集卡等相关硬件支持下的工控机上工作,工控机上面一般没有调试环境也不会放置源代码(出于保密)。假如工控机上的目标程序运行中出了问题,就需要有调试环境却无法安装采集卡等硬件的笔记本上进行远程调试。 1 远程调试条件   1....

weixin_34318272的博客 315

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

深度学习工具包 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++6.0远程调试(亲试成功)[转]

VS2008及以上远程调试上篇已经讲过,这里再讲下VC++6.0开发环境下的远程调试能力,仅需下面4步即可,更方便的就接着后面的5-6步。因为目标程序需要在有采集卡等相关硬件支持下的工控机上工作,工控机上面一般没有调试环境也不会放置源代码(出于保密)。假如工控机上的目标程序运行中出了问题,就需要有调试环境却无法安装采集卡等硬件的笔记本上进行远程调试。

u010551008的博客 195

远程调试续--DLL篇

在上一篇文章中提到exe的远程调试后,有人问怎么远程调试动态库,所以再发个远程调试的续篇补充一下。           基本流程还是一样的,只不过调试动态库的话,除了需要动态库本身外,还需要调用该动态库的执行程序。这里假设要调试的动态库为TestDLL.dll,其中导出一个函数int Add(int a, int b);在可执行程序TestCSDN.exe中会调用TestDll中的Add函数。

dongyewolong的专栏 498

VC++6.0远程调试

先明确下概念,远程调试嘛,自然是两个机器之间调试。程序运行在目标机器上,调试器运行在本机。当然,目标机器上还是要有少许辅助程序才能跟本机的调试器connect上,以便通讯。一般来说,只需要copy四个文件到目标机器上就行了:MSVCMON.EXE、DM.DLL、TLN0T.DLL和MSDIS110.DLL。这四个文件都能在VC6目录的Common/MSDEV98/Bin目录下面找到。copy过去之

dsc的专栏 1048
上一篇: VC++6.0调试篇:远程调试
下一篇: VC++6.0调试篇:定位临界区(critical section)导致的死锁
野男孩
博客等级 码龄21年 451粉丝 28原创
评论 20
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值