flat assembler
Message board for the users of flat assembler.

Index > Main > fasm bug

Author
Thread Post new topic Reply to topic
skykrnl



Joined: 17 Nov 2008
Posts: 21
skykrnl 20 Nov 2008, 15:05
Code:
format pe dll
entry DllEntry
include 'Win32AXP.inc'

CallTest:
  ret
CallTest% = 5

proc DllEntry, hModule, ul_reason_for_call, lpReserved
  stdcall CallTest,1,2,3
      mov     eax,TRUE
    ret
endp

ExportApi01:
 ret

ExportApi02:
 ret

ExportApi03:
 ret

ExportApi04:
 ret

ExportApi05:
 ret




data export
  export  'ept',\
          ExportApi01, 3,\
           ExportApi02, 'ExportApi02',\
             ExportApi03, 7,\
           ExportApi04, 1,\
           ExportApi05, 'ExportApi05'
end data
    


bug 1:
stdcall CallTest,1,2,3 (fasm 1.67.29 bug)
bug 2:
Pe File ExportTable
NumberOfFunctions == NumberOfNames
Thank!
Post 20 Nov 2008, 15:05
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 20 Nov 2008, 15:16
CallTest% = 5
- what is this?
+++++++++++++++++++
set it:
CallTest% = 3
- helps
Post 20 Nov 2008, 15:16
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20303
Location: In your JS exploiting you and your system
revolution 20 Nov 2008, 15:23
These would appear to affect only the macros in the Windows download.

What is bug 1? You are calling CallTest with 3 parameters but you have defined it as needing 5 parameters? Also you don't properly restore the stack in the callTest function.
Post 20 Nov 2008, 15:23
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 20 Nov 2008, 15:27
As for 2, is this code trying to define ordinal values for some of the exports? The "export" macro was not designed for such purpose, those numbers are treated just as single-codepoint names.
Post 20 Nov 2008, 15:27
View user's profile Send private message Visit poster's website Reply with quote
skykrnl



Joined: 17 Nov 2008
Posts: 21
skykrnl 20 Nov 2008, 16:43
revolution wrote:
These would appear to affect only the macros in the Windows download.

What is bug 1? You are calling CallTest with 3 parameters but you have defined it as needing 5 parameters? Also you don't properly restore the stack in the callTest function.


include 'Win32AXP.inc'

invoke CreateFile,0 (fasm 1.67.29)
Post 20 Nov 2008, 16:43
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20303
Location: In your JS exploiting you and your system
revolution 20 Nov 2008, 17:05
skykrnl wrote:
include 'Win32AXP.inc'

invoke CreateFile,0 (fasm 1.67.29)
Are you saying this is a bug? CreateFile needs seven parameters to do it's thing, you gave only one.

If you don't want the macros to check for the parameter count then don't put the P, just use win32ax.inc.
Post 20 Nov 2008, 17:05
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 20 Nov 2008, 18:04
Perhaps he means that fasm crash when it tries to display "Error: invalid count of parameters for CallTest."? It is quite possible because silent updates are too silent to be noticed Smile

PS: I've just checked his code with the bugged display_directive and yes it crash so probably he meant this bug: http://board.flatassembler.net/topic.php?t=9434
Post 20 Nov 2008, 18:04
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.