Ignore:
Timestamp:
Apr 6, 2014, 7:06:02 PM (11 years ago)
Author:
alloc
Message:

Daodan:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Daodan/src/Daodan_Patch.c

    r990 r993  
    4545    DISASM MyDisasm;
    4646    int i = 0;
    47     DDrStartupMessage("");
    48     DDrStartupMessage("");
     47    STARTUPMESSAGE("", 0);
     48    STARTUPMESSAGE("", 0);
    4949
    5050    memset (&MyDisasm, 0, sizeof(DISASM));
    5151    MyDisasm.EIP = (UIntPtr) from;
    5252    i = 0;
    53     DDrStartupMessage("Orig before @ 0x%06x", from);
     53    STARTUPMESSAGE("Orig before @ 0x%06x", from);
    5454    while (i<10){
    5555        len = Disasm(&MyDisasm);
    5656        if (len != UNKNOWN_OPCODE) {
    57                         DDrStartupMessage("%s, Opcode: 0x%x, len: %d, branch: %d, to: 0x%06x", MyDisasm.CompleteInstr, MyDisasm.Instruction.Opcode, len, MyDisasm.Instruction.BranchType, MyDisasm.Instruction.AddrValue);
    58                         DDrStartupMessage("    Cat: 0x%04x, prefix count: %d", MyDisasm.Instruction.Category & 0xffff, MyDisasm.Prefix.Number );
     57                        STARTUPMESSAGE("%s, Opcode: 0x%x, len: %d, branch: %d, to: 0x%06x", MyDisasm.CompleteInstr, MyDisasm.Instruction.Opcode, len, MyDisasm.Instruction.BranchType, MyDisasm.Instruction.AddrValue);
     58                        STARTUPMESSAGE("    Cat: 0x%04x, prefix count: %d", MyDisasm.Instruction.Category & 0xffff, MyDisasm.Prefix.Number );
    5959            MyDisasm.EIP += (UIntPtr)len;
    6060            i++;
    6161        }
    6262    };
    63     DDrStartupMessage("");
     63    STARTUPMESSAGE("", 0);
    6464*/
    6565
     
    7878                        if ((disasm.Instruction.Category & 0xffff) == CONTROL_TRANSFER) {
    7979                                if (disasm.Prefix.Number > 0) {
    80                                                 DDrStartupMessage("Daodan: Detour: Branch in trampoline area from address 0x%08x with prefixes", from);
     80                                                STARTUPMESSAGE("Detour: Branch in trampoline area from address 0x%08x with prefixes", from);
    8181                                                return (void*)-1;
    8282                                }
     
    145145                                                break;
    146146                                        default:
    147                                                 DDrStartupMessage("Daodan: Detour: Unknown branch in trampoline area from address 0x%08x", from);
     147                                                STARTUPMESSAGE("Detour: Unknown branch in trampoline area from address 0x%08x", from);
    148148                                                return (void*)-1;
    149149                                }
     
    155155                }
    156156                else {
    157                         DDrStartupMessage("Daodan: Detour: Unknown opcode in trampoline area from address 0x%08x", from);
     157                        STARTUPMESSAGE("Detour: Unknown opcode in trampoline area from address 0x%08x", from);
    158158                        return (void*)-1;
    159159                }
     
    161161
    162162        if (branches > 1) {
    163                 DDrStartupMessage("Daodan: Detour: Too many branches in trampoline'd code from address 0x%08x: %d", from, branches);
     163                STARTUPMESSAGE("Detour: Too many branches in trampoline'd code from address 0x%08x: %d", from, branches);
    164164                return (void*)-1;
    165165        }
     
    171171        DWORD oldp;
    172172        if (!VirtualProtect(trampoline, 40, PAGE_EXECUTE_READWRITE, &oldp)) {
    173                 DDrStartupMessage("Daodan: Detour: Could not mark page for trampoline as executable: from address 0x%08x", from);
     173                STARTUPMESSAGE("Detour: Could not mark page for trampoline as executable: from address 0x%08x", from);
    174174                return (void*)-1;
    175175        }
     
    179179    MyDisasm.EIP = (UIntPtr) trampoline;
    180180    i = 0;
    181     DDrStartupMessage("Trampoline @ 0x%06x", trampoline);
     181    STARTUPMESSAGE("Trampoline @ 0x%06x", trampoline);
    182182    while (i<10){
    183183        len = Disasm(&MyDisasm);
    184184        if (len != UNKNOWN_OPCODE) {
    185             DDrStartupMessage(MyDisasm.CompleteInstr);
     185            STARTUPMESSAGE("%s", MyDisasm.CompleteInstr);
    186186            MyDisasm.EIP += (UIntPtr)len;
    187187            i++;
    188188        }
    189189    };
    190     DDrStartupMessage("");
     190    STARTUPMESSAGE("", 0);
    191191     
    192192    memset (&MyDisasm, 0, sizeof(DISASM));
    193193    MyDisasm.EIP = disasm.EIP;
    194194    i = 0;
    195     DDrStartupMessage("Orig after @ 0x%06x", disasm.EIP);
     195    STARTUPMESSAGE("Orig after @ 0x%06x", disasm.EIP);
    196196    while (i<7){
    197197        len = Disasm(&MyDisasm);
    198198        if (len != UNKNOWN_OPCODE) {
    199             DDrStartupMessage(MyDisasm.CompleteInstr);
     199            STARTUPMESSAGE("%s", MyDisasm.CompleteInstr);
    200200            MyDisasm.EIP += (UIntPtr)len;
    201201            i++;
    202202        }
    203203    };
    204     DDrStartupMessage("");
     204    STARTUPMESSAGE("", 0);
    205205
    206206    memset (&MyDisasm, 0, sizeof(DISASM));
    207207    MyDisasm.EIP = (UIntPtr) from;
    208208    i = 0;
    209     DDrStartupMessage("Orig start after @ 0x%06x", from);
     209    STARTUPMESSAGE("Orig start after @ 0x%06x", from);
    210210    while (i<3){
    211211        len = Disasm(&MyDisasm);
    212212        if (len != UNKNOWN_OPCODE) {
    213             DDrStartupMessage(MyDisasm.CompleteInstr);
     213            STARTUPMESSAGE("%s", MyDisasm.CompleteInstr);
    214214            MyDisasm.EIP += (UIntPtr)len;
    215215            i++;
    216216        }
    217217    };
    218     DDrStartupMessage("");
    219     DDrStartupMessage("");
    220     DDrStartupMessage("");
     218    STARTUPMESSAGE("", 0);
     219    STARTUPMESSAGE("", 0);
     220    STARTUPMESSAGE("", 0);
    221221*/
    222222
Note: See TracChangeset for help on using the changeset viewer.