自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(72)
  • 资源 (5)
  • 收藏
  • 关注

原创 减小动态库大小及隐藏符号

gcc编译设置-fvisibility=hidden属性,则不加visibility声明的都默认为hidden(隐藏)。strip可以去除.symtab部分符号信息。

2022-09-06 10:09:14 532 1

原创 达梦数据库udf实现

官方介绍的很简单,其实有点小坑头文件引用库文件引用字符串拼接代码(函数名必须是大写,否则创建成功,调用报错【[-7095]:外部函数加载失败.】)编译生成动态库创建函数实际项目使用 注:因为c编写达梦udf走的是dmap代理(/dm/dmdbms/bin/dmap),所以首先需要启动代理。如果库依赖外部环境变量,需要在配置环境变量的控制台手工启动dmap,而不是在运行disql命令行控制台配置,否则环境变量不能正常识别。...

2022-07-05 10:26:53 1089

原创 c语言开发postgres自定义函数

#include<stdio.h>#include <stdlib.h>#include<string.h>#include "postgres.h"#include "fmgr.h"PG_MODULE_MAGIC;PG_FUNCTION_INFO_V1(decrypt_data);Datum decrypt_data(PG_FUNCTION_ARGS){ text *cipherdata = PG_GETARG_TEXT_P(0);.

2022-04-21 17:13:33 1683

原创 localtime函数影响性能

在一个业务逻辑中有存在多线程同时读写一块内存的情况,在流程设计上加了一个线程锁。后来在测试性能上通过其他方式限制了读写取消了锁,发现性能提升比较小,反复测试才发现流程中有调用localtime函数,去掉后性能有明显提升。/*获取系统当前时间(14位)*/int gettimenow(char *ctime){ struct tm *tp= NULL; time_t t; time( &t ); tp = (s...

2022-04-20 10:54:23 343 1

原创 Mac上制作通用静态库

仍以前文在Mac上编译openssl为例编译arm版本库./Configure darwin64-arm64-ccmake编译x86版本库./Configure darwin64-x86_64-ccmake合并两个版本的库lipo -create ./Arm64lib/libcrypto.a ./X8664lib/libcrypto.a -output libcrypto.alipo -create ./Arm64lib/libssl.a ./X8664lib/libss

2022-03-29 16:14:01 815

原创 m1芯片上编译arm64的openssl

配置只有darwin64-x86_64-cc,需要加上darwin64-arm64-cc。在Configurations/10-main.conf配置文件中找到darwin64-x86_64-cc配置部分在其下加入配置"darwin64-arm64-cc" => { inherit_from => [ "darwin-common", asm("aarch64_asm") ], CFLAGS => add("-Wall"), cflags

2022-03-18 15:11:07 1412 2

原创 Intel SGX线程锁

首先支持多线程,需要在config.xml文件中修改配置项//支持的线程数,应用线程数高于这个值会造成接口调用失败<TCSNum>10</TCSNum>线程头文件#include <sgx_thread.h>线程锁使用//申明sgx_thread_mutex_t sgxmut;//初始化sgx_thread_mutexattr_t unused;sgx_thread_mutex_init(&sgxmut,&unuse

2022-03-11 16:35:43 240

原创 Intel SGX开发入门

sgx定义文件*.edlenclave { /*引用外部.edl*/ from "sgx_tstdc.edl" import *; /*安全区函数接口定义*/ trusted { public int sgx_sdkinit([in,size=iplen] unsigned char *ip,size_t iplen,[in,size=portlen] unsigned char *port, size_t portlen); }; /*非安全区函数接口定义*/ untr

2022-03-07 15:55:14 713

原创 为CPropertySheet窗口添加最小化按钮

在CPropertySheet类的OnInitDialog中加入 //设置窗口名 SetWindowText("密码工具箱"); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { pSysMenu->AppendMenu(MF_STRING, SC_MINIMIZE, "最小化"); //备注的是同时打开最大化按钮 //pSysMenu->AppendMe

2021-12-23 16:02:04 212

原创 AIX由于字符集造成getBytes数据与linux不一致问题

import java.io.UnsupportedEncodingException;import java.net.InetAddress;import java.net.NetworkInterface;import java.net.UnknownHostException;import java.util.Enumeration;import java.nio.charset.Charset;import javax.xml.bind.DatatypeConverter;pub.

2021-12-15 17:59:45 1175

原创 oracle使用c语言编写自定义函数

编写sm4gcmdecrypt函数并生成动态库libmyudftest.so#使用管理员加载动态库sqlplus / as sysdbaCREATE OR REPLACE LIBRARY libmyudftest AS '$ORACLE_HOME/bin/libmyudftest.so';/grant execute on libmyudftest to testuser;#使用普通用户创建udf函数sqlplus testuser/123456create or replace

2021-11-18 09:38:44 1144

原创 ocilib库连接oracle

源码路径:https://github.com/vrogier/ocilib通过修改ocilib实现拦截oracle数据加解密功能linux下编译:cdocilib-master./configure --prefix=安装路径make && make installwindows下编译:cdocilib-master\proj\dll打开ocilib_dll_vs2019.sln编译生成ocilib-master\lib64下库文件ociliba.d..

2021-10-20 17:44:36 215

原创 AIX6.1编译openssl

AIX6.1安装包下载地址:ftp://www.oss4aix.org/latest/aix61/(上次是在AIX7.1上编译的包,发现扔在6.1上跑不了,重新编译下)//缺啥包就下载安装啥包(安装上次7.1环境的gcc一直报头文件rid_t类型找不到,所以选择重新安装gcc)rpm -ivh gcc-4.9.3-1.aix6.1.ppc.rpm --nodepsrpm -ivh libgcc-4.9.3-1.aix6.1.ppc.rpm --nodepsrpm -ivh libstdc++

2021-09-23 10:13:18 374

原创 dlopen调用动态库

/*头文件*/#include<dlfcn.h>void *handle;handle = dlopen("libKeyDerive.so",RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND);if (!handle){ return ( -1 );}/*定义库中需要调用的接口*/typedef int (*https_client_batchpost)(char *info,int infolen,char *resp);ht.

2021-08-11 10:34:21 197

原创 python中16进制数据转换字节、字符串数据丢失问题

#coding=utf-8import sysimport osimport codecsimport base64myhexstr = "5C61"print('16进制数据:' + myhexstr)mytestbytes = codecs.decode(myhexstr, "hex")print('转换后byte数据[' + str(len(mytestbytes)) +']:')print(mytestbytes)myteststr = mytestbytes.de.

2021-07-15 17:00:17 520

原创 pygame 简单的飞机大战

#coding:utf-8import osimport os.pathimport pygameimport timeimport sysimport randomfrom pygame.locals import *class MyFeiji(object): x = 0 y = 0 movex = 0 movey = 0 live = 1 def __init__(self,x,y): self.x = x self.y = yclass MyZida.

2021-07-09 10:44:44 55

原创 mac上编译openssl及使用protobuf遇到问题及解决

mac上安装软件可以通过brew install安装编译openssl报错找不到malloc.h解决方法:将报错文件中#include <malloc.h>修改为#include <sys/malloc.h>The pkg-config script could not be found or is too old”brew install pkg-configconfigure: error: Package requirements (protobuf &gt

2021-06-09 11:12:07 499 2

转载 java调用python

原文地址:java代码:PythonInterpreter interpreter = new PythonInterpreter(); interpreter.execfile("/home/ybf/PycharmProjects/first/1.py"); PyFunction func_third= (PyFunction)interpreter.get("third",PyFunction.class); PyObject pyobj = func_third.__call_

2021-06-04 16:43:37 63

原创 hp unix上编译openssl并使用

拿到手的环境perl是5.8.8,需要升级包下载地址:http://hpux.connect.org.uk/hppd/hpux/Languages/perl-5.10.1/解压后配置PATH环境变量后安装编译与其他机器一致./configmake在编译运行时遇到其他问题cc在编译是默认是32位,需要加入+DD64参数指定编译64位生产动态库命令是ld -b报各种常规函数比如strcmp等找不到,需要加入-ldl报Unsatisfied code symbol '_log'

2021-05-22 10:52:30 198

原创 AIX上安装gcc并使用

包的下载地址及安装命令:http://download.aixtools.net/gcc/aixtools.bash.4.3.33.0.aix537.Iaixtools.gmp.5.0.5.0.Iaixtools.mpfr.2.4.2.0.Iaixtools.mpc.1.0.2.0.Iaixtools.gettext.0.18.1.1.Iaixtools.gcc.4.7.4.0.aix537.Iinstallp -d . -aXc all期间遇到问题:ld:open(): A fi.

2021-05-22 10:44:10 924

原创 pykmip测试

开源路径:https://github.com/OpenKMIP创建key并加解密import sslfrom kmip.pie.client import ProxyKmipClient, enumsfrom kmip.pie import objectsclient = ProxyKmipClient( hostname='127.0.0.1', port=5696, cert='/home/nxy/PyKMIP/bin/client_cert.pem',

2021-05-14 15:25:49 509

转载 编译openssl-0.9.8e报错out range of signed 32bit displacement

md5-x86_64.s:41:Error:0xd76aa478outrangeofsigned32bitdisplacementmd5-x86_64.s:50:Error:0xe8c7b756outrangeofsigned32bitdisplacementmd5-x86_64.s:68:Error:0xc1bdceeeoutrangeofsigned32bitdisplacementmd5-x86_64.s:77:Error:0xf57c0fa...

2021-05-14 10:46:33 232

原创 python和go调用c动态库兼容linux和windows方法

python调用:import platformif platform.system() == 'Windows': SDK = cdll.LoadLibrary("./libkms_enc_sdk.dll")else: SDK = cdll.LoadLibrary("libkms_enc_sdk.so")go调用:/*#cgo CFLAGS: -I./#cgo linux LDFLAGS: -L../lib -lkms_enc_sdk#cgo windows LDFLAG

2021-04-22 10:12:00 187

原创 unicode转换utf8编码中文-c代码

#include<stdio.h>int main(){ long i =0; unsigned char tmp[4] = {0}; FILE *fp = NULL; fp = fopen("utf8.txt","w"); if (fp == NULL) { printf("open file err\n"); return (-1); } int count = 0; for (i=0x4e00;i<=0x9fa5;i++) { enc_.

2021-04-16 14:10:59 268

原创 git拉取项目失败error: The requested URL returned error: 401 Unauthorized while accessing

网上百度有多种方法解决,尝试了其中两种第一种:(指定用户/密码) git clone https://用户名:密码@xxxxxx.git第二种:(升级git版本) 升级git 版本≥1.7.10wget https://github.com/git/git/archive/v2.2.1.tar.gztar -zxvf v2.2.1.tar.gzcd git-2.2.1make configure./configuremake &&...

2021-03-03 11:17:22 702

转载 程序获取系统glibc版本号

#include<stdio.h> #include<gnu/libc-version.h> int main(void){ printf("glibc version : %s \n",gnu_get_libc_version()); printf("__GLIBC__ = %d \n",__GLIBC__); printf(".

2021-03-01 17:15:06 151

原创 rust调用so

c动态库代码cone.c:#include<stdio.h>int c_sum(int a){ int i = 0; int sum = 0; for(i=1;i<=a;i++) { sum += i; } return sum;}生成动态库:gcc cone.c -fPIC -shared -o libone.sotwo.rs代码:

2021-03-01 14:44:54 2462

原创 go grpc

#下载grpc包go get google.golang.org/grpc#下载插件go get -u github.com/golang/protobuf/protoc-gen-go#生成代码(这里需要将protoc-gen-go执行文件所在的路径配置到环境变量PATH中)protoc --go_out=plugins=grpc:. testone.proto服务端代码package mainimport ( "fmt" "log" "net" .

2021-02-04 16:30:49 126

原创 c语言grpc

安装见https://blog.csdn.net/linimbus/article/details/90720086testone.protosyntax = "proto3";package testone;service Greeter { rpc MyTestOne (HelloRequest) returns (HelloReply) {}}message HelloRequest { string name = 1;}message HelloReply {

2021-02-03 15:09:34 3815 7

原创 汇编写hello world

testone.soutput: .ascii "hello world!\n".globl mainmain: movl $4, %eax movl $1, %ebx movl $output,%ecx movl $13,%edx int $0x80 movl $1, %eax movl $0, %ebx int $0x80EAX包括.

2021-02-03 09:51:33 93

原创 OSError: [WinError 127] 找不到指定的程序

windows下使用python3调用国密改造的openssl动态库报错,使用python2都是正常的,实在挺纳闷的。后来发现是python3下的DLLs路径下也存在libssl-1_1-x64.dll和libcrypto-1_1-x64.dll库文件,将里面的文件替换为改造后的文件后运行正常。...

2021-01-19 10:12:50 8412 6

原创 python使用jinja2

模板test.html<html><head></head><body><h1>{{title}}</h1><p>My name is : {{name}}</p><p>My age is : {{age}}</p><p>My loc is : {{loc}}</p>{% for n in list %} {{n['key']}}{% en

2020-12-23 09:57:17 240

原创 vs加载多个外部库编译报函数重定义解决

1>libciphersuite.lib(sm3.obj) : error LNK2005: sm3_init 已经在 libcrypto.lib(sm3.obj) 中定义1>libciphersuite.lib(sm3.obj) : error LNK2005: sm3_update 已经在 libcrypto.lib(sm3.obj) 中定义1>libciphersuite.lib(sm3.obj) : error LNK2005: sm3_final 已经在 libcrypto.

2020-12-14 17:40:54 531

原创 go自定义包

在go的src目录下创建包路径:mytest创建mytest.gopackage mytest/*方法名首字母要大写*/func NxyTest() { fmt.Println("this is my test")}编写测试demopackage mainimport ( "fmt" "mytest")func main(){ fmt.Println("begin") mytest.NxyTest()}...

2020-12-02 09:31:23 57

原创 因为计算机中丢失MSVCR100.dll导致程序不能运行解决

windows server 2012 r2无法启动此程序,因为计算机中丢失MSVCR100.dll尝试了从其他机器拷贝MSVCR100.dll及注册dll,失败尝试了下载Microsoft的Visual C++ Redistributable for Visual Studio 2012 Update 4-vcredist_x64.exe安装,失败最后下载了Microsoft Runtimes AIO x86+x64-20180119.exe安装后成功...

2020-11-12 10:22:56 804

原创 Redhat替换Centos Yum源

删除当前系统自带的yumrpm -qa |grep yumrpm -qa|grep yum|xargs rpm -e --nodeps下载Cenots Yum源软件wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpmwget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-

2020-10-26 10:15:55 99

原创 windows下使用libcurl

curl_easy_perform返回1,unsupportedprotocol需要下载支持的libcurl(https://curl.haxx.se/windows/)curl_easy_perform返回60curl: (60) SSL certificate problem: unable to get local issuer certificateMore details here: https://curl.haxx.se/docs/sslcerts.htmlcurl ...

2020-09-22 10:18:05 287

原创 解决go get失败问题

通过设置代理Linux下export GO111MODULE=onexport GOPROXY=https://goproxy.cnWindows下set GO111MODULE=onset GOPROXY=https://goproxy.cn

2020-09-04 10:09:06 409

原创 windows下编译libevent

下载libevent-2.1.11-stable.tar.gz包并解压修改以下文件,添加宏定义在以下3个文件开头添加“#define _WIN32_WINNT 0x0500”libevent-2.0.21-stable\event_iocp.clibevent-2.0.21-stable\evthread_win32.clibevent-2.0.21-stable\listener.c添加头文件引用在minheap-internal.h,加入 #include "stdint.h"不

2020-09-01 10:23:10 167

原创 windows下将执行文件放置到后台运行

@echo offif "%1"=="h" goto beginstart mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit:beginset CS_CONFIG_PATH=D:\workplace\nxy\etcset CS_LOG_PATH=D:\workplace\nxy\logsNohup_CipherPro.exe

2020-08-26 15:30:47 264

jmeter+Standard+Extras+ServerAgent.zip

jmeter性能测试工具及监控服务器资源插件。解压JMeterPlugins-Standard-1.4.0.zip,将其中\lib\ext\JMeterPlugins-Standard.jar包复制到jmeter安装目录下的\lib\ext下,解压JMeterPlugins-Extras-1.4.0.zip,将其中\lib\ext\JMeterPlugins-Extras.jar包复制到jmeter安装目录下的\lib\ext下,ServerAgent-2.2.1.zip解压后放在需要监控的服务器上并启动startAgent.sh。

2019-11-26

coresync+pacemaker

corosync-2.4.2和pacemaker-Pacemaker-1.1.16.tar的源码安装包

2018-09-09

postgresql10.5+pgadmin3安装包

postgresql10.5源码安装包和windows下pgadmin3客户端安装包

2018-09-09

Gallery 和Visual Assist X

自己的VC缺少很多控件,输入也没有提示,不能拷回去,在公司传了先试下,能用会告诉大家的,看回复能用就可以下的哦

2010-09-19

员工信息管理系统,简单的MFC对话框工程

很简单的信息管理而已,信息只包括姓名,性别,出生日期,婚否,部门,备注,简单的增删改查功能,如有问题,纯属菜鸟之作,谅解~~

2010-09-16

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除