flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vbVeryBeginner 04 Apr 2005, 06:55
hi,
anybody have any samples regarding above? |
|||
![]() |
|
JohnFound 04 Apr 2005, 08:50
Well, I suppose FASM generated .dll is exactly the same as any other .dll (only smaller and faster.
![]() Regards |
|||
![]() |
|
vbVeryBeginner 04 Apr 2005, 12:19
i am stupid, just realized where goes wrong after the post
![]() Code: Private Declare Function DllVersion Lib "E:\Ln\ln2.dll" () As Long Private Sub Command1_Click() Call DllVersion End Sub Code: section ".code" code readable executable proc DllMain, dllH, fdwReason, lpvReserved push [dllH] pop [insH] mov eax,TRUE return endp proc DllVersion invoke MessageBox,NULL,[addrMsg],[addrTitle],MB_OK return endp sincerely, sulaiman chang |
|||
![]() |
|
vbVeryBeginner 04 Apr 2005, 12:20
now, i am thinking to use the VB GUI feature to do the application interface and set those event to call on the DLL which is assembled by FASM
![]() i am going to link with the SQLITE3.DLL ![]() |
|||
![]() |
|
vbVeryBeginner 04 Apr 2005, 12:49
it seems it is pretty easy to link both of them
![]() Code: proc SetMessage, addrMsgNew push [addrMsgNew] pop [addrMsg] return endp Code: Private Declare Function SetMessage Lib "E:\Ln\ln2.dll" (ByVal addrMsgNew As Any) As Long Private Sub Command2_Click() Dim newMessage As String newMessage = "Please shut down your computer." & vbCrLf & "How about an automatically shutdown?" SetMessage (newMessage) End Sub let see, what we could do next ![]() |
|||
![]() |
|
vbVeryBeginner 04 Apr 2005, 16:41
well, a little bit small app for testing purpose
let see ![]() i could see there is some potential to code like this ![]() how about a FASM dll file that ease people to use Windows API ![]() eg. get_windows_minor_version and they got the minor version ![]() Code: Private Declare Function DllVersion Lib "E:\Ln\ln2.dll" () As Long Private Declare Function GetWindowsVersion Lib "E:\Ln\ln2.dll" () As Long Private Declare Function SetMessage Lib "E:\Ln\ln2.dll" (ByVal addrMsgNew As Any) As Long Private Declare Function CurrentMessage Lib "E:\Ln\ln2.dll" (ByVal addrMsgNew As Any) As Long Private Declare Sub SetHandle Lib "E:\Ln\ln2.dll" (ByVal handle As Long) Private Sub Command1_Click() Call DllVersion End Sub Private Sub Command2_Click() Dim newMessage As String newMessage = "Set Message." & vbCrLf & "How about an automatically shutdown?" SetMessage (newMessage) End Sub Private Sub Command3_Click() Dim msg As String * 12 CurrentMessage (msg) Text1.Text = msg End Sub Private Sub Command4_Click() Dim minorVersion As Long Dim os As String minorVersion = GetWindowsVersion Select Case minorVersion Case 1 os = "Windows XP" Case 2 os = "Windows Server 2003" Case 10 os = "Windows 98" Case 51 os = "Windows 3.51" Case 90 os = "Windows ME" Case Else os = "Windows 2000 or Windows NT 4.0 or Windows 95" End Select Text2.Text = os End Sub Private Sub Form_Load() SetHandle (Me.hWnd) End Sub Code: format PE GUI 4.0 DLL entry DllMain include "%fasminc%\win32a.inc" section ".data" data readable writeable insH dd ? ; handle for instance boxMsg db "Version = 1.0.",0 boxTitle db "My Windows XP",0 buf rb 0xFF db 0 f1 db "%s",0 osVersion OSVERSIONINFO appH dd ? section ".sdata" readable writeable shareable addrMsg dd boxMsg addrTitle dd boxTitle section ".code" code readable executable proc DllMain, dllH, fdwReason, lpvReserved push [dllH] pop [insH] mov eax,TRUE return endp proc SetHandle,handle push [handle] pop [appH] return endp proc DllVersion push boxMsg pop [addrMsg] invoke MessageBox,[appH],[addrMsg],[addrTitle],MB_OK return endp proc SetMessage, addrMsgNew push [addrMsgNew] pop [addrMsg] return endp proc CurrentMessage, addrMsgNew invoke lstrlen,[addrMsgNew] invoke wsprintf,[addrMsgNew],f1,[addrMsg] return endp proc GetWindowsVersion mov [osVersion.dwOSVersionInfoSize], sizeof.OSVERSIONINFO invoke GetVersionEx,osVersion mov eax,[osVersion.dwMinorVersion] return endp section ".idata" import data readable library \ kernel32, "KERNEL32.DLL",\ user32, "USER32.DLL" include "%fasminc%\apia\Kernel32.inc" include "%fasminc%\apia\User32.inc" section ".edata" export data readable export "LN2.DLL",\ DllVersion, "DllVersion",\ SetMessage, "SetMessage",\ CurrentMessage, "CurrentMessage",\ GetWindowsVersion, "GetWindowsVersion",\ SetHandle, "SetHandle" section ".reloc" fixups data discardable ![]() sincerely, sulaiman chang |
|||
![]() |
|
r22 06 Apr 2005, 00:28
It's easier for fASM and VB to interact than it is for fASM and C++ that's irony!
![]() |
|||
![]() |
|
vbVeryBeginner 06 Apr 2005, 02:14
does it shows VB is a bit superior than C++ when it comes to "interacting"
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.