Function at 0x420510
Capabilities:
Check for peb beingdebugged flag
Check if file exists
Get file attributes
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x45c3cc
mov eax, dword fs:[0]
push eax
sub esp, 0x444
mov eax, dword [0x4713c0]
xor eax, esp
mov dword [esp + 0x440], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4713c0]
xor eax, esp
push eax
lea eax, [esp + 0x458]
mov dword fs:[0], eax
mov eax, dword [esp + 0x468]
mov ebp, dword [esp + 0x46c]
mov dword [esp + 0x18], eax
call fcn.00406dc0
push eax
mov eax, ebp
call fcn.00406dc0
push eax
push 0x46532c
lea eax, [esp + 0x60]
push 0x200
push eax
call fcn.004414db
xor ebx, ebx
add esp, 0x14
lea ecx, [esp + 0x38]
mov word [esp + 0x452], bx
call fcn.0042bd40
mov dword [esp + 0x460], ebx
mov edi, 7
lea eax, [esp + 0x54]
mov dword [esp + 0x34], edi
mov dword [esp + 0x30], ebx
mov word [esp + 0x20], bx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4205b5
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x58]
push ecx
lea esi, [esp + 0x24]
call fcn.00406f80
mov edx, esi
push ebx
push edx
or eax, 0xffffffff
lea esi, [esp + 0x40]
mov byte [esp + 0x468], 1
call fcn.00406df0
mov esi, 8
cmp dword [esp + 0x34], esi
jb 0x420603
mov eax, dword [esp + 0x20]
push eax
call fcn.004415cb
add esp, 4
cmp dword [esp + 0x50], esi
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x34], edi
mov dword [esp + 0x30], ebx
mov word [esp + 0x20], bx
jae 0x42061e
lea edx, [esp + 0x3c]
mov edi, dword [0x474bb0]
cmp edi, ebx
je 0x420660
mov eax, edx
lea esi, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x420630
sub eax, esi
sar eax, 1
push edi
lea ecx, [eax + eax]
push ecx
push 1
push edx
call fcn.004422ed
mov edx, dword [0x474bb0]
push edx
call fcn.004428a9
add esp, 0x14
mov esi, 8
or edi, 0xffffffff
mov dword [esp + 0x460], edi
cmp dword [esp + 0x50], esi
jb 0x42067d
mov eax, dword [esp + 0x3c]
push eax
call fcn.004415cb
add esp, 4
cmp dword [0x474ef8], ebx
je 0x4206e4
push ebx
push 0x46278c
lea esi, [esp + 0x40]
mov dword [esp + 0x58], 7
mov dword [esp + 0x54], ebx
mov word [esp + 0x44], bx
call fcn.00406f80
push ebp
mov dword [esp + 0x464], 2
call fcn.0041ecb0
add esp, 4
mov dword [esp + 0x460], edi
cmp dword [esp + 0x50], 8
mov esi, eax
jb 0x4206d6
mov ecx, dword [esp + 0x3c]
push ecx
call fcn.004415cb
add esp, 4
cmp esi, ebx
je 0x4206e4
mov eax, 2
jmp 0x4207a3
mov esi, dword [esp + 0x18]
cmp dword [esi + 0x14], ebx
je 0x4207a1
lea edi, [esp + 0x1c]
call fcn.004200b0
mov dword [esp + 0x460], 3
cmp dword [esp + 0x30], ebx
jne 0x420726
cmp dword [esp + 0x34], 8
jb 0x42071f
mov edx, dword [esp + 0x20]
push edx
call fcn.004415cb
add esp, 4
mov eax, 3
jmp 0x4207a3
cmp dword [esp + 0x34], 8
mov eax, dword [esp + 0x20]
jae 0x420735
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x42077b
mov edx, ebp
mov ecx, esi
call fcn.0041eaf0
test eax, eax
je 0x42075e
lea ecx, [esp + 0x1c]
call fcn.00406b10
mov eax, 4
jmp 0x4207a3
push ebp
call fcn.0041ecb0
add esp, 4
test eax, eax
je 0x420798
lea ecx, [esp + 0x1c]
call fcn.00406b10
mov eax, 5
jmp 0x4207a3
push ebp
call fcn.0041ecb0
add esp, 4
test eax, eax
je 0x420798
lea ecx, [esp + 0x1c]
call fcn.00406b10
mov eax, 6
jmp 0x4207a3
lea ecx, [esp + 0x1c]
call fcn.00406b10
xor eax, eax
mov ecx, dword [esp + 0x458]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x440]
xor ecx, esp
call fcn.004414cc
add esp, 0x450
ret