C语言 中mysql_query()函数的返回值是什么?

liangchaoxi 2013-12-23 08:04:37
C语言 中mysql_query()函数 当里面执行的SELECT 语句时,返回值是什么? 我知道不是执行SELECT \SHOW 语句的时候 成功返回0 失败返回非零, 在PHP中执行SELECT \SHOW 语句的时候 成功返回的是MYSQL_RES *。请问C中十分也是? 如果不是,执行SELECT \SHOW 语句的时候,如何释放内存?
...全文
540 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ACMAIN_CHM 2013-12-23
  • 打赏
  • 举报
回复
int mysql_query(MYSQL *mysql, const char *stmt_str) 类似这类问题,其实可以直接百度,或者查看MYSQL的官方免费手册。
引用
20.9.3.51. mysql_query() int mysql_query(MYSQL *mysql, const char *stmt_str) Description Executes the SQL statement pointed to by the null-terminated string stmt_str. Normally, the string must consist of a single SQL statement and you should not add a terminating semicolon (“;”) or \g to the statement. If multiple-statement execution has been enabled, the string can contain several statements separated by semicolons. See Section 20.9.12, “C API Support for Multiple Statement Execution”. mysql_query() cannot be used for statements that contain binary data; you must use mysql_real_query() instead. (Binary data may contain the “\0” character, which mysql_query() interprets as the end of the statement string.) If you want to know whether the statement should return a result set, you can use mysql_field_count() to check for this. See Section 20.9.3.22, “mysql_field_count()”. Return Values Zero if the statement was successful. Nonzero if an error occurred. Errors CR_COMMANDS_OUT_OF_SYNC Commands were executed in an improper order. CR_SERVER_GONE_ERROR The MySQL server has gone away. CR_SERVER_LOST The connection to the server was lost during the query. CR_UNKNOWN_ERROR An unknown error occurred.
gongheguoyingpai11 2013-12-23
  • 打赏
  • 举报
回复
http://dev.mysql.com/doc/refman/5.1/zh/apis.html#mysql-query
内容概要:本文详细记录了对一个Android ARM64静态ELF文件字符串加密机制的逆向分析过程。该ELF文件的所有字符串均被加密,无法通过常规strings命令或IDA直接识别。作者通过分析发现,加密字符串存储在.rodata段,其解密所需信息(包括密文地址、长度和16位密钥)保存在.data.rel.ro段的40字节描述符。核心解密函数sub_10F408采用自反的双pass流密码算法,结合固定密钥KEY_TERM(由.data段24字节数据计算得出),实现字节级非线性、位置与长度相关的加密。文章还复现了完整的Python解密脚本,并揭示了该保护机制的本质为代码混淆而非强加密,最终成功批量解密全部956条字符串,暴露程序真实行为,如shell命令模板、设备标识篡改、网络重置等操作。此外,文还提及未启用的自定义壳框架及其反dump设计。; 适合人群:具备逆向工程基础的安全研究人员、二进制分析人员及对ELF保护技术感兴趣的开发者。; 使用场景及目标:①学习ELF二进制字符串加密的典型实现方式与逆向突破口;②掌握从结构识别、函数追踪到算法还原的完整逆向流程;③理解“绑定二进制”的完整性校验设计及其局限性;④实践编写IDAPython脚本自动化提取与解密敏感数据。; 阅读建议:此资源以实战案例驱动,不仅展示技术细节,更强调逆向思维与验证方法,建议读者结合IDA调试环境,逐步跟随文步骤进行动态分析与算法验证,深入理解每一步的推理依据。

57,064

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧