Function at 0x496510
Capabilities:
Create directory
Get common file path
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x244
mov eax, dword [0x5392a4]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x244], ecx
movzx eax, byte [ebp + 0xc]
test eax, eax
je 0x49653e
mov ecx, dword [ebp - 0x244]
mov dword [ecx + 4], 0
lea edx, [ebp - 0x218]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
jne 0x49655f
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x496871
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
jne 0x496578
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x496871
mov byte [ebp - 0x219], 1
movzx ecx, byte [ebp - 0x219]
test ecx, ecx
je 0x496856
mov edx, dword [ebp - 0x244]
mov eax, dword [ebp - 0x244]
mov ecx, dword [edx + 4]
cmp ecx, dword [eax + 8]
jae 0x496856
mov edx, dword [ebp - 0x244]
mov eax, dword [edx + 0xc]
mov ecx, dword [ebp - 0x244]
mov edx, dword [ecx + 4]
mov eax, dword [eax + edx]
mov dword [ebp - 0x220], eax
mov ecx, dword [ebp - 0x244]
mov edx, dword [ecx + 4]
add edx, 4
mov eax, dword [ebp - 0x244]
mov dword [eax + 4], edx
mov ecx, dword [ebp - 0x244]
mov edx, dword [ecx + 0xc]
mov eax, dword [ebp - 0x244]
mov ecx, dword [eax + 4]
mov edx, dword [edx + ecx]
mov dword [ebp - 0x228], edx
mov eax, dword [ebp - 0x244]
mov ecx, dword [eax + 4]
add ecx, 4
mov edx, dword [ebp - 0x244]
mov dword [edx + 4], ecx
cmp dword [ebp - 0x228], 2
jne 0x49661b
mov byte [ebp - 0x219], 0
jmp 0x496851
cmp dword [ebp - 0x228], 0
jne 0x496669
mov eax, dword [ebp - 0x244]
cmp dword [eax + 0x10], 1
jbe 0x496669
push 8
mov ecx, dword [ebp - 0x244]
mov edx, dword [ecx + 0xc]
mov eax, dword [ebp - 0x244]
add edx, dword [eax + 4]
push edx
lea ecx, [ebp - 0x230]
push ecx
call fcn.00448f70
add esp, 0xc
mov edx, dword [ebp - 0x244]
mov eax, dword [edx + 4]
add eax, 8
mov ecx, dword [ebp - 0x244]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x244]
mov eax, dword [edx + 4]
mov dword [ebp - 0x238], eax
mov ecx, dword [ebp - 0x244]
mov edx, dword [ecx + 4]
add edx, dword [ebp - 0x220]
mov eax, dword [ebp - 0x244]
mov dword [eax + 4], edx
push 0
mov ecx, dword [ebp - 0x244]
add ecx, 4
push ecx
mov edx, dword [ebp - 0x244]
mov eax, dword [edx + 0xc]
push eax
mov ecx, dword [ebp - 0x244]
call fcn.00496440
mov ecx, dword [ebp - 0x244]
mov edx, dword [ecx + 0xc]
mov eax, dword [ebp - 0x244]
add edx, dword [eax + 4]
mov dword [ebp - 0x234], edx
mov ecx, dword [ebp - 0x234]
push ecx
call fcn.00448da2
add esp, 4
mov edx, dword [ebp - 0x244]
mov ecx, dword [edx + 4]
lea edx, [ecx + eax*2 + 2]
mov eax, dword [ebp - 0x244]
mov dword [eax + 4], edx
push 0
mov ecx, dword [ebp - 0x244]
add ecx, 4
push ecx
mov edx, dword [ebp - 0x244]
mov eax, dword [edx + 0xc]
push eax
mov ecx, dword [ebp - 0x244]
call fcn.00496440
cmp dword [ebp - 0x228], 1
jne 0x496781
push 0
mov ecx, dword [ebp - 0x234]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x49674e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x224], eax
cmp dword [ebp - 0x224], 0xb7
je 0x49674e
mov eax, dword [ebp - 0x224]
jmp 0x496871
push 0
mov edx, dword [ebp - 0x234]
push edx
mov ecx, dword [ebp - 0x244]
call fcn.00496510
mov dword [ebp - 0x23c], eax
cmp dword [ebp - 0x23c], 0
je 0x49677c
mov eax, dword [ebp - 0x23c]
jmp 0x496871
jmp 0x496851
mov eax, dword [ebp - 0x234]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x4967b2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x224], eax
cmp dword [ebp - 0x224], 2
je 0x4967b2
mov eax, dword [ebp - 0x224]
jmp 0x496871
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
mov ecx, dword [ebp - 0x234]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x240], eax
cmp dword [ebp - 0x240], 0xffffffff
je 0x49684a
push 0
lea edx, [ebp - 0x220]
push edx
mov eax, dword [ebp - 0x220]
push eax
mov ecx, dword [ebp - 0x244]
mov edx, dword [ecx + 0xc]
add edx, dword [ebp - 0x238]
push edx
mov eax, dword [ebp - 0x240]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x244]
cmp dword [ecx + 0x10], 1
jbe 0x49683b
lea edx, [ebp - 0x230]
push edx
lea eax, [ebp - 0x230]
push eax
lea ecx, [ebp - 0x230]
push ecx
mov edx, dword [ebp - 0x240]
push edx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov eax, dword [ebp - 0x240]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x496851
mov eax, 9
jmp 0x496871
jmp 0x49657f
lea ecx, [ebp - 0x218]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
jne 0x49686f
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x496871
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004489b2
mov esp, ebp
pop ebp
ret 8