-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More reverse/mapping around MidiDevice and MidiTimer
- Loading branch information
Showing
8 changed files
with
57 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
|
||
bool __thiscall | ||
th06::MidiDevice::SendShortMsg(MidiDevice *this,byte firstByte,byte secondByte,byte thirdByte) | ||
th06::MidiDevice::SendShortMsg(MidiDevice *this,byte midiStatus,byte firstByte,byte secondByte) | ||
|
||
{ | ||
DWORD DVar1; | ||
MMRESULT MVar2; | ||
bool bVar3; | ||
DWORD local_8; | ||
BYTE aBVar1 [4]; | ||
MMRESULT res; | ||
bool hasError; | ||
BYTE dwMsg [4]; | ||
|
||
DVar1 = local_8; | ||
aBVar1 = dwMsg; | ||
if (this->handle == (HMIDIOUT)0x0) { | ||
bVar3 = false; | ||
hasError = false; | ||
} | ||
else { | ||
MVar2 = midiOutShortMsg(this->handle,local_8); | ||
bVar3 = MVar2 != 0; | ||
dwMsg[1] = firstByte; | ||
dwMsg[0] = midiStatus; | ||
/* Ghidra is drunk here: | ||
- Order is wrong (should be 0, 1, 2) | ||
- dwMsg[3] is never set. */ | ||
dwMsg[3] = aBVar1[3]; | ||
dwMsg[2] = secondByte; | ||
res = midiOutShortMsg(this->handle,(DWORD)dwMsg); | ||
hasError = res != 0; | ||
} | ||
return bVar3; | ||
return hasError; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
|
||
void th06::MidiTimer::DefaultTimerCallback(uint uTimerID,uint uMsg,MidiOutput *dwUser) | ||
void th06::MidiTimer::DefaultTimerCallback | ||
(uint uTimerID,uint uMsg,DWORD_PTR dwUser,DWORD_PTR dw1,DWORD_PTR dw2) | ||
|
||
{ | ||
(**(code **)(dwUser->timer).vtbl)(); | ||
(***(code ***)dwUser)(); | ||
return; | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
UINT __thiscall | ||
th06::MidiTimer::StartTimer(MidiTimer *this,UINT delay,LPTIMECALLBACK cb,DWORD_PTR data) | ||
|
||
{ | ||
MMRESULT timer_id; | ||
|
||
StopTimer(this); | ||
timeBeginPeriod((this->timeCaps).wPeriodMin); | ||
if (cb == (LPTIMECALLBACK)0x0) { | ||
timer_id = timeSetEvent(delay,(this->timeCaps).wPeriodMin,DefaultTimerCallback,(DWORD_PTR)this, | ||
TIME_PERIODIC); | ||
this->timerId = timer_id; | ||
} | ||
else { | ||
timer_id = timeSetEvent(delay,(this->timeCaps).wPeriodMin,cb,data,TIME_PERIODIC); | ||
this->timerId = timer_id; | ||
} | ||
return this->timerId; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
272 | ||
273 |