IPB

Welcome Guest ( Log In | Register )


-B-
Posted on: Jun 5 2006, 02:31 PM


Mess.beanie
*

Group: Members
Posts: 10
Joined: 8-May 06
Member No.: 19,072


Just as conformation btw on the Internet security restrictions:
QUOTE
Add-ins run under a sandboxed CAS (code-access-security) environment, which means there's quite a bit add-ins can't do too. We currently run add-ins under the 'Internet' permission set, which means they can't interact with your file system, make registry changes, and are under a bunch of other restrictions as well.
Source: http://blogs.msdn.com/katieblanch/

And saving to your HD is done by using the SavedState. These files appear in your C:\Documents and Settings\<YOUR_LOGON_NAME>\Application Data\Microsoft\MSN Messenger\<YOUR_MSN_NUMBER>\PlugInState
  Forum: Add-on Programming · Post Preview: #138036 · Replies: 69 · Views: 76,950

-B-
Posted on: May 10 2006, 09:46 AM


Mess.beanie
*

Group: Members
Posts: 10
Joined: 8-May 06
Member No.: 19,072


QUOTE(coderCode @ May 10 2006, 11:24 AM)
You mean I actually need to apply the registry tweaks to reveal the "Add-Ins" option?
[right][snapback]135148[/snapback][/right]


Yes, place this in a .reg file and execute it
CODE
[HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger]
"AddInFeatureEnabled"=dword:00000001


Or go to start > run > regedit

then browse to HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger

Right Click White Space -> New" -> "DWORD Value" -> "AddInFeatureEnabled"
Right Click "AddInFeatureEnabled" -> "Modify" -> Value Data = "1"
  Forum: Add-on Programming · Post Preview: #135149 · Replies: 18 · Views: 6,010

-B-
Posted on: May 10 2006, 08:35 AM


Mess.beanie
*

Group: Members
Posts: 10
Joined: 8-May 06
Member No.: 19,072


After analyzing the plugin, i managed to find out that your plugin very probably runs in "Internet" security. This means that you are restricted to the following permissions:
CODE
File Dialog
Isolated Storage File
Security
User Interface
Printing


I tried to mess with a little around with the isolated store btw, but i still get security exceptions, or exceptions that it cannot determine it's own domain or some.

The code that is used to launch your app in it's own application domain, is roughly like this:

CODE
string filename = Path.GetFileName(strAssemblyFileName);
string extension = Path.GetExtension(filename );
string basefilename = filename.Substring(0, filename.Length - ((extension.Length <= 0) ? 0 : extension.Length));
AppDomain appDomain = AppDomain.CreateDomain(strAssemblyFileName);
PolicyLevel policyLevel = PolicyLevel.CreateAppDomainLevel();
policyLevel.RootCodeGroup = new UnionCodeGroup(new AllMembershipCondition(), new PolicyStatement(policyLevel.GetNamedPermissionSet("Internet")));
AssemblyName assemblyName = Assembly.GetExecutingAssembly().GetName();
policyLevel.RootCodeGroup.AddChild(new UnionCodeGroup(new StrongNameMembershipCondition(new StrongNamePublicKeyBlob(assemblyName.GetPublicKey()), assemblyName.Name, assemblyName.Version), new PolicyStatement(new PermissionSet(PermissionState.Unrestricted))));
appDomain.SetAppDomainPolicy(policyLevel);
object local = appDomain.CreateInstanceAndUnwrap(assemblyName.FullName, "Microsoft.Messenger.MessengerClient");
((MessengerClient)local).Startup(messengerClientInternal, strAssemblyFileName, basefilename);


Trying now to patch the dll so i get more/full rights. already tried to change the named permission set to a new msn set (hexeditor patch, same string length), and add that to the .net framework configuration permissions, but that didnt seem to work sadly. Neither can i disassemble the file using ILDASM.exe and reassemble it with ILASM.exe (even without any patches what so ever).
Aint giving up yet though msn_wink.gif

QUOTE(TheSteve @ May 10 2006, 07:43 AM)
How would you get handles to other windows? Windows APIs are restricted along with other dll imports.
[right][snapback]135130[/snapback][/right]

Well, yes, but that is the job of the program at the other side of msn. That one finds the handle to your invisible window, and polls i.e. a textbox containt XML-data, and another to post. It's an workaround really, and it is far from beautiful, but it should be able to work. Plus having a seperate program polling data from you plug-in actually quite defeats the purpose of a plugin...

QUOTE(deAd @ May 9 2006, 11:09 PM)
It wont be invisible, as part of the sandbox messenger makes forms visible...unless you use opacity, not sure about that
[right][snapback]135082[/snapback][/right]

Euh, you could be right indeed... Read that somewhere as well... Well aint gonna check if that is true or not really, as i dont like the implementation method anyways...

Will try some more to patch the dll to give us more rights, but i dont seem to succeed much... I'm quite sure what to patch, but i don't have the skills/technique to patch it... Any help/thoughts would be appriciated msn_happy.gif
  Forum: Add-on Programming · Post Preview: #135144 · Replies: 69 · Views: 76,950

-B-
Posted on: May 8 2006, 11:19 PM


Mess.beanie
*

Group: Members
Posts: 10
Joined: 8-May 06
Member No.: 19,072


(WLM 8.0.0689.00) Quick and dirty try, swapped the UNICODE "Title" and "WM/AlbumTitle" in the pmsong.dll
I hadnt time to analyse the dll, nor to think about it, i *might* do that tomorrow (although probably i don't get to it msn_sad.gif ). But i have no time to analyze atm, nor to do more, as i have an important day tomorrow, and need my sleep now msn_wink.gif already running late msn_tongue.gif

Strategy i used for the quick and dirty hack: i loaded windows media player in Ollydbg (media player loads the pmsong) played a song, searched the name of the current song in the dump, put a breakpoint on it, changed the song, check if it did break (it did), see where the album tilte is called, swap the two pushes, save the change to the binary and upload them here. No thinking involved, so condemned to fail msn_tongue.gif msn_rolleyes.gif

Please note that this only changes your own song title - artist, not those of others.


Attached File(s)
Attached File  psmsong.zip ( 26.43K ) Number of downloads: 44
 
  Forum: Add-on Programming · Post Preview: #134954 · Replies: 10 · Views: 3,644

-B-
Posted on: May 8 2006, 10:33 PM


Mess.beanie
*

Group: Members
Posts: 10
Joined: 8-May 06
Member No.: 19,072


Oh, wait, is it a follow-up on the this problem?
  Forum: Add-on Programming · Post Preview: #134942 · Replies: 17 · Views: 6,209

-B-
Posted on: May 8 2006, 10:19 PM


Mess.beanie
*

Group: Members
Posts: 10
Joined: 8-May 06
Member No.: 19,072


QUOTE(deAd @ May 8 2006, 11:35 PM)
Maybe rewording it would help you understand....hex edit through code?
[right][snapback]134930[/snapback][/right]

Ah, yes... well, in that case the second part of my previous reply is valid as my 2 cents.

I can't really help you much then with this issue, except short explanation how i used to do this with other applications (used it on msn as well to test my activity plugin, before i discovered that this board gave polygamy patches). It is probably different from common approuch here (but i dont know which that would be, i am just 2 hours old on this board msn_wink.gif ).

I use the debugger OllyDbg to debug the applications (msn in this case) and to set breakpoints and patch the code. Please note that this is a debugger (not a resource editor), and has abitlities to patch asm code in the binaries (both runtime and into the file). And that it is not an application which you understand and can use in an hour (but imo very powerful).

The approuch i commonly use to find where i need to be is to set a breakpoint on certain API calls, or on the imported library functions. When it is reached i anylize the code that i see (dont forget to hit right click > analyze if you attached it runtime, if you opened it with file > open, it does when starting).

I check the things that i see against the assembly/win32 help files, and try to find out for myself wheter i want a small patch or a big patch. if it is a small patch i can use the space that the exe/dll uses for itself, and add my own code to there, if it is a big patch, you need to find free space in the binary, jump to there, execute your own code, and jump back. To know how to do this, you need quite some knowledge of the binary structures and asm (although you can write your code in c, compile it, open it in ollydbg, and see what code it generated), and it ain't easy.

But anyways, probably this technique aint used anyways, so i spare myself the extra/more detailed explanations msn_demon.gif If not, let me know msn_happy.gif

But, like stated before, i think it is nicer to inject your code into the (running) process, or use hooks, instead of hex editing any files. But that might be a matter of preference.
And a second note: imo these are quite complex solutions, patience and research is needed for sure msn_wink.gif
  Forum: Add-on Programming · Post Preview: #134940 · Replies: 17 · Views: 6,209

-B-
Posted on: May 8 2006, 09:33 PM


Mess.beanie
*

Group: Members
Posts: 10
Joined: 8-May 06
Member No.: 19,072


QUOTE(deAd @ May 8 2006, 11:16 PM)
He wants to modify a dll from a script, not hook messenger.
[right][snapback]134924[/snapback][/right]

hmm, my bad... Although i still dont understand exactly what exactly is trying to be archieved?

The thing may still be offtopic, but in that case it is because i still dont understand the problem really msn_tongue.gif msn_sarcastic.gif but just trying to be of any help i can msn_happy.gif

Do you want to change the binaries themselves to add functionality? Add your own code in them? (if not please explain again ( msn_dunno.gif ) or wait for someone else to aid.
But in this case, i dont really know, but personally it would not the way i would do it (changing binaries). Because everytime there is an update, you can do all of it again, and with the upcoming WLM, this may be harder/more often. In case you are the only user, it aint thát bad, but if you will make your app available to others, it becomes a bigger 'problem'. That besides the point things might go unpredicable if others use the same technique?

Well, just my 2 cents, just trying to help, just ignore if it aint any use msn_demon.gif
  Forum: Add-on Programming · Post Preview: #134929 · Replies: 17 · Views: 6,209

-B-
Posted on: May 8 2006, 09:17 PM


Mess.beanie
*

Group: Members
Posts: 10
Joined: 8-May 06
Member No.: 19,072


Just gave a thought on it, and I suppose that there are many global shortcuts to MSN: to start it automatically with windows, to start from start menu, to start com/activex instances, and maybe many more. So it depends really what you try to archive...

Many of these are accesible in the windows registery (start > run > regedit.exe), do a search here on msnmsgr.exe, and see if you can find the one that your need? Of course be a little careful what you change in the registery.
  Forum: Add-on Programming · Post Preview: #134926 · Replies: 1 · Views: 1,090

-B-
Posted on: May 8 2006, 09:11 PM


Mess.beanie
*

Group: Members
Posts: 10
Joined: 8-May 06
Member No.: 19,072


Well, i am not completely sure what you mean, but take a look at this and this. The first replaces a button with own functionality, the second adds menu items to msn. (used neither of them, didnt read them neither... just ran into them, so just take a look if you can use them or not yourself msn_happy.gif )

if you want to make an always on top button, you might want to also take a look at the Messenger API, because you can detect and retrieve the handles to new converstation windows (by head).
  Forum: Add-on Programming · Post Preview: #134920 · Replies: 17 · Views: 6,209

-B-
Posted on: May 8 2006, 07:46 PM


Mess.beanie
*

Group: Members
Posts: 10
Joined: 8-May 06
Member No.: 19,072


interesting topic, so interesting that i registered on this board to join the discussion msn_demon.gif

I was trying to develop a(n imo) cool plugin, and kept running into limitations althrough the developing with the Messenger API and the activity sdk, therefore i checked if WLM offered some new useful features for my plugin. It looked so promising....... just until that evil sandbox! msn_sad.gif No communication whatever with anything, not even as simple as the HD msn_sad.gif

Seeing that some of you run into the same problem (i.e. the saving of the settings) let join thoughts on how to bypass this d**n sandbox. (although i doubt that the sandbox will be removed when WLM goes official, it would still be nice to have my plugin ready, and just have to simplify it).

Thus... started thinking and trying... came up with a few ideas, with obviously didnt work (sharing files, IPC, remoting, etc)... Then I almost had a great idea: use DLL injection; inject your own dll into an empty/void plugin, and just use a hooking technique to intercept calls to this dll, but then with full rights. It looked promising (it also would remove the 1-plugin limitations, as you just could implement more hooks)... Untill i realised that the injected program would also run in the restricted sandbox...

There are currently 2 possible solutions that i can think of at the moment:
  1. Going one step earlier and somehow try to retrieve the call/event when MSN calls an plugin
  2. Have an (invisible) form which you can read of information, and post information to, using handles/messages/etc

Any thoughts on this? Who has some nice ideas as well msn_grin.gif

P.s. i dont want to use the MSN protocol... i am making an addon for msn, not a stand alone app
  Forum: Add-on Programming · Post Preview: #134887 · Replies: 69 · Views: 76,950


New Posts  New Replies
No New Posts  No New Replies
Hot topic  Hot Topic (New)
No new  Hot Topic (No New)
Poll  Poll (New)
No new votes  Poll (No New)
Closed  Locked Topic
Moved  Moved Topic
 

RSS Lo-Fi Version Time is now: 17th November 2018 - 10:20 PM
© 2004-2008 Seb Skuse, mess.be.
MessForum v6.1.4 - created for, and for use only by mess.be.