2015年2月2日 星期一

2015/02/02 AllSeen /AllJoyn in openwrt 12.09 with TP-Link 1043nd V1

最近開始研究 AllSeen 也就是Alljoyn.

我的測試機器為TP-Link1043nd V1 ,上面跑的OS為 openwrt 12.09的版本,
並不是原生TPLink的 OS哦!


2014年12月23日 星期二

ld: warning: cannot find entry symbol _start;

如題,今天compile一個東西,只想compile他的lib而不是整個daemon,

所以就下了 make XXXlib 這樣的指令,

實際執行起來大概像是  /usr/bin/ld hello.c -o hello.o 這樣的東西

就跑出了如標題這樣的錯誤,雖然只是一個warning 但是根本可以看做一個error,因為位置

根本全部都錯亂,所以下面一定跑出一堆undefined reference,

研究了許久

終於發現要在後面加上 -lc



/usr/bin/ld hello.c -o hello.o -lc

-lc 代表要跟compiler 說使用標準的C 函式庫

這樣終於可以過了 -.-


2014年12月15日 星期一

C++中函式輸入泛型並型態轉換為enum / In C++ function generic parameter casting to enum / casting void* to enum


在C++中不能直接cast成 enum 但在C 中可以
如以下source code 在C中可以COMPILE過 
情況類似此篇文章 typdef enum void* 的用法請益

typedef enum {
     enum1
     enum2,
     enum3}
myenum;
void myfunc(void *data)
{
    if((myenum)data==enum1)
      ...
    else if ((myenum)data==enum2)
     ...
    else
     ...
}

2014年10月28日 星期二

[LuaDec51] Compile for Ubuntu

首先先到  luadec的網站下載Luadec51的source code : http://files.luaforge.net/releases/
之後再把lua5.1版本的source code下載下來 :  http://www.lua.org/versions.html



由於luadec51會用到Lua51的LIB   (liblua.a    and  liblualib.a)
所以先進到lua5.1的資料夾中去把 Lua compile起來,
$> cd lua5.1...
$> make all

則 liblua.a   and liblualib.a 在  luadec51/src  中可以找到

之後只要自己寫個Makefile指向這兩個lib就可以compile成功並執行囉

如果對於如何寫一個Makefile有問題可以留言在底下。



2013年11月5日 星期二

[Python][suds][errno 111] 如果你用Python suds library 遇見了 errno111 的問題請進/If you using python suds library and error happen which errno is 111 , please come in

作業系統 /operating system: Fedora 17
Python :2.6

直接看code 這個問題困擾我很久,今天終於解決了!


PROBLEM CODE: 

#python code start #
from suds.client import Client

url = 'someurl?wsdl'
client = Client(url,cache=None)
print  client.service.yourfunction();


然後就會發生下面這個錯誤/ And some error cause



  File "/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/client.py", line 542, in __call__
  File "/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/client.py", line 602, in invoke
  File "/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/client.py", line 637, in send
  File "/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/transport/https.py", line 64, in send
  File "/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/transport/http.py", line 77, in send
  File "/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/transport/http.py", line 118, in u2open
  File "/usr/lib64/python2.6/urllib2.py", line 383, in open
    response = self._open(req, data)
  File "/usr/lib64/python2.6/urllib2.py", line 401, in _open
    '_open', req)
  File "/usr/lib64/python2.6/urllib2.py", line 361, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 1130, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib64/python2.6/urllib2.py", line 1105, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>


2013年11月1日 星期五

[OllyDBG][反組譯/deassembly][mirc_6.0][keygen]如何使用OllyDBG寫一個序號產生器,Writing a keygen by OllyDBG Tutorial

原文網址在此 http://www.securitytube.net/video/1078

如果網頁連結/影片失效請聯絡我。

閱讀本文請搭配上方網址的影片。
-------------------------------------------------------------------------------------------------------
最近對於反組譯 與 組合語言有點興趣,所以找了網路上的教學來看,由於是英文的所以讀者可能需要多聽幾次。

此教學為"教學 與 學習" 用,請不要拿去做商業行為。

作業系統: Windows 8 64bit
反組譯工具: OllyDBG 2.0 官方版本 no plugin
程式撰寫工具: SlickEdit 官方試用版本
GCC編譯環境: Cygwin 64bit-安裝gcc

以上大家都可以在google輕易找到

至於學習對象為mirc 版本為6.0.1,官方不提供舊版,請讀者們自己尋找。


2013年9月6日 星期五

[Java] JComboBox/ComboBox 字體顯示置中 display in the center / 在下拉式選單中顯示置中 center align the text in the comboBox

最近遇到 java combox 需要在下拉式選單中把選項的字  置中 與 顯示出來也置中  如圖












如何達成圖上這個效果

直接來看一下片段代碼