Function at 0x40d9a0
Capabilities:
Access peb ldr_data
Check if file exists

Disassembly:
push 0xffffffffffffffff
push 0x4d0920
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push ebp
push esi
push edi
mov eax, dword [0x50397c]
xor eax, esp
push eax
lea eax, [esp + 0x3c]
mov dword fs:[0], eax
mov eax, dword [0x50c48c]
mov edx, dword [eax + 0xc]
xor esi, esi
mov ecx, 0x50c48c
mov dword [esp + 0x34], esi
call edx
lea ebp, [eax + 0x10]
mov dword [esp + 0x28], ebp
lea ebx, [esp + 0x24]
mov dword [esp + 0x44], esi
call fcn.00428ed0
lea eax, [esp + 0x20]
push eax
mov byte [esp + 0x48], 1
call fcn.004291c0
add esp, 4
lea esi, [esp + 0x1c]
mov byte [esp + 0x44], 2
call fcn.0042f480
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x30]
push edx
mov ebx, str.handinput.dat
mov byte [esp + 0x4c], 3
call fcn.004065b0
mov eax, dword [eax]
mov esi, dword [0x4d5364]
add esp, 8
push eax
call esi
mov edi, eax
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40da59
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test edi, edi
lea edx, [esp + 0x2c]
mov ebx, str.handinput.dat
je 0x40da7e
lea ecx, [esp + 0x20]
push ecx
push edx
call fcn.004065b0
add esp, 8
mov byte [esp + 0x44], 4
jmp 0x40db2e
lea ecx, [esp + 0x24]
push ecx
push edx
call fcn.004065b0
mov eax, dword [eax]
add esp, 8
push eax
call esi
mov edi, eax
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40dab3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test edi, edi
lea edx, [esp + 0x2c]
mov ebx, str.handinput.dat
je 0x40dad5
lea ecx, [esp + 0x24]
push ecx
push edx
call fcn.004065b0
add esp, 8
mov byte [esp + 0x44], 5
jmp 0x40db2e
lea ecx, [esp + 0x1c]
push ecx
push edx
call fcn.004065b0
mov eax, dword [eax]
add esp, 8
push eax
call esi
mov esi, eax
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40db0a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
je 0x40dde6
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x30]
push edx
mov ebx, str.handinput.dat
call fcn.004065b0
add esp, 8
mov byte [esp + 0x44], 6
mov ecx, dword [eax]
lea eax, [ecx - 0x10]
lea esi, [ebp - 0x10]
cmp eax, esi
je 0x40db80
cmp dword [esi + 0xc], 0
lea edi, [esi + 0xc]
jl 0x40db6f
mov edx, dword [eax]
cmp edx, dword [esi]
jne 0x40db6f
call fcn.00402a60
mov ebx, eax
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
test eax, eax
jg 0x40db66
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
lea ebp, [ebx + 0x10]
mov dword [esp + 0x28], ebp
jmp 0x40db80
mov ebx, dword [ecx - 0xc]
push ecx
lea eax, [esp + 0x2c]
call fcn.00406770
mov ebp, dword [esp + 0x28]
mov byte [esp + 0x44], 3
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40dba5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x1388
call fcn.004aad76
mov ecx, dword [esp + 0x50]
add esp, 4
test eax, eax
mov dword [ecx + 0x840], eax
jne 0x40dbde
mov byte [esp + 0x44], 2
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x40ddff
xor esi, esi
push esi
push 0x80
push 3
push esi
push 1
push 0x80000000
push ebp
call dword [0x4d52cc]
cmp eax, 0xffffffff
jne 0x40dcc4
call fcn.00402e30
test eax, eax
jl 0x40dde6
lea ecx, [esp + 0x30]
push ecx
push esi
call dword [0x4d529c]
mov edi, eax
or ebx, 0xffffffff
cmp edi, ebx
mov dword [esp + 0x2c], edi
jne 0x40dccf
call fcn.00402e30
test eax, eax
jge 0x40dccb
test esi, esi
je 0x40dc42
push esi
call dword [0x4d52d8]
mov byte [esp + 0x44], 2
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
mov ecx, ebx
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40dc66
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x44], 1
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
mov edx, ebx
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40dc8a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x44], 0
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, ebx
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40dcae
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov dword [esp + 0x44], ebx
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebx
dec ebx
test ebx, ebx
jmp 0x40de6d
mov esi, eax
jmp 0x40dc0d
mov edi, dword [esp + 0x2c]
push edi
call fcn.004aad76
mov ecx, dword [esp + 0x50]
add esp, 4
test eax, eax
mov dword [ecx + 0x844], eax
je 0x40dc37
push 0
lea ecx, [esp + 0x30]
push ecx
push edi
push eax
push esi
mov dword [esp + 0x40], 0
call dword [0x4d52c8]
test eax, eax
jne 0x40de93
call fcn.00402e30
test eax, eax
jl 0x40dc37
test esi, esi
mov ebx, dword [0x4d52d8]
je 0x40dd26
push esi
call ebx
xor esi, esi
mov eax, dword [esp + 0x4c]
mov edx, dword [eax + 0x844]
mov eax, dword [eax + 0x840]
call fcn.00465af0
test ax, ax
jne 0x40dddf
test byte [0x5108b8], 1
mov edi, 0x2100
jne 0x40dd82
or dword [0x5108b8], 1
cmp dword [0x50de50], 0
jne 0x40dd75
cmp dword [0x50de54], 0
jne 0x40dd75
mov dword [0x50de50], 0x50e0f0
push 0x4d4190
call fcn.004aa96d
add esp, 4
mov eax, dword [0x50de50]
cmp dword [eax + 0xcd4], 0
mov edx, 1
mov dword [0x50de4c], edx
je 0x40dda0
mov edi, 0x2103
cmp dword [eax + 0xcd8], 0
je 0x40ddac
or edi, 4
mov ecx, dword [esp + 0x4c]
mov eax, dword [ecx + 0x840]
cmp word [eax + 0xe4a], 0
jne 0x40ddc6
and edi, 0xffff
mov dword [eax + 0xe4c], edi
mov eax, dword [ecx + 0x840]
mov word [eax + 0xe56], 0x1e
mov dword [esp + 0x34], edx
test esi, esi
je 0x40dde6
push esi
call ebx
mov byte [esp + 0x44], 2
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40de0b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x44], 1
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40de30
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x44], 0
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40de55
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov dword [esp + 0x44], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40de79
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x3c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 4
cmp dword [esp + 0x2c], edi
jne 0x40dc37
jmp 0x40dd17