Function at 0x404790
Capabilities:
Access peb ldr_data
Move file
Set current directory

Disassembly:
push 0xffffffffffffffff
push 0x42af48
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov eax, dword [0x436b90]
xor eax, esp
push eax
lea eax, [esp + 0x20]
mov dword fs:[0], eax
xor esi, esi
mov dword [esp + 0x28], esi
mov eax, dword [esp + 0x30]
mov eax, dword [eax]
mov ecx, dword [eax + 0x1c]
cmp dword [eax + 0xc], ecx
jle 0x4047e5
cmp ecx, esi
jl 0x4047e0
cmp ecx, dword [eax + 0xc]
jge 0x4047e0
mov edx, dword [eax + 8]
mov eax, dword [edx + ecx*4]
mov dword [esp + 0x18], eax
jmp 0x4047e9
call fcn.00411116
mov dword [esp + 0x18], esi
mov ebx, dword [esp + 0x34]
lea eax, [ebx - 0x10]
push eax
mov dword [esp + 0x20], eax
call fcn.004021a0
lea ebp, [eax + 0x10]
add esp, 4
mov dword [esp + 0x30], ebp
mov byte [esp + 0x28], 1
call fcn.004111f0
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x404823
push 0x80004005
call fcn.00401160
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
mov byte [esp + 0x28], 2
cmp dword [ebp - 4], 1
jle 0x40484f
mov ecx, dword [ebp - 0xc]
push ecx
lea ecx, [esp + 0x34]
call fcn.004020b0
mov ebp, dword [esp + 0x30]
mov edi, ebp
call fcn.004086f0
cmp ebp, esi
jne 0x40485e
xor eax, eax
jmp 0x404878
mov eax, ebp
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x404863
sub eax, edx
sar eax, 1
js 0x4049ee
cmp eax, dword [ebp - 8]
jg 0x4049ee
mov dword [ebp - 0xc], eax
mov word [ebp + eax*2], si
mov esi, dword [esp + 0x18]
mov edx, dword [esi]
mov eax, dword [edx + 0x1c]
push ebp
push str.Directories
mov ecx, esi
call eax
test eax, eax
je 0x40499b
mov ebx, dword [sym.imp.USER32.dll_CharNextW]
lea ebx, [ebx]
cmp word [ebp], 0
mov eax, ebp
je 0x4048d0
lea esp, [esp]
push eax
call ebx
cmp word [eax], 0
jne 0x4048c0
cmp ebp, eax
ja 0x4048f5
lea ecx, [ecx]
movzx ecx, word [eax]
cmp cx, 0x2f
je 0x4048f5
cmp cx, 0x5c
je 0x4048f5
cmp cx, 0x3a
je 0x4048f5
cmp eax, ebp
je 0x404900
push eax
push ebp
call dword [sym.imp.USER32.dll_CharPrevW]
cmp ebp, eax
jbe 0x4048d0
push eax
call ebx
test eax, eax
jne 0x404904
xor ecx, ecx
jmp 0x404923
mov eax, ebp
jmp 0x4048f8
mov ecx, eax
lea esi, [ecx + 2]
lea esp, [esp]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x404910
sub ecx, esi
mov esi, dword [esp + 0x18]
sar ecx, 1
push ecx
push eax
lea ecx, [esp + 0x1c]
call fcn.00402290
cmp dword [ebp - 4], 1
jle 0x404945
mov ecx, dword [ebp - 0xc]
push ecx
lea ecx, [esp + 0x34]
call fcn.004020b0
mov ebp, dword [esp + 0x30]
mov edi, ebp
call fcn.004086f0
test ebp, ebp
jne 0x404954
xor eax, eax
jmp 0x404971
mov eax, ebp
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x404960
sub eax, edx
sar eax, 1
js 0x4049ee
cmp eax, dword [ebp - 8]
jg 0x4049ee
mov dword [ebp - 0xc], eax
mov word [ebp + eax*2], 0
mov edx, dword [esi]
mov eax, dword [edx + 0x1c]
push ebp
push str.Directories
mov ecx, esi
call eax
test eax, eax
jne 0x4048b0
mov ebx, dword [esp + 0x34]
mov eax, dword [ebx - 0xc]
lea esi, [eax + 0x104]
xor ecx, ecx
mov eax, esi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0040ab0b
add esp, 4
cmp esi, 0x7fffffff
mov edi, eax
ja 0x4049d4
mov eax, ebp
mov edx, esi
mov ecx, edi
call fcn.00402b20
mov eax, dword [esp + 0x14]
mov ecx, edi
call fcn.00408830
mov esi, ebx
call fcn.004087e0
test eax, eax
jne 0x4049f8
xor ecx, ecx
jmp 0x404a0f
push 0x80070057
call fcn.00401160
mov ecx, eax
lea esi, [ecx + 2]
lea ecx, [ecx]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x404a00
sub ecx, esi
sar ecx, 1
push ecx
push eax
lea ecx, [esp + 0x1c]
call fcn.00402290
mov esi, dword [esp + 0x14]
mov eax, esi
mov ecx, edi
call fcn.00408830
push edi
push ebx
call fcn.00417d40
add esp, 8
test eax, eax
je 0x404a4f
push 8
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x404a4f
call fcn.004086f0
push edi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push edi
call fcn.0040ab06
lea eax, [esi - 0x10]
add esp, 4
mov byte [esp + 0x28], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x404a79
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov byte [esp + 0x28], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x404a9a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x28], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x404abf
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x20]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 8