How to DLL hook in windows CE? - Windows Mobile Development and Hacking General

How to DLL hook in windows CE?
for example how to hook RIL_Dial in ril.dll?

the process is nearly similar to normal Windows. For example you can make a wrapper around the dll, or patch its export table, or import table of app that uses it. Read cracking sites for more info.

Thanks for replay.
I need a sample code for used fast.

But WinCE does not support SetWindowHook and CreateRemoteThread (at least I cannot find it in the SDK help)
We can use VirtualProtect to change API entry but I cannot enter address space of other process.
that means we can hook API within our program only we cannot implement interprocess API interception like under win32 platform.
Writting a wrapper for API is too tough for big DLLs with hundreds of APIs.
Patching export table in binary file is impossible for system DLLs in the ROM.
headache

SetWindowsHook is obsolete. Use SetWindowsHookEx.
There is no need to use CreateRemoteThread. All processes in CE share the same 4Gb linear address space and can access each other's data. To convert a pointer from your or any other processes' address to a "global" that can be accessed from everywhere use a poorly docummented function:
Code:
extern"C" LPVOID MapPtrToProcess(LPVOID lpv, HANDLE hProc);
To inject DLL into address space of other process I use
Code:
typedef struct _CALLBACKINFO {
HANDLE hProc; /* destination process */
FARPROC pfn; /* function to call in dest. process */
PVOID pvArg0; /* arg0 data */
} CALLBACKINFO;
typedef CALLBACKINFO *PCALLBACKINFO;
extern"C" DWORD PerformCallBack4(CALLBACKINFO *pcbi,...);
...
HANDLE Proc=OpenProcess(0,0,Pid);
void *Ptr=MapPtrToProcess(L"phonehook.dll",GetCurrentProcess());
CALLBACKINFO ci;
ci.hProc=Proc;
void *t=GetProcAddress(GetModuleHandle(L"coredll.dll"),L"LoadLibraryW");
ci.pfn=(FARPROC)MapPtrToProcess(t,Proc);
ci.pvArg0=Ptr;
PerformCallBack4(&ci);
CloseHandle(Proc);
The method is unstable - it can hang your device if the process was inside an API function. I call Sleep(500) before PerformCallBack4 and it works in most cases.
The other metod that allows hooking of most kernel functions is patching the SystemAPISets table. Search this forum, an example was posted here.

I Understand attach dll to other process but no Understand to change the original function adress to my hook function .
for example in hook dll write this code
Code:
typedef HRESULT t_RIL_Dial(HRIL hRil, LPCSTR lpszAddress, DWORD dwType, DWORD dwOptions);
HRESULT New_RIL_Dial(HRIL hRil, LPCSTR lpszAddress, DWORD dwType, DWORD dwOptions);
t_RIL_Dial *Old_RIL_Dial;
HINSTANCE hRilDll = LoadLibrary(L"\\Windows\\Ril.Dll");
Old_RIL_Dial = (t_RIL_Dial*)GetProcAddress(hRilDll, L"RIL_Dial");
and my hook function
Code:
HRESULT New_RIL_Dial(HRIL hRil, LPCSTR lpszAddress, DWORD dwType, DWORD dwOptions)
{
// hook code
}
how to change the Old_RIL_Dial to New_RIL_Dial.
please help me.

Cannot give you a simple code to demonstrate it. You must have knowledge of assembly language and how win32 system works.
in breif,
1. use system hook to enter other process
2. get entry address of API
3. change protection type of that address
5. save that value
4. replace that address with your function and a long jmp
5. in your function, write that value back and call original API and replace that address again.
6. Use interprocess communication APIs.
7. keep multi-thread safe and be very careful
I think SetWindowsHookEx is not a documented API in win CE sdk/MSDN.

This isn't anything like regular win32 hooking. Because WINCE uses XIP technology.
Since rill.dll and rilgsm.dll are XIP dll's, they're executed directly from ROM. Without being loaded to RAM. Therefore, it is not possible to patch those modules "on the fly" and insert a jump/hook because ROM is read only.
Correct me if I'm wrong?

This isn't anything like regular win32 hooking. Because WINCE uses XIP technology.
Since rill.dll and rilgsm.dll are XIP dll's, they're executed directly from ROM. Without being loaded to RAM. Therefore, it is not possible to patch those modules "on the fly" and insert a jump/hook because ROM is read only.
Correct me if I'm wrong?
Click to expand...
Click to collapse
this is true only sometimes:
modern devices usual have in ROM only 5-10 files (example Dell x51v)
Also if ROM code section is compressed, it will be decompressed to RAM at first.
XIP is eXecution In Place, so all above can't be called XIP.

Related

Copying files out of ROM

Does anyone have or know of a utility for copying files out of ROM on the PocketPC so that I can look at them on my desktop? I know that the Grundle File Explorer utility can do this but I don't want to have to buy a copy when I'll probably only ever do this once.
If not, does anyone know of a utility to do a symbol-dump on an in-ROM file on the PPC? I just want to see what the full list of functions in the ccoreutl.dll library is, and it's not documented anywhere that I can find.
thanks,
nick.
all grundle file explorer allows you to do is filter the directory listing
to only display rom-files.
Since the Files in ROM are speparated into parts (data sections, code sections, etc) they don't exist like on a normal file system. The splitting of the files is done for "XIP" (execute in place). Whenever you "launch" an executable or load a library only the "data sections" will be "copied" into RAM (each process will have it's own data section). The code sections will remain in ROM and executed there (so there is no RAM usage for ROM code).
If you wan't to copy files out of ROM you have to assemble the files back (first all code sections of all files are sotred in ROM and then all data sections will be stored compressed). Unfortunately there is no complete documentation of the ROM filesystem (it seems it's a kind of Object Store). So even you dump the ROM content (something like VirtualMem.... will do it) you will not be able to extract complete files.
UnKnOwN
here is microsoft's description of XIP
http://msdn.microsoft.com/library/d.../en-us/dncenet/html/systemmemorymgmtwince.asp
and this (winceemul41.exe )
http://www.microsoft.com/downloads/...b0-c2fe-4647-833a-8831c5fccd56&DisplayLang=en
contains most (if not all) of the source code to the wince.net kernel.
WINCE410\PUBLIC\COMMON\OAK\INC\romldr.h
contains definitions of all structures related to the rom-filesystem,
WINCE410\PRIVATE\WINCEOS\COREOS\NK\KERNEL
has files like 'loader.c' and 'resource.c' which show how the kernel
handles them.
...
I think these files should contain enough information to write a tool
to extract the files.
And I think the wince.Net code is quite similar to how it works
in wince.300 ( the interesting header files for
wince300 are not publicly available, but are in the
wince-platformbuilder)
tool in progress
XDA developer Itsme said:
I think these files should contain enough information to write a tool
to extract the files.
And I think the wince.Net code is quite similar to how it works
in wince.300 ( the interesting header files for
wince300 are not publicly available, but are in the
wince-platformbuilder)
Click to expand...
Click to collapse
Actually I'm working on such a tool. It is about 50% done. I can currently extract most sections per file of all files from a ROM image file. I'm not sure if it is possible to recreate executables and dll's such that they function normally. But it should be fine to create definition files for DLL's and such. Also for reverse engineering it should be fine. Current problem I ran into is that I do not have public source for the compression used in PocketPC to compress data sections in the ROM.
Not sure but it looks like a simple LZSS compression
UnKnOwN
UnKnOwN said:
Not sure but it looks like a simple LZSS compression
UnKnOwN
Click to expand...
Click to collapse
I thought it might be called LZX, but I'm not much of a compression guru. I did find an open source cab-extractor that implements LZX and I could try that, but haven't gotten to it yet. Another option is to extract the binary code from the emulator and use that, but I find that that is getting messy.
Just found something interesting in
WINCE410\PRIVATE\WINCEOS\COREOS\NK\KERNEL\compr2.c
WINCE provides two different functions to the KERNEL (binary and string (de)compression).
They both use the buildin CECompress() / CEDecompress() functions...
UnKnOwN
OK, I thought CECompress/CEDecompress are available but...
so I post some details here now :twisted:
in coredll.dll there are four functions:
StringCompress, StringDecompress, BinaryCompress, BinaryDecompress
You can use them via GetProcAddress( hCoreDLL, TEXT("BinaryDecompress") );
Here are some function headers and defines for you:
#define CECOMPRESS_ALLZEROS 0
#define CECOMPRESS_FAILED 0xffffffffUL
#define CEDECOMPRESS_FAILED 0xffffffffUL
DWORD StringCompress( LPBYTE bufin, DWORD lenin, LPBYTE bufout, DWORD lenout );
DWORD StringDecompress( LPBYTE bufin, DWORD lenin, LPBYTE bufout, DWORD lenout );
DWORD BinaryCompress( LPBYTE bufin, DWORD lenin, LPBYTE bufout, DWORD lenout );
DWORD BinaryDecompress( LPBYTE bufin, DWORD lenin, LPBYTE bufout, DWORD lenout, DWORD skip );
The return value is the number of bytes written to the output buffer or one of the three defines.
UnKnOwN
compress functions
The compress functions are the ones I was talking about getting out of the emulator code. Another options is to use a pocketpc application to copy the rom images out. The source code of the compression functions is not available, not even in the source code that M$ made available of the private wince parts.
CECompress and CEDecompress are in nkcompr.lib
which can be found in the (not so publicly available) platformbuilder,
and also in the (more available) wince41 developer kit.
in PUBLIC/COMMON/OAK/LIB/X86/DEBUG/nkcompr.lib
the wince41 kit only has the x86 version, a sa1100 version
is in the ce-platformbuilder.
Could your provide the tool to copy rom sections? I would try to add file assembling to it...
John
hmmm
Tried Binwalk? Send me a copy and i can have a crack at it.

How to make Popup Message on CAB Files?

I received a CAB file from my friend, and when I tried to install it, I found that it has a popup message from my friend telling me a joke...
how he do that?
and how can I change that message?
Still No Comment...!
Please Help!
I asume you know how to make a cab to start with????
As you know there are exported functions in the dll that the cab uses (you make the dll). For example this is the normal look of whats exportd. Bellow is whats in the def file.
--------------------------------------------------------------------------
; TestSetup.def : Declares the module parameters for the DLL.
LIBRARY "TESTSETUP"
;DESCRIPTION 'TESTSETUP Windows CE Dynamic Link Library'
EXPORTS
Install_Init
Install_Exit
Uninstall_Init
Uninstall_Exit
now in the code for one of those you just make a dialog like normal.
The code below is cut out of one of my working cabs. Because its in Install_Init it is the first thing to happen. Changing the method to Install_Exit would give the message after the instalation.
#include "stdafx.h"
#include "TestSetup.h"
#include "ce_setup.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "MyAboutDialog.h"
BOOL CALLBACK gAboutDialogProc(HWND h_dlg, UINT my_message, WPARAM wpAram, LPARAM lpAram);
static CMyAboutDialog* myAbout= new CMyAboutDialog();
BOOL CALLBACK gAboutDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return myAbout->AboutProc(hWnd,uMsg,wParam,lParam);
}
/////////////////////////////////////////////////////////////////////////////
// CTestSetupApp
BEGIN_MESSAGE_MAP(CTestSetupApp, CWinApp)
//{{AFX_MSG_MAP(CTestSetupApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTestSetupApp construction
CTestSetupApp::CTestSetupApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CTestSetupApp object
CTestSetupApp theApp;
/////////////////////////////////////////////////////////////////////
codeINSTALL_INIT
Install_Init( HWND hwndParent,
BOOL fFirstCall,
BOOL fPreviouslyInstalled,
LPCTSTR pszInstallDir )
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
DialogBox:AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDD_AboutDIALOG),
hwndParent,
(DLGPROC)gAboutDialogProc);
return codeINSTALL_INIT_CONTINUE;
}
//------------------------------------------------------------------
Of course the detail of the dialog is in the MyAboutDialog. You just make your own to do what you want.
You can do just about anything from the code you put in the cab's dll, but a lot of the instalation should be left up to cabwiz to generate. What ever you do put in the dll will permanently reside in the windows folder until the user removes the program, so don't make it too big.
Thanks Dear OdeeanRDeathshead...
your reply is more than an informative article.
however, I hope if you can answer my second part of the question...
how can I remove the message from a CAB file that i have?
I you want to remove the message on an existing cab then that is more complicated. If you know everything that the cab dose when it gets tapped (eg registry changes etc) then you could gather all the file that the cab installs and use them to re-write them into a new cab that has no messages. This is more trouble than its worth. Unless your friend is willing to give you detailed info on what his cab dose you would be bound to miss something.
Also many messages are as a result of the os, and these vary depending on the version of os. You can't stop some of those (on every platform).
Most people would not want their instalation packages tampered with.
Try to extract the .cab file with Win CE Cab manager. Remove the Setup.dll, hopefully it does not do anything else then showing the joke Then build your own version of it.
for any complex instalation I doubt that doing that would leave you with a working instalation. Still its worth a go if it saves time. What I would like to know (not having vis studio 2005 yet) is why dose the wm2005 device always ask where you want to put the software even when you have turned this feature off? When one's coding gets a bit lazy it can all fall appart when put in a location other than that you expect.
OdeeanRDeathshead, I assume you are referring to whether to install to main memory or to SD question (this dialog pups up on WM5 device with SD inserted or built in storage).
To avoid it remove the InstDir string from your inf file (or change the string name to something else). This will force the software installation to the directory you specify in the cab.
I did not want to hard code the directory, so I used
InstallDir="%CE2%"
That should get the location of the windows folder for the install. Are you saying that if I just put
InstallDir="\windows\"
it will force it there. Dose this mean that there is a new table of Windows CE Directory Identifiers or that installs just always ask if you use them?
No, what I meant was you don’t want a string call 'InstallDir' in your inf file.
The 'InstallDir' is just a string definition you may or may not use later in the inf (like #define in C).
What determines where the files are installed is what's in the [DestinationDirs] section.
For example:
Files.Windows = 0,%CE2%
You should delete the line InstallDir = completely from your inf file, or if this string appears else where (except [CEStrings] section) just change it to something like MyDir= (be sure to change it every ware it appears in the file)

Help building a small exe that changes a registry key

I'm hoping someone can help me build a small exe that will change a single registry value.
Device: Touch Pro running custom 6.5.3 ROM built from SDK
Problem: on my Touch Pro, when I run the 'Align Screen' routine, the following registry entry is created...
[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\KEYBD]
"FirstCalibration"=dword:00000001
For some reason this is conflicting with the default Windows Unlock routine and causes a 2 to 3 second delay when turning on the device.
http://forum.xda-developers.com/showthread.php?t=587931
Deleting or changing the key to dword:00000000 prevents the issue. This is easily fixed manually.
Reason: I am building a WM 6.5.3 ROM ported from the 6.5.3 SDK released by MS last month (99% complete). I am doing it in a way that uses little to no 3rd party software, just a few basic drivers. I would like to avoid using MortScript or FdcSoft TaskMgr. I find that stylus accuracy is poor if I skip the Screen Align during Welcome/First boot. Since the registry is changed after the initial first boot, it is not possible to make the change part of my ROM.
My options are to have the user make the change manually themselves, have them run a cab to make the change or create a small exe that runs during start up that sets the key to 0. I think option 3 is best (I'm open to other ideas).
Anyway, I have eVC++ 4 + PPC2003 SDK installed (I don't have access to VS2005 or 2008).
I also modified a snipet of code that I found which should make the change for me....
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
namespace RegistryAccess
{
class Program
{
static void Main(string[] args)
{
RegistryKey baseKey = Registry.LocalMachine;
RegistryKey hardwareKey = baseKey.OpenSubKey("HARDWARE", true);
RegistryKey devicemapKey = hardwareKey.OpenSubKey("DEVICEMAP", true);
RegistryKey keybdKey = devicemapKey.OpenSubKey("KEYBD", true);
keybdKey.SetValue("FirstCalibration", 0);
}
}
}
I'm stuck compiling/building the above code into a executable. Any help would be appreciated. =)
I did a search for the RegistryKey class and it looks like it is part of .NET, which I can't do with eVC++.
I did find the following page which has several samples of code for accessing the registry using eVC++. Using voregistry seems like a good idea.
http://windowsmobiledn.com/working-with-registry-on-pocket-pc/
I tried to use the voregistry code in a new project, but when I build it I get an error due to CString being undeclared. I'm guessing I need to include a library that includes the CString class, but I'm not sure what to include.
Well I'm more a newbie that an expert, but
Won't a .cab solve it ?
you can put reg change in .cab
So you will just have to install it each time it is necessary... instead of runnig an .exe
This should do the trick....
In eVC create an app as a simple CE application.
Code:
#include "stdafx.h"
#include "Winreg.h"
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
DWORD Value=0;
HKEY RegKey;
RegOpenKeyEx(HKEY_LOCAL_MACHINE,TEXT("\\HARDWARE\\DEVICEMAP\\KEYBD"),0,0,&RegKey);
RegSetValueEx(RegKey,TEXT("FirstCalibration"),NULL,REG_DWORD, (unsigned char *) &Value ,sizeof Value);
RegCloseKey(RegKey);
return 0;
}
Works perfectly stephj, thank you so very much.
darksasas said:
Well I'm more a newbie that an expert, but
Won't a .cab solve it ?
you can put reg change in .cab
So you will just have to install it each time it is necessary... instead of runnig an .exe
Click to expand...
Click to collapse
True, this change could be made by cab. Actually, there are many ways to make the change manually or automatically (use MortScript to execute change, import reg using TaskMgr, use AutoRun to execute provxml, etc etc). In this case, I wanted to implement a fix that would require no intervention by the user of my ROM and didn't use any 3rd party software.
I may not use it in my final version, but now I have the option if I so choose. Thank you again stephj.
Mabey it's an idea to make your ROM UC Capable?
[App] ROM Flashing Junkies: User Customization is here!
http://forum.xda-developers.com/showthread.php?t=366337
Within this thread there is an application called SDConfig.txt creator which was created by DoeDoe's. Currently it is replaced by;
[Release] UC ROM SDConfig.txt Builder (reborn) [Prikolchik Ed.]
http://forum.xda-developers.com/showthread.php?t=390846
and ofcourse;
SDConfig Builder Mobile by l3v5y
http://forum.xda-developers.com/showthread.php?p=2114491
It's just an idea
Senax
Senax said:
[App] ROM Flashing Junkies: User Customization is here!
http://forum.xda-developers.com/showthread.php?t=366337
Within this thread there is an application called SDConfig.txt creator which was created by DoeDoe's. Currently it is replaced by;
[Release] UC ROM SDConfig.txt Builder (reborn) [Prikolchik Ed.]
http://forum.xda-developers.com/showthread.php?t=390846
and ofcourse;
SDConfig Builder Mobile by l3v5y
http://forum.xda-developers.com/showthread.php?p=2114491
It's just an idea
Senax
Click to expand...
Click to collapse
That would work as well, but again with 3rd party software.

[Library] DBXDroid - Simple ORM Library for Android SQLite Database

DBXDroid​Simple ORM Library for Android SQLite Database​
Description
This is android library to simplify Android SQlite Database
It become very tedious to write large Android SQLite Open helper for simple database usage. So I developed this library to create android databases very easily using straight forward functions.
Github Project Link - DBXDroid-Github
Direct Download Link - DBXDroid-Sourceforge
Features
Create Android SQLite Database
Add Tables to database
Insert new entry to tables
Fetch entries from tables
Ability to interact with database directly using getDatabase() function.
Compatibility
DBXDroid library is compatible for Android 2.3+
Installation
To use DBXDroid ,
Download Library
Extract it to DBXDroid directory
Copy it to your Android Project Workspace
Add it as a project to your Android ADT
Edit properties of your project -> Android -> Library -> Add DBXDroid as Library
Library is now ready to use
Use
1. Define Database
Code:
DBXDatabase studentDatabase;
studentDatabase = new DBXDatabase("college.db", this);
2. Create ColumnList
Code:
DBXColumnList studentColumns = new DBXColumnList();
studentColumns.addColumn(new DBXColumn("student_id",DBXFieldType.INTEGER));
studentColumns.addColumn(new DBXColumn("student_name",DBXFieldType.TEXT));
studentColumns.addColumn(new DBXColumn("student_dept",DBXFieldType.VARCHAR));
3. Add new Table to Database
Code:
studentDatabase.addTable(new DBXTable("students", studentColumns));
4. Create Database
Code:
try {
studentDatabase.createDatabase();
} catch (Exception e) {
e.printStackTrace();
}
5. Open Database
Code:
try {
studentDatabase.openDatabase();
} catch (Exception e) {
e.printStackTrace();
}
6. Inserting new Entry to table
Code:
DBXFieldValuePairList studentFieldsList = new DBXFieldValuePairList();
studentFieldsList.addFieldValuePair(new DBXFieldValuePair("student_id", Integer.parseInt(studentID)));
studentFieldsList.addFieldValuePair(new DBXFieldValuePair("student_name", studentName));
studentFieldsList.addFieldValuePair(new DBXFieldValuePair("student_dept", studentDept));
try {
if (studentDatabase.insertEntry("students", studentFieldsList) != -1) {
Toast.makeText(this, "Added", Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
e.printStackTrace();
}
7. Fetching Entries
Code:
DBXResult dbxResult = studentDatabase.getEntries("students");
String[][] result = dbxResult.getResults();
8. Access Database Directly
Code:
public SQLiteDatabase getDatabase();
This method returns SQLiteDatabase object reference for your database, So you can interact normally and directly to database
9. Closing Database
Code:
try {
studentDatabase.closeDatabase();
} catch (Exception e) {
e.printStackTrace();
}
Refer DBXDroidDemo for Full Demo
License
DBXDroid is under the GNU General Public License v3.0 License.
sdk? or jdk
s.o.s so this is a java script object oriented based sql form relational database that has a sdk acting like the LRAD filtering data through normal forms?
If you decide to further inspect the contents of the p32m x 360f512 l.h file (it is a simple
text file that you can open with the MPLAB editor), you will see that it contains an
incredibly long list of definitions for all the names of the internal special-function
registers (often referred to in the documentation as the SFRs ) of the chosen PIC32 model.
If the include file is accurate, those names reflect exactly those being used in the device
datasheet and the PIC32 reference manual.
Here is a segment of the p32m x 360f512 l.h file in which the special-function register that
controls the watchdog module ( WDTCON ) and each of its individual bits are assigned their
conventional names:
...
extern volatile unsigned int WDTCON__attribute__
((section( " sfrs " )));
typedef union {
struct {
unsigned WDTCLR:1;
The Adventure Begins 7
unsigned WDTWEN:1;
unsigned SWDTPS0:1;
unsigned SWDTPS1:1;
unsigned SWDTPS2:1;
unsigned SWDTPS3:1;
unsigned SWDTPS4:1;
unsigned :7;
unsigned FRZ:1;
unsigned ON:1;
};
...
Back to our Hello.c source file; let ’ s add a couple more lines that will introduce you to
the main() function:
main()
{
}
What we have now is already a complete, although still empty and pretty useless, C
language program. In between those two curly brackets is where we will soon put the first
few instructions of our embedded-control application.
Independently of this function position in the file, whether in the first lines on top or
the last few lines in a million-lines file, the main() function is the place where the
microcontroller will go first at power-up or after each subsequent reset. This is actually an
oversimplification. After a reset or at power-up, but before entering the main() function,
the microcontroller will execute a short initialization code segment automatically
inserted by the MPLAB C32 linker. This is known as the Startup code or crt0 code (or
simply c0 in the traditional C language literature). The Startup code will perform basic
housekeeping chores, including the all important initialization of the stack, among many
other things.
aditya.kamble said:
DBXDroid​Simple ORM Library for Android SQLite Database​
Description
...
Click to expand...
Click to collapse
This is no ORM library. There is no mapping from or to objects in this code. Have a look at http://en.wikipedia.org/wiki/Object-relational_mapping for the differences. As examples for real ORM libraries for android, OrmLite or GreenDAO come to mind.
Furthermore, there are a lot of problems with this code.
Its ORM Like Library
onlyolli said:
This is no ORM library. There is no mapping from or to objects in this code. Have a look at http://en.wikipedia.org/wiki/Object-relational_mapping for the differences. As examples for real ORM libraries for android, OrmLite or GreenDAO come to mind.
Furthermore, there are a lot of problems with this code.
Click to expand...
Click to collapse
Yeah it is not fully ORM library but it is ORM like library which provides easier functions can be adopted fast by developer when they dont have time to learn proper ORM library
Nope, sorry, it is really not. All it is is a few functions to create a database schema programmatically and a few functions to do some conversion from and to strings. This is nothing anyone should touch if he/she wants to do proper android software development. If you dont have the time to learn some real ORM tool, then you're better of not developing at all. It takes just a few minutes to get started with something like SugarORM (have a look at http://satyan.github.io/sugar/getting-started.html to see what i mean) which provides a real benefit to your application.
JDXA ORM for Android
You may want to check out JDXA, a simple yet powerful, and flexible ORM solution for Android. JDXA easily supports inheritance, one-to-one, one-to-many, and many-to-many relationships and offers a POJO (Plain Old Java Objects) friendly non-intrusive programming model, which does not require you to change your Java classes in any way:
No need to subclass your domain classes from any base class
No need to clutter your source code with annotations
No need for DAO classes
No source code generation or pre-processing of your code
Automatic creation of database schema
Get more information including code snippets and a FREE trial download at softwaretree.com

[DLL/WINMD][Source] Ativ S RPC Client

ive created a clean implementation rpc client that calls remote procedures to the FCRouter service. its more of a proof of concept. it doesnt use any part of RPCComponent, just straight up low level rpc. right now it only has 2 methods exposed, copyfile and createprocess. i will add more later. copyfile AFAIK isnt in RPCComponent. i could be wrong though, but it allows file copying anywhere on the system, even from hidden folders. for example, C:\dpp\microsoft\microsoft.pvk (oops). watch out though, you could hard brick your device messing with the wrong files.
i have a similar library for lumia that allows full file and reg access,but my screen on my lumia is broken, and the code is messy and has alot of hard coded memory addresses,so it wont run on any other device. when i get my replacement screen, ill fix it up and make it available (hello caps unlock).
heres the lib and the src code for anyone curious and wants to play around with it. have fun.
How to use the library
-----------------------
add <Capability Name="ID_CAP_INTEROPSERVICES"/> to WMAppManifest.xml
add a reference to RPClib.winmd
add "using RPClib" or "using namespace RPClib" declaration
c# silverlight code example
-------------------------
//instantiate the library
RPClib.ativ arpc = new RPClib.ativ();
//initialize and bind the RPC connection
arpc.RPC_Init();
//CopyFile
String src = "C:\\Data\\Users\\Public\\Pictures\\mypic.jpg";
String dst = "C:\\mypic.jpg";
UInt32 flag = 0;
arpc.RPC_CopyFileEx(src, dst, flag);
flag is a flag that determines if the copyfile operation will overwrite a file if it already exists.
1 = FAIL and do not overwrite if file exists.
0 = overwrite if file exists.
please test the flag option just in case.
//CreateProcess
String cmdline = "C:\\windows\\system32\\someinterestingfile.exe /somecommandlineoption";
arpc.RPC_CreateProcessA(cmdline);
first application using this lib + source code :
It works for file copy correctly but I weren't able to use for running process maybe I don't know how to use it
You did a amazing job.
No one to know, How to write such RPC stuff. SO Why all are uses OEM stuff ? But, You did It !!!
Thanks again @vcfan

Categories

Resources