[Ok I see you got your prob solved but I'll post my reply anyway
]
I would pick some other code cave tool. There's a lot more caves than that. They usually give you the correct mem region too, but I'm not sure how you make your trainer but I guess it's TMK and also guess that they change rights when needed.
Opcode balancing is important to ensure that no code gets lost.
For instance if your original code is this:
mov [ebp+0x314], edx
mov [ebp+0x318], eax
mov [ebp+0x31B], ebx
And you do this:
mov [ebp+0x314], edx
jmp 0xAddy
You will most likely overwrite:
mov [ebp+0x318], eax
which means you need to recreate it in your code cave.
You'll also likely get the situation where your replacement screws up some code:
mov [ebp+0x314], edx
jmp 0xAddy
add ebx,9 (example; this shouldn't be here)
mov [ebp+0x31B], ebx (this is ok, but usually everything after the jmp will be screwed up)
To fix this you balance with nops:
mov [ebp+0x314], edx
jmp 0xAddy
nop
nop
..
nop (result = no new operations)
mov [ebp+0x31B], ebx (jump back here)
As you see, your mov [ebp+0x318] disappears and probably causes an error or a crash. So it has to be recreated.
Edit:
+ I think you should put edx back to -1 in order to avoid problems.