Function at 0x406829
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffcc
push esi
push edi
mov dword [ebp - 8], 0
inc dword [0x416992]
mov esi, dword [ebp + 8]
mov eax, dword [0x4169fe]
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0xc], eax
cmp dword [0x416a1a], 0
jne 0x40713c
push dword [0x4169fe]
push dword [0x4169fa]
call fcn.00411140
cmp eax, 3
jne 0x406877
mov dword [ebp - 8], eax
jmp 0x406f21
cmp byte [0x416910], 2
je 0x4068b2
mov eax, dword [esi + 0x18]
mov ebx, dword [esi + 0x14]
cmp eax, dword [edi + 0x18]
jb 0x406f5f
ja 0x40708c
mov ecx, 0x1312cff
sub ebx, dword [edi + 0x14]
je 0x4068b2
jb 0x4068aa
cmp ebx, ecx
jbe 0x4068b2
jmp 0x40708c
add ebx, ecx
jae 0x406f5f
mov ecx, dword [esi + 0x20]
mov edx, dword [esi + 0x1c]
cmp ecx, dword [edi + 0x20]
jne 0x40708c
cmp edx, dword [edi + 0x1c]
jne 0x40708c
cmp byte [0x416910], 0
je 0x40717c
mov eax, 0xa
xchg ecx, eax
shr edx, 1
rcr eax, 1
loop 0x4068dd
test eax, eax
jne 0x4068e8
inc eax
test edx, edx
je 0x4068f1
mov eax, 0xffffffff
push eax
push 0x187
call fcn.0040d931
mov byte [0x4161d1], 0xd9
push 4
push 0x1000
push dword [0x4161db]
push 0
call sub.KERNEL32.dll_VirtualAlloc
mov dword [ebp - 8], eax
test eax, eax
je 0x406f21
mov dword [ebp - 0x10], eax
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push 0x8000000
push 0
push 0
push 0x80000000
lea eax, [ebp - 0x14]
push eax
push dword [0x4169fa]
call fcn.00406754
mov dword [ebp - 8], eax
cmp eax, 4
jne 0x406f4e
mov dword [ebp - 4], 0
push 0x8000000
push 0
push 0
push 0x80000000
lea eax, [ebp - 0x18]
push eax
push dword [0x4169fe]
call fcn.00406754
mov dword [ebp - 8], eax
cmp eax, 4
jne 0x406f46
mov esi, dword [ebp + 8]
mov ebx, dword [esi + 0x20]
mov ecx, dword [esi + 0x1c]
xor edx, edx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x30], edx
mov eax, dword [0x4161df]
xor edx, edx
sub dword [ebp - 0x2c], eax
jae 0x4069c3
sbb dword [ebp - 0x28], edx
jae 0x4069c3
add eax, dword [ebp - 0x2c]
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x28], edx
test eax, eax
je 0x406da8
mov dword [ebp - 0x24], eax
add dword [ebp - 0x34], eax
adc dword [ebp - 0x30], 0
call fcn.004096f6
test eax, eax
jne 0x4069e2
mov dword [ebp - 8], 3
jmp 0x406f2a
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x10]
push dword [ebp - 0x14]
call sub.KERNEL32.dll_ReadFile
test eax, eax
je 0x406a02
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x24]
je 0x406a41
push 0
push dword [0x4169fa]
push 0x215
push 0x202
push 0x1a0
call fcn.004098f6
mov esi, eax
push dword [ebp - 0x18]
call sub.KERNEL32.dll_CloseHandle
push dword [ebp - 0x14]
call sub.KERNEL32.dll_CloseHandle
cmp esi, 1
je 0x406931
mov dword [ebp - 8], esi
jmp 0x406f4e
mov edi, dword [ebp - 0x10]
add edi, dword [0x4161df]
push 0
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x24]
push edi
push dword [ebp - 0x18]
call sub.KERNEL32.dll_ReadFile
test eax, eax
je 0x406a68
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x24]
je 0x406aa7
push 0
push dword [0x4169fe]
push 0x215
push 0x202
push 0x1a0
call fcn.004098f6
mov esi, eax
push dword [ebp - 0x18]
call sub.KERNEL32.dll_CloseHandle
push dword [ebp - 0x14]
call sub.KERNEL32.dll_CloseHandle
cmp esi, 1
je 0x406931
mov dword [ebp - 8], esi
jmp 0x406f4e
mov esi, dword [ebp - 0x10]
pushfd
cld
mov ecx, dword [ebp - 0x24]
and ecx, 0xfffffffc
je 0x406ac5
shr ecx, 2
repe cmpsd dword [esi], dword es:[edi]
je 0x406ac5
inc ecx
sub esi, 4
sub edi, 4
shl ecx, 2
popfd
and eax, 3
add ecx, eax
je 0x4069a1
pushfd
cld
repe cmpsb byte [esi], byte es:[edi]
setne al
popfd
test al, al
je 0x4069a1
inc ecx
mov dword [ebp - 0x24], ecx
sub dword [ebp - 0x1c], ecx
sub dword [ebp - 0x34], ecx
sbb dword [ebp - 0x30], 0
push dword [ebp - 0x18]
call sub.KERNEL32.dll_CloseHandle
mov edi, dword [ebp + 0xc]
test dword [edi], 1
je 0x406b9b
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push dword [0x4169fe]
call fcn.00404737
test eax, eax
jne 0x406b4a
push 0
push dword [0x4169fe]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x406b12
mov dword [ebp - 8], eax
jmp 0x406f46
mov esi, 0xfffffffe
and esi, dword [edi]
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push esi
lea eax, [edi + 0x2c]
push eax
call fcn.00413319
test eax, eax
jne 0x406b94
push 0
push dword [0x4169fe]
push 0x214
push 0x201
push 0x1a4
call fcn.004098f6
cmp eax, 1
je 0x406b5d
mov dword [ebp - 8], eax
jmp 0x406f46
mov dword [ebp - 4], 1
push 0x8000000
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x18]
push eax
push dword [0x4169fe]
call fcn.00406754
mov dword [ebp - 8], eax
cmp eax, 4
jne 0x406f32
push 0
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 0x34]
push dword [ebp - 0x18]
call sub.KERNEL32.dll_SetFilePointer
cmp eax, 0xffffffff
jne 0x406be4
call sub.KERNEL32.dll_GetLastError
cmp eax, 0
jne 0x406c08
mov ebx, dword [ebp - 0x10]
add ebx, dword [ebp - 0x1c]
push 0
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x24]
push ebx
push dword [ebp - 0x18]
call sub.KERNEL32.dll_WriteFile
test eax, eax
je 0x406c08
mov ebx, dword [ebp - 0x20]
cmp dword [ebp - 0x24], ebx
je 0x406c4a
push dword [0x4169fe]
push dword [0x4169fa]
push 0x213
push 0x200
push 0x1a9
call fcn.004098f6
cmp eax, 1
jne 0x406c42
push dword [ebp - 0x18]
call sub.KERNEL32.dll_CloseHandle
push dword [ebp - 0x14]
call sub.KERNEL32.dll_CloseHandle
jmp 0x406931
mov dword [ebp - 8], eax
jmp 0x406f2a
mov eax, dword [0x4161db]
xor edx, edx
sub dword [ebp - 0x2c], eax
jae 0x406c6c
sbb dword [ebp - 0x28], edx
jae 0x406c6c
add eax, dword [ebp - 0x2c]
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x28], edx
test eax, eax
je 0x406d37
mov dword [ebp - 0x24], eax
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x10]
push dword [ebp - 0x14]
call sub.KERNEL32.dll_ReadFile
test eax, eax
je 0x406c8f
mov ebx, dword [ebp - 0x1c]
cmp dword [ebp - 0x24], ebx
je 0x406cd1
push dword [0x4169fe]
push dword [0x4169fa]
push 0x213
push 0x200
push 0x1a5
call fcn.004098f6
cmp eax, 1
jne 0x406cc9
push dword [ebp - 0x18]
call sub.KERNEL32.dll_CloseHandle
push dword [ebp - 0x14]
call sub.KERNEL32.dll_CloseHandle
jmp 0x406931
mov dword [ebp - 8], eax
jmp 0x406f2a
push 0
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x10]
push dword [ebp - 0x18]
call sub.KERNEL32.dll_WriteFile
test eax, eax
je 0x406cf5
mov ebx, dword [ebp - 0x20]
cmp dword [ebp - 0x24], ebx
je 0x406c4a
push dword [0x4169fe]
push dword [0x4169fa]
push 0x213
push 0x200
push 0x1a9
call fcn.004098f6
cmp eax, 1
jne 0x406d2f
push dword [ebp - 0x18]
call sub.KERNEL32.dll_CloseHandle
push dword [ebp - 0x14]
call sub.KERNEL32.dll_CloseHandle
jmp 0x406931
mov dword [ebp - 8], eax
jmp 0x406f2a
mov esi, dword [ebp + 8]
mov ax, word [0x41692d]
mov word [0x4161d9], ax
lea eax, [esi + 0x14]
push eax
push 0
push 0
push dword [ebp - 0x18]
call sub.KERNEL32.dll_SetFileTime
test eax, eax
jne 0x406d83
push 0
push dword [0x4169fa]
push 0x219
push 0x206
push 0x1a8
call fcn.004098f6
cmp eax, 1
je 0x406d46
mov dword [ebp - 8], eax
jmp 0x406f2a
inc dword [0x41697a]
test word [0x416928], 1
je 0x406dcf
push 1
push dword [0x4169fe]
push 0x1f3
call fcn.00407f67
jmp 0x406dcf
push dword [ebp - 0x14]
call sub.KERNEL32.dll_CloseHandle
push dword [ebp - 0x18]
call sub.KERNEL32.dll_CloseHandle
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
push 0
lea eax, [edi + 0x14]
push eax
lea eax, [esi + 0x14]
push eax
call fcn.0040ffb8
jmp 0x406df3
push dword [ebp - 0x18]
call sub.KERNEL32.dll_CloseHandle
cmp dword [ebp - 4], 0
je 0x406deb
mov edi, dword [ebp + 0xc]
push dword [edi]
lea eax, [edi + 0x2c]
push eax
call fcn.00413319
push dword [ebp - 0x14]
call sub.KERNEL32.dll_CloseHandle
mov byte [0x4161d1], 0xdd
push 0x8000
push 0
push dword [ebp - 0x10]
call sub.KERNEL32.dll_VirtualFree
mov dword [ebp - 8], eax
test eax, eax
je 0x406f21
cmp byte [0x416913], 0
je 0x406eda
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
mov ebx, dword [esi]
mov ecx, dword [edi]
and ebx, 7
and ecx, 7
cmp ebx, ecx
je 0x406eda
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push dword [0x4169fe]
call fcn.00404737
test eax, eax
jne 0x406e7d
push 0
push dword [0x4169fa]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x406e45
mov dword [ebp - 8], eax
jmp 0x406f21
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push ebx
lea eax, [edi + 0x2c]
push eax
call fcn.00413319
mov dword [ebp - 8], eax
test eax, eax
jne 0x406ec0
push 0
push dword [0x4169fe]
push 0x218
push 0x205
push 0x1a7
call fcn.004098f6
cmp eax, 1
je 0x406e89
mov dword [ebp - 8], eax
jmp 0x406f21
test word [0x416928], 0x800
je 0x406eda
push 1
push dword [ebp - 0xc]
push 0x1f1
call fcn.00407f67
cmp byte [0x4161fb], 0
je 0x406efb
push 1
push 0x1aa
push dword [0x4169fe]
push dword [0x4169fa]
call fcn.0040f9bc
cmp byte [0x4161fc], 0
je 0x406f1a
push dword [0x4169fe]
push dword [0x4169fa]
call fcn.0040fc74
mov dword [ebp - 8], eax
jmp 0x406f21
mov dword [ebp - 8], 4
mov eax, dword [ebp - 8]
pop edi
pop esi
leave
ret 8
push dword [ebp - 0x18]
call sub.KERNEL32.dll_CloseHandle
cmp dword [ebp - 4], 0
je 0x406f46
mov edi, dword [ebp + 0xc]
push dword [edi]
lea eax, [edi + 0x2c]
push eax
call fcn.00413319
push dword [ebp - 0x14]
call sub.KERNEL32.dll_CloseHandle
push 0x8000
push 0
push dword [ebp - 0x10]
call sub.KERNEL32.dll_VirtualFree
jmp 0x406f21
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], eax
test word [0x416928], 0x20
je 0x406f82
push 1
push dword [0x4169fe]
push 0x1ef
call fcn.00407f67
cmp byte [0x416917], 0
je 0x40708c
cmp byte [0x416917], 2
jne 0x40717c
push dword [0x4169fe]
call fcn.0040da1e
push eax
push 0x188
call fcn.0040d931
mov esi, dword [ebp + 8]
test dword [esi], 7
je 0x40704c
and dword [esi], 0xfffffff8
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push dword [0x4169fa]
call fcn.00404737
test eax, eax
jne 0x407008
push 0
push dword [0x4169fa]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x406fd0
mov dword [ebp - 8], eax
jmp 0x406f21
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push dword [esi]
lea eax, [esi + 0x2c]
push eax
call fcn.00413319
test eax, eax
jne 0x40704c
push 0
push dword [0x4169fa]
push 0x20d
push 0x1fa
push 0x1a4
call fcn.004098f6
cmp eax, 1
je 0x407014
mov dword [ebp - 8], eax
jmp 0x406f21
xor ebx, ebx
test word [0x416928], 0x40
je 0x40705e
mov ebx, 0x1f3
push 0x41695e
push ebx
push dword [0x4169fa]
push dword [0x4169fe]
call fcn.0040f856
cmp eax, 2
je 0x406f24
cmp eax, 3
je 0x406f24
jmp 0x406e14
push dword [0x4169fa]
call fcn.0040da1e
push eax
push 0x188
call fcn.0040d931
mov edi, dword [ebp + 0xc]
test dword [edi], 7
je 0x40713c
and dword [edi], 0xfffffff8
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push dword [0x4169fe]
call fcn.00404737
test eax, eax
jne 0x4070f8
push 0
push dword [0x4169fe]
push 0x21a
push 0x207
push 0x1ab
call fcn.004098f6
cmp eax, 1
je 0x4070c0
mov dword [ebp - 8], eax
jmp 0x406f21
mov ax, word [0x41692d]
mov word [0x4161d9], ax
push dword [edi]
lea eax, [edi + 0x2c]
push eax
call fcn.00413319
test eax, eax
jne 0x40713c
push 0
push dword [0x4169fe]
push 0x20d
push 0x1fa
push 0x1a4
call fcn.004098f6
cmp eax, 1
je 0x407104
mov dword [ebp - 8], eax
jmp 0x406f21
xor ebx, ebx
test word [0x416928], 1
je 0x40714e
mov ebx, 0x1f3
push 0x41697a
push ebx
push dword [0x4169fe]
push dword [0x4169fa]
call fcn.0040f856
cmp eax, 2
je 0x406f24
cmp eax, 3
je 0x406f24
jmp 0x406e14
test word [0x416928], 2
je 0x406e14
push 1
push dword [0x4169fe]
push 0x1ee
call fcn.00407f67
jmp 0x406e14