Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //SOURCE: http://www.nextgenupdate.com/forums/call-duty-black-ops-2-modding-tools/747545-release-hitmanmodz-black-ops-2-button-monitoring-c-library-dll.html
- /*
- * °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°PwN3D°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°PwN3D°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°PwN3D°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°PwN3D°°°°°°°°°°°°°PwN3D°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°PwN3D°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
- * °°°°°°PwN3D°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°PwN3D°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°PwN3D°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°PwN3D°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°PwN3D°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°PwN3D°°°°°°°°°°
- ____ __ __ __ __ __ ____
- /\ _`\ /\ \ __/\ \/\ \/\ \ /'__`\ /\ _`\
- \ \ \L\ \ \ \/\ \ \ \ \ `\\ \/\_\L\ \\ \ \/\ \
- \ \ ,__/\ \ \ \ \ \ \ \ , ` \/_/_\_<_\ \ \ \ \
- \ \ \/ \ \ \_/ \_\ \ \ \`\ \/\ \L\ \\ \ \_\ \
- \ \_\ \ `\___x___/\ \_\ \_\ \____/ \ \____/
- \/_/ '\/__//__/ \/_/\/_/\/___/ \/___/
- * _ _ _
- / /\ /\ \ /\_\ _
- / / \\ \ \ / / //\_\
- / / /\ \\ \ \_/ / / \/_/
- / / /\ \ \\ \___/ /
- / / /\ \_\ \\ \ \_/
- / / /\ \ \___\\ \ \
- / / / \ \ \__/ \ \ \ _
- / / /____\_\ \ \ \ \ /_/\
- / / /__________\ \ \_\ \_\/
- \/_____________/ \/_/
- °
- _____ _____ _____ _____ _____ _____ _______ _____
- /\ \ /\ \ /\ \ /\ \ /\ \ /\ \ ______ /::\ \ /\ \
- /::\ \ /::\ \ /::\ \ /::\ \ /::\____\ /::\ \ |::| | /::::\ \ /::\ \
- /::::\ \ /::::\ \ /::::\ \ /::::\ \ /:::/ / /::::\ \ |::| | /::::::\ \ /::::\ \
- /::::::\ \ /::::::\ \ /::::::\ \ /::::::\ \ /:::/ / /::::::\ \ |::| | /::::::::\ \ /::::::\ \
- /:::/\:::\ \ /:::/\:::\ \ /:::/\:::\ \ /:::/\:::\ \ /:::/ / /:::/\:::\ \ |::| | /:::/~~\:::\ \ /:::/\:::\ \
- /:::/__\:::\ \ /:::/__\:::\ \ /:::/__\:::\ \ /:::/__\:::\ \ /:::/____/ /:::/__\:::\ \ |::| | /:::/ \:::\ \ /:::/__\:::\ \
- /::::\ \:::\ \ /::::\ \:::\ \ \:::\ \:::\ \ \:::\ \:::\ \ /::::\ \ /::::\ \:::\ \ |::| | /:::/ / \:::\ \ /::::\ \:::\ \
- /::::::\ \:::\ \ /::::::\ \:::\ \ ___\:::\ \:::\ \ ___\:::\ \:::\ \ /::::::\ \ _____ /::::::\ \:::\ \ |::| | /:::/____/ \:::\____\ /::::::\ \:::\ \
- /:::/\:::\ \:::\ ___\ /:::/\:::\ \:::\ \ /\ \:::\ \:::\ \ /\ \:::\ \:::\ \ /:::/\:::\ \ /\ \ /:::/\:::\ \:::\ \ ______|::|___|___ ____ |:::| | |:::| | /:::/\:::\ \:::\____\
- /:::/__\:::\ \:::| |/:::/ \:::\ \:::\____\/::\ \:::\ \:::\____\/::\ \:::\ \:::\____\/:::/ \:::\ /::\____\/:::/ \:::\ \:::\____\|:::::::::::::::::| ||:::|____| |:::| |/:::/ \:::\ \:::| |
- \:::\ \:::\ /:::|____|\::/ \:::\ /:::/ /\:::\ \:::\ \::/ /\:::\ \:::\ \::/ /\::/ \:::\ /:::/ /\::/ \:::\ /:::/ /|:::::::::::::::::|____| \:::\ \ /:::/ / \::/ |::::\ /:::|____|
- \:::\ \:::\/:::/ / \/____/ \:::\/:::/ / \:::\ \:::\ \/____/ \:::\ \:::\ \/____/ \/____/ \:::\/:::/ / \/____/ \:::\/:::/ / ~~~~~~|::|~~~|~~~ \:::\ \ /:::/ / \/____|:::::\/:::/ /
- \:::\ \::::::/ / \::::::/ / \:::\ \:::\ \ \:::\ \:::\ \ \::::::/ / \::::::/ / |::| | \:::\ /:::/ / |:::::::::/ /
- \:::\ \::::/ / \::::/ / \:::\ \:::\____\ \:::\ \:::\____\ \::::/ / \::::/ / |::| | \:::\__/:::/ / |::|\::::/ /
- \:::\ /:::/ / /:::/ / \:::\ /:::/ / \:::\ /:::/ / /:::/ / /:::/ / |::| | \::::::::/ / |::| \::/____/
- \:::\/:::/ / /:::/ / \:::\/:::/ / \:::\/:::/ / /:::/ / /:::/ / |::| | \::::::/ / |::| ~|
- \::::::/ / /:::/ / \::::::/ / \::::::/ / /:::/ / /:::/ / |::| | \::::/ / |::| |
- \::::/ / /:::/ / \::::/ / \::::/ / /:::/ / /:::/ / |::| | \::/____/ \::| |
- \::/____/ \::/ / \::/ / \::/ / \::/ / \::/ / |::|___| ~~ \:| |
- ~~ \/____/ \/____/ \/____/ \/____/ \/____/ ~~ \|___|
- *
- *
- Yb dP 8 w .d88b. w w dP"Yb
- Yb db dP 8d8b. .d88 w8ww YPwww. .d88b .d8b 8 8 8d8b w w8ww Yb dP " d8
- YbdPYbdP 8P Y8 8 8 8 d8 8.dP' 8 8b d8 8P 8 8 YbdP dP
- YP YP 8 8 `Y88 Y8P `Y88P' `Y88P `Y8P `Y8P8 8 8 Y8P dP w
- dP
- *
- *
- ::: ::::::::
- :+: :+: :+:
- +:+ +:+
- +#+ +#++:
- +#+ +#+
- #+# #+# #+#
- ### ######## _ _ _
- | | | | | |
- _ _ _ __ ___ _ __ ___ _ __ _ _ _ __ | |_ ___ __| | | |__ ___ ___ __ _ _ _ ___ ___ __ _____ ___ __ _ _ __ ___
- | | | | '_ \ / _ \ '_ \ / __| '__| | | | '_ \| __/ _ \/ _` | | '_ \ / _ \/ __/ _` | | | / __|/ _ \ \ \ /\ / / _ \ / __/ _` | '__/ _ \
- | |_| | | | | __/ | | | (__| | | |_| | |_) | || __/ (_| | | |_) | __/ (_| (_| | |_| \__ \ __/ \ V V / __/ | (_| (_| | | | __/
- \__,_|_| |_|\___|_| |_|\___|_| \__, | .__/ \__\___|\__,_| |_.__/ \___|\___\__,_|\__,_|___/\___| \_/\_/ \___| \___\__,_|_| \___|
- __/ | |
- |___/|_|
- ::: ::::::::
- :+: :+: :+:
- +:+ +:+
- +#+ +#++:
- +#+ +#+
- #+# #+# #+#
- ### ########
- */
- using ns2;
- using System;
- using System.Collections.Generic;
- namespace ButtonMonitoring
- {
- public static class PS3Buttons
- {
- public static uint X;
- public static uint Square;
- public static uint Triangle;
- public static uint Circle;
- public static uint L1;
- public static uint L2;
- public static uint L3;
- public static uint R1;
- public static uint R2;
- public static uint R3;
- public static uint ToggleADS;
- public static uint Crouch;
- public static uint Prone;
- public static uint Start;
- public static uint Select;
- public static uint Up;
- public static uint Down;
- public static uint Left;
- public static uint Right;
- public static string Layout;
- public static bool Flipped;
- public static List<uint> SpecialList;
- private static bool bool_0;
- public static void Init(bool isLocal = false, string layout = "Default", bool flipped = false)
- {
- PS3Buttons.bool_0 = isLocal;
- PS3Buttons.ChangeLayout(layout, flipped);
- }
- public unsafe static void ChangeLayout(string layout = "Default", bool flipped = false)
- {
- void* ptr = stackalloc void[17 / sizeof(void)];
- PS3Buttons.Layout = layout;
- PS3Buttons.Flipped = flipped;
- *(byte*)(ptr + 16 / sizeof(void)) = ((!PS3Buttons.bool_0) ? 1 : 0);
- if (!(*(bool*)(ptr + 16 / sizeof(void))))
- {
- PS3Buttons.X = 19u;
- PS3Buttons.Square = 51u;
- PS3Buttons.Triangle = 67u;
- PS3Buttons.Circle = 35u;
- PS3Buttons.L1 = 83u;
- PS3Buttons.L2 = 291u;
- PS3Buttons.L3 = 259u;
- PS3Buttons.R1 = 99u;
- PS3Buttons.R2 = 307u;
- PS3Buttons.R3 = 275u;
- PS3Buttons.Start = 227u;
- PS3Buttons.Select = 243u;
- PS3Buttons.Up = 323u;
- PS3Buttons.Down = 339u;
- PS3Buttons.Left = 355u;
- PS3Buttons.Right = 371u;
- }
- else
- {
- PS3Buttons.X = 8192u;
- PS3Buttons.Square = 4u;
- PS3Buttons.Triangle = 134217728u;
- PS3Buttons.Circle = 33554432u;
- PS3Buttons.L1 = 2147487744u;
- PS3Buttons.L2 = 256u;
- PS3Buttons.L3 = 1088u;
- PS3Buttons.R1 = 128u;
- PS3Buttons.R2 = 512u;
- PS3Buttons.R3 = 32u;
- PS3Buttons.Crouch = 16384u;
- PS3Buttons.Prone = 32768u;
- PS3Buttons.Start = 0u;
- PS3Buttons.Select = 0u;
- PS3Buttons.Up = 1024u;
- PS3Buttons.Down = 512u;
- PS3Buttons.Left = 256u;
- PS3Buttons.Right = 8388608u;
- if (layout != null)
- {
- if (!(layout == "Default"))
- {
- if (!(layout == "Tactical"))
- {
- if (!(layout == "Lefty"))
- {
- if (!(layout == "Nom4d"))
- {
- if (layout == "Charlie")
- {
- PS3Buttons.ToggleADS = 4096u;
- *(byte*)(ptr + 16 / sizeof(void)) = ((!flipped) ? 1 : 0);
- if (!(*(bool*)(ptr + 16 / sizeof(void))))
- {
- PS3Buttons.L1 = PS3Buttons.L2;
- PS3Buttons.L2 = 131584u;
- PS3Buttons.R1 = 2147483648u;
- PS3Buttons.R2 = 1835136u;
- }
- else
- {
- PS3Buttons.L1 = 131584u;
- PS3Buttons.R1 = 1835136u;
- PS3Buttons.R2 = 2147483648u;
- }
- }
- }
- else
- {
- PS3Buttons.R3 = PS3Buttons.Circle;
- PS3Buttons.Circle = 65568u;
- PS3Buttons.ToggleADS = 4096u;
- *(byte*)(ptr + 16 / sizeof(void)) = ((!flipped) ? 1 : 0);
- if (!(*(bool*)(ptr + 16 / sizeof(void))))
- {
- PS3Buttons.R2 = PS3Buttons.R1;
- PS3Buttons.L1 = 131328u;
- PS3Buttons.L2 = 2147483648u;
- PS3Buttons.R1 = 1835520u;
- }
- else
- {
- PS3Buttons.L1 = 2147483648u;
- PS3Buttons.L2 = 131328u;
- PS3Buttons.R2 = 1835520u;
- }
- }
- }
- else
- {
- *(int*)(ptr + 8 / sizeof(void)) = (int)PS3Buttons.L3;
- PS3Buttons.L3 = PS3Buttons.R3;
- PS3Buttons.R3 = *(uint*)(ptr + 8 / sizeof(void));
- *(byte*)(ptr + 16 / sizeof(void)) = ((!flipped) ? 1 : 0);
- if (!(*(bool*)(ptr + 16 / sizeof(void))))
- {
- PS3Buttons.L1 = PS3Buttons.R2;
- PS3Buttons.R1 = PS3Buttons.L2;
- PS3Buttons.L2 = 131200u;
- PS3Buttons.R2 = 2149322752u;
- }
- else
- {
- *(int*)(ptr + 12 / sizeof(void)) = (int)PS3Buttons.L2;
- PS3Buttons.L2 = PS3Buttons.R2;
- PS3Buttons.R2 = *(uint*)(ptr + 12 / sizeof(void));
- PS3Buttons.L1 = 131200u;
- PS3Buttons.R1 = 2149322752u;
- }
- }
- }
- else
- {
- PS3Buttons.R3 = PS3Buttons.Circle;
- PS3Buttons.Circle = 65568u;
- *(byte*)(ptr + 16 / sizeof(void)) = ((!flipped) ? 1 : 0);
- if (!(*(bool*)(ptr + 16 / sizeof(void))))
- {
- PS3Buttons.L1 = PS3Buttons.L2;
- PS3Buttons.R1 = PS3Buttons.R2;
- PS3Buttons.L2 = 2147618816u;
- PS3Buttons.R2 = 1835136u;
- }
- else
- {
- PS3Buttons.L1 = 2147618816u;
- PS3Buttons.R1 = 1835136u;
- }
- }
- }
- else
- {
- *(byte*)(ptr + 16 / sizeof(void)) = ((!flipped) ? 1 : 0);
- if (!(*(bool*)(ptr + 16 / sizeof(void))))
- {
- *(int*)ptr = (int)PS3Buttons.L1;
- *(int*)(ptr + 4 / sizeof(void)) = (int)PS3Buttons.R1;
- PS3Buttons.L1 = PS3Buttons.L2;
- PS3Buttons.L2 = *(uint*)ptr;
- PS3Buttons.R1 = PS3Buttons.R2;
- PS3Buttons.R2 = *(uint*)(ptr + 4 / sizeof(void));
- }
- }
- }
- PS3Buttons.SpecialList = new List<uint>
- {
- PS3Buttons.X,
- PS3Buttons.Square,
- PS3Buttons.Triangle,
- PS3Buttons.Circle,
- PS3Buttons.L1,
- PS3Buttons.L2,
- PS3Buttons.L3,
- PS3Buttons.R1,
- PS3Buttons.R2,
- PS3Buttons.R3
- };
- }
- }
- public unsafe static uint Get(string button)
- {
- void* ptr = stackalloc void[8 / sizeof(void)];
- if (button != null)
- {
- if (Class6.dictionary_0 == null)
- {
- Class6.dictionary_0 = new Dictionary<string, int>(19)
- {
- {
- "X",
- 0
- },
- {
- "Square",
- 1
- },
- {
- "Triangle",
- 2
- },
- {
- "Circle",
- 3
- },
- {
- "L1",
- 4
- },
- {
- "L2",
- 5
- },
- {
- "L3",
- 6
- },
- {
- "R1",
- 7
- },
- {
- "R2",
- 8
- },
- {
- "R3",
- 9
- },
- {
- "ToggleADS",
- 10
- },
- {
- "Crouch",
- 11
- },
- {
- "Prone",
- 12
- },
- {
- "Start",
- 13
- },
- {
- "Select",
- 14
- },
- {
- "Up",
- 15
- },
- {
- "Down",
- 16
- },
- {
- "Left",
- 17
- },
- {
- "Right",
- 18
- }
- };
- }
- if (Class6.dictionary_0.TryGetValue(button, out *(int*)(ptr + 4 / sizeof(void))))
- {
- switch (*(int*)(ptr + 4 / sizeof(void)))
- {
- case 0:
- *(int*)ptr = (int)PS3Buttons.X;
- goto IL_241;
- case 1:
- *(int*)ptr = (int)PS3Buttons.Square;
- goto IL_241;
- case 2:
- *(int*)ptr = (int)PS3Buttons.Triangle;
- goto IL_241;
- case 3:
- *(int*)ptr = (int)PS3Buttons.Circle;
- goto IL_241;
- case 4:
- *(int*)ptr = (int)PS3Buttons.L1;
- goto IL_241;
- case 5:
- *(int*)ptr = (int)PS3Buttons.L2;
- goto IL_241;
- case 6:
- *(int*)ptr = (int)PS3Buttons.L3;
- goto IL_241;
- case 7:
- *(int*)ptr = (int)PS3Buttons.R1;
- goto IL_241;
- case 8:
- *(int*)ptr = (int)PS3Buttons.R2;
- goto IL_241;
- case 9:
- *(int*)ptr = (int)PS3Buttons.R3;
- goto IL_241;
- case 10:
- *(int*)ptr = (int)PS3Buttons.ToggleADS;
- goto IL_241;
- case 11:
- *(int*)ptr = (int)PS3Buttons.Crouch;
- goto IL_241;
- case 12:
- *(int*)ptr = (int)PS3Buttons.Prone;
- goto IL_241;
- case 13:
- *(int*)ptr = (int)PS3Buttons.Start;
- goto IL_241;
- case 14:
- *(int*)ptr = (int)PS3Buttons.Select;
- goto IL_241;
- case 15:
- *(int*)ptr = (int)PS3Buttons.Up;
- goto IL_241;
- case 16:
- *(int*)ptr = (int)PS3Buttons.Down;
- goto IL_241;
- case 17:
- *(int*)ptr = (int)PS3Buttons.Left;
- goto IL_241;
- case 18:
- *(int*)ptr = (int)PS3Buttons.Right;
- goto IL_241;
- }
- }
- }
- *(int*)ptr = 0;
- IL_241:
- return *(uint*)ptr;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement