Class 0 SMS (flash SMS) on Android 2.1+ - Desire Q&A, Help & Troubleshooting

Hi!
Have anyone noticed that Android removed the hidden API sendRawPdu() from the Interface ISms?
androidjavadoc.com/1.0_r1_src/com/android/internal/telephony/gsm/ISms.html
(I'm not allowed to link yet because I'm a new user ).
The API was still present at 1.6.
Is there a way to implement this into a custom ROM so that we could keep continuing to send these class 0 SMS'? Or is there a new method that I've missed?
Cheers

Flash SMS works fine for me.
Not very polished application, but does correctly send flash SMS.

snark_be said:
Flash SMS works fine for me.
Not very polished application, but does correctly send flash SMS.
Click to expand...
Click to collapse
I was under the impression that "FlashSMS" did *not* work with newer Android releases. At least that what I've read about it. The main reason why I'm pursuing this is because MyPhoneExplorer lost it's capability to send class 0 SMS through the phone (after v1.6) due to Android removing the API completely. And it shouldn't be too hard to implement this API in a custom ROM? Anyone?

itwt said:
I was under the impression that "FlashSMS" did *not* work with newer Android releases. At least that what I've read about it. The main reason why I'm pursuing this is because MyPhoneExplorer lost it's capability to send class 0 SMS through the phone (after v1.6) due to Android removing the API completely. And it shouldn't be too hard to implement this API in a custom ROM? Anyone?
Click to expand...
Click to collapse
Just bought it, didn't work for my, Defrost 5.7.. tried both with regular number and with +46 (my country prefix..) refund!

itwt said:
I was under the impression that "FlashSMS" did *not* work with newer Android releases.
Click to expand...
Click to collapse
As sais above, it works for me, on a HTC Desire running a rooted Froyo.
ivarson_swe said:
Just bought it, didn't work for my, Defrost 5.7.. tried both with regular number and with +46 (my country prefix..) refund!
Click to expand...
Click to collapse
Did the application crash? Or is the Flash SMS not sent? Maybe it's your operator that blocks Flash SMSes?

Flash sms works for me too, the one made by qwinter......
Sent from my HTC Desire using Tapatalk

Hmm, strange.. I wonder what API he used. I might try that app.
I'm still up for implementing the API mentioned, though.

snark_be said:
As sais above, it works for me, on a HTC Desire running a rooted Froyo.
Did the application crash? Or is the Flash SMS not sent? Maybe it's your operator that blocks Flash SMSes?
Click to expand...
Click to collapse
Nothing happened when I hit send. No crash or message. Should have checked logcat, too late now though.. you could be right about lockdown by operator too.. haven't tried sending from that sim card befo..

ivarson_swe said:
Just bought it, didn't work for my, Defrost 5.7.. tried both with regular number and with +46 (my country prefix..) refund!
Click to expand...
Click to collapse
Did you get an error or what happened? I just got "SMS send end" popup when I tried to press the send button.
EDIT:
Nevermind, it worked.

itwt said:
Did you get an error or what happened? I just got "SMS send end" popup when I tried to press the send button.
EDIT:
Nevermind, it worked.
Click to expand...
Click to collapse
the sms send end popup means the sms has been sent lol

AndroHero said:
the sms send end popup means the sms has been sent lol
Click to expand...
Click to collapse
Not necessarily, as mine didn't send because I activated flight mode, yet the popup appeared.

I just spoke with the author, he's calling the SendRawPdu() method to push the class 0 sms through. So the API must be present in the system after all. Hmm.

IS the API still here cause i can't use/find it

Flash sms
Flash sms - nothing happend when i hit SEND
Advansed sms sender - "send failed"
HTC Tattoo with 2.3.3 CM7

Still no luck with class0 on Android? Something like HushSMS would be great!

I think the code is missing is the following, that exists in the previous version 2:
grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.6_r2/com/android/internal/telephony/IccSmsInterfaceManager.java#IccSmsInterfaceManager.sendRawPdu(byte%5B%5D%2Cbyte%5B%5D%2Candroid.app.PendingIntent%2Candroid.app.PendingIntent[/url])
/**
* Send a Raw PDU SMS
*
* @param smsc the SMSC to send the message through, or NULL for the
* defatult SMSC
* @param pdu the raw PDU to send
* @param sentIntent if not NULL this <code>Intent</code> is
* broadcast when the message is sucessfully sent, or failed.
* The result code will be <code>Activity.RESULT_OK<code> for success,
* or one of these errors:
* <code>RESULT_ERROR_GENERIC_FAILURE</code>
* <code>RESULT_ERROR_RADIO_OFF</code>
* <code>RESULT_ERROR_NULL_PDU</code>.
* @param deliveryIntent if not NULL this <code>Intent</code> is
* broadcast when the message is delivered to the recipient. The
* raw pdu of the status report is in the extended data ("pdu").
*/
public void sendRawPdu(byte[] smsc, byte[] pdu, PendingIntent sentIntent,
PendingIntent deliveryIntent) {
Context context = mPhone.getContext();
context.enforceCallingPermission(
"android.permission.SEND_SMS",
"Sending SMS message");
if (DBG) log("sendRawPdu: smsc=" + smsc +
" pdu="+ pdu + " sentIntent" + sentIntent +
" deliveryIntent" + deliveryIntent);
mDispatcher.sendRawPdu(smsc, pdu, sentIntent, deliveryIntent);
}
create SmsRawData lists from all sms record byte[] Use null to indicate "free" record
Parameters:
messages List of message records from EF_SMS.
Returns:
SmsRawData list of all in-used records
121
122 protected ArrayList<SmsRawData> buildValidRawData(ArrayList<byte[]> messages) {
123 int count = messages.size();
124 ArrayList<SmsRawData> ret;
125
126 ret = new ArrayList<SmsRawData>(count);
127
128 for (int i = 0; i < count; i++) {
129 byte[] ba = messages.get(i);
130 if (ba[0] == STATUS_ON_ICC_FREE) {
131 ret.add(null);
132 } else {
133 ret.add(new SmsRawData(messages.get(i)));
134 }
135 }
136
137 return ret;
138 }
Generates an EF_SMS record from status and raw PDU.
Parameters:
status Message status. See TS 51.011 10.5.3.
pdu Raw message PDU.
Returns:
byte array for the record.
146
147 protected byte[] makeSmsRecordData(int status, byte[] pdu) {
148 byte[] data = new byte[IccConstants.SMS_RECORD_LENGTH];
149
150 // Status bits for this record. See TS 51.011 10.5.3
151 data[0] = (byte)(status & 7);
152
153 System.arraycopy(pdu, 0, data, 1, pdu.length);
154
155 // Pad out with 0xFF's.
156 for (int j = pdu.length+1; j < IccConstants.SMS_RECORD_LENGTH; j++) {
157 data[j] = -1;
158 }
159
160 return data;
161 }
162
163 protected abstract void log(String msg);
164
165}
Compared with the 2.2.1_r1
grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/1.6_r2/com/android/internal/telephony/IccSmsInterfaceManager.java/?v=diff&id2=2.2.1_r1

Working app
Only for HTC official ROMs, but working. Available in Market. Application name - "Flash sms for HTC"

Flash SMS by jomegasoft in the market works on my HTC Sensation Z710a running Pyramid3D v8.3.0 XE ROM.

hi there, ive tried all the applications!
Flash sms (logo with heart)
Flash sms (Jomego)
HushSMS
advanced sms sender and ...
and all above DOES NOT send class 0 sms for me
and there is one apk that i can not try!
https://github.com/virtualabs/ZeroSMS
can any body tell me how can i install that?
ive tried with Quick ADB Pusher v0.5 but i can not do that!

DSH said:
hi there, ive tried all the applications!
Flash sms (logo with heart)
Flash sms (Jomego)
HushSMS
advanced sms sender and ...
and all above DOES NOT send class 0 sms for me
and there is one apk that i can not try!
can any body tell me how can i install that?
ive tried with Quick ADB Pusher v0.5 but i can not do that!
Click to expand...
Click to collapse
Hi click on the first folder or top folder then select the signed apk and install. Works perfectly with my nexus 4 running minco ROM and Franco kernel r53
---------- Post added at 09:00 PM ---------- Previous post was at 08:54 PM ----------
I used root browser lite to install and download it apk using my phone .if I remember correctly go root browser
Sdcard/ download/ and install from there.

Related

Hook API function WM6

I'm trying to hook api function "NKDbgPrintfW" from coredll.dll.
I use import table in-memory patch. It works fine for main module (exe file).
It hooks all calls from exe, but does not from dll it uses.
I think root of problem is that exe and loaded dlls use own import table and I patch only exe's one.
I use next function to hook exe api calls:
Code:
DWORD ic_PatchProcImports ( HANDLE hProc, DWORD dFind, DWORD dReplace )
{
DWORD ret = 0;
/* GODMODE ON */
BOOL bOldKMode = SetKMode ( TRUE );
DWORD dOldPerms = SetProcPermissions ( 0xFFFFFFFF );
/* get process ptr prom handle */
HDATA * hProcHD = ( HDATA * ) ( 0x80000000 | ( ( DWORD ) hProc & HANDLE_ADDRESS_MASK ) );
PROCESS * prc = ( PROCESS * ) hProcHD->pvObj;
/* get imports sections */
struct ImpHdr * blockptr, * blockstart;
blockstart = ( struct ImpHdr * ) MapPtrProc ( prc->e32.e32_vbase + prc->e32.e32_unit[IMP].rva, prc );
/* iterate thru imports sections */
for ( blockptr = blockstart; blockptr->imp_lookup; ++blockptr )
{
DWORD dOldProtect, tmp;
/* get vectors ptr */
DWORD * vectors = ( DWORD * ) MapPtrProc ( prc->e32.e32_vbase + blockptr->imp_address, prc );
/* count vectors */
DWORD * vptr = vectors;
while ( * vptr ) ++vptr;
DWORD vcnt = ( vptr - vectors );
/* try to unlock imports section memory */
if ( VirtualProtect ( vectors, vcnt * sizeof ( DWORD ), PAGE_EXECUTE_READWRITE, &dOldProtect ) )
{
/* find&replace */
for ( UINT i = 0; i < vcnt; ++i )
{
if ( vectors[i] == dFind )
{
vectors[i] = dReplace;
++ret;
}
}
/* lock back */
VirtualProtect ( vectors, vcnt * sizeof ( DWORD ), dOldProtect, &tmp );
}
}
/* GODMODE OFF */
SetProcPermissions ( dOldPerms );
SetKMode ( bOldKMode );
/* */
return ret;
}
I tried to find import table in loaded dll module but failed.
Here is the code I used:
Code:
DWORD ic_PatchModuleImports ( HANDLE hProc, Module* mod, DWORD dFind, DWORD dReplace )
{
DWORD ret = 0;
/* GODMODE ON */
BOOL bOldKMode = SetKMode ( TRUE );
DWORD dOldPerms = SetProcPermissions ( 0xFFFFFFFF );
/* get process ptr prom handle */
HDATA * hProcHD = ( HDATA * ) ( 0x80000000 | ( ( DWORD ) hProc & HANDLE_ADDRESS_MASK ) );
PROCESS * prc = ( PROCESS * ) hProcHD->pvObj;
/* get imports sections */
ImpHdr *blockptr, *blockstart;
blockstart = ( ImpHdr * ) MapPtrProc(mod->e32.e32_vbase + mod->e32.e32_unit[IMP].rva, prc);
/* iterate thru imports sections */
for ( blockptr = blockstart; blockptr->imp_lookup; ++blockptr )
{
// NKDbgPrintfW(L"%s", blockptr->imp_dllname);
//DWORD dOldProtect, tmp;
/* get vectors ptr */
DWORD * vectors = ( DWORD * ) MapPtrProc(mod->e32.e32_vbase + blockptr->imp_address, prc);
/* count vectors */
DWORD * vptr = vectors;
while ( * vptr ) ++vptr;
DWORD vcnt = ( vptr - vectors );
/* try to unlock imports section memory */
//if ( VirtualProtect ( vectors, vcnt * sizeof ( DWORD ), PAGE_EXECUTE_READWRITE, &dOldProtect ) )
{
/* find&replace */
for ( UINT i = 0; i < vcnt; ++i )
{
NKDbgPrintfW(L"Serach for: %x; Found: %x", dFind, vectors[i]);
if ( vectors[i] == dFind )
{
vectors[i] = dReplace;
++ret;
}
}
/* lock back */
// VirtualProtect ( vectors, vcnt * sizeof ( DWORD ), dOldProtect, &tmp );
}
}
/* GODMODE OFF */
SetProcPermissions ( dOldPerms );
SetKMode ( bOldKMode );
/* */
return ret;
}
I'm looking for any way to hook this function, but I prefer in-memory import table patch..
Hello!
Perhaps this will help:
http://forum.xda-developers.com/showthread.php?t=372496
I am also working on a program that needs hooks. My problem right now is that I need to create the header with all the structure definitions (PROCESS, THREAD, ect). I found this but it is most likely for an older CE version as it was written in 2003:
http://nah6.com/~itsme/cvs-xdadevtools/itsutils/old/cenk.h
Do you have these definitions for wince 5.x?
I think, you can find it in Windows Mobile Platform SDK .
MS sells that SDK, but if you google it, you'll find a place where you can download it for free
I was working on a similar problem but I decided to make a generic hook that didn't rely only on import table. Thanks to itutils I was able to hook some functions until when I found out that there two methods for making api calls, the standard one and the "speedy" one. I wasn't able to hook any function that was using the second method and after a bit I gave up. How did you overcome this problem?
Any suggestion is welcome, thank you
I still have not solved my problem. I am trying to hook calls to keybd_event in coredll from keypad.dll. I think the root of the problem is that that keypad.dll is in ROM. Therefore the thunk table that is actually inside keypad.dll is not readable or writeable at runtime. I think there is a thunk table created in RAM somewhere else where the function pointers are actually stored. I can find it by analyzing keypad.dll and finding the hex location to where the runtime thunk table is, but I cant find a way to figure it out at runtime so that my hook will work with any dll.
I use the PerformCallback4 DLL hooking and it's working with ROM files. But I'd also be interested if there's a way to inject into a process without needing to load a separate DLL.
Well process injection is not my problem. I am trying to hook calls from a service dll. All I did was add my dll as a service and I am kindly loaded at boot. Its the hooking I cant get to work. How are you accomplishing the hook? I just want to hook all calls from other services to keybd_event.
What _exactly_ do you guys want to do? I may be able to assist.
I know the answers to most questions I see here, but I will simply not give out the code to do this, because it is "dangerous" code. By that I do not mean it is not somewhat reliable, but dangerous to commercial developers as these techniques allow you to crack pretty any commercial app with minimal effort...
(see my notice about having easily bypassed the MS Marketplace "advanced protection" on various news sites for an example of how bad this can be)
Actually I'd be curious to know how to hook an API that can use the kmode speedup, that is one that's using g_pKmodeEntries. I'm not interesting into cracking anything but at this point I'm curious to know how to go ahead.
Thanx for any help.
I heard that the DLL injection hooks won't work for WinCE 6.0 (--> WM 7) but what about the mentioned "kmode speedup"?
bbbird1 said:
Actually I'd be curious to know how to hook an API that can use the kmode speedup, that is one that's using g_pKmodeEntries. I'm not interesting into cracking anything but at this point I'm curious to know how to go ahead.
Thanx for any help.
Click to expand...
Click to collapse
Well there are various ways to patch functions out. The problem is that there are several ways that a kernel function can ultimately be called. Of course there are also various ways to go about patching these functions. To name a few:
(1) Patch the apiset tables and overwrite the function address the trap jumps to. If this is the same table and address are used for the g_pKmodeEntries jump I am not sure - you would have to do some IDA'ing / testing to figure that one out
(2) Patch the import tables of the executable / dll calling this function, if you have a specific target in mind (with some small trickery this can be adapted to also patch 'dynamic imports', i.e. GetProcAddress, even after the call was made)
(3) Patch the export table of coredll (actually if this one matches your wishes, I usually use 4 instead)
(4) Patch the function inside coredll directly by (saving first and then) overwriting the first few instructions with a jump to your code
(5) Patch the actual function inside nk or the other exe server (closely related to 4)
Each method has it's own pros and cons, injection/controlled-leak/code requirements and may or may not work with certain way of calling the function. Some of these patches are much more difficult to do than others...
You'd have to figure out for your function which method might actually work. For example I usually have great results with method 4, however it will not catch some ways of kernel-internal calls, so you have to confirm first with some heavy IDA'ing to see if internal calls exist (completely bypassing coredll, for most functions they actually don't). Unfortunately that I recall I have not tried patching any g_pKmodeEntries intentionally (as in I might have patched such functions, but not knowingly).
RAMMANN said:
I heard that the DLL injection hooks won't work for WinCE 6.0 (--> WM 7) but what about the mentioned "kmode speedup"?
Click to expand...
Click to collapse
Well we'd pretty much have to start from scratch again, figuring a lot of stuff out, but I'm sure we'll find new and exciting ways of hooking kmode speedup might still be there, though, but likely in a different form.
Chainfire said:
What _exactly_ do you guys want to do? I may be able to assist.
I know the answers to most questions I see here, but I will simply not give out the code to do this, because it is "dangerous" code. By that I do not mean it is not somewhat reliable, but dangerous to commercial developers as these techniques allow you to crack pretty any commercial app with minimal effort...
(see my notice about having easily bypassed the MS Marketplace "advanced protection" on various news sites for an example of how bad this can be)
Click to expand...
Click to collapse
Hello chainfire! I am trying to hook keyboard events comming from the keypad driver. There is a service that runs to detect key interrupts and when it does detect them it calls keybd_event to broadcast the event. keybd_event is in coredll. The keypad service is loaded from keypad.dll (in most ROMs). So I want to hook calls from keypad.dll to keybd_event in coredll. The problem is that I want it to work regardless of ROM version and there are different versions of keypad.dll, and some ROMs dont have it at all. Therefore I want to hook all calls to keybd_event from services. I added my dll as a service so injection method is not a problem. Now I need to hook.
Using IDA I found the address of the IAT in keypad, but the IAT that exists in the dll itself is not readable or writeable. It seems that there is a thunk table that gets created in RAM separate from where the dll is loaded. Each process seems to create it's own RAM thunk table for loaded dlls (my guess is just those in ROM). I dont know how to programmatically find these thunk tables.
Do I make sense? This is of course targeting WM6.x (wce5). I just need some way to hook calls to keybd_event from all dlls loaded in the current process. Some of those dlls may be in ROM but they need to be hooked too.
Chainfire said:
Well there are various ways to patch functions out. The problem is that there are several ways that a kernel function can ultimately be called. Of course there are also various ways to go about patching these functions. To name a few:
(1) Patch the apiset tables and overwrite the function address the trap jumps to. If this is the same table and address are used for the g_pKmodeEntries jump I am not sure - you would have to do some IDA'ing / testing to figure that one out
(2) Patch the import tables of the executable / dll calling this function, if you have a specific target in mind (with some small trickery this can be adapted to also patch 'dynamic imports', i.e. GetProcAddress, even after the call was made)
(3) Patch the export table of coredll (actually if this one matches your wishes, I usually use 4 instead)
(4) Patch the function inside coredll directly by (saving first and then) overwriting the first few instructions with a jump to your code
(5) Patch the actual function inside nk or the other exe server (closely related to 4)
Each method has it's own pros and cons, injection/controlled-leak/code requirements and may or may not work with certain way of calling the function. Some of these patches are much more difficult to do than others...
You'd have to figure out for your function which method might actually work. For example I usually have great results with method 4, however it will not catch some ways of kernel-internal calls, so you have to confirm first with some heavy IDA'ing to see if internal calls exist (completely bypassing coredll, for most functions they actually don't). Unfortunately that I recall I have not tried patching any g_pKmodeEntries intentionally (as in I might have patched such functions, but not knowingly).
Well we'd pretty much have to start from scratch again, figuring a lot of stuff out, but I'm sure we'll find new and exciting ways of hooking kmode speedup might still be there, though, but likely in a different form.
Click to expand...
Click to collapse
I like the sound of (3). Why Use (4) instead? How do you find the export table programmatically? If I use this method, as long as my service is loaded first it should work.
Ok I just tried something and it worked. It seems that these RAM thunk tables are always loaded at 0x01bb5000 for every process. The following code worked:
Code:
coremod = GetModuleHandle(L"coredll.dll");
o_keybd_event = (_keybd_event)GetProcAddress(coremod, L"keybd_event");
my_kbe = (DWORD)(my_keybd_event);
addr = (DWORD*)(0x01bb5000);
VirtualProtect(addr, 4, PAGE_READWRITE, NULL);
while(ReadProcessMemory(GetCurrentProcess(), addr, &dat, 4, NULL))
{
if(dat == (DWORD)o_keybd_event)
{
WriteProcessMemory(GetCurrentProcess(), addr, &my_kbe, 4, NULL);
kbe_hkd = TRUE;
}
addr++;
VirtualProtect(addr, 4, PAGE_READWRITE, NULL);
}
The thunk tables seem to be back to back and ReadProcessMemory seems to always fail at the end of them, so the loop does not run too long. Chainfire, does this make sense to you?
JKingDev said:
...
Do I make sense? This is of course targeting WM6.x (wce5). I just need some way to hook calls to keybd_event from all dlls loaded in the current process. Some of those dlls may be in ROM but they need to be hooked too.
Click to expand...
Click to collapse
Using IAT patch to do this is certainly possible but a lengthy process as you'd have to keep track for all dll loads in services.exe and patch each and every dll as it loads. One of the other methods I described may fit better.
JKingDev said:
I like the sound of (3). Why Use (4) instead? How do you find the export table programmatically? If I use this method, as long as my service is loaded first it should work.
Click to expand...
Click to collapse
(3) is actually (IMHO) a very annoying patch to implement. It doesn't easily allow you to patch/unpatch at will. It doesn't cover coredll-internal jumps. The timing/load-order has to be perfect. It requires slightly more memory. And because you have to load it before anything else if you screw something up there's a good chance you'll need a hard-reset to recover (that's a real ***** with testing!). You can get the export table from the e32 structure of the module, though it isn't always easily patched
JKingDev said:
Ok I just tried something and it worked. It seems that these RAM thunk tables are always loaded at 0x01bb5000 for every process. The following code worked:
The thunk tables seem to be back to back and ReadProcessMemory seems to always fail at the end of them, so the loop does not run too long. Chainfire, does this make sense to you?
Click to expand...
Click to collapse
ROM DLLs create a seperate data section in memory for every process it is loaded into, the IAT is also stored there. Note that the addresses / virtual memory are the same across processes, but different physical memory is used for each process (same as data sections for normal DLLs, though those are located at the normal addresses). To figure out where this memory is look at the rwLow and rwHigh members of the PMODULE structure. (actually I'm surprised you found the location without this )
Chainfire said:
ROM DLLs create a seperate data section in memory for every process it is loaded into, the IAT is also stored there. Note that the addresses / virtual memory are the same across processes, but different physical memory is used for each process (same as data sections for normal DLLs, though those are located at the normal addresses). To figure out where this memory is look at the rwLow and rwHigh members of the PMODULE structure. (actually I'm surprised you found the location without this )
Click to expand...
Click to collapse
That is the vital info I needed! Quick question, do I start searching at rwLow and end at rwHigh, or start at rw Low and end at rwLow+rwHigh?
Thanks!
*edit* Answering my own question, start searching at rwLow and end at rwHigh. I was still having problems because my MODULE structure definition is incorrect, but I was able to find where the information I needed was so it doesnt really matter. Thanks so much!!

SQL CE is driving me crazy !

Hi !
I'm trying to create an application based on location aware concept.
And I'm trying to do a simple query to update some records in my database but it isn't working..
I'm trying to do a simple query like "UPDATE markers set status = 0 WHERE id = 10"
This is giving me an error like this "[1,8,markers]". BUT WHAT THE HELL DOES THIS MEAN ?
If I try to run que query manually it does work ! So what i'm I doing wrong ? How can I activate a (MUCH) more verbose error information ?
This is my function :
Code:
Public Sub turnMarker(ByVal id As String, ByVal status As String)
cOpen()
Dim query As SqlCeCommand = myCon.CreateCommand
query.CommandText = "UPTADE markers set status = " + status + " WHERE id = " + id + ""
Try
'MsgBox(query.CommandText)
query.ExecuteNonQuery()
Catch ex As Exception
MsgBox("Error updating markers !" + query.CommandText + ex.Message)
End Try
cClose()
End Sub
thanks !
EDIT: Nevermind ... found out the problem.
Nevertheless, does anyone know how to make errors more verbose ?
Use SqlCeException as opposed to Exception, and then run through the errors collection....
strX = strX & ex.NativeError
For I = 0 To ex.Errors.Count - 1
strX = strX & "Index #" & I & vbCrLf & "Error:" & ex.Errors(I).ToString() & vbCrLf
Next
do a search for sr.dll. you need to deploy this as part of your app to be able to see exception data when debugging .net ce apps.
or go here -> http://forum.xda-developers.com/showpost.php?p=4862355&postcount=87 .That sample project has got a copy. you'll need to add it as part of whatever project you're making.

Accessing SQL server Database

So I am trying to access a data an sql database hosted by godaddy.com i am easily able to write to and read from the database from a desktop app the i wrote but i was trying to write an app for my windows moible phone that would write to the database but its not working. I don't get any errors, the program just runs but nothing get written to the database. Any help would be great. Thanks
Code:
string connectionstring = "data Source=irus99.db.5497838.hostedresource.com;Initial Catalog=irus99;Persist Security Info=True;User ID=usr;Password=pw";
SqlConnection connection = new SqlConnection(connectionstring);
string insertStatement = "INSERT Data (User, ZipCode, LatLong) " + "VALUES (@User, @ZipCode, @LatLong)";
SqlCommand insertCommand = new SqlCommand(insertStatement, connection);
connection.Open();
insertCommand.Parameters.AddWithValue("@User", "name");
insertCommand.Parameters.AddWithValue("@ZipCode", 32826);
insertCommand.Parameters.AddWithValue("@LatLong", 28.59283);
connection.Close();
no one knows...
........
Calling
Code:
insertCommand.ExecuteNonQuery();
before closing the connection?
heliosdev said:
Calling
Code:
insertCommand.ExecuteNonQuery();
before closing the connection?
Click to expand...
Click to collapse
Thanks for replying, I tried what you said but I get an error. I put the insertCommand.ExecuteNonQuery(); right after the other insert commands. do you have another suggestion. Thanks again
You put the line just before closing the connection, right?
Do you check that the connection is open after the connection.Open() call?
heliosdev said:
You put the line just before closing the connection, right?
Do you check that the connection is open after the connection.Open() call?
Click to expand...
Click to collapse
how can i check?, I just assumed that it was since i was not getting any errors
check connection.State == ConnectionState.Open
P.S.:
What cf version are you using? (2.0, 3.5)
I'm using SqlCeConnection and you have SqlConnection
heliosdev said:
check connection.State == ConnectionState.Open
P.S.:
What cf version are you using? (2.0, 3.5)
I'm using SqlCeConnection and you have SqlConnection
Click to expand...
Click to collapse
I tried SqlCeConnection but I was getting errors. I'm using 3.5
Is check a command cause its not showing up???
Code:
...
connection.Open();
if (connection.State == ConnectionState.Open)
{
...
connection.Close();
}
...
heliosdev said:
Code:
...
connection.Open();
if (connection.State == ConnectionState.Open)
{
...
connection.Close();
}
...
Click to expand...
Click to collapse
I get an error
'System.Data.ConnectionState' is a 'type' but is used like a 'variable'

Running Homebrew Native Executables - Status: DONE!!

[2012/06/03] IMPORTANT UPDATE HERE
Hi hackers,
This is meant as a little update on one of the projects I've been working on. I'm kinda stuck now. I have a suspicion of what the problem is. I thought that maybe if I write a post about it, me or someone else will have an idea on how to get this working.
The goal is to run native homebrew executables on WP7
This has not been done yet. All apps are Silverlight apps that are compiled as DLL and run by Taskhost.exe with least privileges. All other executables are signed by Microsoft. Executables that are compiled as ARM executable cannot be started.
The angle is to create a certificate that allows to sign a WP7 executable. Then add that to the appropriate certificate store. Create an executable. Sign it with the private key. Load it onto a WP7 device. Copy it to the Windows folder. Use an OEM driver to launch the executable.
First I did research on the certificate stores. I can now with certainty state that there are 4 certificate stores:
- CA
- Root
- My
- Code Integrity
After a lot of research I finally got complete read/write access to all of these stores. The Code Integrity store contains all the certificates that are used by the Loader Verifier to verify the executable that is being launched. When the device is launched for the first time, the certificates that are in \Windows\ciroots.p7b are installed to that certificate store. These certificates have these properties:
Key Usage = 0x86 = Digital Signature, Certificate Signing, Off-line CRL Signing, CRL Signing
Entended Key Usage = Code Signing (1.3.6.1.5.5.7.3.3) + Unknown key usage (1.3.6.1.4.1.311.10.3.14)
So I used OpenSSL to create such an certificate (with private key) for myself. And I installed the certificate in the Code Integrity store.
I then used VS2008 to create a completely barebone executable (ARMv4 Console app with only Sleep(-1) in the Main). I signed it with SignTool from Microsoft.
I loaded the executable to my device and I copied it to the \Windows folder (I think the policies restrict executing to only from that folder, but I'm not sure about that).
I use the Samsung driver to launch the executable, because I need at least Standard Rights to launch an executable. The Samsung driver has Elevated Rights. My own app has only Least Privileges. Using the Samsung driver does not return any success or fail codes. But looking at the Running Processes list, I don't see my Test.exe running. It should be, because the main thread is put to sleep infinitely.
So why is this not working?
Well, I have a guess. I think it's the policies that bind the certificates in the Code Integrity store to the different accounts/chambers. In the \Windows folder there are a lot of policy xml-files. On fist boot, these are merged into PolicyCommit.xml and then compiled to policydb.vol. When the Loader Verifier (lvmod.dll) loads an executable, it queries the policies to determine access rights and chamber for that executable. The policies that matter in this context are defined in 8314B832-8D03-444f-9A2A-1EF6FADCC3B8.policy.xml. It's an xml-file that basically says this:
Code:
Microsoft Mobile Device Privileged PCA - ced778d7bb4cb41d26c40328cc9c0397926b4eea - not used in this context
Microsoft Mobile Device TCB PCA - 88bcaec267ef8b366c6e6215ac4028e7a1be2deb - honored by System Identity Group
Microsoft Mobile Device Unprivileged PCA - 1c8229f5c8d6e256bdcb427cc5521ec2f8ff011a - honored by Standard Right Identity Group
Microsoft Mobile Device VSD PCA - 91b318116f8897d2860733fdf757b93345373574 - not used in this context
VeriSign Mobile Root Authority for Microsoft - 069dbcca9590d1b5ed7c73de65795348e58d4ae3 - honored by LPC Identity Group
I should find a way to add a policy with my certificate in it. Any ideas?
Ciao,
Heathcliff74
If you are able to re-sign an executable that is already in the ROM, i would try that, so you know the problem isn't within the native code, but only with the signing. Or maybe the other way round which would be awesome.
regards
Flow WP7 said:
If you are able to re-sign an executable that is already in the ROM, i would try that, so you know the problem isn't within the native code, but only with the signing. Or maybe the other way round which would be awesome.
regards
Click to expand...
Click to collapse
That's a good idea. I must say that I don't have much faith in the current RecMod tools for WP7 right now. I am able to get the binaries recmodded so that I can disassemble them correctly. But I don't think they can be easily launched. But there are executables that are on the rom as complete binaries, instead of rom-modules. To begin with, I have to select one that does not need much privileges to run and try to sign that one and then run it.
I'm really busy with work right now, so I think I won't be able to try it until the day after tomorrow. But I will try it and will let know how that went.
Thanks!
Decompiled taskhost.exe, so it gets more easy for us to see if its able to make taskhost to start another exe for us. Lots of code tho (C code).
taskhost.c (276 KB) in attachments.
edit: Oh, WOW, this really shows how to call those anonymous methods without call signature "Hello" (signature: "??z_Hello_?mze")
Hmm, pretty much about the pause part?
Code:
if ( v10 )
{
a7 = sub_178E7(v10);
if ( a7 >= 0 )
{
a7 = sub_180A5(v7, v7 + 64);
if ( a7 >= 0 )
{
a7 = ThemeInitialize(v7 + 136);
if ( a7 >= 0 )
{
v11 = sub_1862B(v13, v7);
EnableHostAutoDehydration(v11 == 3);
v16 = 0;
a7 = InitializeEmClientEx(&a2, 0, &v16);
if ( a7 >= 0 )
{
a7 = RegisterPausedHostCallback(sub_19D0D, 0);
if ( a7 >= 0 )
{
a7 = RegisterResumingHostCallback(sub_19D31, 0);
if ( a7 >= 0 )
{
if ( v11 != 3
|| (a7 = RegisterDehydrateHostCallback(sub_19D76, 0), a7 >= 0)
&& (a7 = RegisterFreezeHostCallback(sub_19D97, 0), a7 >= 0) )
{
a7 = RegisterExitHostCallback(sub_19D55, 0);
if ( a7 >= 0 )
a7 = sub_17C0A(*(_DWORD *)(v7 + 128), 0);
}
}
}
}
}
}
}
}
UIX framework entry-point (exe)
Code:
int __cdecl sub_11114(int a1, int a2, int a3)
{
int v4; // [sp+0h] [bp-38h]@1
char Dst; // [sp+4h] [bp-34h]@1
int v6; // [sp+8h] [bp-30h]@1
int v7; // [sp+Ch] [bp-2Ch]@1
int v8; // [sp+18h] [bp-20h]@1
int v9; // [sp+28h] [bp-10h]@1
v4 = 0;
memset(&Dst, 0, 0x34u);
v8 = a3;
v6 = (int)L"res://FlightModeUXDLL!FlightMode.uix";
v7 = (int)L"FMMain";
v9 = 2;
RunApplication(&v4);
return dword_12034;
}
C++ converted
Code:
UIXApplicationInfo app;
app { ... }
RunApplication(&app);
struct UIXApplicationInfo
{
int UNK_v4 = 0;
char Dst = {0};
char* uixFile;
char* uixEntryPoint;
int UNK_v8;
int UNK_v9 = 2;
}
Then just figure out the UIX part (or test the existing "res://FlightModeUXDLL!FlightMode.uix" if it launches, if so, we made it).
___
Found this in mango dump:
> Uninstall provxml
Code:
<!-- Uninstall Xbox LIVE Extras App -->
<characteristic type="AppInstall">
<nocharacteristic type="{0c17d153-b5d5-df11-a844-00237de2db9e}"/>
</characteristic>
Is there a reason you can't just use COM interop to run native code? Check out this thread for a discussion covering the technique: http://forum.xda-developers.com/showthread.php?t=820455
athompson said:
Is there a reason you can't just use COM interop to run native code? Check out this thread for a discussion covering the technique: http://forum.xda-developers.com/showthread.php?t=820455
Click to expand...
Click to collapse
Hello "co-founder of native code on WP7"
I'm fully aware of the possibility of native code through COM. I use it for example in the WP7 Root Tools. But I just wanted to take it a step further. Running native executables give a lot more freedom. Not being bound to the watchdog, getting higher privileges and running in the background for instance. But there's a whole lot more. So that's why I started research on it. Thanks anyway. You helped making native code possible on WP7.
Ciao,
Heathcliff74
The taskhost.exe is our RAM, because our app run in it, giving us full RAM access inside our "viritual ram". So that means we own all strings, int, floats etc. Then rewrite the ram to change strings in mscorlib. The checksum if an exe has been modified is only checked at startup, without checking if we modify the dll at runtime.
My purpose with this is that some function's call external apps, where we rewrite the args going in to the function. Just find an exploitable function and modify it after JIT has been there one before generating the pre ram, that we modify and call yet again but with the modified ram values behind.
Marshal.Copy, my friends, there.
[SecurityFuckingSafeCritical]
(byte[] source, IntPtr destination, int length)
> Interopservices leaked dll (\windows)
destination = our ram ptr to modify.
fiinix said:
The taskhost.exe is our RAM, because our app run in it, giving us full RAM access inside our "viritual ram". So that means we own all strings, int, floats etc. Then rewrite the ram to change strings in mscorlib. The checksum if an exe has been modified is only checked at startup, without checking if we modify the dll at runtime.
My purpose with this is that some function's call external apps, where we rewrite the args going in to the function. Just find an exploitable function and modify it after JIT has been there one before generating the pre ram, that we modify and call yet again but with the modified ram values behind.
Marshal.Copy, my friends, there.
[SecurityFuckingSafeCritical]
(byte[] source, IntPtr destination, int length)
> Interopservices leaked dll (\windows)
destination = our ram ptr to modify.
Click to expand...
Click to collapse
Hmmm. 10 Points for inventiveness But I don't think it's going to work. Even if you could find a function where the executable is passed as argument you still don't have enough privileges. Most code will have the path to the executable hardcoded instead of an argument. And you will still run under TaskHost with Least Privileges. And you need to have at least Standard Privileges or higher to launch most executables with CreateProcess() or ShellExecuteEx().
Sent from my OMNIA7 using XDA Windows Phone 7 App
Heathcliff74 said:
Hmmm. 10 Points for inventiveness But I don't think it's going to work. Even if you could find a function where the executable is passed as argument you still don't have enough privileges. Most code will have the path to the executable hardcoded instead of an argument. And you will still run under TaskHost with Least Privileges. And you need to have at least Standard Privileges or higher to launch most executables with CreateProcess() or ShellExecuteEx().
Sent from my OMNIA7 using XDA Windows Phone 7 App
Click to expand...
Click to collapse
"And you will still run under TaskHost with Least Privileges"
I know, i dont need standard rights to do it. Because i call a mscorlib function that is trusted code. I think you saw my idea wrong, let me show you.
[mscorlib, SecuritySafeCritical]
public static void example(string str)
{
string mscorlibStr = "you cant change my value ";
Debug.WriteLine(mscorlibStr + str);
}
This is where we modify "mscorlibStr" in ram and the function is still trusted code. But its doing something totally different from that it would do.
fiinix said:
"And you will still run under TaskHost with Least Privileges"
I know, i dont need standard rights to do it. Because i call a mscorlib function that is trusted code. I think you saw my idea wrong, let me show you.
[mscorlib, SecuritySafeCritical]
public static void example(string str)
{
string mscorlibStr = "you cant change my value ";
Debug.WriteLine(mscorlibStr + str);
}
This is where we modify "mscorlibStr" in ram and the function is still trusted code. But its doing something totally different from that it would do.
Click to expand...
Click to collapse
I really hate to break it for you. But the [SecuritySafeCritical] is indeed trusted code, but it will still check your privileges. All the API functions that do system modifications like that, do the security checks. Read the note under SecuritySafeCriticalAttribute here. Also read this; same problem. You are in process TaskHost.exe and it is launched in LPC (Least Privilege Chamber), so every CeImpersonateToken() to do the important stuff will fail and return an error code. I also wouldn't know how you would modify the stack-frame of a function that you call. Seems impossible to me, because at the moment you call the function, that stack-frame has not been allocated yet.
Anyway, although I don't think that is going to work in any way, I absolutely don't want to discourage you, because my experience is that when you try enough, sooner or later you will find an exploit
Ciao,
Heathcliff74
Currently installing "Windows Embeded Compact 7", because this lousy ARMv4 compiler (from WM5-6) maybe generates wrong ARM op-codes (WP7 runs ARMv7), therefore it says "Invalid program signature" (or what error it was).
Maybe ARMv7 is'nt even backwards compatibility with ARMv4.
By compiling with the ARMv7 compiler from WEM7, it will probably (hope) generate a valid exe.
Thats it..
edit:
*Research
"Armv7 is the processor instruction set used starting with the S5L8920 in the iPhone 3GS and in all subsequent devices. Processors that support Armv7 instructions are backward compatible with Armv6 instructions, but attempting to run binaries compiled for Arm7 on older, Armv6 processors will result in the error: "Bad CPU type in executable"."
Source: http://theiphonewiki.com/wiki/index.php?title=Armv7
___
"As I said in the past, the ARMv6 CTR was kept backwards compatible with
> > > earlier versions of the ARM architecture (and ARM tried to keep it like
> > > this as much as possible). With ARMv7, you have multiple levels of cache
> > > and different types (e.g. ASID-tagged VIVT I-cache). There is no way you
> > > could encode the useful information while keeping the same (and only)
> > > register, hence the the need for a new register."
Source: http://www.spinics.net/lists/arm-kernel/msg58813.html
As i see this (^), all ARMv > 6 == no backwards
ARMv6 had backwards to 4
ARMv7 >> ARMv6 compatibility, not more.
_
Problem officer even running ARMv4???
>On a non ARMv4 backwards compatibility CPU.
Profit!!
__
[ExeX.exe] (the one that i recompiled to a state: "this has to work")(ARMv4)
Decompilation:
Code:
; Attributes: bp-based frame
EXPORT start
start
var_20= -0x20
oldR4= -0x1C
oldR5= -0x18
oldR6= -0x14
oldR7= -0x10
oldR11= -0xC
oldSP= -8
oldLR= -4
MOV R12, SP
STMFD SP!, {R4-R7,R11,R12,LR}
ADD R11, SP, #0x1C
SUB SP, SP, #4
MOV R4, R3
MOV R5, R2
MOV R6, R1
MOV R7, R0
.
Next up, decompile a ARMv7 from a raw device. (how, someone has one)
fiinix said:
Next up, decompile a ARMv7 from a raw device. (how, someone has one)
Click to expand...
Click to collapse
I think you'll find what you're looking for here: http://forum.xda-developers.com/showthread.php?t=681659 in the dump of the IMAGEFS. What did you use to decompile it? IDA Pro, or a different thing?
athompson said:
I think you'll find what you're looking for here: http://forum.xda-developers.com/showthread.php?t=681659 in the dump of the IMAGEFS. What did you use to decompile it? IDA Pro, or a different thing?
Click to expand...
Click to collapse
IDA Pro, yes. Ill see if i can dump that "nbh" (used to nb0), and extract a fully operable exe that is not corrupted.
fiinix said:
IDA Pro, yes. Ill see if i can dump that "nbh" (used to nb0), and extract a fully operable exe that is not corrupted.
Click to expand...
Click to collapse
First use Andim's WP7 Rom Tools to extract the rommodules. Remember to always dump a folder, not a single file.
Then use Denomitor's version of Recmod and follow the instructions in the post. That works most of the time.
Going forward
Currently building the WP7 ARMv7 commandline, getting closer.
Current cmd (not working, no need to help):
Code:
"C:\WINCE700\sdk\bin\i386\arm\cl.exe" /Od /D "_DEBUG" /D "_WIN32_WCE=0x700" /D "UNDER_CE" /D "ZUNE_HD" /D "WINCE" /D "DEBUG" /D "_WINDOWS" /D "ARM" /D "_ARM_" /D "_UNICODE" /D "UNICODE" /D "_CRT_SECURE_NO_WARNINGS" /Gm /EHsc /MTd /Gy /fp:fast /GR- /Fo"C:\Users\Steven VM\Desktop\ARMv7\Build\Debug/" /Fd"C:\Users\Steven VM\Desktop\ARMv7\Build\Debug/vc80.pdb" /W3 /c /Zi /TP /QRfpe- /QRarch7 "C:\Users\Steven VM\Desktop\ARMv7\main.cpp"
/QRarch7 is the ARMv7.
edit:
HOORRY SHEEAT
generated:
> main.obj
> vc80.idb
> vc80.pdb
, feels soo good:
main.exe is there.
IDA Pro says "ARM AND THUMB MODE SWITCH INSTRUCTIONS", just like others.
Code:
; Input MD5 : B50E8D8395DE7CA2419464DC3CE0BC74
; File Name : C:\Users\Steven\Desktop\burn\main.exe
; Format : Portable executable for ARMI (PE)
; Imagebase : 10000
; Section 1. (virtual address 00001000)
; Virtual size : 00000018 ( 24.)
; Section size in file : 00000200 ( 512.)
; Offset to raw data for section: 00000400
; Flags 60000020: Text Executable Readable
; Alignment : default
; Processor : ARM
; Target assembler: Generic assembler for ARM
; Byte sex : Little endian
; Segment type: Pure code
AREA .text, CODE, READWRITE, ALIGN=4
; ORG 0x11000
CODE32
EXPORT start
start
var_4= -4
SUB SP, SP, #4
MOV R3, #1
STR R3, [SP,#4+var_4]
LDR R0, [SP,#4+var_4]
ADD SP, SP, #4
BX LR
; End of function start
Made an empty entry point as from above ^:
Code:
int wWinMainCRTStartup()
{
return 1;
}
PE Explorer (main.exe):
Machine: THUMB
Operating System Version: 7.0
Image Version: 7.0
Subsystem Version: 7.0
Subsystem: WinCE GUI
**** so CLOSE!
Successful copied "main.exe" and "ExeX.exe" to "\Windows", where i have the right to launch them remotely.
Method:
WP7Process p = device.LaunchEXE(@"main.exe", "");
main.exe (no signing, ARMv7):
System.UnauthorizedAccessException: Access is denied.
WP7Process p = device.LaunchEXE(@"ExeX.exe", "");
ExeX.exe (signed with CA/ROOT custom, ARMv4):
System.Runtime.InteropServices.COMException (0x800704EC): This program is blocked by group policy. For more information, contact your system administrator.
There IS different things going on! Something is missing, but what
edit:
Signed main.exe with custom XDA ROOT certificate (ARMv7):
signtool.exe sign /sha1 "[CertChomp]" "main.exe"
> Now main.exe also gets "This program is blocked by group policy. For more information, contact your system administrator."
Ill see if i can add it to startup list , if it boot from there.
edit 2:
Nope gonna hijack "fieldtestapp.exe" with my app because policy says:
Risky-mode.Activate();
Backup(fieldtestapp.exe, backupPath);
Copy(main.exe, > fieldtestapp.exe);
"LOADERVERIFIER_ROUTE_BY_NAME"
"LOADERVERIFIER_EXE_AUTHZ_INROM_ROOT"
<Rule Description="Route fieldtestapp.exe" ResourceIri="$(LOADERVERIFIER_ROUTE_BY_NAME)/PRIMARY/WINDOWS/FIELDTESTAPP.EXE" SpeakerAccountId="$(SYSTEM_USER_NAME)" PriorityCategoryId="PRIORITY_LOW">
<Authorize>
<Match AccountId="$(FIELDTESTAPP_EXE_SID)" AuthorizationIds="LV_ACCESS_EXECUTE" />
</Authorize>
</Rule>
<Rule Description="Authorize fieldtestapp.exe be loadable to $(FIELDTESTAPP_EXE_SID) and chambers" ResourceIri="$(LOADERVERIFIER_EXE_AUTHZ_INROM_ROOT)/WINDOWS/FIELDTESTAPP.EXE" SpeakerAccountId="$(SYSTEM_USER_NAME)" PriorityCategoryId="PRIORITY_STANDARD">
<Authorize>
<Match AccountId="$(FIELDTESTAPP_EXE_SID)" AuthorizationIds="LV_ACCESS_EXECUTE,LV_ACCESS_LOAD" />
</Authorize>
</Rule>
edit 3:
Seems like "fieldtestapp.exe" is ROM locked. Need to try out some other targets.
edit 4:
Target acquired "ProximitySensorDisable.exe" > "ProximitySensorDisableBackup.exe"
Successful copy == no ROM lock.
edit 5:
There exists two types of talking to the LoadVerifier (the: This program is blocked by group policy.):
Direct exe name OR special certificate
How we do:
> Direct exe (hijack exe)
How we cant do (SHA1) (Nope, ain't gonna happen):
> We certainly dont have Microsofts certificate so this way is a nodo, haha lol, no do way.
(1: direct exe name) /LOADERVERIFIER/GLOBAL/AUTHORIZATION/PE_AUTHZ/NONE/NONE/PRIMARY/WINDOWS/CFGHOST.EXE
(2: static/pre certificates) /LOADERVERIFIER/GLOBAL/CERTIFICATES/HASH/SHA1/91B318116F8897D2860733FDF757B93345373574
edit 6:
Yep, loads of edits, just for you.
Allowed exe's to run (sorted a-z) (direct exe) (pre cert removed):
Code:
ACCESSIBILITYCPL.EXE
ACCOUNTSMANAGER.EXE
ALARMS.EXE
APPCHECKERSHIM.EXE
APPPREINSTALLER.EXE
AUTODATACONFIG.EXE
AUTOSIM.EXE
AUTOTIMEUPDATE.EXE
BRIGHTNESSCPL.EXE
BTUXCPL.EXE
CALENDARAPP.EXE
CALLSETTINGSHOST.EXE
CALNOT.EXE
CALUPD.EXE
CAM_FW_UPDATE_UI.EXE
CELLUXCPL.EXE
CERTINSTALLER.EXE
CFGHOST.EXE
CFLAUNCHER.EXE
CHDIALERHOST.EXE
CIPHASE2.EXE
CLIENTSHUTDOWN3.EXE
CLOCKNOT.EXE
CMACCEPT3.EXE
COLDINIT.EXE
COMMSVC.EXE
COMPOSITOR.EXE
CONFIGDM.EXE
CONFIGXML.EXE
CONMANCLIENT3.EXE
CONTACTS.EXE
CPROG.EXE
DATETIMECPL.EXE
DCVSSWITCH.EXE
DEPOTCOPY.EXE
DEVICEFEEDBACKCPL.EXE
DEVICEREG.EXE
DIAGPORTCHANGETEST.EXE
DLLHOST.EXE
DMSCHEDULERCALLBACK.EXE
DMSRV.EXE
DMSTOOLS.EXE
DUACLIENT.EXE
DW.EXE
EDM3.EXE
EMAIL.EXE
EMAILSETUP.EXE
ENDPOINT.EXE
FCROUTERCMDTEST.EXE
FIELDTESTAPP.EXE
FLIGHTMODE.EXE
GAMESUX.EXE
IEXPLORE.EXE
INITIATEDMSESSION.EXE
INVALIDLICENSEUXLAUNCHER.EXE
KEYBOARDCPL.EXE
LASSCREDENTIALEXPIRATIONCHECK.EXE
LASSRESTARTER.EXE
LIVETOKEN.EXE
LOCKCPL.EXE
LOOPBACKTEST.EXE
MEDIAGROVEL.EXE
MEUX.EXE
MITSMAN.EXE
MMSPRPROXY.EXE
MMSTRANSHOST.EXE
MULTIMEDIALAUNCHER.EXE
MYPHONECPL.EXE
MYPHONETASKSRUNTIME.EXE
NATIVEINSTALLERHOST.EXE
OFFICEURL.EXE
OMADMCLIENT.EXE
OMADMPRC.EXE
OMHUB.EXE
ONBOOTSQM.EXE
ONENOTEMOBILE.EXE
OOBE.EXE
PACMANINSTALLER.EXE
PHOTOENT.EXE
PHOTOENTCAPTURE.EXE
PHOTOUPLOADER.EXE
PPT.EXE
PWORD.EXE
PWRLOGCTRL.EXE
PXL.EXE
RAPICONFIG.EXE
REGIONCPL.EXE
RMACTIVATE.EXE
SAPISVR.EXE
SECSIMTKIT.EXE
SERVICESD.EXE
SERVICESSTART.EXE
SETTELEPORTMODE.EXE
SETTINGS3.EXE
SHORTMSG.EXE
SICLNT.EXE
SIGNALEVENT.EXE
SIREPSERVERAPPDEV.EXE
SMSETTINGS.EXE
SMSTRANSPORT.EXE
SOUNDCPL.EXE
SPEECHCPL.EXE
SPMC.EXE
SQMEVENT.EXE
SSUPDATE.EXE
TASKHOST.EXE
TELSHELL.EXE
TESTSHOW.EXE
THEMECPL.EXE
TOGGLEBROWSERHIBERNATION.EXE
TOGGLEDOG.EXE
UDEVICE.EXE
UIF.EXE
UNIFIEDPAIR.EXE
USBMGR.EXE
WEBSEARCH.EXE
WIFIUXSPLASH.EXE
WLANEXT.EXE
WLIDSETUP.EXE
WWANDATAMGR.EXE
XDRMREMOTESERV.EXE
ZIPVIEW.EXE
ZMFTASKLAUNCH.EXE
How code (yes i know its super un-optimized, fast put together):
Code:
var doc = XDocument.Load(File.OpenRead("SamsungOmnia7_BasePolicy_webserver.xml"));
var ea = doc.Elements().ToArray()[0].Elements()
.Where(x => x.Name.LocalName == "Rule")
.Where(x => x.Attributes("ResourceIri").Count() > 0)
.Where(x =>
{
var r = x.Attribute("ResourceIri").Value;
return r.Contains("LOADERVERIFIER") && r.ToLower().Contains(".exe") && !r.Contains("CERTIFICATES");
})
.Select(x =>
{
var v = x.Attribute("ResourceIri").Value;
var l = v.LastIndexOf('/');
return v.Substring(l + 1);
})
.Distinct()
.OrderBy(x => x)
.ToArray();
edit 7:
yeah, lol i say too.
Unprotected exe (FCRouterCmdTest.exe)
> c:\Project Work\SGH-i707(Cetus)\FCRouterCmdTest\Windows Mobile 6 Professional SDK (ARMV4I)\Release\FCRouterCmdTest.pdb
mfw samsung use "Windows Mobile 6 Professional SDK (ARMV4I)"
Wow, this truly was a big step today
Done hacking today.
"After a day, there comes another day"
@fiinix,
You did a lot of testing. Good job, man.
A few comments:
0x800704ec "blocked by group policy" is THE error of the new WP7 security model. It is basically telling you to go f*ck yourself. Everything you do without enough privileges or capabilities results in this error.
The two ways of policies, exe-path and cert-hash, is result of difference between rom-modules and executables that are signed and added as a file. Rom-modules are not even normal files. You can't open and read them. They are executable sections that are mapped in rom-address-space. You can only call loadlibrary() and createprocess() on them. Since they are only executable sections, they don't have a signature, like a normal executable file would have. Therefore they are referred to with an exe-path. You may safely assume that every path to an executable in the policy files is referring to a rom-module and can't be overwritten in any way (except by cooking your own rom - who is going to unlock our bootloaders?!?) Other than that, there are a few signing certs that Microsoft has. Signing the different executables with different privileges and accordingly a different cert. Their hashes are in the policies.
Using ARMv7 isn't going to add much I'm afraid. Although it may make a difference in the exe-header. But you've seen tools that were really old, remember And they were signed to have TCB access. And they were compiled for ARMv4. So it should not make much difference.
I did some testing with certificates myself yesterday. Up until Zune totally went bezerk on it. I don't know what happened, but after removing my own cooked certs it all seems normal again. Zune started using 100% cpu on verifying certs and dropping my connection all the time. Help! So I haven't made much progress. I will try again later. Hope it will go better. And I will try to resign an existing executable, as Flow WP7 suggested.
According to policy on my omnia (webserver dumped) there seems to exist two typed of HDD, one ROM hard coded and one that points to internal sd card. It seems that all exe and dll on the sd are not "protected" and therefore can be hijacked.
Seems like ARMv4 will be enough, but to be on the safe side i compile with both, to have more chance getting it work.
Zune, hmm, did not seem to like you, maybe Microsoft DDOS'ed you lol
"Sent from my fingers on my phone", don't expect way too long text
XxXPachaXxX said:
Excuse my ignorance...I'm a noob...This hack may also work on LG devices?
Click to expand...
Click to collapse
At the moment fiinix and I are both working on Samsungs and we use a couple of Samsung-specific exploit to get deeper in the system and getting a better understanding of the system. The ultimate goal is to find exploits that will work for all devices. But we're not at that stage yet. Hacking is research, a lot of trying and being lucky sometimes. Just bear with us
Ciao,
Heathcliff74

Question [How-to] Enable Call Recording on Pixel 6 Pro [Root needed]

Install: https://play.google.com/store/apps/details?id=com.termux
Then open Termux
Type:
apt update; apt install sqlite
SU
Then type:
/data/data/com.termux/files/usr/bin/sqlite3 /data/user/0/com.google.android.gms/databases/phenotype.db
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__enable_call_recording", 0, 1, 0)
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__force_within_call_recording_geofence_value", 0, 1, 0)
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__use_call_recording_geofence_overrides", 0, 1, 0)
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__force_within_crosby_geofence_value", 0, 1, 0)
Next:
Clear dialer data
Open dialer and force close (clear from recent apps)
Open the dialer once again and in settings screen, you should see: "call recording"
Optional:
Depending on your location, you might get a pre-recording prompt notifying you (and the other party on the line) that the call may be recorded. This can be disabled by unzipping the attached file and copying the files to: /data/data/com.google.android.dialer/files/callrecordingprompt
Then in termux, run the following command
SU (unless your initial Termux session is still running)
chmod -R 777 /data/data/com.google.android.dialer/files/callrecordingprompt
Please note that disabling this prompt may be illegal depending on your jurisdiction. Some places however only require single party consent. Hence, why I posted this. You are responsible to know the laws of your jurisdiction. I will not be held liable for you breaking the law.
Major props to this thread: https://forum.xda-developers.com/t/...ding-in-stock-dialer-app-root-needed.4321719/
And @gisthere and @Liranazuz5
The above is a modification from their work on that thread. Most notability the removal of some ";" in the code that caused database errors and the combination of 2 different posts (flag implementation + app w/ database flags sync).
Intention of this thread: bring this information to Pixel 6 Pro owners. Please go and like the original thread/user posts (instead of this thread).
mkhcb said:
Install: https://play.google.com/store/apps/details?id=com.termux
Then open Termux
Type:
apt update; apt install sqlite
SU
Then type:
/data/data/com.termux/files/usr/bin/sqlite3 /data/user/0/com.google.android.gms/databases/phenotype.db
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__enable_call_recording", 0, 1, 0)
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__force_within_call_recording_geofence_value", 0, 1, 0)
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__use_call_recording_geofence_overrides", 0, 1, 0)
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__force_within_crosby_geofence_value", 0, 1, 0)
Next:
Clear dialer data
Open dialer and force close (clear from recent apps)
Open the dialer once again and in settings screen, you should see: "call recording"
Major props to this thread: https://forum.xda-developers.com/t/...ding-in-stock-dialer-app-root-needed.4321719/
And @gisthere and @Liranazuz5
The above is a modification from their work on that thread. Most notability the removal of some ";" in the code that caused database errors and the combination of 2 different posts (flag implementation + app w/ database flags sync).
Intention of this thread: bring this information to Pixel 6 Pro owners. Please go and like the original thread/user posts (instead of this thread).
Click to expand...
Click to collapse
Good info. For those of us that are too lazy to go through those steps, there is also a tiny app available to enable call recording as well (rooted devices only). Just install, enable from the app, and after 15 minutes or so you should see the call recording button/option. Been using on my device for a bit now and no issues. There are also a ton of flags available you can experiment with, just use caution in doing so. I am not the dev and no credit goes to me. Just sharing the devs (jacopotediosi) work:
Releases · jacopotediosi/GAppsMod
Tweak Google apps (e.g., Phone and Messages) to unlock hidden features (e.g., available only in some countries or on certain devices). Root is required. - jacopotediosi/GAppsMod
github.com
scott.hart.bti said:
Good info. For those of us that are too lazy to go through those steps, there is also a tiny app available to enable call recording as well (rooted devices only). Just install, enable from the app, and after 15 minutes or so you should see the call recording button/option. Been using on my device for a bit now and no issues. There are also a ton of flags available you can experiment with, just use caution in doing so. I am not the dev and no credit goes to me. Just sharing the devs (jacopotediosi) work:
Releases · jacopotediosi/GAppsMod
Tweak Google apps (e.g., Phone and Messages) to unlock hidden features (e.g., available only in some countries or on certain devices). Root is required. - jacopotediosi/GAppsMod
github.com
Click to expand...
Click to collapse
Nice find!
mkhcb said:
Install: https://play.google.com/store/apps/details?id=com.termux
Then open Termux
Type:
apt update; apt install sqlite
SU
Then type:
/data/data/com.termux/files/usr/bin/sqlite3 /data/user/0/com.google.android.gms/databases/phenotype.db
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__enable_call_recording", 0, 1, 0)
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__force_within_call_recording_geofence_value", 0, 1, 0)
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__use_call_recording_geofence_overrides", 0, 1, 0)
INSERT INTO FlagOverrides(packageName, user, name, flagType, boolVal, committed) VALUES("com.google.android.dialer", "", "G__force_within_crosby_geofence_value", 0, 1, 0)
Next:
Clear dialer data
Open dialer and force close (clear from recent apps)
Open the dialer once again and in settings screen, you should see: "call recording"
Major props to this thread: https://forum.xda-developers.com/t/...ding-in-stock-dialer-app-root-needed.4321719/
And @gisthere and @Liranazuz5
The above is a modification from their work on that thread. Most notability the removal of some ";" in the code that caused database errors and the combination of 2 different posts (flag implementation + app w/ database flags sync).
Intention of this thread: bring this information to Pixel 6 Pro owners. Please go and like the original thread/user posts (instead of this thread).
Click to expand...
Click to collapse
Hi buddy,
All credit for these call recording values goes to @gisthere !
But yeah, i'm still using that method on the P6Pro.
Just a note, in some regions there is a stupid voice message whenever you start recording. So, in order to eliminate that just replace these two files in /data/data/com.google.android.dialer/files/callrecordingprompt with the files inside that that zip file attached. Rename the unzipped files accordingly .
Liranazuz5 said:
Hi buddy,
All credit for these call recording values goes to @gisthere !
But yeah, i'm still using that method on the P6Pro.
Just a note, in some regions there is a stupid voice message whenever you start recording. So, in order to eliminate that just replace these two files in /data/data/com.google.android.dialer/files/callrecordingprompt with the files inside that that zip file attached. Rename the unzipped files accordingly .
Click to expand...
Click to collapse
So I replaced the files and now it says "Recording Failed" when I replaced the files. What permissions are your files? Any tips?
Edit: seems like the files above are corrupt and hence why I can't get it to work.
Edit 2: It appears that the file owner, which I can't seem to reproduce, has to be exactly the same as the original file.
Edit 3: chmod -R 777 /data/data/com.google.android.dialer/files/callrecordingprompt seems to have fixed the issue.
Can we uninstall sqlite after the changes are done?
@mkhcb "Edit 3: chmod -R 777 /data/data/com.google.android.dialer/files/callrecordingprompt seems to have fixed the issue." -> This with the corrupt files or the original files?
mkhcb said:
So I replaced the files and now it says "Recording Failed" when I replaced the files. What permissions are your files? Any tips?
Edit: seems like the files above are corrupt and hence why I can't get it to work.
Edit 2: It appears that the file owner, which I can't seem to reproduce, has to be exactly the same as the original file.
Edit 3: chmod -R 777 /data/data/com.google.android.dialer/files/callrecordingprompt seems to have fixed the issue.
Click to expand...
Click to collapse
I should've mentioned that smh, sorry buddy, it was late..
WhoIsJohnGalt1979 said:
@mkhcb "Edit 3: chmod -R 777 /data/data/com.google.android.dialer/files/callrecordingprompt seems to have fixed the issue." -> This with the corrupt files or the original files?
Click to expand...
Click to collapse
The files are not corrupt, I thought they were since I couldn't open it with VLC. Even if it is corrupt, it works with the right permission .
These are just an "empty" wav files, that's all .
Liranazuz5 said:
These are just an "empty" wav files, that's all .
Click to expand...
Click to collapse
I figured based on the size. I thought it would at least be 1 second of nothing sounds, but nope.
mkhcb said:
I figured based on the size. I thought it would at least be 1 second of nothing sounds, but nope.
Click to expand...
Click to collapse
Yeah lol, 00:00 seconds recording.
Great job on that guide, nicely done Sir!
scott.hart.bti said:
Good info. For those of us that are too lazy to go through those steps, there is also a tiny app available to enable call recording as well (rooted devices only). Just install, enable from the app, and after 15 minutes or so you should see the call recording button/option. Been using on my device for a bit now and no issues. There are also a ton of flags available you can experiment with, just use caution in doing so. I am not the dev and no credit goes to me. Just sharing the devs (jacopotediosi) work:
Releases · jacopotediosi/GAppsMod
Tweak Google apps (e.g., Phone and Messages) to unlock hidden features (e.g., available only in some countries or on certain devices). Root is required. - jacopotediosi/GAppsMod
github.com
Click to expand...
Click to collapse
This module worked very well on my pixel 6 for almost 7 months. now, suddenly the phone starts to prmopt"not support in your region"
How it woks for you now?
Chmod is a linux or terminal command. Will it work if we just change the permissions in a root explorer on the phone?
Spookymyo said:
Chmod is a linux or terminal command. Will it work if we just change the permissions in a root explorer on the phone?
Click to expand...
Click to collapse
Yes
Edit: Darn sorry for the bump. I got a notification and thought this was a new question. Then I realized the notification was a like, not a reply to my thread.
I purchased the full version of 'call recorder' by skvalex. Pricy, but just works.
fil3s said:
I purchased the full version of 'call recorder' by skvalex. Pricy, but just works.
Click to expand...
Click to collapse
I can confirm it is working without any problems. Thanks for the heads up!

Categories

Resources