Author Topic: MASM64....  (Read 12716 times)

0 Members and 1 Guest are viewing this topic.

gerard

  • Guest
MASM64....
« on: 2005-10-25 12:15:35 »
It is about MASM64 or better tell GoASm....

You will find an example in the zip file...

http://pageperso.aol.fr/chapillong/MASM64.zip

To see GoAsm ---> http://www.GoDevTool.com

I don`t forget you...

Good Enjoy...
----

Gerard

gerard

  • Guest
Re: MASM64....
« Reply #1 on: 2005-10-25 13:13:25 »
Warning....

In file Struc.inc there are a little error...

Structure MSG is ---->

MSG STRUCT
  hwnd      DQ         ?
  message   DD         ?
;  reserved  DD      ?
  wParam    DQ         ?
  lParam    DQ         ?
  time      DD       ?
  pt        POINT         <?>
ENDS


Excuse me for the error I did in file Struc.inc...
It was not a wanted error...

Good enjoy...

---
Gerard

gerard

  • Guest
Re: MASM64....
« Reply #2 on: 2005-10-25 17:43:11 »
Here is another listing...

Have a look...

http://pageperso.aol.fr/chapillong/cMASM64.zip



Good Enjoy...
----
Gerard

gerard

  • Guest
Re: MASM64....
« Reply #3 on: 2005-10-26 19:22:50 »
Another program...

http://pageperso.aol.fr/chapillong/Essai-iz-64-4.zip

You will see that with this example the better choice for structure MSG is


Code: [Select]
[size=20pt]MSG STRUCT
  hwnd      DQ      ?
  message   DQ      ?
;  reserved  DD ?
  wParam    DQ      ?
  lParam    DD      ?   ;;;WARNING  this error is wanted...for compatibility....
  time      DD    ?
  pt        POINT <?>
ENDS[/size]


I know very well that for lParam a value DQ would be better but 
GoAsm has been made like that...

This little error (elaboration of GoAsm) serves only to put people in trouble...

I repeat me these programs work only on platform 64 bits...

You can compile on a 32 bits platform...

The more difficult is to find the real Structure of variable...


GoodEnjoy..
---
Gerard

Offline f0dder

  • Community Staff
  • ASM Fanatic
  • *****
  • Posts: 7788
  • Front Line Assembly
    • http://f0dder.reteam.org
Re: MASM64....
« Reply #4 on: 2005-10-26 19:30:55 »
Quote
The more difficult is to find the real Structure of variable...
Why difficult? Just parse the header files from microsoft...
- carpe noctem

gerard

  • Guest
Re: MASM64....
« Reply #5 on: 2005-10-27 04:18:25 »
WARNING

If you let program Mem.exe opened a long time something happens...

Do the test...your PC doesn`t risk something....do the test...


I think that the use of DD (instead of  DQ) for lParam is the culprit...

GoAsm is only a Beta Version...and I think will hav a good future...

Excuse me for the trouble...You see that knowledge of MASM32 is similar than 64 bits...


GoodEnjoy...
----
Gerard

jorgon

  • Guest
Re: MASM64....
« Reply #6 on: 2005-10-27 16:32:25 »
Hi Gerard

The file struc.inc is not part of GoAsm.  Where did it come from?

As far as I am concerned the correct MSG structure in 64-bits is as follows:-

Code: [Select]
MSG      DQ 0         ;+0 hWnd
         DD 0         ;+8 message
         DD 0         ;padding for next
         DQ 0         ;+10 wParam
         DQ 0         ;+18 lParam
         DD 0         ;+20 time
         DD 0         ;+24 1st part of point structure
         DD 0         ;+28 2nd part of point structure

Message is only a dword and you need 4 bytes of padding after it to ensure that the following qwords are on their natural boundary.

For comparison here is the 32-bit version of the MSG structure:-

Code: [Select]
MSG      DD 0         ;+0 hWnd
         DD 0         ;+4 message
         DD 0         ;+8 wParam
         DD 0         ;+C lParam
         DD 0         ;+10 time
         DD 0         ;+14 1st part of point structure
         DD 0         ;+18 2nd part of point structure

gerard

  • Guest
Re: MASM64....
« Reply #7 on: 2005-10-31 10:43:54 »
Here is another program...
64 bits
http://pageperso.aol.fr/chapillong/Essai-iz-64-5.zip

Same than this -one
32 bits
http://pageperso.aol.fr/gerardchap/Provider.zip

The 64 bits works normally...but  with WinXP64Bits...it has some troubles...
 the problem is in dll of Microsoft
in directory C:\WINDOWS\SysWOW64 ----> advapi32.dll
Microsoft has forgotten some things...
a)Provider Type DH (Diffie and Hellman) are not introduced...
b) One can`t enumerate Provider with API CryptGetProvParam

If someone could test my program on Windows2003 64 bits...
Perhaps the dll advapi32.dll in 64 bits is the same Windows 2003/XP 64 bits...

Therefore if someone does the test on Windows2003 64 bits a little message on this forum will be the welcomer...


GoAsm....works almost perfectly...
The problem of lParam was perturbing because when one uses Shelltray...this parameter is often used...

Good Enjoy..
----
Gerard
-----------------------------------------------------------------------------------------------------
 ? ??? ?? ???????? ??? , ?? ??? ?? ???? ??? ??????????...
("God let permit to me to change the world"---he never listens to me...)

jorgon

  • Guest
Re: MASM64....
« Reply #8 on: 2005-10-31 15:26:39 »
Quote
GoAsm....works almost perfectly...
The problem of lParam was perturbing because when one uses Shelltray...this parameter is often used...

Just to make it clear, the "problem of lParam" is and never was a GoAsm issue.

gerard

  • Guest
Re: MASM64....
« Reply #9 on: 2005-11-03 16:16:18 »
Hi...

Here is a new program working in 64 bits...
http://pageperso.aol.fr/chapillong/Essai-iz-64-6.zip

It is the same than this one for 32 bits
http://pageperso.aol.fr/gerardchap/DAPVersion3.zip

This of 32 bits doesn't work correctly on WindowsXP64Bits ...the problem is in
API FTPGetSizeFile (used in 32 bits) whose doesn't work...on WinXP64Bits

With this program this of 64 bits you will be able to retrieve file on FTP Server if this one permit it...
ftp://ftp.sedl.org/pub/mirrors/nihongo/
FTP is ftp://ftp.sedl.org  and one can resume a broken download...
THis FTP is a site for Japonese ----> nihongo...

Why with DAP (SpeedBits) and IDM and other one can resume on FTP File because they (these programs) works on NetWork i.e. they are like eMule or Kazaa...

You will find a little Tutorial
http://pageperso.aol.fr/gerardchap/Annexe.zip

Good Enjoy..
----
Gerard

gerard

  • Guest
Re: MASM64....
« Reply #10 on: 2005-11-08 18:34:41 »
Hi...

I have a little problem ...with GoAsm...because I want to use static code libraries and I don't arrive...

(It is to build Driver in 64 bits)...

Like one can't retrieve address of certain Function (API)...I use the following line...
Then I use

Quote
invoke ntoskrnl.lib:IoCreateDevice,[lpDriverObject],0,[cusDevice],FILE_DEVICE_UNKNOWN,0,FALSE,ADDR DeviceObject
then ..
Quote
GoAsm /x64 MyDriver.asm

and I obtain the following error...

Quote
Error!
Cannot use import library instead of static code library!
ntoskrnl.lib

OBJ file not made

If you have time ...could you explain me where I made an error....

Normally GoAsm support Library...

GoodEnjoy...
---
Gerard


jorgon

  • Guest
Re: MASM64....
« Reply #11 on: 2005-11-08 18:57:42 »
Hi Gerard

GoAsm gives this error if you have tried to use an import library (containing only the names of the DLLs for linking purposes) instead of a static library (containing actual code of functions).

If you have a look inside ntoskrnl.lib using a PE viewer (could I suggest Wayne Radburn's PEview?) you can check which type of library it is.

When writing 64-bit code with the help of code (static) libraries, you would need 64-bit versions of such libraries.  These would contain 64-bit code instead of 32-bit code.  So far I have not come across any such code libraries.  If they exist I would welcome a chance to get my hands on them, since I suspect the format of the library will be different from usual 32-bit static libraries.  If so, I would need to make some adjustments to GoAsm to suit.

gerard

  • Guest
Re: MASM64....
« Reply #12 on: 2005-11-14 09:10:04 »
Hi

   In this folder http://pageperso.aol.fr/chapillong/Essai-iz-64-8.zip
there are an example of a DLL in 64 bits...
The example serves only to show the entry point i.e. the

Quote
DllEntry FRAME hInst,reason,reserved1
   mov rax,[reason]
   cmp rax,DLL_PROCESS_ATTACH
   jne >>.1
         
.1:       cmp rax,DLL_PROCESS_DETACH
   jne >.2
         
.2:   push [hInst]
   pop [hInst]
        mov  rax,1
        ret
ENDFRAME


Without this Function  your DLL  serves to nothing...because it is impossible to load it...


I am doing to build a DLL fron ntoskrnl.exe i.e ntoskrnl.dll which will serve to build Drivers...

When this dll will be finished I put it on the Net...

GoodEnjoy...
----
Gerard...
---------------------------------------------------------------------------------
Better late than never....


gerard

  • Guest
Re: MASM64....
« Reply #13 on: 2005-12-02 06:47:37 »
It is always about EXE files or DLL files...

To see the structure go to ---> http://elfz.laacz.lv/ms_exe_spec.html

Try to use a good program ...at page http://www.magma.ca/~wjr/

Program's link...( http://www.magma.ca/~wjr/PEview.zip )

Try also to see the interior of a *.obj file ...and, above all, try to build a listing...
i.e

Quote
GoAsm /l /x64 prog.asm

Jeremy used a very original manner to build an  *.obj file....

To better understand the Linkage try to use the following link

http://elfz.laacz.lv/ms_exe_spec.html


About Drivers...I have a little problem because I have not the ntoskrnl.lib and hal.lib..files...
These two files are in 64 bits...

I re-give you a good link...for Drivers in 32 bits...the site was made by Four-F..he is Russian ...
(Four-F is a game of words between hexadecimal FFFF and Forrest first Great Wizard of K.K.K in 18xx)
http://www.freewebs.com/four-f/


I hope you will enjoy after seeing all these sites...

----
Gerard

gerard

  • Guest
Re: MASM64....
« Reply #14 on: 2005-12-07 05:30:45 »
For those who want to have a better understanding about how and why GoAsm is built like that

Go to ----->http://win.asmcommunity.net/x86book/index.php?pagename=WinCallingConventions

One can read that ecx and edx was (and is always used) under 32 bits...

For 64 bits ecx and edx are always used..but r9 and r8 are also used...

If you want to know more about stack please read that...

http://win.asmcommunity.net/x86book/index.php?pagename=TheStack

I think that these informations will be welcomers... 8)

----
Gerard