惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - Ethan_村长

自己开发iOS版按键精灵--TTouch iOS 基于OpenCV图像比较的常见方法 iOS越狱系统使用root权限运行命令 Mac CEF 支持mp3 mp4编译 iOS自动化测试需求实现(iOS按键精灵类似) [转]runtime 消息机制 [转]多线程 Mac读取Andriod屏幕截图 windows或mac上对iOS设备截图 JPEG文件结构 ios获取左右眼图片景深图 使用libjpeg.framework压缩UIImage shell脚本删除指定mobileprovision iphone使用mac上的SOCKS代理 eclipse配置javah命令 [转]Android通过NDK调用JNI,使用opencv做本地c++代码开发配置方法 利用JNI技术在Android中调用、调试C++代码 iOS在线更新framework,使用NSBundle动态读取 CocoaPods pod install
解决读取iphone名称中文乱码问题
Ethan_村长 · 2016-01-12 · via 博客园 - Ethan_村长
#region 解决中文乱码 Ethan 2016-01-06
[DllImport("iTunesMobileDevice.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "AMDeviceCopyValue")]
public unsafe static extern __CFString* AMDeviceCopyValue_1(void* device, uint unknown, void* cfstring);
[DllImport("CoreFoundation.dll", CallingConvention = CallingConvention.Cdecl)]
public unsafe static extern int CFStringGetLength(__CFString* thisString);
// Token: 0x060000A3 RID: 163
[DllImport("CoreFoundation.dll", CallingConvention = CallingConvention.Cdecl)]
public unsafe static extern byte CFStringGetCString(__CFString* thisString, void* value, int length, uint format);

// Token: 0x060000D5 RID: 213 //for 32位
[DllImport("msvcr71.dll", CallingConvention = CallingConvention.Cdecl)]
public unsafe static extern void* malloc(uint size);

// Token: 0x060000D7 RID: 215 //for 64位
[DllImport("msvcr100.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "malloc")]
public unsafe static extern void* malloc_64(ulong size);

// Token: 0x02000012 RID: 18
public struct __CFString
{
}

public unsafe static string AMDeviceCopyValue_fix(void* device, string name)
{
    string result = "";
    try
    {
        __CFString* ptr = AMDeviceCopyValue_1(device, 0u, __CFStringMakeConstantString(StringToCString(name)));
        if (ptr != null)
        {
            uint num = (uint)CFStringGetLength(ptr);
            uint num2 = 4u * num + 2u;
            sbyte* value;

            try
            {
                value = (sbyte*)malloc(num2);
            }
            catch (Exception)
            {


                value = (sbyte*)malloc_64(num2);
            }


            CFStringGetCString(ptr, (void*)value, (int)num2, 134217984u);
            EX.UTF8Marshaler uTF8Marshaler = new EX.UTF8Marshaler();
            result = (string)uTF8Marshaler.MarshalNativeToManaged(new IntPtr((void*)value));

        }
    }
    catch (Exception ex)
    {

    }

    return result;
}
#endregion