8/3/2023 0 Comments Free pascal asm db![]() this does not make sense what your function is doing, no params? if so this needs to be cdecl and this function needs to correct the stack.Īlso if RegCall is false, then your stack is going to become corrupt. Procedure YourProc(StkAdr: PAnsiChar StkUsage: LongWord) Īdr(. Is RegCall a param? can you post the function declaration? Also what is _EAX, _EDX, _ECX ? you need to post all variables used so i can convert it. Note that is aligns memory on 4 bytes for speed copy of dword's but i don't see it writing any left over bytes. ![]() This just looks like an inefficient string copy routine, it copies string onto stack then calls some other function, i'm guessing it is stdcall, not sure what Adr is or doing in the called function. esp is restored by the external function Mov ECX, Adr // execute the external function Shr ecx, 2 // divide by 4 to perform DWORD-copy (is faster) Mov ecx, StkUsage // prepare ecx to copy StkUsage bytes Mov esi, StkAdr // set source of mem copy, it is Addr(ExtStk) ![]() Mov edi, esp // set destination of mem copy, it is the stack Push edi // (we use only esi and edi here). Now here's the piece of code:Īsm push esi // esi, edi, ebp and ebx must be kept Of course it is also possible to convert the ASM part to 64 bit assembler. I want to port the program to 64 bit, so porting to Pascal would be an advantage. (It is originally written for Delphi but compiles with FPC, too). The reason is that it is obviously 32 bit Assembler. Since we've got the converting C to Pas thread, I thought some of you are familiar with inline ASM.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |