| |
|
|
- Page 1 - |
|
Uwe ''Pascal'' Niemeier | Hi people!
in the hope, that here the a or others ASM-Kenner mitliest, place I time 'ne question:
I Search a Possibility, a StdCall-function with discretionary many Parameters aufzurufen. the the fundamentally possible is, shows this Snippet:
the works sowohl as function in a dll as well as as "Embedded ASM" directly in Profan:
window 800,600
declare a#:dim a#,48
long a#,0=734366549,1088979908,83395421,79824245
long a#,16=-2095256832,91556088,-352319294,217613074
long a#,32=214041973,-2096567552,58003704,4290
print call(a#,1)
print call(a#,1,2)
print call(a#,1,2,3)
print call(a#,1,2,3,4)
waitinput
now think I but, it ought to too plainer and universeller weg, because one through verbiegen of Pointern with a einfachen RET auskommt and itself whom Bandwurm of IF-inquire save can (RET accepted Yes no tab as Parameter). stand there though something on the Hose, what Stack-Manipulationen concerns.
can someone help?
[OFFTOPIC]BTW: @ iF: Hab's somehow not hingekriegt, this Posting under "Assembler" to take off [/OFFTOPIC]
SeeYou Pascal |
|
|
| |
|
|
|
« this Posting watts as Solution marked. » |
|
| Hello Uwe, is been successful...
or.
or.
term fehlerfrei tested under 32bit WinXP XProfan 11.
one must hold The Rücksprungandresse secure and these to künstlichem reduce the Stacks on the new Stackposition take off.
would be me forward if you so something begin can. |
|
|
| |
|
|
|
|
| I faith I know already How to the ... I teste the today evening same time and report. (without Ifs, creep and jmp eax*anything else)
[OFFTOPIC]Have whom Topic by DB to Assembler moved. as i even probierte here in under Assembler Topics To produce (too gleichnamige) funktionierte the free from problems. What exactly was happens the itself the Topic not take off let?[/OFFTOPIC] |
|
|
| |
|
|
|
| Hello Uwe, is been successful...
or.
or.
term fehlerfrei tested under 32bit WinXP XProfan 11.
one must hold The Rücksprungandresse secure and these to künstlichem reduce the Stacks on the new Stackposition take off.
would be me forward if you so something begin can. |
|
|
| |
|
|
|
Uwe ''Pascal'' Niemeier | Hi iF!
class! skin there!
The function should always only a konstanten worth give back, but even with discretionary many Parameters, independent of its Content.
i will from it a universelle Dummy-function for OLE-Interfaces basteln (was Yes clear ) unfortunately works even the still not, probably because straight there my Berechnung the Rücksprungadresse/Parameterzahl not is correct. but the wars I out...
thanks for your Help!
PS: If you this reads has the Posting worked
SeeYou Pascal |
|
|
| |
|
|
|
| Juhu ^^
Stumpf said reichts apparently if on the Funktionkopf standing around the Stack for ret 0 To präparieren with alike How many Params. |
|
|
| |
|
|
|
Uwe ''Pascal'' Niemeier | Nachtrag @ iF:
withal your Solution I will these engineering well not use can apparently can it vorkommen, that the Aufrufer ( in my case Windows itself, the The modes of my Interfaces aufruft ) to the Funktionsaufruf values for Eigenbedarf on the Stack pusht, The none as Parameter for function vorgesehen are. and so is the Parameterberechnung through ebp less esp frail means is it furthermore necessary, for each Parameterzahl a Own Dummy-function bereitzustellen. but whom attempt war's worth!
SeeYou Pascal |
|
|
| |
|
|
|
| Sorry, there have I ad hoc too no idea - particularly if The Aufruferfunktion too with the Stack werkelt.
I could me yet present the "Win" The difference in such drop in a tab mitliefert or by Stack - there a dependence herauszufummeln is certainly quite "irre". |
|
|
| |
|
|
|
| though...
If you time lauter Longs of Stack simply impudent in a Debugviewer puschst ...
vlt. works Yes if one More as only 1 Long zurücksichert. |
|
|
| |
|
|
|
Uwe ''Pascal'' Niemeier | Hi iF!
I faith meanwhile not any more, that the whole machbar is: Each method has now time a solid amount Parameter, and derjenige, the The modes provides (and therefore goes it Yes), has even for worry To carry, that these Parameter correctly machine go. Why ought to itself M$ The to give trouble, these amount somewhere incorporate? And if, would it even undokumentiert and so seeeehr tipsily...The Idea with the MultiParameter-method is Yes on my Mist grown Also holds itself the hoisted with the recent engineering too in Grenzen; here a Version the OLE-RTF-Controls:
window 800,600
$H windows.ph
$H RichEdit.ph
usermessages 16'--WM_CLOSE
def StgCreateDocfileOnILockBytes(4) !"ole32","StgCreateDocfileOnILockBytes"
def CreateILockBytesOnHGlobal(3) !"ole32","CreateILockBytesOnHGlobal"
def &NI $80004001'--hardship Implemented
def &OK 0'----------OK
proc CreateIMD'---------------------------------------InterfaceMethodDummy
var a&=~GlobalAlloc(0,8)
byte a&,0=$B8'-------mov eax,&(2)
long a&,1=&(2)'------Return: pretended Constant
byte a&,5=$C2'-------ret &(1)*4+4
word a&,6=&(1)*4+4'--amount Parameter * 4 + "This"-Pointer
return a&'-----------finished function in memory
'--PS: with a couple NOP's to that move the Placeholder fits everything in 1 row with 4 LongInts
endproc'------------------------------------------------------------------
proc GetNewStorage'------------------------------------------GetNewStorage
parameters IFace&,IStorage&
declare ILockBytes&
CreateILockBytesOnHGlobal(0,1,addr(ILockBytes&))
StgCreateDocfileOnILockBytes(ILockBytes&,$1012,0,IStorage&)
call(long(long(ILockBytes&,0),8),ILockBytes&)'--ILockBytes::Release
return &OK
endproc'------------------------------------------------------------------
declare VTable#:dim VTable#,60'-----------------------IRichEditOleCallback-interface
long VTable#, 0=CreateIMD(1,&NI)'-------------QueryInterface
long VTable#, 4=CreateIMD(0,&NI)'-------------AddRef
long VTable#, 8=CreateIMD(0,&NI)'-------------Release
long VTable#,12=procaddr("GetNewStorage",2)'--GetNewStorage
long VTable#,16=CreateIMD(3,&NI)'-------------GetInPlaceContext
long VTable#,20=CreateIMD(1,&NI)'-------------ShowContainerUI
long VTable#,24=CreateIMD(3,&OK)'-------------QueryInsertObject
long VTable#,28=CreateIMD(1,&NI)'-------------DeleteObject
long VTable#,32=CreateIMD(5,&OK)'-------------QueryAcceptData
long VTable#,36=CreateIMD(1,&NI)'-------------ContextSensitiveHelp
long VTable#,40=CreateIMD(3,&NI)'-------------GetClipboardData
long VTable#,44=CreateIMD(3,&NI)'-------------GetDragDropEffect
long VTable#,48=CreateIMD(4,&NI)'-------------GetContextMenu
long VTable#,52=VTable#
var IFace&=VTable#+52
var Edit&=create("richedit",%hwnd,"",20,20,500,500)
sendmessage(Edit&,~EM_SETOLECALLBACK,0,IFace&)'---EM_SETOLECALLBACK
var File$=loadfile$("RTF with Objects wählen","*.rtf")
Rtf("LoadRTF",Edit&,File$)
while 1
waitinput
case %umessage=16:break
endwhile
sendmessage(Edit&,~EM_SETOLECALLBACK,0,0)
destroywindow(Edit&)
dispose VTable#
'--here müßten eigendlich any modes-Dummys with ~GlobalFree() released go
was but well, time again little ASM To exercise
SeeYou Pascal |
|
|
| |
|
|