首页 \ 问答 \ 我如何使用xdebug跟踪我的卷曲(How can I track my curl with xdebug)

我如何使用xdebug跟踪我的卷曲(How can I track my curl with xdebug)

我试图用崇高的Xdebug,这是工作。 我想跟踪我的卷曲代码,例如:

我打开了一个URL http://localhost:8001/test/show ,这是我在test.php文件中的断点,它是可行的。 在test.php我使用curl来调用http://localhost:8002/api/show并且我想在api.php文件中添加断点,但它不适用于api.php 。 我该怎么做? 谢谢。


I had tried to use Xdebug with sublime, it's work. And I want to track my curl code, for example:

I opened a URL http://localhost:8001/test/show, my breakpoint at the test.php file, it's work. And in the test.php I use curl to call http://localhost:8002/api/show and I want to add the breakpoint at api.php file, but it does not work on the api.php. How can I do it? thanks.


原文:https://stackoverflow.com/questions/33953859
更新时间:2023-06-03 19:06

最满意答案

那么,你可以尝试:

#define system DontEvenThinkAboutUsingThisFunction
#define exec   OrThisOneYouClown

在一个头文件中,但我非常确定任何值得他们的盐的代码猴可以绕过这样的“保护”。

我有兴趣了解为什么你认为这是必要的(如果我们更好地理解问题,可能会有更好的解决方案)。

唯一想到的是,你想提供一些类似于Euler项目的在线编译器/ runner。 如果是这样的话,那么你可以搜索字符串system<whitespace>(的代码system<whitespace>(作为一个选项,但即使如此,一个确定的派对可能只是:

#define InoccuousFunction system

绕过你的防御。

如果是这样的话,你可能要考虑使用类似chroot东西,这样任何人都无法访问任何危险的二进制文件,如shutdown (并且该特定的野兽不应该由普通用户真正运行) - 在换句话说,限制他们的环境,使他们唯一可以看到的东西是gcc和它的亲属。

你需要做适当的沙盒,因为即使你以某种方式阻止他们运行外部程序,他们仍然可以做一些危险的事情,比如overwite文件或者打开套接字连接到他们自己的盒子,通过你的珍贵信息的内容发送。


Well, you could try:

#define system DontEvenThinkAboutUsingThisFunction
#define exec   OrThisOneYouClown

in a header file but I'm pretty certain any code monkey worth their salt could bypass such a "protection".

I'd be interested in understanding why you thought this was necessary (there may be a better solution if we understood the problem better).

The only thing that comes to mind is that you want to provide some online compiler/runner akin to the Euler project. If that was the case, then you could search the code for the string system<whitespace>( as an option but, even then, a determined party could just:

#define InoccuousFunction system

to get around your defenses.

If that is the case, you might want to think about using something like chroot so that no-one can even get access to any dangerous binaries like shutdown (and that particular beast shouldn't really be runnable by a regular user anyway) - in other words, restrict their environment so that the only things they can even see are gcc and its kin.

You need to do proper sandboxing since, even if you somehow prevented them from running external programs, they may still be able to do dangerous things like overwite files or open up socket connections to their own box to send through the contents of your precious information.

相关问答

更多
  • 看这个 HDC hDC = GetDC(g_hWnd); LPRECT rect = (LPRECT)malloc(sizeof(RECT)); GetWindowRect(g_hWnd,rect); int h = rect->right - rect->left; int w = rect->bottom - rect->top; LPRECT rect = (LPRECT)malloc(sizeof(RECT)); GetWindowRect(g_hWnd,rect); HBITMAP ...
  • 它是原始的ANSI C之前的版本,如K&R1(Kernighan和Ritchie的“C编程语言”的原始版本所示。所谓的“原始”或前ANSI C编译器使用了这种语法。一些现代编译器可以被调用,所以他们将使用命令行选项接受这种类型的代码。 从那以后,C已经发展了很长的路,但是你仍然会在较旧的程序中遇到它。 It's original pre-ANSI C, like shown in K&R1 (the original edition of "The C Programming Language" by Ke ...
  • Delphi(以及之前的Turbo Pascal,IIRC)一直有使用T前缀类型的自定义,如TStringList , TButton , TCustomForm , TDateTime等。 您可以在Windows.pas单元中找到为您声明的TTextMetric (和TPaintStruct ),以及许多标准的WinAPI函数。 ( WinTypes , WinTypes已被弃用。对于16位应用程序来说,它是Delphi 1的旧版遗留物,在Delphi的更高版本中会被Windows自动替换。) Delph ...
  • 最简单的机制是创建一个pascal Static Library并将其包含在Objective-C iOS项目中,否则你必须将构建过程集成到xcode环境中; 这是一个更多的工作,而不是通过标题暴露API,然后链接到.a文件。 The simplest mechanism is to create a pascal Static Library and include it in the Objective-C iOS project, otherwise you would have to integra ...
  • 您将在此Lazarus论坛主题和此处找到一些不同的解决方案。 You will find a few different solutions in this Lazarus forum thread and here.
  • 你不能直接和便携地从Pascal调用C ++方法。 如果您的回调函数是C ++对象,请忘记它。 否则填充TMethod对象并将其转换为正确的“对象过程”声明。 不要忘记调用约定。 对于更奇怪的解决方案,您可能需要查看(RemObjects')Pascalscript。 Ps这是相同的,你甚至无法从另一个C ++编译器可靠地调用C ++方法。 它不是Pascal vs C ++本身。 You cannot directly and portably call a C++ method from Pascal. ...
  • 我认为你混合动态数组和开放数组。 其中措词相同,但在不同的情况下。 http://rvelthuis.de/articles/articles-openarr.html 尝试这个: type TPAnsiCharDynArray = array of PAnsiChar; function callPluginFunction(plugin, method: PAnsiChar; synchronous :boolean; param: array of PAnsiChar; ...
  • 好吧,这样的事情? int compare(unsigned char *pascal, unsigned char *str, unsigned int strLength) { unsigned int length = pascal[0];// get length of pascal string if(length != strLength) return 0; // if strings have different length no need to compa ...
  • 在评论中,您提到将counter.c编译为名为a.out的可执行文件。 如果未向编译器显式提供输出名称,那么这是缺省可执行文件名。 因此,如果您同时编译counter.c和main.c ,则只有其中一个是a.out 。 您可以为gcc提供一个选项,命名您的可执行文件与默认值不同: gcc -o counter counter.c 另外,你对execl的调用并不完全正确。 第一个参数是可执行文件的路径,但其余参数将变为argv[0] , argv[1]等。因此,您真的想以这种方式调用execl : ...
  • 那么,你可以尝试: #define system DontEvenThinkAboutUsingThisFunction #define exec OrThisOneYouClown 在一个头文件中,但我非常确定任何值得他们的盐的代码猴可以绕过这样的“保护”。 我有兴趣了解为什么你认为这是必要的(如果我们更好地理解问题,可能会有更好的解决方案)。 唯一想到的是,你想提供一些类似于Euler项目的在线编译器/ runner。 如果是这样的话,那么你可以搜索字符串system(的代 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。