It is currently Tue Mar 31, 2020 8:24 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: [DONE] [TB 1.878 PB 4.30 x64] NetLocalGroupAdd
PostPosted: Thu Dec 25, 2008 9:24 am 
Offline
Addict
Addict

Joined: Sun May 15, 2005 5:15 am
Posts: 1027
Location: Australia
I get a FAsm error saying
Quote:
CALL NetLocalGroupAdd
error: undefined symbol 'NetLocalGroupAdd'


pb code:
Code:
ProcedureDLL NetLocalGroupAdd(GroupName.s)
 
  ; Renvoie 1 si groupe créé / 0 si erreur de création
 
  parm_err.l
  If NetLocalGroupAdd_(0,0,buf,@parm_err)=0
    retour=1
  Else
    retour=0
  EndIf
 
  ProcedureReturn retour
EndProcedure


Generated ASM:
Code:
format MS64 COFF

Public PB_NetLocalGroupAdd


Extrn SYS_FastAllocateString4
Extrn SYS_FreeString


section '.text' code readable executable

PB_NetLocalGroupAdd:
MOV    qword [rsp+8],rcx
PUSH   r15
PS62=96
XOR    rax,rax
PUSH   rax
PUSH   rax
PUSH   rax
PUSH   rax
PUSH   rax
SUB    rsp,40
MOV    rdx,[rsp+PS62+0]
LEA    rcx,[rsp+40]
SUB    rsp,16
CALL   SYS_FastAllocateString4
ADD    rsp,16
;
; Renvoie 1 si groupe créé / 0 si erreur de création
;
; buf.LOCALGROUP_INFO_0
LEA    rax,[rsp+48]
;
; parm_err.l
; If NetLocalGroupAdd_(0,0,buf,@parm_err)=0
LEA    rax,[rsp+56]
MOV    rax,rax
PUSH   rax
LEA    rax,[rsp+56]
MOV    rax,rax
PUSH   rax
PUSH   qword 0
PUSH   qword 0
POP    rcx
POP    rdx
POP    r8
POP    r9
ADD    rsp,-32
CALL   NetLocalGroupAdd
ADD    rsp,32
MOV    r15,rax
AND    r15,r15
JNE   _EndIf25
; retour=1
MOV    qword [rsp+64],1
; Else
JMP   _EndIf24
_EndIf25:
; retour=0
MOV    qword [rsp+64],0
; EndIf
_EndIf24:
;
; ProcedureReturn retour
MOV    rax,qword [rsp+64]
JMP   _EndProcedure63
;
; EndProcedure
XOR    rax,rax
_EndProcedure63:
PUSH   rax
MOV    rcx,qword [rsp+48]
SUB    rsp,32
CALL   SYS_FreeString
ADD    rsp,32
POP    rax
ADD    rsp,80
POP    r15
RET


Just noticed that parm_err.l receives a pointer, but changing it to .i doesn't fix the problem. (Obviously)

_________________
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 06, 2009 7:58 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1143
Location: Germany
change the function name to something else and it works.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 13, 2009 3:57 am 
Offline
Addict
Addict

Joined: Sun May 15, 2005 5:15 am
Posts: 1027
Location: Australia
Is there any way to fix this?
PB functions with the same name as an API function minus the _ works with 4.30 x86 + Tailbite, and 4.30 x64 (when testing with F5)

excuse the ignorance (and non knowledge of ASM), but doesn't it just need Extrn NetLocalGroupAdd?
I just don't understand why it doesn't work only in x64 TB.

_________________
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 13, 2009 6:47 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1143
Location: Germany
i removed that check, so lets see what happens :shock:
lexvictory wrote:
I just don't understand why it doesn't work only in x64 TB.

in X86 its _NetLocalGroupAdd@16 and in X64 NetLocalGroupAdd, so thats why it works in X86 and not in X64 :wink:


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jan 14, 2009 1:27 am 
Offline
Addict
Addict

Joined: Sun May 15, 2005 5:15 am
Posts: 1027
Location: Australia
ABBKlaus wrote:
i removed that check, so lets see what happens :shock:

now it gets a symbol already defined for a shared function - line 28
Code:
format MS64 COFF

Public Droopy_SearchDirectory


Extrn SYS_FastAllocateString4
Extrn PB_Right
Extrn SYS_StringEqual
Extrn SYS_CopyString
Extrn SYS_AllocateString4
Extrn FindFirstFileA
Extrn PB_PeekS
Extrn Droopy_SearchDirectory
Extrn Droopy_SearchFiles
Extrn FindNextFileA
Extrn FindClose
Extrn SYS_FreeString
Extrn PB_StringBasePosition
Extrn Droopy__S24
Extrn PB_StringBase
Extrn Droopy__S25
Extrn Droopy__S26
Extrn Droopy__S27


section '.text' code readable executable

Droopy_SearchDirectory:
MOV    qword [rsp+8],rcx
MOV    qword [rsp+16],rdx
PUSH   rbp
PUSH   r15
PS86=432
MOV    rdx,46
.ClearLoop:

---snip---


ABBKlaus wrote:
in X86 its _NetLocalGroupAdd@16 and in X64 NetLocalGroupAdd, so thats why it works in X86 and not in X64 :wink:

Ah, I see, that explains it! There are more differences in x64 than I realised :lol:


And how does TB determine the prefs file to use? Because I remember reading that it would use a different one for x64 than it did for x86, but when I launch TB Manager from PB x86's tools menu, it still uses x64 prefs (and therefore PB x64 paths)
Does a /PREFS: command line option have to be added?
Or should I install separately and tell the x86 IDE to use a different tools file? (It already runs with the /noext option)

_________________
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jan 14, 2009 9:28 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1143
Location: Germany
the above problem should be fixed now.
lexvictory wrote:
And how does TB determine the prefs file to use?

TB reads the registry (needs PB run without the /noext switch), takes the path to PB and runs PBCompiler.exe to see what version is running.
lexvictory wrote:
Because I remember reading that it would use a different one for x64 than it did for x86, but when I launch TB Manager from PB x86's tools menu, it still uses x64 prefs (and therefore PB x64 paths)

The prefsfile is stored in AppData, the X64 version uses i.e. "TailBite_430X64.prefs"

lexvictory wrote:
Does a /PREFS: command line option have to be added?
Or should I install separately and tell the x86 IDE to use a different tools file? (It already runs with the /noext option)

You can install separate versions of TailBite for each version of PB, you should use a folder thats writeable without admin rights.
Just copy the correct "TailBite.prefs" in the TB folder.
For the correct folders you should edit it by hand.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jan 15, 2009 1:49 am 
Offline
Addict
Addict

Joined: Sun May 15, 2005 5:15 am
Posts: 1027
Location: Australia
ABBKlaus wrote:
You can install separate versions of TailBite for each version of PB, you should use a folder thats writeable without admin rights.
Just copy the correct "TailBite.prefs" in the TB folder.
For the correct folders you should edit it by hand.

Thought that might be the other option, although it slipped my mind before.
And the admin rights is no problem - I'm using XP x64.


Thank you for all the help with x64 - Droopy's lib now compiles! (well apart from unicode mode, but that's a PB compiler problem)

You're a genius I tell you! :D

_________________
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye