편집 :js-ctypes에서 dll 사용하기 mozilla add-on sdk - 프로그램의 STDOUT을 보시겠습니까? 나는 DLL이 잘못된 내장했기 때문에
나는 DLL을 구축하고, 나는 DLL에dumpbin /exports
명령을 할 경우 내가 다음을 참조
:
Dump of file stun_driver.dll
File Type: DLL
Section contains the following exports for stun_driver.dll
00000000 characteristics
546E6C63 time date stamp Thu Nov 20 17:34:11 2014
0.00 version
1 ordinal base
4 number of functions
4 number of names
ordinal hint RVA name
1 0 00001005 OPENSSL_Applink = @ILT+0(_OPENSSL_Applink)
2 1 00001320 launch_stun = @ILT+795(_launch_stun)
3 2 000011D6 stop_stun = @ILT+465(_stop_stun)
4 3 00001078 test_print = @ILT+115(_test_print)
Summary
1A000 .data
2000 .idata
46000 .rdata
F000 .reloc
135000 .text
은 "test_print을 실행하기위한 내 코드 "기능은 다음과 같다 :
이/* import js-ctypes */
Cu.import("resource://gre/modules/ctypes.jsm")
var stun_driver = ctypes.open("C:\\stun_driver.dll");
const test_print = stun_driver.declare("test_print", ctypes.default_abi, ctypes.int32_t);
.
.
.//in a button
test_print();
그래서 제 질문은 내 test_print()
어디 텍스트가 가는가하는 printf("Hello World")
을하고있는 경우? 내 브라우저 콘솔이나 dos 콘솔에 기록되지 않는 것 같습니다. "cfx run"을 실행하고 있습니다.
이 주제에 대한 좋은 주제 : https://ask.mozilla.org/question/1086/x11-getting-output-of-nsiprocess/?answer=1116#post-id-1116 – Noitidart
Hrmm. 공유 라이브러리에서 메소드를 실행하는 것과는 대조적으로, 추가 기능에서 쉘 명령을 실행하는 것에 대해 이야기하는 것 같습니다 - 아니면 제가 잘못 생각합니까? – Derek
당신 말이 맞아요. DLL의 출력을 얻으려면 쉘을 사용하여 실행 한 다음 쉘의 출력을 얻어야합니다. subprocess.jsm을 확인하십시오. – Noitidart