Jump to content
Moopler

Search the Community

Showing results for tags 'Snippet'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Moopler & You
    • Feedback
    • General Discussion
    • Introductions & Farewells
    • News
  • MapleStory Global
    • Discussion
    • Questions
    • Hacks, Resources & Tutorials
    • Programming
  • Other MapleStory Regions
    • South-East Asia
    • Mobile

Categories

  • MapleStory Global
    • Hacks
    • Resources
  • Programming
    • General Resources
  • MapleStory M

Categories

  • MapleStory Global
  • MapleStory SEA

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 6 results

  1. System Call WOW64: Snippet: Hooking Engine: https://github.com/Sentinel-One/minhook Inject 64 bit dll into WOW64 process: https://github.com/yardenshafir/rewolf-wow64ext
  2. This is more of a pseudo tool which explains how most pretty advance commercial obfuscators / packers / protectors / virtualizers expand expressions out. More generations past 50 will give more variations where you start to see less duplicates like (19/19) for example. Around 1000 or so cycles it will take around 10 minutes or so to complete tasks. This is because I did not make this multi-threaded and ConstantExpansion's split operation is the most time consuming sub task since it just tries to randomly brute-force algorithms for 30 seconds. Please note that division and mods are currently not implemented and require additional type-casting in python for the expression to work. Also note that pows are currently commented out as well since it is not a universal operator in other languages such as C and C++. * I may throw in some final result cleaning regexes in the future to output with type-casts and pow function wrappers to get around this. There may be some mistakes in the results due to some minor mistakes I made during some late nights working on this. If you find an issue please send me the entire expression JSON file or send the final resulting expression and I can trace it back to where the expansion failed; much thanks to another project I made along side this one. As a side note galaxy is quite handy for more non-native based languages (.NET, Python, JavaScript, LUA, ETC) to confuse simple iterations and add beef on common logic. This is still under active development so be patient 😊 Source: https://github.com/0xee1/galaxy Demo:
  3. Hi boys 'n grills, A while ago I re-reversed the way the Nexon Launcher obtains the login token, so I could use my CLB again as well as my launcher. In case you wanted to code your own CLB or launcher, you can use these snippets to authenticate your accounts and obtain the required login token. Code How to use WebApi webApi = new WebApi(); if(!webApi.AccessToken.IsValid()) { await webApi.GetAccessToken(s.Context.Profile.Email, s.Context.Profile.Password); } NexonPassport passport = await webApi.GetPassport(webApi.AccessToken.Token); Console.WriteLine(passport.Token); Credits to Waty for the original structure of the WebApi class.
  4. NewSprux2.0?

    Snippet [Warframe] Hacking necessities

    For anyone interested in ever hacking Warframe, most of their in-game structures are based on this encoding: EncodedType.hpp #pragma once class EncodedType { unsigned int flags; // + 0x00 - 1st bit = init flag, rest = pointer public: bool initialized(); protected: void set_flags(); }; class EncodedShort : public EncodedType { static const unsigned short data_key = 0x1A9E; static const unsigned short checksum_key = 0xD7F1; unsigned short data; // + 0x04 unsigned short checksum; // + 0x06 public: unsigned short get(); void set(unsigned short* value); }; class EncodedInt : public EncodedType { static const unsigned int data_key = 0x3D821A9E; static const unsigned int checksum_key = 0x2D30D7F1; unsigned int data; // + 0x04 unsigned int checksum; // + 0x08 public: unsigned int get(); void set(unsigned int* value); }; class EncodedFloat : public EncodedInt { public: float get(); void set(float value); }; EncodedType.cpp #include "EncodedType.hpp" #include <intrin.h> /* EncodedType */ bool EncodedType::initialized() { return ((this->flags & 1) != 0); } void EncodedType::set_flags() { this->flags |= 1; unsigned short* flag_pointer = reinterpret_cast<unsigned short*>(this->flags & 0xFFFFFFFE); if (flag_pointer) *flag_pointer |= 1; } /* EncodedShort */ unsigned short EncodedShort::get() { unsigned short decrypted_data = this->data; decrypted_data ^= reinterpret_cast<unsigned short>(&this->data); decrypted_data ^= this->data_key; return _rotr16(decrypted_data, 3); } void EncodedShort::set(unsigned short* value) { if (this->get() != *value) { unsigned short encrypted_data = _rotl16(*value, 3); encrypted_data ^= reinterpret_cast<unsigned short>(&this->data); encrypted_data ^= this->data_key; this->data = encrypted_data; this->checksum = encrypted_data ^ this->checksum_key; this->set_flags(); } } /* EncodedInt */ unsigned int EncodedInt::get() { unsigned int decrypted_data = this->data; decrypted_data ^= reinterpret_cast<unsigned int>(&this->data); decrypted_data ^= this->data_key; return _rotr(decrypted_data, 3); } void EncodedInt::set(unsigned int* value) { if (this->get() != *value) { unsigned int encrypted_data = _rotl(*value, 3); encrypted_data ^= reinterpret_cast<unsigned int>(&this->data); encrypted_data ^= this->data_key; this->data = encrypted_data; this->checksum = encrypted_data ^ this->checksum_key; this->set_flags(); } } /* EncodedFloat */ float EncodedFloat::get() { unsigned int integer = this->EncodedInt::get(); return *reinterpret_cast<float*>(&integer); } void EncodedFloat::set(float value) { unsigned int integer = *reinterpret_cast<unsigned int*>(&value); return this->EncodedInt::set(&integer); } This is necessary to change values in the game. Here's a few examples of how to use it: class AmmunitionVtbl { public: typedef unsigned int (__fastcall* get_clip_capacity_t)(void* ecx, void* edx); padding(0x18C); get_clip_capacity_t get_clip_capacity; }; #pragma pack(push, 1) class __declspec(align(2)) Ammunition { public: AmmunitionVtbl* vtable; padding_sub(0x9E8, sizeof(AmmunitionVtbl*)); unsigned short clip; }; #pragma pack(pop) static_assert_size(sizeof(AmmunitionVtbl), 0x18C + 4); static_assert_size(sizeof(Ammunition), 0x9E8 + 2); bool Hook_unlimited_ammo(bool enable) { typedef int (__fastcall* set_ammunition_clip_t)(Ammunition* ecx, void* edx, unsigned int clip, bool check_capacity); static set_ammunition_clip_t set_ammunition_clip = reinterpret_cast<set_ammunition_clip_t>(module_start + 0x906000); // 8B 44 24 04 8D 51 04 ? ? BF 9E 1A 00 00 0F B7 (2nd) static set_ammunition_clip_t set_ammunition_clip_hook = [](Ammunition* ecx, void* edx, unsigned int clip, bool check_capacity) -> int { if (check_capacity) { unsigned int capacity = ecx->vtable->get_clip_capacity(ecx, nullptr); if (clip < capacity && !OverlayMenu::get_instance().is_enabled("Unlimited Ammunition")) capacity = clip; return (ecx->clip = capacity); } else { return (ecx->clip = clip); } }; typedef void (__fastcall* set_ammunition_t)(EncodedShort* ecx, void* edx, WORD* ammo_ptr); static set_ammunition_t set_ammunition = reinterpret_cast<set_ammunition_t>(module_start + 0x107B250); // 8B 44 24 04 8D 51 04 ? ? BF 9E 1A 00 00 0F B7 (2nd) static set_ammunition_t set_ammunition_hook = [](EncodedShort* ecx, void* edx, WORD* ammo_ptr) -> void { if (OverlayMenu::get_instance().is_enabled("Unlimited Ammunition") && ecx->get() > *ammo_ptr) *ammo_ptr = ecx->get(); return set_ammunition(ecx, edx, ammo_ptr); }; return detours::redirect(enable, reinterpret_cast<void**>(&set_ammunition_clip), set_ammunition_clip_hook) && detours::redirect(enable, reinterpret_cast<void**>(&set_ammunition), set_ammunition_hook); } bool Hook_unlimited_energy(bool enable) { typedef float (__fastcall* get_max_energy_t)(void* ecx, void* edx); static get_max_energy_t get_max_energy = reinterpret_cast<get_max_energy_t>(module_start + 0x108A400); // 51 8B 81 ? ? 00 00 8B 00 85 C0 74 ? 80 B9 ? ? 00 00 00 74 ? 8B C8 83 (start) static get_max_energy_t get_max_energy_hook = [](void* ecx, void* edx) -> float { float max_energy = get_max_energy(ecx, edx); if (OverlayMenu::get_instance().is_enabled("Unlimited Energy")) reinterpret_cast<EncodedFloat*>(reinterpret_cast<unsigned char*>(ecx) + 0x22D0)->set(max_energy); return max_energy; }; return detours::redirect(enable, reinterpret_cast<void**>(&get_max_energy), get_max_energy_hook); } bool Hook_unlimited_health(bool enable) { typedef unsigned int (__fastcall* get_max_health_t)(void* ecx, void* edx, int unknown); static get_max_health_t get_max_health = reinterpret_cast<get_max_health_t>(module_start + 0xE31A20); // 51 56 57 8B F9 8B B7 ? ? 00 00 8D (start) static get_max_health_t get_max_health_hook = [](void* ecx, void* edx, int unknown) -> unsigned int { unsigned int max_health = get_max_health(ecx, edx, unknown); if (OverlayMenu::get_instance().is_enabled("Unlimited Health")) reinterpret_cast<EncodedInt*>(reinterpret_cast<unsigned char*>(ecx) + 0x62C)->set(&max_health); return max_health; }; return detours::redirect(enable, reinterpret_cast<void**>(&get_max_health), get_max_health_hook); } bool Hook_unlimited_shield(bool enable) { typedef unsigned int (__fastcall* get_max_shield_t)(void* ecx, void* edx, int unknown); static get_max_shield_t get_max_shield = reinterpret_cast<get_max_shield_t>(module_start + 0xD3E340); // 83 EC ? 53 55 56 8B F1 33 D2 8B (start) static get_max_shield_t get_max_shield_hook = [](void* ecx, void* edx, int unknown) -> unsigned int { unsigned int max_shield = get_max_shield(ecx, edx, unknown); if (OverlayMenu::get_instance().is_enabled("Unlimited Shield")) reinterpret_cast<EncodedInt*>(reinterpret_cast<unsigned char*>(ecx) + 0x12C0)->set(&max_shield); return max_shield; }; return detours::redirect(enable, reinterpret_cast<void**>(&get_max_shield), get_max_shield_hook); }
  5. Guest

    Snippet TSingleton - Reorganized

    Did not test this yet. There could be an error for pointer not being initialized in the constructor. Since it is generic class, I think it could be auto assigned to pointer (idk) if not then just do pointer = address in constructor? after delete. The "delete this" may not be right action, so let me know what you all think. I think you can explictly use template and have a class be generic still but the typename would need to be set to either int, long, dword or whatever the pointer (0x02XXXXX) is written to. #pragma once template <class T, typename address> class TSingleton { public: TSingleton(); ~TSingleton(); static T* getInstance(); static bool isInitialized(); private: address pointer; }; #include "TSingleton.h" /** * \brief explicit instantiation for dynamic usage. Add or remove */ template TSingleton<class T, int>; template<class T, typename address> TSingleton<T, address>::TSingleton() { delete this; } template<class T, typename address> TSingleton<T, address>::~TSingleton() { delete this; } template<class T, typename address> T * TSingleton<T, address>::getInstance() { return *reinterpret_cast<T**>(pointer); } template<class T, typename address> bool TSingleton<T, address>::isInitialized() { return getInstance() != nullptr; }
  6. Guest

    Snippet TSecType - Reorganized

    Example usage is same as original post benny made https://wecodez.com/threads/source-tsectype-class.604/ TSecType<double> tsec_double; printf("TSecType<double>:\n"); printf("setData(): %04X\n", tsec_double.setData(1.89)); printf("getData(): %08f\n", tsec_double.getData()); printf("\n"); Example usage of TSecType in Getting Item coordinates https://github.com/Waty/KamiPls/blob/master/KamiPls/TSecType.h TSecType.cpp /** * \brief get and set data from a checksum * \author benny - original source https://wecodez.com/threads/source-tsectype-class.604/ * \author yuri - reorganized * \version 12/16/2016 */ #include <cstdio> #include <cstdlib> #include "TSecType.h" /** * \brief explicit instantiation for dynamic usage. * Add or remove generics supported here */ template TSecType<int>; template TSecType<signed int>; template TSecType<unsigned int>; template TSecType<long>; template TSecType<signed long>; template TSecType<unsigned long>; template TSecType<signed char>; template TSecType<unsigned char>; template TSecType<short>; template TSecType<signed short>; template TSecType<unsigned short>; template TSecType<char>; template TSecType<signed char>; template TSecType<unsigned char>; template TSecType<double>; template TSecType<float>; /** * \brief private helper to get lower byte using upgraded * #define LOBYTE(x) (*(unsigned char *) &(x)) * \param x template x value * \return pointed type casted int to char */ template <class T> unsigned char LOBYTE(T x) { return (*reinterpret_cast<unsigned char *>(&(x))); } /** * \brief private helper to initialize constructor of object by using generic parameter * \param data generic type object */ template <class T> void TSecType<T>::init(T data) { this->m_secdata = reinterpret_cast<TSecData<T>*>(malloc(12)); this->FakePtr1 = static_cast<unsigned int>(reinterpret_cast<unsigned int>(&this[-0x00003FF8]) + rand()); this->FakePtr2 = static_cast<unsigned int>(reinterpret_cast<unsigned int>(&this[-0x00003FF8]) + rand()); this->m_secdata->FakePtr1 = static_cast<unsigned char>(LOBYTE(this->FakePtr1)); this->m_secdata->FakePtr2 = static_cast<unsigned char>(LOBYTE(this->FakePtr2)); this->setData(data); } /** * \brief private helper method to get key at index * \param index used to find key * \return the key */ template <class T> unsigned char TSecType<T>::setKey(unsigned char index) { unsigned char key = 0; //key = (i == 0 ? this->m_secdata->bKey : reinterpret_cast<unsigned char*>(&this->m_secdata->data)[i - 1] + key + 42); if (index == 0) key = this->m_secdata->bKey; else key = reinterpret_cast<unsigned char*>(&this->m_secdata->data)[index - 1] + key + 42; return key; } /** * \brief default constructor setting data to zero */ template <class T> TSecType<T>::TSecType() { init(0); } /** * \brief default constructor setting data * \param data custom data to add */ template <class T> TSecType<T>::TSecType(T data) { init(data); } /** * \brief Default destructor, clears m_secdata */ template <class T> TSecType<T>::~TSecType() { if (this->m_secdata) // != null free(this->m_secdata); // TODO: else exception here } /** * \brief gets data from the "encryped" checksum * \return the decrypted data */ template <class T> T TSecType<T>::getData() { T decrypted_data = 0; unsigned short checksum = 0; for (unsigned char i = 0; i < (sizeof(T) + 1); i++) { unsigned char key = this->setKey(i); if (i > 0) if (i > 1) // bitwise or checksum = ((8 * checksum) | (key + (checksum >> 13))); else checksum = ((key + 4) | 0xD328); if (i < sizeof(T)) { if (!key) // no key key = 42; reinterpret_cast<unsigned char*>(&decrypted_data)[i] = reinterpret_cast<unsigned char*>(&this->m_secdata->data)[i] ^ key; } } // test to throw exception on error checksum = 0; // final check on failure of checksum if ((this->m_secdata->wChecksum != checksum) || (LOBYTE(this->FakePtr1) != this->m_secdata->FakePtr1) || (LOBYTE(this->FakePtr2) != this->m_secdata->FakePtr2)) { // TODO: throw exception on error. Needs to be handled. printf("GetData failed.\n" "wChecksum - TSecData(%04X) : GetData(%04X)\n" "FakePtr1 - TSecData(%02X) : TSecType(%02X)\n" "FakePtr2 - TSecData(%02X) : TSecType(%02X)\n", this->m_secdata->wChecksum, checksum, this->m_secdata->FakePtr1, static_cast<unsigned char>(LOBYTE(this->FakePtr1)), this->m_secdata->FakePtr2, static_cast<unsigned char>(LOBYTE(this->FakePtr2))); return 0; } return decrypted_data; } /** * \brief sets data according to the checksum * \param data to "encrypt" into checksum * \return wChecksum of set Data */ template <class T> unsigned short TSecType<T>::setData(T data) { this->m_secdata->bKey = static_cast<unsigned char>(rand()); this->m_secdata->wChecksum = static_cast<unsigned short>(39525); for (unsigned char i = 0; i < (sizeof(T) + 1); i++) { unsigned char key = this->setKey(i); if (i > 0) this->m_secdata->wChecksum = ((8 * this->m_secdata->wChecksum) | (key + (this->m_secdata->wChecksum >> 13))); if (i < sizeof(T)) { if (!key) key = 42; reinterpret_cast<unsigned char*>(&this->m_secdata->data)[i] = reinterpret_cast<unsigned char*>(&data)[i] ^ key; } } return this->m_secdata->wChecksum; } TSecType.h #pragma once template <class T> struct TSecData { T data; unsigned char bKey; unsigned char FakePtr1; unsigned char FakePtr2; unsigned short wChecksum; }; template <class T> class TSecType { public: TSecType(); TSecType(T data); ~TSecType(); T getData(); unsigned short setData(T data); private: unsigned int FakePtr1; unsigned int FakePtr2; TSecData<T>* m_secdata; void init(T data); unsigned char setKey(unsigned char index); }; Same as benny's original work, just organized differently and pleases my eyes. Feel free to add / remove. Planned to throw exceptions but didn't have time yet.
×