Hacking Crashing on curl_easy_setup?

QuarkTheAwesome

🦊
OP
Member
Joined
Apr 19, 2015
Messages
1,023
Trophies
1
Location
Stuck in the PowerPC
Website
heyquark.com
XP
3,912
Country
Australia
Hey everyone!

I'm writing a little program for the WiiU and it needs to grab some files with cURL (similar to what the ELF loader does) It's all going well, up until the call to curl_easy_setup - where the system crashes. The majority of the cURL code (basically everything but the write callback) is copied from the ELF loader, so it should work, but it just doesn't. I'd really appreciate any help you guys have because I'm watching the exact same code working fine for someone else, just not for me!

Code:
Code:
    uint32_t nn_ac_handle, nsysnet_handle, libcurl_handle, nn_startupid;
    OSDynLoad_Acquire("nn_ac.rpl", &nn_ac_handle);
    OSDynLoad_Acquire("nsysnet", &nsysnet_handle);
    OSDynLoad_Acquire("nlibcurl", &libcurl_handle);

    int  (*ACInitialize)(void);
    int  (*ACGetStartupId)(uint32_t *id);
    int  (*ACConnectWithConfigId)(uint32_t id);
    int  (*socket_lib_init)(void);
    int  (*curl_global_init)(int opts);
    void*(*curl_easy_init)(void);
    void (*curl_easy_cleanup)(void *handle);

    OSDynLoad_FindExport(nn_ac_handle, 0, "ACInitialize", &ACInitialize);
    OSDynLoad_FindExport(nn_ac_handle, 0, "ACGetStartupId", &ACGetStartupId); 
    OSDynLoad_FindExport(nn_ac_handle, 0, "ACConnectWithConfigId",&ACConnectWithConfigId);
    OSDynLoad_FindExport(nsysnet_handle, 0, "socket_lib_init", &socket_lib_init);
    OSDynLoad_FindExport(libcurl_handle, 0, "curl_global_init", &curl_global_init);
    OSDynLoad_FindExport(libcurl_handle, 0, "curl_easy_init", &curl_easy_init);
    OSDynLoad_FindExport(libcurl_handle, 0, "curl_easy_cleanup", &curl_easy_cleanup);

    ACInitialize();
    ACGetStartupId(&nn_startupid);
    ACConnectWithConfigId(nn_startupid);
    socket_lib_init();
    curl_global_init(CURL_GLOBAL_ALL);

    void *curl_handle = curl_easy_init(); //System crashes here.
    //Everything below this point isn't executed.
    if(!curl_handle) OSFatal("cURL not initialized");

    curl_download_file(curl_handle, url); //I've already set up the URL above
    curl_easy_cleanup(curl_handle);
Yeah, as you can tell, it's basically all the same as the ELF loader. I'm running a 5.5.1 WiiU using libstagefright and self-hosting the ELF loader which then loads my program (~50k). I can run most other userspace homebrews just fine.
Thanks in advance!

Edit: I've been thinking about it and it might be because I'm running out of RAM? Don't hold me to that.
 
Last edited by QuarkTheAwesome,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Xdqwerty @ Xdqwerty:
    I just got friendzoned by the girl i like :sleep:
    +2
  • AncientBoi @ AncientBoi:
    :ohnoes: oh wait.. Here they are. Thought I lost my Chips Ahoy cookies :cry:
  • K3Nv2 @ K3Nv2:
    Sorry I sat on them when they were open
  • AncientBoi @ AncientBoi:
    eeewww
  • K3Nv2 @ K3Nv2:
    I thought it was the toilet
  • AncientBoi @ AncientBoi:
    okies. Time to go watch YT paranormal ghost things. L8er my luvs :D
    +1
  • K3Nv2 @ K3Nv2:
    I got a massive clue
  • BakerMan @ BakerMan:
    this mf def ain't watching ghost shit, he boutta beat his meat fr
    +1
  • K3Nv2 @ K3Nv2:
    Nah he's about to be the ghost in your bedroom
    +1
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, and leave ectoplasm all over the place
  • BakerMan @ BakerMan:

    this is him being described
    +2
  • Xdqwerty @ Xdqwerty:
    Sigh
  • Xdqwerty @ Xdqwerty:
    Yawn
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, I dislike the kind of drm where you have to play single player games online all the time bc of some verification bs
    +1
  • SylverReZ @ SylverReZ:
    @Xdqwerty, Don't use games that have Easy Anti-Cheat as its been exploited many times.
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, my PC can't run most AAA games so i wont
    +1
  • Xdqwerty @ Xdqwerty:
    Most of the modern AAA games
    +1
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, I also heard one of the Prince of Persia games was so unfinished that it required the "24/7 online" drm so a puzzle could be done and the game could be finished. And that when the Ubisoft servers were closed the (cracked) game was impossible to finish or something like that
  • SylverReZ @ SylverReZ:
    @Xdqwerty, That's extra scummy. Ubisoft nowadays ship out incomplete games like Skull and Bones which was being worked on for nearly a decade now.
    +1
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, i think they have been doing that since late 2000s
    +1
  • Xdqwerty @ Xdqwerty:
    Either that or their old games were unfinished aswell but we can't notice it
  • Psionic Roshambo @ Psionic Roshambo:
    I like that games can be fixed after the fact, hate that it's being abused via beta tests... And DLC... I was a 7800 owner back in the day and loved Impossible Mission, turns out I couldn't beat it because it was actually impossible lol
    Psionic Roshambo @ Psionic Roshambo: I like that games can be fixed after the fact, hate that it's being abused via beta tests... And...