澳门太阳娱乐集团官网-太阳集团太阳娱乐登录

【原创】VB型超声会诊强游戏外挂帮助类,封装了
分类:脚本专栏

''' <summary>'''  a very nice file that can be used on  other projects ''' </summary>''' <remarks></remarks>Module ReadWritingMemory    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer    Private Declare Function WriteProcessMemory1 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer    Private Declare Function WriteProcessMemory2 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Single    Private Declare Function WriteProcessMemory3 Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Long    Private Declare Function ReadProcessMemory1 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer    Private Declare Function ReadProcessMemory2 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Single    Private Declare Function ReadProcessMemory3 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Long    Const PROCESS_ALL_ACCESS = &H1F0FF    Public Function WriteDMAInteger(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Integer, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean        Try            Dim lvl As Integer = Address            For i As Integer = 1 To Level                lvl = ReadInteger(Process, lvl, nsize) + Offsets            Next            WriteInteger(Process, lvl, Value, nsize)            Return True        Catch ex As Exception            Return False        End Try    End Function    Public Function ReadDMAInteger(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Integer        Try            Dim lvl As Integer = Address            For i As Integer = 1 To Level                lvl = ReadInteger(Process, lvl, nsize) + Offsets            Next            Dim vBuffer As Integer            vBuffer = ReadInteger(Process, lvl, nsize)            Return vBuffer        Catch ex As Exception        End Try    End Function    Public Function WriteDMAFloat(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Single, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean        Try            Dim lvl As Integer = Address            For i As Integer = 1 To Level                lvl = ReadInteger(Process, lvl, nsize) + Offsets            Next            WriteFloat(Process, lvl, Value, nsize)            Return True        Catch ex As Exception            Return False        End Try    End Function    Public Function ReadDMAFloat(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Single        Try            Dim lvl As Integer = Address            For i As Integer = 1 To Level                lvl = ReadFloat(Process, lvl, nsize) + Offsets            Next            Dim vBuffer As Single            vBuffer = ReadFloat(Process, lvl, nsize)            Return vBuffer        Catch ex As Exception        End Try    End Function    Public Function WriteDMALong(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Long, ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Boolean        Try            Dim lvl As Integer = Address            For i As Integer = 1 To Level                lvl = ReadLong(Process, lvl, nsize) + Offsets            Next            WriteLong(Process, lvl, Value, nsize)            Return True        Catch ex As Exception            Return False        End Try    End Function    Public Function ReadDMALong(ByVal Process As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Level As Integer, Optional ByVal nsize As Integer = 4) As Long        Try            Dim lvl As Integer = Address            For i As Integer = 1 To Level                lvl = ReadLong(Process, lvl, nsize) + Offsets            Next            Dim vBuffer As Long            vBuffer = ReadLong(Process, lvl, nsize)            Return vBuffer        Catch ex As Exception        End Try    End Function    Public Sub WriteNOPs(ByVal ProcessName As String, ByVal Address As Long, ByVal NOPNum As Integer)        Dim C As Integer        Dim B As Integer        If ProcessName.EndsWith Then            ProcessName = ProcessName.Replace(".exe", "")        End If        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)        If MyP.Length = 0 Then            MessageBox.Show(ProcessName & " isn't open!")            Exit Sub        End If        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP        If hProcess = IntPtr.Zero Then            MessageBox.Show("Failed to open " & ProcessName & "!")            Exit Sub        End If        B = 0        For C = 1 To NOPNum            Call WriteProcessMemory1(hProcess, Address + B, &H90, 1, 0&)            B = B + 1        Next C    End Sub    Public Sub WriteXBytes(ByVal ProcessName As String, ByVal Address As Long, ByVal Value As String)        If ProcessName.EndsWith Then            ProcessName = ProcessName.Replace(".exe", "")        End If        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)        If MyP.Length = 0 Then            MessageBox.Show(ProcessName & " isn't open!")            Exit Sub        End If        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP        If hProcess = IntPtr.Zero Then            MessageBox.Show("Failed to open " & ProcessName & "!")            Exit Sub        End If        Dim C As Integer        Dim B As Integer        Dim D As Integer        Dim V As Byte        B = 0        D = 1        For C = 1 To Math.Round((Len / 2))            V = Val("&H" & Mid$(Value, D, 2))            Call WriteProcessMemory1(hProcess, Address + B, V, 1, 0&)            B = B + 1            D = D + 2        Next C    End Sub    Public Sub WriteInteger(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Integer, Optional ByVal nsize As Integer = 4)        If ProcessName.EndsWith Then            ProcessName = ProcessName.Replace(".exe", "")        End If        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)        If MyP.Length = 0 Then            MessageBox.Show(ProcessName & " isn't open!")            Exit Sub        End If        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP        If hProcess = IntPtr.Zero Then            MessageBox.Show("Failed to open " & ProcessName & "!")            Exit Sub        End If        Dim hAddress, vBuffer As Integer        hAddress = Address        vBuffer = Value        WriteProcessMemory1(hProcess, hAddress, CInt, nsize, 0)    End Sub    Public Sub WriteFloat(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Single, Optional ByVal nsize As Integer = 4)        If ProcessName.EndsWith Then            ProcessName = ProcessName.Replace(".exe", "")        End If        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)        If MyP.Length = 0 Then            MessageBox.Show(ProcessName & " isn't open!")            Exit Sub        End If        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP        If hProcess = IntPtr.Zero Then            MessageBox.Show("Failed to open " & ProcessName & "!")            Exit Sub        End If        Dim hAddress As Integer        Dim vBuffer As Single        hAddress = Address        vBuffer = Value        WriteProcessMemory2(hProcess, hAddress, vBuffer, nsize, 0)    End Sub    Public Sub WriteLong(ByVal ProcessName As String, ByVal Address As Integer, ByVal Value As Long, Optional ByVal nsize As Integer = 4)        If ProcessName.EndsWith Then            ProcessName = ProcessName.Replace(".exe", "")        End If        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)        If MyP.Length = 0 Then            MessageBox.Show(ProcessName & " isn't open!")            Exit Sub        End If        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP        If hProcess = IntPtr.Zero Then            MessageBox.Show("Failed to open " & ProcessName & "!")            Exit Sub        End If        Dim hAddress As Integer        Dim vBuffer As Long        hAddress = Address        vBuffer = Value        WriteProcessMemory3(hProcess, hAddress, vBuffer, nsize, 0)    End Sub    Public Function ReadInteger(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Integer        If ProcessName.EndsWith Then            ProcessName = ProcessName.Replace(".exe", "")        End If        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)        If MyP.Length = 0 Then            MessageBox.Show(ProcessName & " isn't open!")            Exit Function        End If        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP        If hProcess = IntPtr.Zero Then            MessageBox.Show("Failed to open " & ProcessName & "!")            Exit Function        End If        Dim hAddress, vBuffer As Integer        hAddress = Address        ReadProcessMemory1(hProcess, hAddress, vBuffer, nsize, 0)        Return vBuffer    End Function    Public Function ReadFloat(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Single        If ProcessName.EndsWith Then            ProcessName = ProcessName.Replace(".exe", "")        End If        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)        If MyP.Length = 0 Then            MessageBox.Show(ProcessName & " isn't open!")            Exit Function        End If        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP        If hProcess = IntPtr.Zero Then            MessageBox.Show("Failed to open " & ProcessName & "!")            Exit Function        End If        Dim hAddress As Integer        Dim vBuffer As Single        hAddress = Address        ReadProcessMemory2(hProcess, hAddress, vBuffer, nsize, 0)        Return vBuffer    End Function    Public Function ReadLong(ByVal ProcessName As String, ByVal Address As Integer, Optional ByVal nsize As Integer = 4) As Long        If ProcessName.EndsWith Then            ProcessName = ProcessName.Replace(".exe", "")        End If        Dim MyP As Process() = Process.GetProcessesByName(ProcessName)        If MyP.Length = 0 Then            MessageBox.Show(ProcessName & " isn't open!")            Exit Function        End If        Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, MyP        If hProcess = IntPtr.Zero Then            MessageBox.Show("Failed to open " & ProcessName & "!")            Exit Function        End If        Dim hAddress As Integer        Dim vBuffer As Long        hAddress = Address        ReadProcessMemory3(hProcess, hAddress, vBuffer, nsize, 0)        Return vBuffer    End FunctionEnd Module

在类型支付中无时无刻的应用了UIButton,假如急需贯彻部分异样的效能就供给自定义开关(例如图片在上,图片在下,配置角标等),要是每二个功效都要自定义开关的话,那文件显著就这个了,所以笔者对button实行了打包, 在开辟中带动了简便并压缩代码量)

  

图片 1JMButton.png

JMbadgeValue承接自UIlabel,内置二种体裁和三种动画, 是按键上的多个角标, 独立于JMButton, 暗中认可不出示那个角标的

/** badgeValue样式 */typedef NS_ENUM(NSInteger, JMBadgeValueType) { JMBadgeValueTypePoint, //点 JMBadgeValueTypeNew, //new JMBadgeValueTypeNumber, //number};/** badgeValue 动画样式 */typedef NS_ENUM(NSInteger, JMBadgeValueAnimationType) { JMBadgeValueAnimationTypeNone, //无动画 JMBadgeValueAnimationTypeShake, //抖动 JMBadgeValueAnimationTypeOpacity, //透明过渡动画 JMBadgeValueAnimationTypeScale, //缩放动画};@interface JMBadgeValue : UIView/** badgeL */@property (nonatomic, strong) UILabel *badgeL;/** type */@property (nonatomic, assign) JMBadgeValueType type;/** animationType */@property (nonatomic, assign) JMBadgeValueAnimationType animationType;/** badgeValue */@property (nonatomic, copy) NSString *badgeValue;@property (nonatomic, assign) CGFloat badgeRadius;- showAnimation;@end

JMButton是三个自定义View,首要的机能是承受呈现自定义Button, 自定义BadgeVlaue以及对点击事件, 下边是代码块中有四个最初化方式和一些对badgeValue的配置,如出示new关键字的BadgeValue- showNewBadgeValue;您还足以呈现badgeValue的卡通效果- showBadgeAnimation;

@interface JMButton : UIView- (instancetype)initWithFrame:frame ButtonConfig:(JMBaseButtonConfig *)buttonConfig;/** 点击事件 @param target 事件目标 @param action 事件方法 @param controlEvents 事件类型 */- addTarget:target action:action forControlEvents:(UIControlEvents)controlEvents;/********** 按钮角标配置及显示, 默认不显示角标, 如需要可通过如下方法设置 (frame必需要有值) **********//***** 请注意, 如果需要自定义角标的样式(如调用时下面五个属性时必需在show方法之前设置调用 *****//** 角标的文字颜色 (默认 #FFFFFF) */@property (nonatomic, strong) UIColor *badgeTextColor;/** 角标的背景颜色 (默认 #FF4040) */@property (nonatomic, strong) UIColor *badgeBackgroundColor;/** badgeTextFont (如没有特殊需求, 请勿修改此属性, 此属性只有在控制器加载完成后有效)*/@property (nonatomic, strong) UIFont *badgeTextFont;/** badgeSize (如没有特殊需求, 请勿修改此属性, 此属性只有在控制器加载完成后有效)*/@property (nonatomic, assign) CGSize badgeSize;/** badgeOffset (如没有特殊需求, 请勿修改此属性, 此属性只有在控制器加载完成后有效) */@property (nonatomic, assign) CGPoint badgeOffset;/** badge圆角大小 (如没有特殊需求, 请勿修改此属性, 此属性只有在控制器加载完成后有效, 一般配合badgeSize或badgeOffset使用) */@property (nonatomic, assign) CGFloat badgeRadius;/***** 请注意, 如果需要自定义角标的样式(如调用时上面五个属性时必需在show方法之前设置调用 *****//** 动画类型 */@property (nonatomic, assign) JMBadgeValueAnimationType badgeAnimationType;/** badgeValue(角标数值, 仅对 数值样式有效) */@property (nonatomic, copy) NSString *badgeValue;/** 显示小红点样式 */- showPointBadgeValue;/** 显示New样式 */- showNewBadgeValue;/** 显示数值样式 @param badgeValue 数值 */- showNumberBadgeValue:(NSString *)badgeValue;/** 删除小红点 */- removeBadgeValue;/** 展示动画 */- showBadgeAnimation;@end

JMBaseButton承继自UIButton, 对开关实行了莫斯中国科学技术大学学自定义, 富含图片上下左右的支配、图片和文字的距离决定、圆角、背景、边框等,JMBaseButton和JMBaseButtonConfig是不可分离的,前面会讲课到JMBaseButtonConfig,提供了工厂方法和实例方法实行发轫化。

#import <UIKit/UIKit.h>#import "JMBaseButtonConfig.h"@interface JMBaseButton : UIButton+ (instancetype)buttonFrame:frame ButtonConfig:(JMBaseButtonConfig *)buttonConfig;- (instancetype)initWithFrame:frame ButtonConfig:(JMBaseButtonConfig *)buttonConfig;@end

JMBaseButtonConfig和JMBaseButton能够说是密不可分的,因为它便是贰个布局文件,用于对JMBaseButton的体制配置。

#import <Foundation/Foundation.h>#import <UIKit/UIKit.h>@interface JMBaseButtonConfig : NSObjecttypedef NS_ENUM(NSInteger, JMButtonStyleType) { JMButtonStyleTypeTop, //图片在上, 文字在下 JMButtonStyleTypeLeft, //图片在左, 文字在右 JMButtonStyleTypeBottom, //图片在下, 文字在上 JMButtonStyleTypeRight, //图片在右, 文字在左};/** 初始化 */+ (instancetype)buttonConfig;/** 按钮类型 (默认图片在左, 文字在右) */@property (nonatomic, assign) JMButtonStyleType styleType;/** padding (文字和图片之间的间距, 默认为6.f) */@property (nonatomic, assign) CGFloat padding;/************************ 文字相关属性设置 ************************//** 文字大小 */@property (nonatomic, strong) UIFont *titleFont;/** 文字  */@property (nonatomic, copy) NSString *title;/** 文字颜色 */@property (nonatomic, strong) UIColor *titleColor;/** 更改文字的origin(无特殊需求,请勿修改此属性, 注意不能设置为0,0) */@property (nonatomic, assign) CGPoint titleOrigin;/************************ 图片相关属性设置 ************************//** 图片 */@property (nonatomic, strong) UIImage *image;/** 图片的大小(无特殊需求, 请勿修改此属性) */@property (nonatomic, assign) CGSize imageSize;/** 图片的origin(无特殊需求,请勿修改此属性,注意不能设置为0,0) */@property (nonatomic, assign) CGPoint imageOrigin;/************************ 圆角相关属性设置 ************************//** 圆角类型 (默认 UIRectCornerAllCorners) */@property (nonatomic, assign) UIRectCorner corners;/** 圆角大小  */@property (nonatomic, assign) CGFloat cornerRadius;/************************ 背景相关属性设置 ************************//** 背景颜色  */@property (nonatomic, strong) UIColor *backgroundColor;/** 背景图片  */@property (nonatomic, strong) UIImage *backgroundImage;/************************ 边框相关属性设置 ************************//** 边框线条颜色 (默认 clearColor) */@property (nonatomic, strong) UIColor *borderColor;/** 边框线条宽度  */@property (nonatomic, assign) CGFloat borderWidth;@end

JMBootstrapButton承继自JMBaseButton,在具备JMBaseButton的习性下扩张了本人的体裁。JMBootstrapButtonConfig承接自JMBaseButtonConfig,在富有JMBaseButtonConfig的性情下扩大了和煦的体制。

  1. 导入JMButton#import "JMButton.h"
  2. 初阶化JMBootstrapButtonConfig并安排属性
JMBootstrapButtonConfig *buttonConfig = [JMBootstrapButtonConfig buttonConfig];buttonConfig.bootstrapType = JMBootstrapTypeDefault;
  1. 最早化JMButton并增多到视图
JMButton *btn = [[JMButton alloc] initWithFrame:CGRectMake(100, 100, 100, 50) ButtonConfig:buttonConfig];[btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];[self.view addSubView:btn];

图片 2JMButtonAll.gif

本文由澳门太阳娱乐集团官网发布于脚本专栏,转载请注明出处:【原创】VB型超声会诊强游戏外挂帮助类,封装了

上一篇:.NET DataSet、DataTable操作记录 下一篇:没有了
猜你喜欢
热门排行
精彩图文