Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


CE Video Player

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
Aylin
Grandmaster Cheater
Reputation: 10

Joined: 16 Feb 2017
Posts: 643

PostPosted: Thu Apr 23, 2020 10:05 pm    Post subject: Reply with quote

Congratulations. It works fine.
It loads and launches faster than the original.
While the video subject and CE are remote possibilities, you coded it.
Good job.

_________________
Hi Hitler Take control of your trainer
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 38

Joined: 10 Apr 2015
Posts: 1530

PostPosted: Fri Apr 24, 2020 12:09 am    Post subject: Reply with quote

Aylin wrote:
Congratulations. It works fine.
It loads and launches faster than the original.
While the video subject and CE are remote possibilities, you coded it.
Good job.


NVM, thank you

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Aylin
Grandmaster Cheater
Reputation: 10

Joined: 16 Feb 2017
Posts: 643

PostPosted: Fri Apr 24, 2020 1:09 pm    Post subject: Reply with quote

DB, must have a comment on this beautiful work.
And @mgr.inz.Player; The project has been completed.

_________________
Hi Hitler Take control of your trainer
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message MSN Messenger
mgr.inz.Player
I post too much
Reputation: 165

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Apr 25, 2020 8:24 am    Post subject: Reply with quote

Nice. Few things.

Lua function mciSendString returns strings, not an integer. If you want integer value to be first (MCI error codes), here:
Code:
function ceVideoPlayer()
  if ceVideoPlayer_Loaded then return true end

  local script=[[loadlibrary(C:\Windows\System32\winmm.dll)
alloc(ce_VideoPlayer,4096)
registersymbol(ce_VideoPlayer)

define(returnString,300)
define(retErrorString,400)
define(mciErrorCode,F00)

[64-bit]
ce_VideoPlayer:
lea rsp,[rsp-28]
mov rsi,rcx

lea rdx,[rcx+returnString]
mov r8d,80
xor r9d,r9d
call mciSendStringW
mov [rsi+mciErrorCode],rax // retVal

mov rcx,rax
lea rdx,[rsi+retErrorString]
mov r8,200
call mciGetErrorStringW

lea rsp,[rsp+28]
ret
[/64-bit]

[32-bit]
ce_VideoPlayer:
push ebp
mov ebp,esp
push ebx

mov ebx,[ebp+8]

sub esp,10
mov [esp],ebx
lea ebx,[ebx+returnString]
mov [esp+4],ebx
mov [esp+8],80
mov [esp+c],0
call mciSendStringW

mov ebx,[ebp+8]
mov [ebx+mciErrorCode],eax // retVal
lea ebx,[ebx+retErrorString]

sub esp,0c
mov [esp],eax
mov [esp+0x4],ebx
mov [esp+0x8],200
call mciGetErrorStringW

pop ebx
leave
ret 004
[/32-bit]
]]

  if autoAssemble(script,true) then
    ceVideoPlayer_Loaded=true
    msPlayerCommand=createMemoryStream()
    msPlayerCommand.Size=2048
    return true
  else
    return false
  end

end

function mciSendString(Command)
    writeStringLocal(msPlayerCommand.Memory, Command, true);
    writeBytesLocal (msPlayerCommand.Memory+2*#Command, 0, 0);
    executeCodeLocal('ce_VideoPlayer',msPlayerCommand.Memory);
    return readIntegerLocal(msPlayerCommand.Memory+0xF00),
           readStringLocal(msPlayerCommand.Memory+0x400,512,true),
           readStringLocal(msPlayerCommand.Memory+0x300,128,true)
end



Code:
 mciErrorCode,retErrorString,returnString = mciSendString("open "..filename.." type mpegvideo alias movie parent "..tonumber(panel1.handle).." style child")
 print(mciErrorCode,retErrorString,returnString)

 mciErrorCode,retErrorString,returnString = mciSendString("play movie")
 print(mciErrorCode,retErrorString,returnString)

_________________
Back to top
View user's profile Send private message MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 38

Joined: 10 Apr 2015
Posts: 1530

PostPosted: Sat Apr 25, 2020 9:33 am    Post subject: Reply with quote

Thanks, @mgr.inz.Player, for fixed and updated error handling.
Now, I am able to fix my main CE Video Player project.

EDIT:
@mgr.inz.Player, I try to implement your updated code, give an error: attempt to index a nil value (global 'msPlayerCommand)

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
JohnathanSweeney
Newbie cheater
Reputation: 1

Joined: 04 Apr 2016
Posts: 16

PostPosted: Thu Aug 06, 2020 8:46 pm    Post subject: Reply with quote

this is crazy, I never expected to see a CE video player haha nice work!
Back to top
View user's profile Send private message
ProB1
Advanced Cheater
Reputation: 0

Joined: 20 Jul 2019
Posts: 73
Location: At Home

PostPosted: Sat Sep 26, 2020 1:35 am    Post subject: Reply with quote

Good Work i like it i can add to trainer Thanks !
_________________
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites