Page 2 of 2

Re: Using 'FileSeek' and 'Inline ASM' in Memory?

Posted: Mon Oct 16, 2023 9:02 am
by PoorMan
Gents,
Sorry for the confusion. I'll explain the issue in detail.
Game is big so I created an alternative sample code, were you can get the 'Correct MessageBox' if you enter "I_Love_PB".

Code: Select all

If InputRequester("PoorMan", "Enter Password:", "") = "I_Love_PB"
  MessageRequester("", "Password is Correct!")
Else
  MessageRequester("", "Password is Incorrect!")
EndIf
Using a debugger, you can simply change the instruction "or eax,eax" at "$10BE" to "mov al,1" to get the correct message whatever your input is, but this is Not what I want (see the picture):
https://ibb.co/jwpjghv

Actually, I need the following DLL Code to change "eax value to 1" once the code leaves RVA $10BE":

Code: Select all

EnableExplicit
ProcedureDll DoASM()          ; Procedure Name will be changed later
  Protected EAX.l  
  ! mov eax, 1
  ! mov dword [p.v_EAX], eax  ; p.v_EAX -> pointer to variable EAX
EndProcedure

DoASM()

Re: Using 'FileSeek' and 'Inline ASM' in Memory?

Posted: Mon Oct 16, 2023 8:31 pm
by Olli
You can make a virtual machin on pureBasic :

Code: Select all

Procedure.S myVM(OpCode, arg.s)
Repeat
 Select OpCode
  Case 0: End
  Case 1: ProcedureReturn InputRequester("", "", "")
  Case 2: ProcedureReturn Str(Bool(Len(arg) )
  Case 3: ProcedureReturn StringField(arg, ";", Val(StringField(arg, ";", 1) + 1) )
  ; etc...
EndSelect
ForEver
EndProcedure
Also, a program is a values serial (1, 2, 5, 1, 0, or whatever).
And this serial is "crypted" by a string.

factice encryption : (simple addition modulo 10)

(password = 056
program = 12510)

Code: Select all

05605 password looped
+++++
12510 program
"""""
17115 encrypted program

Re: Using 'FileSeek' and 'Inline ASM' in Memory?

Posted: Tue Oct 17, 2023 8:59 pm
by PoorMan
virtual machin .. !
Nor in my dreams, I expected to find a GENIUS same as you in this form!

Re: Using 'FileSeek' and 'Inline ASM' in Memory?

Posted: Wed Oct 18, 2023 12:02 pm
by Olli
Image
Is this your image ?

Re: Using 'FileSeek' and 'Inline ASM' in Memory?

Posted: Wed Oct 18, 2023 5:49 pm
by PoorMan
Forget about my image Mr. "virtual machine"
I've solved the issue by myself!

Re: Using 'FileSeek' and 'Inline ASM' in Memory?

Posted: Wed Oct 18, 2023 5:51 pm
by Olli
And this :

Code: Select all

If InputRequester("PoorMan", "Enter Password:", "") = "I_Love_PB"
  MessageRequester("", "Password is Correct!")
Else
  MessageRequester("", "Password is Incorrect!")
EndIf
Is this your source code ?

Re: Using 'FileSeek' and 'Inline ASM' in Memory?

Posted: Wed Oct 18, 2023 8:26 pm
by Mijikai
PoorMan wrote: Wed Oct 18, 2023 5:49 pm ...
I've solved the issue by myself!
PG/VEH ?