flat assembler
Message board for the users of flat assembler.
Index
> Windows > C/C++ code to FASM, help..!!! |
Author |
|
asmdemon 19 Apr 2005, 22:05
this code doesn't execute. try putting it into the exported function:
Code: proc winampGetGeneralPurposePlugin mov [plugin.version],10h mov [plugin.description], Deskripsi mov [plugin.lpInit], init mov [plugin.lpConfig], config mov [plugin.lpQuit], quit mov [plugin.WinAmpHwnd], 0 mov [plugin.hDllInstance], 0 mov eax, plugin ret endp second, does the c++ code work when compiled?? _________________ It is better to be on the right side of the devil than in his path. |
|||
19 Apr 2005, 22:05 |
|
senolc_eht 20 Apr 2005, 17:10
Thanks for the help, but its still doesn't work (the dll is compiled, but still doesn't attact to winamp).
are there any deferent between dll that compiled with FASM and VC++..? and the c++ code is work (I compile it and it attact to winamp), this code i get from winamp forum (empty plugin SDK). and was a forget to attact the "gen_empty.h" this "gen_empty.h" code: Code: #ifndef gen_empty_h #define gen_empty_h #include <windows.h> typedef struct { int version; char *description; int (*init)(); void (*config)(); void (*quit)(); HWND hwndParent; HINSTANCE hDllInstance; } winampGeneralPurposePlugin; #define GPPHDR_VER 0x10 extern winampGeneralPurposePlugin *gen_plugins[256]; typedef winampGeneralPurposePlugin * (*winampGeneralPurposePluginGetter)(); #endif can any body help.... My regard Senolc_eht _________________ sorry if i always asking..... |
|||
20 Apr 2005, 17:10 |
|
madmatt 20 Apr 2005, 21:31
some things to try:
First, put the code below into your DllEntryPoint function, before the mov eax, TRUE:return Code: mov [plugin.version],10h mov [plugin.description], Deskripsi mov [plugin.lpInit], init mov [plugin.lpConfig], config mov [plugin.lpQuit], quit mov [plugin.WinAmpHwnd], 0 mov [plugin.hDllInstance], 0 Second, try using the cproc macro instead of the proc macro, and you may have to export the three other functions as well: init, config, quit Third, put this line at the end of your dll code, after the export Code: section '.reloc' fixups data discardable MadMatt |
|||
20 Apr 2005, 21:31 |
|
Torrey 21 Apr 2005, 04:27
With this code below I got some action out of winamp:
Code: format PE GUI 4.0 DLL entry DllEntryPoint include 'win32a.inc' section '.data' data readable writeable struct winampGeneralPurposePlugin .version dd ? .description dd ? .lpInit dd ?;offset init .lpConfig dd ?; offset Config .lpQuit dd ?;offset Quit .WinAmpHwnd dd ?; dd ? .hDllInstance dd ?;HINSTANCE ; ends Deskripsi db 'MyEmpyProject vx.x (gen_empty.dll)', 0 caption db 'win32asm fasm',0 plugin winampGeneralPurposePlugin configdesk db 'config',0 initdesk db 'init',0 quitdesk db 'quit',0 section '.code' code readable executable proc DllEntryPoint, hinstDLL,fdwReason,lpvReserved mov eax,TRUE return endp proc winampGetGeneralPurposePlugin enter mov [plugin.version],10h mov [plugin.description], Deskripsi mov [plugin.lpInit], init mov [plugin.lpConfig], config mov [plugin.lpQuit], quit mov [plugin.WinAmpHwnd], 0 mov [plugin.hDllInstance], 0 mov eax, plugin return endp proc init enter invoke MessageBox,HWND_DESKTOP,initdesk,caption,MB_OK return endp proc config enter invoke MessageBox,HWND_DESKTOP,configdesk,caption,MB_OK return endp proc quit enter invoke MessageBox,HWND_DESKTOP,quitdesk,caption,MB_OK return endp section '.idata' import data readable writeable library user,'USER32.DLL' import user,\ MessageBox,'MessageBoxA' section '.edata' export data readable export 'winamp2.DLL',\ winampGetGeneralPurposePlugin, 'winampGetGeneralPurposePlugin' section '.reloc' fixups data discardable |
|||
21 Apr 2005, 04:27 |
|
senolc_eht 21 Apr 2005, 15:13
Thank for the help, but in my opinion the wrong is in the converting this code
Code: winampGeneralPurposePlugin plugin = { GPPHDR_VER, "MyEmpyProject vx.x (gen_empty.dll)", // Plug-in description init, config, quit, }; is this really give same effect with this code in fasm Code: mov [plugin.version],10h mov [plugin.description], Deskripsi mov [plugin.lpInit], init mov [plugin.lpConfig], config mov [plugin.lpQuit], quit mov [plugin.WinAmpHwnd], 0 mov [plugin.hDllInstance], 0 i search in the net and found in Iczelion website (win32assembly.online.fr) an example (in masm, i guess) that attact, but it still have code like this (in data.inc) Code: plugin winampGeneralPurposePlugin <IN_VER,\ offset szPluginDescription,\ offset init,\ offset config,\ offset quit,\ 0,\ ; main window - winamp window 0> ;dll hInstance before and after thanks for the help, you all have a good work my regard Senolc_eht ps. i never try the masm code (don't have masm compiler), and Torrey (Sir, Mr, or...? what should i call u? ) can you give my the compiled dll, (couse it's doesn't work yet in my Winamp, thanks) btw, i use winamp v5.03a (x86) -mar 26 2004 and use FASM v1.60
_________________ sorry if i always asking..... |
|||||||||||
21 Apr 2005, 15:13 |
|
Torrey 22 Apr 2005, 04:19
So far it's a boring night at work, so I think I will reverse and recode gen_tray.dll in the plugins directory of winamp so you have a fasm source so you have an example to look at. Shouldn't take me too long.
|
||||||||||
22 Apr 2005, 04:19 |
|
senolc_eht 22 Apr 2005, 12:12
Good work, can i have the code , so i can configure what wrong with me (not my code ) , Thanks
my regard Senolc_Eht _________________ sorry if i always asking..... |
|||
22 Apr 2005, 12:12 |
|
Torrey 25 Apr 2005, 07:44
I attached below the simple source code for the winamp plugin that displays the message boxes at initialize, config, and quit that you were trying to get working at the beginning.
[edit] Also remember that after your init proc has executed EAX needs to equal zero, an easy xor eax,eax takes care of that before you return.
|
|||||||||||
25 Apr 2005, 07:44 |
|
senolc_eht 28 Apr 2005, 07:33
Thanks you Torrey, now i Know if fasm can do that kind things
a new lesson for me, it's make some thing easier.. my regard Senolc_eht _________________ sorry if i always asking..... |
|||
28 Apr 2005, 07:33 |
|
Torrey 28 Apr 2005, 08:10
FASM's only limitation is your imagination. The more creative the person, the more creative the code, but that's just my own opinion.
|
|||
28 Apr 2005, 08:10 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.