; ; _getdrive from 0x18013471c to 0x180134812 (246 bytes) ; ; 3 xrefs: ; > get_drive_number_from_path @ 0x180129692 ; > common_getdcwd @ 0x18013bf46 ; > @ 0x180203278 ; ; This function is hookable on this platform! ; ; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA ; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings ; mov [rsp+arg_0], rbx ; +0x0, 0x18013471c mov [rsp+arg_8], rsi ; +0x5, 0x180134721 push rdi ; +0xa, 0x180134726 sub rsp, 240h ; +0xb, 0x180134727 mov rax, cs:__security_cookie ; +0x12, 0x18013472e xor rax, rsp ; +0x19, 0x180134735 mov [rsp+248h+var_18], rax ; +0x1c, 0x180134738 xor edx, edx; Val ; +0x24, 0x180134740 lea rcx, [rsp+248h+Buffer]; void * ; +0x26, 0x180134742 mov r8d, 20Ah; Size ; +0x2b, 0x180134747 call memset ; +0x31, 0x18013474d lea rdx, [rsp+248h+Buffer]; lpBuffer ; +0x36, 0x180134752 mov ecx, 105h; nBufferLength ; +0x3b, 0x180134757 call cs:GetCurrentDirectoryW ; +0x40, 0x18013475c cmp eax, 104h ; +0x46, 0x180134762 ja short loc_180134790 ; +0x4b, 0x180134767 xor edi, edi ; +0x4d, 0x180134769 cmp [rsp+248h+Buffer], di ; +0x4f, 0x18013476b jz short loc_1801347EB ; +0x54, 0x180134770 cmp [rsp+248h+var_226], 3Ah ; ':' ; +0x56, 0x180134772 jnz short loc_1801347EB ; +0x5c, 0x180134778 movzx ecx, [rsp+248h+Buffer] ; +0x5e, 0x18013477a lea eax, [rcx-61h] ; +0x63, 0x18013477f cmp eax, 19h ; +0x66, 0x180134782 lea edi, [rcx-20h] ; +0x69, 0x180134785 cmova edi, ecx ; +0x6c, 0x180134788 sub edi, 40h ; '@' ; +0x6f, 0x18013478b jmp short loc_1801347EB ; +0x72, 0x18013478e lea esi, [rax+1] ; +0x74, 0x180134790 mov edx, 2; Size ; +0x77, 0x180134793 mov ecx, esi; Count ; +0x7c, 0x180134798 call _calloc_base ; +0x7e, 0x18013479a xor edi, edi ; +0x83, 0x18013479f mov rbx, rax ; +0x85, 0x1801347a1 test rax, rax ; +0x88, 0x1801347a4 jz short loc_1801347B8 ; +0x8b, 0x1801347a7 mov rdx, rax; lpBuffer ; +0x8d, 0x1801347a9 mov ecx, esi; nBufferLength ; +0x90, 0x1801347ac call cs:GetCurrentDirectoryW ; +0x92, 0x1801347ae test eax, eax ; +0x98, 0x1801347b4 jnz short loc_1801347C5 ; +0x9a, 0x1801347b6 call _errno ; +0x9c, 0x1801347b8 mov dword ptr [rax], 0Ch ; +0xa1, 0x1801347bd jmp short loc_1801347E3 ; +0xa7, 0x1801347c3 cmp [rbx], di ; +0xa9, 0x1801347c5 jz short loc_1801347E3 ; +0xac, 0x1801347c8 cmp word ptr [rbx+2], 3Ah ; ':' ; +0xae, 0x1801347ca jnz short loc_1801347E3 ; +0xb3, 0x1801347cf movzx ecx, word ptr [rbx] ; +0xb5, 0x1801347d1 lea eax, [rcx-61h] ; +0xb8, 0x1801347d4 cmp eax, 19h ; +0xbb, 0x1801347d7 lea edi, [rcx-20h] ; +0xbe, 0x1801347da cmova edi, ecx ; +0xc1, 0x1801347dd sub edi, 40h ; '@' ; +0xc4, 0x1801347e0 mov rcx, rbx; Block ; +0xc7, 0x1801347e3 call _free_base ; +0xca, 0x1801347e6 mov eax, edi ; +0xcf, 0x1801347eb mov rcx, [rsp+248h+var_18] ; +0xd1, 0x1801347ed xor rcx, rsp; StackCookie ; +0xd9, 0x1801347f5 call __security_check_cookie ; +0xdc, 0x1801347f8 lea r11, [rsp+248h+var_8] ; +0xe1, 0x1801347fd mov rbx, [r11+10h] ; +0xe9, 0x180134805 mov rsi, [r11+18h] ; +0xed, 0x180134809 mov rsp, r11 ; +0xf1, 0x18013480d pop rdi ; +0xf4, 0x180134810 retn ; +0xf5, 0x180134811