SHOW:
|
|
- or go back to the newest paste.
| 1 | - | void JmpFunction::operator() () |
| 1 | + | void JmpFunction::operator() () |
| 2 | - | { |
| 2 | + | {
|
| 3 | - | g_CurrJmpFunc = this; |
| 3 | + | g_CurrJmpFunc = this; |
| 4 | - | |
| 4 | + | |
| 5 | - | if(!m_PreparedArguments) PrepareArguments(); |
| 5 | + | if(!m_PreparedArguments) PrepareArguments(); // Not important |
| 6 | - | |
| 6 | + | |
| 7 | - | DWORD t_Addy; |
| 7 | + | DWORD t_Addy; |
| 8 | - | if(m_Offset==0) |
| 8 | + | if(m_Offset==0) // Are we supposed to start at the function start (0) or somewhere else (m_Offset)? |
| 9 | - | t_Addy = (DWORD)m_Function; |
| 9 | + | t_Addy = (DWORD)m_Function; |
| 10 | - | else t_Addy = m_Offset; |
| 10 | + | else t_Addy = m_Offset; // If this happens, we called StartHere() |
| 11 | - | |
| 11 | + | |
| 12 | - | int t_Diff = m_Offset-(DWORD)m_Function; |
| 12 | + | int t_StackSize = m_Stack.size(); // Number of arguments |
| 13 | - | |
| 13 | + | int t_StackSizeBytes = t_StackSize*sizeof(void*); // byte size |
| 14 | - | int t_StackSize = m_Stack.size(); |
| 14 | + | |
| 15 | - | int t_StackSizeBytes = t_StackSize*sizeof(void*); |
| 15 | + | for(int i = t_StackSize-1; i>=0; i--) // For each argument |
| 16 | - | |
| 16 | + | {
|
| 17 | - | for(int i = t_StackSize-1; i>=0; i--) |
| 17 | + | DWORD t_Argument = (m_Arguments[i]); |
| 18 | - | { |
| 18 | + | __asm |
| 19 | - | DWORD t_Argument = (m_Arguments[i]); |
| 19 | + | {
|
| 20 | - | __asm |
| 20 | + | mov eax, t_Argument // push onto stack |
| 21 | - | { |
| 21 | + | push eax |
| 22 | - | mov eax, t_Argument |
| 22 | + | } |
| 23 | - | push eax |
| 23 | + | } |
| 24 | - | } |
| 24 | + | |
| 25 | - | } |
| 25 | + | __asm // call and stack inc |
| 26 | - | |
| 26 | + | {
|
| 27 | - | __asm |
| 27 | + | call t_Addy |
| 28 | - | { |
| 28 | + | add esp, t_StackSizeBytes |
| 29 | - | call t_Addy |
| 29 | + | } |
| 30 | - | add esp, t_StackSizeBytes |
| 30 | + |