Function at 0x4a0040
Capabilities:
Check if file exists
Create directory
Get file attributes
Get thread local storage value
Read file on windows
Set file attributes

Disassembly:
sub esp, 0xab0
mov al, byte [0x524a50]
push ebx
push ebp
push esi
push edi
mov byte [esp + 0x538], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x539]
rep stosd dword es:[edi], eax
mov ecx, dword [0x527af4]
stosw word es:[edi], ax
push ecx
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x4a008c
pop edi
pop esi
pop ebp
mov eax, 4
pop ebx
add esp, 0xab0
ret
mov edi, dword [esp + 0xac4]
mov dword [esi + 0x96a], 0
mov eax, dword [edi + 0x2c]
test eax, eax
jne 0x4a00ea
mov eax, dword [esi + 0x3c]
test eax, eax
jne 0x4a00ea
mov eax, dword [esi + 0x44]
test eax, eax
jne 0x4a00ea
mov edx, dword [edi + 0x18]
lea eax, [esp + 0x538]
push edx
push eax
call fcn.004a3200
lea ecx, [esp + 0x540]
push ecx
call fcn.004a37d0
add esp, 0xc
test eax, eax
jne 0x4a00ea
lea edx, [esp + 0x538]
push 0x511870
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov eax, dword [esi + 0x19c]
mov dword [esp + 0x10], 0x2f
test eax, eax
jne 0x4a0128
lea eax, [esp + 0x988]
mov dword [edi + 0xc], eax
mov eax, dword [esi + 0x19c]
test eax, eax
jne 0x4a0128
push edi
call fcn.0049e240
add esp, 4
test eax, eax
jne 0x4a0ce1
mov edi, dword [esp + 0xac4]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea ecx, [esp + 0x538]
lea eax, [esi + 0x75e]
push ecx
push eax
call ebx
mov eax, dword [edi + 0xc]
mov ebp, dword [sym.imp.USER32.dll_CharNextA]
add eax, 0x26
mov cl, byte [eax]
test cl, cl
je 0x4a0162
cmp cl, 0x2f
jne 0x4a0159
mov byte [eax], 0x5c
push eax
call ebp
mov cl, byte [eax]
test cl, cl
jne 0x4a0151
mov edx, dword [edi + 0xc]
lea eax, [esp + 0x22c]
add edx, 0x26
push edx
push eax
call ebx
mov eax, dword [edi + 0x30]
test eax, eax
je 0x4a01a2
mov ecx, dword [edi + 0xc]
lea edx, [esp + 0x884]
add ecx, 0x26
push ecx
push edx
call fcn.0049c8d0
mov ecx, dword [edi + 0xc]
add esp, 8
lea eax, [esp + 0x884]
add ecx, 0x26
push eax
push ecx
call ebx
mov edx, dword [edi + 0xc]
lea ebp, [esi + 0x75e]
add edx, 0x26
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov edx, dword [edi + 0xc]
xor eax, eax
mov ax, word [esi + 0xc48]
xor ecx, ecx
mov dword [esp + 0x220], eax
mov cx, word [esi + 0xc46]
mov dword [esp + 0x224], ecx
mov eax, dword [edx + 0x12a]
lea ecx, [esp + 0x11c]
push ebp
push ecx
mov dword [esp + 0x230], eax
call ebx
mov eax, dword [edi + 0x2c]
test eax, eax
jne 0x4a0690
mov eax, dword [esi + 0x3c]
test eax, eax
jne 0x4a0690
mov eax, dword [esi + 0x44]
test eax, eax
jne 0x4a0690
mov eax, dword [esi + 0xac2]
test eax, eax
je 0x4a025d
mov edx, dword [esi + 0xac6]
lea ecx, [esp + 0x11c]
push edx
push ecx
call eax
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea edx, [esp + 0x11c]
lea eax, [esi + 0x75e]
push edx
push eax
call ebp
mov eax, dword [esp + 0xac4]
mov edx, dword [esp + 0x228]
mov ecx, dword [eax + 0xc]
mov dword [ecx + 0x12a], edx
jmp 0x4a0263
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0
lea eax, [esp + 0x1c]
push 0
push eax
lea ecx, [esp + 0x78c]
lea eax, [esi + 0x75e]
push ecx
push eax
call fcn.004a3810
push 0
lea edx, [esp + 0x30]
push 0
lea eax, [esp + 0x79c]
push edx
lea ecx, [esp + 0x350]
push eax
push ecx
call fcn.004a39c0
add esp, 0x28
lea edx, [esp + 0x330]
lea eax, [esp + 0x18]
push edx
push eax
call ebp
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
lea ecx, [esp + 0x330]
push 0x5c
push ecx
call fcn.004a3790
test eax, eax
je 0x4a02ed
lea edx, [esp + 0x330]
mov byte [eax], 0
push edx
call edi
cmp eax, 0xffffffff
je 0x4a02b6
lea eax, [esp + 0x330]
lea ecx, [esp + 0x434]
push eax
push ecx
jmp 0x4a02fd
lea edx, [esp + 0x330]
lea eax, [esp + 0x434]
push edx
push eax
call ebp
lea ecx, [esp + 0x434]
push 0x511870
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea edx, [esp + 0x18]
lea eax, [esp + 0x330]
push edx
push eax
call ebp
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ecx, [esp + 0x434]
push ecx
call ebx
lea edx, [esp + 0x330]
mov edi, eax
push edx
call ebx
cmp edi, eax
jge 0x4a03f0
lea eax, [esp + 0x434]
push eax
call ebx
lea ecx, [esp + 0x434]
lea ebp, [esp + eax + 0x434]
push ecx
call ebx
lea edi, [esp + eax + 0x330]
mov al, byte [esp + eax + 0x330]
test al, al
je 0x4a039d
cmp al, 0x5c
je 0x4a039d
mov byte [ebp], al
mov dl, byte [edi]
push edx
inc ebp
call dword [sym.imp.KERNEL32.dll_IsDBCSLeadByte]
test eax, eax
je 0x4a038e
mov al, byte [edi + 1]
mov byte [ebp], al
inc ebp
push edi
call dword [sym.imp.USER32.dll_CharNextA]
mov edi, eax
mov al, byte [edi]
test al, al
jne 0x4a0372
lea ecx, [esp + 0x434]
push 0
push ecx
mov byte [ebp], 0
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
je 0x4a0441
lea edx, [esp + 0x434]
push 0x511870
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [esp + 0x434]
push eax
call ebx
lea ecx, [esp + 0x330]
mov edi, eax
push ecx
call ebx
cmp edi, eax
jl 0x4a0345
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea edi, [esi + 0x75e]
lea eax, [esi + 0x318]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x4a045f
mov esi, dword [esp + 0xac4]
mov ecx, dword [esi + 0x28]
push ecx
push 2
push 0x7e
call fcn.004a35d0
add esp, 8
push eax
push 0x31
call fcn.0049bc40
add esp, 0xc
mov dword [esi + 0xc], 0
mov eax, 0x31
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xab0
ret
mov edx, dword [esp + 0xac4]
pop edi
pop esi
pop ebp
mov dword [edx + 0xc], 0
mov eax, 0x1c
pop ebx
add esp, 0xab0
ret
lea eax, [esi + 0x862]
push edi
push eax
call ebp
push 0
push 0x80000080
push 3
push 0
push 3
push SysReAllocStringLen
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x4a0690
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 8]
test eax, eax
jne 0x4a0690
mov eax, dword [esp + 0xac4]
mov ecx, dword [eax + 0x28]
test ecx, ecx
jne 0x4a06ba
push 0x7f00
push 0
call dword [sym.imp.USER32.dll_LoadCursorA]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
lea ebp, [esi + 0x75e]
mov dword [esp + 0x10], eax
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4a05f6
test bl, 0x10
jne 0x4a05f6
test bl, 1
push ebp
je 0x4a0589
lea edx, [esp + 0x120]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [esp + 0x11c]
push eax
push 0
push 0x80
call fcn.004a35d0
add esp, 8
lea ecx, [esp + 0x1c]
push eax
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
mov ecx, dword [esi + 0x1a4]
xor eax, eax
cmp ecx, 0xc8
lea edx, [esp + 0x24]
setle al
dec eax
push edx
and eax, 0xc
push 0
add eax, 3
push 1
push eax
push 8
call fcn.004a14c0
mov edi, eax
add esp, 0x20
cmp edi, 0x64
je 0x4a055b
cmp edi, 5
jne 0x4a0577
and ebx, 0xfffffffe
mov dword [esi + 8], 1
push ebx
push ebp
mov edi, 6
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
jmp 0x4a05fb
cmp edi, 6
jne 0x4a05fb
and ebx, 0xfffffffe
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
jmp 0x4a05fb
lea ecx, [esp + 0x120]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea edx, [esp + 0x11c]
push edx
push 0
push 0x44
call fcn.004a35d0
add esp, 8
push eax
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov edi, dword [esi + 0x1a4]
xor edx, edx
cmp edi, 0xc8
lea ecx, [esp + 0x24]
setle dl
dec edx
push ecx
and edx, 0xc
push 0
add edx, 3
push 0
push edx
push 8
call fcn.004a14c0
mov edi, eax
add esp, 0x20
cmp edi, 0x64
je 0x4a05ef
cmp edi, 5
jne 0x4a05fb
mov dword [esi + 8], 1
mov edi, 6
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
cmp edi, 2
jne 0x4a0629
mov ecx, dword [esp + 0xac4]
pop edi
pop esi
pop ebp
mov dword [ecx + 0xc], 0
mov eax, 0x30
pop ebx
add esp, 0xab0
ret
cmp edi, 7
jne 0x4a064c
mov edx, dword [esp + 0xac4]
pop edi
pop esi
pop ebp
mov dword [edx + 0xc], 0
mov eax, 0x31
pop ebx
add esp, 0xab0
ret
cmp edi, 0x65
jne 0x4a0690
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [esp + 0x11c]
push ebp
push eax
call edi
push 0
push 0x8e
call fcn.004a35d0
lea ecx, [esp + 0x124]
push eax
push ecx
call fcn.004a2d10
add esp, 0x10
lea edx, [esp + 0x11c]
lea eax, [esi + 0x862]
push edx
push eax
call edi
lea eax, [esi + 0x318]
push eax
call fcn.004a0d30
xor ebp, ebp
add esp, 4
cmp eax, ebp
je 0x4a06d1
mov ecx, dword [esp + 0xac4]
pop edi
pop esi
mov dword [ecx + 0xc], ebp
pop ebp
pop ebx
add esp, 0xab0
ret
pop edi
pop esi
mov dword [eax + 0xc], 0
pop ebp
mov eax, 0x31
pop ebx
add esp, 0xab0
ret
mov ebx, dword [esp + 0xac4]
xor edi, edi
mov dword [esp + 0x10], edi
mov edx, dword [ebx + 0x2c]
mov dword [esi + 0x99e], edx
call fcn.0049c370
test eax, eax
jne 0x4a0700
pop edi
pop esi
pop ebp
mov eax, 0x1d
pop ebx
add esp, 0xab0
ret
cmp dword [esi + 0x19c], ebp
jne 0x4a079a
push ebp
call fcn.004a0ed0
add esp, 4
cmp eax, ebp
mov dword [esi + 0x98a], eax
je 0x4a0725
mov edi, eax
mov dword [esp + 0x10], edi
xor eax, eax
xor ecx, ecx
mov ax, word [esi + 0xc2a]
mov cx, word [ebx + 0x14]
dec eax
cmp ecx, eax
jle 0x4a0744
mov edi, 0x19
mov dword [esp + 0x10], edi
jmp 0x4a078a
cmp edi, ebp
jne 0x4a078a
cmp dword [esi + 0xc36], ebp
jne 0x4a0767
mov dword [esi + 0x976], ebp
mov dword [esi + 0x97a], ebp
call fcn.0049cc40
mov dword [esi + 0x98a], eax
cmp dword [esi + 0x98a], ebp
jne 0x4a078a
mov eax, dword [ebx + 0x14]
cdq
mov dword [esi + 0x976], eax
mov dword [esi + 0x97a], edx
call fcn.0049cc40
mov dword [esi + 0x98a], eax
mov eax, dword [esi + 0x98a]
cmp eax, edi
jle 0x4a079a
mov edi, eax
mov dword [esp + 0x10], edi
mov al, byte [esi + 0xc42]
mov dword [esi + 0xc84], ebp
test al, 1
je 0x4a07b4
mov dword [esi + 0xc84], 1
cmp word [esi + 0xc44], 8
jbe 0x4a07cb
mov dword [esp + 0x10], 0x2a
jmp 0x4a0cdc
cmp edi, ebp
jne 0x4a0cdc
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
mov eax, dword [esi + 0xc7c]
test eax, eax
je 0x4a0949
mov eax, dword [esi + 0xc80]
xor edx, edx
mov dx, word [esi + 0xc5c]
cmp edx, eax
je 0x4a0949
call fcn.0049c330
mov ax, word [esi + 0xc24]
push 0x524a50
cmp ax, 0xffff
jne 0x4a082e
xor eax, eax
push 0
mov ax, word [esi + 0xc5c]
inc eax
push eax
push 1
push 0
jmp 0x4a0842
movsx ecx, ax
xor edx, edx
inc ecx
mov dx, word [esi + 0xc5c]
push ecx
inc edx
push edx
push 1
push 1
call fcn.004a14c0
add esp, 0x14
cmp eax, 1
jne 0x4a0923
call fcn.0049c3c0
test eax, eax
jne 0x4a0916
call fcn.0049c370
test eax, eax
je 0x4a0916
mov eax, dword [esi + 0xc64]
mov ecx, dword [esi + 0x97e]
push 0
push 0
push eax
push ecx
call fcn.004a4590
mov eax, dword [esi + 0x97e]
add esp, 0x10
lea edx, [esp + 0x14]
lea edi, [esi + 0xaf6]
push 0
push edx
push 0x1e
push edi
push eax
call ebx
cmp eax, 1
jne 0x4a07df
cmp dword [esp + 0x14], 0x1e
jne 0x4a07df
cmp dword [edi], 0x4034b50
jne 0x4a07df
mov ecx, dword [esp + 0xac4]
mov eax, dword [esi + 0xc68]
mov edx, dword [ecx + 0x14]
mov ecx, dword [esi + 0xc70]
push edx
push eax
push ecx
call fcn.0049c470
add esp, 0xc
lea edi, [esi + 0x8f5c]
lea edx, [esp + 0x18]
push edi
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
xor eax, eax
mov ax, word [esi + 0xb10]
push eax
call fcn.0049c2a0
add esp, 4
lea ecx, [esp + 0x18]
push ecx
push edi
call ebp
test eax, eax
je 0x4a0930
jmp 0x4a07df
mov dword [esp + 0x10], 0x1d
jmp 0x4a07df
mov dword [esp + 0x10], 0x30
jmp 0x4a09bc
xor edx, edx
mov dword [esp + 0x10], 0
mov dx, word [esi + 0xc5c]
mov dword [esi + 0xc80], edx
jmp 0x4a09bc
mov eax, dword [esi + 0xc64]
mov ecx, dword [esi + 0x97e]
push 0
push 0
push eax
push ecx
call fcn.004a4590
mov eax, dword [esi + 0x97e]
add esp, 0x10
lea edx, [esp + 0x14]
lea edi, [esi + 0xaf6]
push 0
push edx
push 0x1e
push edi
push eax
call ebx
test eax, eax
je 0x4a0988
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x4a0990
mov dword [esp + 0x10], 3
cmp dword [edi], 0x4034b50
je 0x4a09a2
mov dword [esp + 0x10], 3
jmp 0x4a09bc
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x4a09bc
xor ecx, ecx
mov cx, word [esi + 0xb10]
push ecx
call fcn.0049c2a0
add esp, 4
call fcn.0049c330
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x4a0ce1
lea eax, [esi + 0x318]
push eax
call fcn.0049ea50
xor edi, edi
add esp, 4
cmp eax, edi
mov dword [esi + 0x98a], eax
je 0x4a0a35
mov edx, dword [esp + 0xac4]
mov dword [edx + 0xc], edi
mov eax, dword [esi + 0x8ce2]
cmp eax, edi
je 0x4a0a0b
push eax
call fcn.004b0778
add esp, 4
mov dword [esi + 0x8ce2], edi
mov eax, dword [esi + 0x8f50]
cmp eax, edi
je 0x4a0a24
push eax
call fcn.004b0778
add esp, 4
mov dword [esi + 0x8f50], edi
mov eax, dword [esi + 0x98a]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xab0
ret
cmp dword [esi + 0x99e], edi
jne 0x4a0b26
cmp dword [esi + 0x3c], edi
je 0x4a0a8f
lea edi, [esi + 0x75e]
push edi
push 0
push 0x84
call fcn.004a35d0
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
add esp, 8
push eax
lea eax, [esi + 0x9ae]
push eax
call ebx
add esp, 0xc
push edi
push 2
push 0x93
call fcn.004a35d0
add esp, 8
lea ecx, [esp + 0x640]
push eax
push ecx
call ebx
jmp 0x4a0b11
cmp dword [esi + 0x44], edi
je 0x4a0ab3
push edi
push 0x95
call fcn.004a35d0
add esp, 8
lea edx, [esp + 0x63c]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp 0x4a0b14
lea eax, [esi + 0x75e]
push eax
lea eax, [esp + 0x120]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea ecx, [esp + 0x11c]
push ecx
push 0
push 0x48
call fcn.004a35d0
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
add esp, 8
lea edx, [esi + 0x9ae]
push eax
push edx
call edi
add esp, 0xc
lea eax, [esp + 0x11c]
push eax
push 2
push 0x91
call fcn.004a35d0
add esp, 8
lea ecx, [esp + 0x640]
push eax
push ecx
call edi
add esp, 0xc
lea edx, [esp + 0x63c]
push edx
call fcn.004a2a40
add esp, 4
jmp 0x4a0b94
lea eax, [esi + 0x75e]
push eax
lea eax, [esp + 0x120]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea ecx, [esp + 0x11c]
push ecx
push 0
push 0x49
call fcn.004a35d0
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
add esp, 8
lea edx, [esi + 0x9ae]
push eax
push edx
call edi
add esp, 0xc
lea eax, [esp + 0x11c]
push eax
push 2
push 0x92
call fcn.004a35d0
add esp, 8
lea ecx, [esp + 0x640]
push eax
push ecx
call edi
lea edx, [esp + 0x648]
push edx
call fcn.004a2a40
add esp, 0x10
lea eax, [esi + 0x75e]
push eax
call fcn.004a37d0
add esp, 4
test eax, eax
jne 0x4a0cdc
mov edi, dword [esp + 0xac4]
mov eax, dword [edi + 0xc]
mov ecx, dword [eax + 0x12a]
mov eax, dword [esi + 0xac2]
and ecx, 7
test eax, eax
mov dword [esi + 0x966], ecx
je 0x4a0bec
mov dx, word [esp + 0x220]
mov word [esi + 0xb02], dx
mov ax, word [esp + 0x224]
mov word [esi + 0xb00], ax
lea ecx, [esi + 0x862]
push ecx
call fcn.0049e790
add esp, 4
mov dword [esi + 0x98a], eax
test eax, eax
jle 0x4a0cd8
mov ecx, dword [esi + 0xc84]
test ecx, ecx
je 0x4a0cd8
cmp eax, 0x2c
jne 0x4a0cd8
mov eax, dword [edi + 0x28]
test eax, eax
jne 0x4a0cc7
push 0x7f00
push 0
call dword [sym.imp.USER32.dll_LoadCursorA]
mov ebx, dword [sym.imp.USER32.dll_SetCursor]
push eax
call ebx
mov edi, eax
lea eax, [esi + 0x75e]
lea edx, [esp + 0x11c]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [esp + 0x11c]
push eax
push 0
push 0x46
call fcn.004a35d0
add esp, 8
lea ecx, [esp + 0x1c]
push eax
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
lea edx, [esp + 0x24]
push edx
push 0
push 0
push 1
push 9
call fcn.004a14c0
add esp, 0x20
mov ebp, eax
push edi
call ebx
cmp ebp, 2
jne 0x4a0caf
mov eax, dword [esp + 0xac4]
mov dword [esp + 0x10], 0x2c
mov dword [eax + 0xc], 0
jmp 0x4a0cdc
mov ecx, dword [esp + 0xac4]
mov dword [esp + 0x10], 0x31
mov dword [ecx + 0xc], 0
jmp 0x4a0cdc
mov dword [edi + 0xc], 0
mov dword [esp + 0x10], 0x31
jmp 0x4a0cdc
mov dword [esp + 0x10], eax
call fcn.0049eaa0
mov edx, dword [esp + 0xac4]
xor edi, edi
mov dword [edx + 0xc], edi
mov eax, dword [esi + 0x8ce2]
cmp eax, edi
je 0x4a0d06
push eax
call fcn.004b0778
add esp, 4
mov dword [esi + 0x8ce2], edi
mov eax, dword [esi + 0x8f50]
cmp eax, edi
je 0x4a0d1f
push eax
call fcn.004b0778
add esp, 4
mov dword [esi + 0x8f50], edi
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xab0
ret