Function at 0x540830
Capabilities:
Delete file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5a29d3
mov eax, dword fs:[0]
push eax
sub esp, 0x5c8
mov eax, dword [0x601018]
xor eax, ebp
mov dword [ebp - 0x18], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 8]
mov esi, ecx
xor ebx, ebx
mov dword [ebp - 0x4f8], eax
mov dword [ebp - 0x500], esi
cmp esi, ebx
je 0x5408b1
push esi
call fcn.004f9540
add esp, 4
test eax, eax
je 0x5408d2
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
neg eax
sbb eax, eax
neg eax
dec eax
cmp eax, ebx
je 0x5408d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.ERROR_:_failed_to_delete_the_existing_file____s____error_d
mov ecx, 0x610240
call fcn.00504670
add esp, 0xc
or eax, 0xffffffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x18]
xor ecx, ebp
call fcn.00596083
mov esp, ebp
pop ebp
ret 4
push 0x434
mov dword [ebp - 4], ebx
call dword [sym.imp.MSVCR100.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
cmp eax, ebx
je 0x54090d
mov edi, eax
mov dword [eax + 4], ebx
mov dword [eax], vtable.WindowsFile.0
mov dword [eax + 8], 0xffffffff
mov dword [eax + 0xc], ebx
mov byte [eax + 0x14], bl
mov byte [eax + 0x414], bl
mov dword [ebp - 0x4f0], edi
jmp 0x540915
mov dword [ebp - 0x4f0], ebx
mov edi, ebx
push esi
push 0x5c7d4c
push str.corw
call fcn.00508fc0
mov edx, dword [edi]
mov eax, dword [edx + 0x14]
add esp, 0xc
mov ecx, edi
call eax
cmp eax, ebx
je 0x540947
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.ERROR_:_failed_to_create_file____s____error_d
jmp 0x5408a4
mov eax, dword [ebp - 0x4f8]
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [eax + 0x84c]
mov edx, dword [eax + 0x848]
push ecx
push edx
push str.__PDF__d._d_r_n
mov esi, 0x400
lea edi, [ebp - 0x41c]
call fcn.004f9520
mov eax, edi
add esp, 0xc
lea esi, [eax + 1]
nop
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x540980
mov ecx, dword [ebp - 0x4f0]
mov edx, dword [ecx]
mov edx, dword [edx + 0x2c]
sub eax, esi
push eax
lea eax, [ebp - 0x41c]
push eax
call edx
mov edi, vtable.PDFObjID.0
mov dword [ebp - 0x524], ebx
mov dword [ebp - 0x520], ebx
mov dword [ebp - 0x534], edi
mov dword [ebp - 0x52c], ebx
mov dword [ebp - 0x528], ebx
mov dword [ebp - 0x530], ebx
mov esi, dword [ebp - 0x4f8]
mov dword [ebp - 4], 2
mov eax, dword [esi + 0x810]
push eax
lea ecx, [ebp - 0x4cc]
push ecx
call fcn.0053a680
mov eax, 0x5bc564
lea ecx, [ebp - 0x470]
mov byte [ebp - 4], 3
call fcn.00402e20
mov dword [ebp - 0x51c], edi
mov dword [ebp - 0x514], ebx
mov dword [ebp - 0x510], ebx
mov dword [ebp - 0x518], ebx
mov eax, 0x5bc564
lea ecx, [ebp - 0x454]
mov byte [ebp - 4], 5
call fcn.00402e20
lea edx, [ebp - 0x5d4]
push edx
mov byte [ebp - 4], 6
call fcn.0053ab70
mov byte [ebp - 4], 7
mov dword [ebp - 0x500], ebx
cmp dword [esi + 0x888], ebx
jle 0x541230
lea edi, [ebp - 0x5d4]
call fcn.0053ae70
mov eax, dword [ebp - 0x4f8]
add eax, 0x860
call fcn.004961a0
mov dword [ebp - 0x504], eax
test eax, eax
je 0x541215
mov eax, dword [ebp - 0x4f8]
push eax
mov eax, dword [ebp - 0x504]
call fcn.005438d0
xor ebx, ebx
xor edi, edi
mov eax, 0x5bc564
lea esi, [ebp - 0x438]
mov dword [ebp - 0x424], 0xf
mov dword [ebp - 0x428], ebx
mov byte [ebp - 0x438], bl
call fcn.00402fe0
mov byte [ebp - 4], 8
mov ecx, dword [ebp - 0x518]
mov dword [ebp - 0x53c], ebx
mov dword [ebp - 0x538], ebx
mov byte [ebp - 0x4e9], 0
mov dword [ebp - 0x514], ebx
mov dword [ebp - 0x510], ebx
cmp ecx, ebx
je 0x540aed
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
mov dword [ebp - 0x518], ebx
mov eax, dword [ebp - 0x4f8]
lea ecx, [ebp - 0x51c]
push ecx
lea edx, [ebp - 0x53c]
push edx
push eax
lea ecx, [ebp - 0x4e9]
lea edx, [ebp - 0x438]
call fcn.00543930
test eax, eax
jle 0x540e31
jmp 0x540b20
mov al, byte [ebp - 0x4e9]
cmp al, 9
je 0x540e03
cmp al, 0xa
je 0x540e03
cmp dword [ebp - 0x424], 0x10
mov ebx, dword [ebp - 0x438]
jae 0x540b4b
lea ebx, [ebp - 0x438]
mov edi, dword [ebp - 0x428]
mov esi, 5
mov eax, str._XRef
call fcn.00527cd0
test eax, eax
jne 0x540e03
cmp dword [ebp - 0x514], eax
jle 0x541302
cmp dword [ebp - 0x510], eax
jl 0x541302
lea esi, [eax + 7]
mov eax, str._ObjStm
call fcn.00527cd0
test eax, eax
je 0x540d5d
lea ebx, [ebp - 0x4cc]
call fcn.00495fd0
mov ecx, dword [ebp - 0x504]
mov edx, dword [ebp - 0x438]
add ecx, 0x5c
cmp dword [ebp - 0x424], 0x10
mov dword [ebp - 0x4a4], ecx
jae 0x540bc4
lea edx, [ebp - 0x438]
mov ecx, dword [ebp - 0x428]
lea eax, [ebp - 0x4cc]
push eax
call fcn.0053c510
test eax, eax
jle 0x541379
mov ecx, dword [ebp - 0x498]
mov edx, dword [ebp - 0x49c]
sub ecx, edx
sar ecx, 2
xor eax, eax
mov dword [ebp - 0x4fc], ecx
mov dword [ebp - 0x4f4], eax
test ecx, ecx
jle 0x540e03
test eax, eax
js 0x540d49
mov esi, dword [ebp - 0x498]
sub esi, edx
sar esi, 2
cmp eax, esi
jge 0x540d49
mov esi, dword [edx + eax*4]
test esi, esi
je 0x540d49
lea eax, [ebp - 0x54c]
mov ecx, esi
call fcn.00495d50
lea ecx, [ebp - 0x534]
cmp ecx, eax
je 0x540c5e
mov edx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x52c], edx
mov dword [ebp - 0x528], eax
mov dword [ebp - 0x530], 0
lea ecx, [ebp - 0x54c]
call fcn.00460860
push esi
lea ebx, [ebp - 0x4e8]
call fcn.00495d70
mov edi, eax
lea esi, [ebp - 0x470]
mov byte [ebp - 4], 9
call fcn.00402f10
mov esi, ebx
mov byte [ebp - 4], 8
call fcn.004542a0
mov esi, dword [ebp - 0x4f0]
mov edx, dword [esi]
mov eax, dword [edx + 0x30]
mov ecx, esi
call eax
push edx
push eax
lea ecx, [ebp - 0x534]
lea edi, [ebp - 0x5d4]
call fcn.0053b200
test eax, eax
jle 0x541379
mov edx, dword [ebp - 0x45c]
mov eax, dword [ebp - 0x470]
cmp edx, 0x10
jae 0x540cd2
lea eax, [ebp - 0x470]
mov ecx, dword [ebp - 0x460]
cmp byte [eax + ecx - 1], 0xd
je 0x540d1b
mov eax, dword [ebp - 0x470]
cmp edx, 0x10
jae 0x540cf0
lea eax, [ebp - 0x470]
cmp byte [eax + ecx - 1], 0xa
je 0x540d1b
push 0xd
mov ebx, 1
lea esi, [ebp - 0x470]
call fcn.0044ad40
mov edx, dword [ebp - 0x45c]
mov ecx, dword [ebp - 0x460]
mov esi, dword [ebp - 0x4f0]
mov eax, dword [ebp - 0x470]
cmp edx, 0x10
jae 0x540d2c
lea eax, [ebp - 0x470]
mov edx, dword [esi]
push ecx
push eax
mov eax, dword [edx + 0x2c]
mov ecx, esi
call eax
mov edx, dword [ebp - 0x49c]
mov eax, dword [ebp - 0x4f4]
mov ecx, dword [ebp - 0x4fc]
inc eax
mov dword [ebp - 0x4f4], eax
cmp eax, ecx
jl 0x540c05
jmp 0x540e03
mov esi, dword [ebp - 0x4f0]
mov edx, dword [esi]
mov eax, dword [edx + 0x30]
mov ecx, esi
call eax
push edx
push eax
lea ecx, [ebp - 0x51c]
lea edi, [ebp - 0x5d4]
call fcn.0053b200
test eax, eax
jle 0x541379
mov edx, dword [ebp - 0x424]
mov eax, dword [ebp - 0x438]
cmp edx, 0x10
jae 0x540d9e
lea eax, [ebp - 0x438]
mov ecx, dword [ebp - 0x428]
cmp byte [eax + ecx - 1], 0xd
je 0x540de7
mov eax, dword [ebp - 0x438]
cmp edx, 0x10
jae 0x540dbc
lea eax, [ebp - 0x438]
cmp byte [eax + ecx - 1], 0xa
je 0x540de7
push 0xd
mov ebx, 1
lea esi, [ebp - 0x438]
call fcn.0044ad40
mov edx, dword [ebp - 0x424]
mov ecx, dword [ebp - 0x428]
mov esi, dword [ebp - 0x4f0]
mov eax, dword [ebp - 0x438]
cmp edx, 0x10
jae 0x540df8
lea eax, [ebp - 0x438]
mov edx, dword [esi]
push ecx
push eax
mov eax, dword [edx + 0x2c]
mov ecx, esi
call eax
mov eax, dword [ebp - 0x4f8]
lea ecx, [ebp - 0x51c]
push ecx
lea edx, [ebp - 0x53c]
push edx
push eax
lea ecx, [ebp - 0x4e9]
lea edx, [ebp - 0x438]
call fcn.00543930
test eax, eax
jg 0x540b20
lea ecx, [ebp - 0x5d4]
push ecx
call fcn.0053b270
mov ebx, dword [ebp - 0x4f0]
mov edx, dword [ebx]
mov eax, dword [edx + 0x30]
mov ecx, ebx
call eax
mov dword [ebp - 0x508], edx
mov edx, dword [ebx]
push 6
mov dword [ebp - 0x50c], eax
mov eax, dword [edx + 0x2c]
push str.xref_r_n
mov ecx, ebx
call eax
mov eax, dword [ebp - 0x5c8]
mov ecx, dword [ebp - 0x5cc]
sub eax, ecx
sar eax, 2
mov dword [ebp - 0x4f4], 0
test eax, eax
jle 0x540fe2
cmp dword [ebp - 0x4f4], 0
jl 0x540fbc
cmp dword [ebp - 0x4f4], eax
jge 0x540fbc
mov edx, dword [ebp - 0x4f4]
mov eax, dword [ecx + edx*4]
mov dword [ebp - 0x4fc], eax
test eax, eax
je 0x540fbc
mov ecx, dword [eax + 8]
mov edx, dword [eax + 4]
push ecx
push edx
push str._d__d_r_n
mov esi, 0x400
lea edi, [ebp - 0x41c]
call fcn.004f9520
mov eax, edi
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x540ee0
mov ecx, dword [ebp - 0x4f0]
sub eax, edx
mov edx, dword [ecx]
mov edx, dword [edx + 0x2c]
push eax
lea eax, [ebp - 0x41c]
push eax
call edx
mov eax, dword [ebp - 0x4fc]
mov eax, dword [eax + 0x20]
mov ebx, dword [eax]
cmp ebx, eax
je 0x540fb6
mov eax, dword [ebx + 0x18]
movsx ecx, byte [eax + 0x18]
mov edx, dword [eax + 0x14]
push ecx
mov ecx, dword [eax + 0xc]
push edx
mov edx, dword [eax + 8]
push ecx
push edx
push str._010I64d__05d__c_r_n
mov esi, 0x400
lea edi, [ebp - 0x41c]
call fcn.004f9520
mov eax, edi
add esp, 0x14
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x540f42
mov ecx, dword [ebp - 0x4f0]
sub eax, edx
mov edx, dword [ecx]
mov edx, dword [edx + 0x2c]
push eax
lea eax, [ebp - 0x41c]
push eax
call edx
cmp byte [ebx + 0x21], 0
jne 0x540fa7
mov eax, dword [ebx + 8]
cmp byte [eax + 0x21], 0
jne 0x540f8c
mov ebx, eax
mov eax, dword [ebx]
cmp byte [eax + 0x21], 0
jne 0x540fa7
lea esp, [esp]
mov ebx, eax
mov eax, dword [ebx]
cmp byte [eax + 0x21], 0
je 0x540f80
jmp 0x540fa7
mov eax, dword [ebx + 4]
cmp byte [eax + 0x21], 0
jne 0x540fa5
cmp ebx, dword [eax + 8]
jne 0x540fa5
mov ebx, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0x21], 0
je 0x540f95
mov ebx, eax
mov eax, dword [ebp - 0x4fc]
cmp ebx, dword [eax + 0x20]
jne 0x540f11
mov ecx, dword [ebp - 0x5cc]
mov eax, dword [ebp - 0x5c8]
mov edx, dword [ebp - 0x4f4]
sub eax, ecx
inc edx
sar eax, 2
mov dword [ebp - 0x4f4], edx
cmp edx, eax
jl 0x540e8b
mov ebx, dword [ebp - 0x4f0]
mov edi, 0xd
mov eax, str.trailer_r_n___r_n
lea esi, [ebp - 0x454]
call fcn.00402fe0
cmp dword [ebp - 0x440], 0x10
mov eax, dword [ebp - 0x454]
jae 0x541008
mov eax, esi
mov ecx, dword [ebp - 0x444]
mov edx, dword [ebx]
mov edx, dword [edx + 0x2c]
push ecx
push eax
mov ecx, ebx
call edx
mov ecx, dword [ebp - 0x520]
test ecx, ecx
jl 0x541048
jg 0x54102e
cmp dword [ebp - 0x524], 0
jb 0x541048
mov eax, dword [ebp - 0x504]
mov edx, dword [ebp - 0x524]
mov dword [eax + 0xe0], edx
mov dword [eax + 0xe4], ecx
jmp 0x54104e
mov eax, dword [ebp - 0x504]
mov ecx, dword [ebp - 0x508]
test ecx, ecx
jl 0x541075
jg 0x541063
cmp dword [ebp - 0x50c], 0
jb 0x541075
mov edx, dword [ebp - 0x50c]
mov dword [eax + 0x148], edx
mov dword [eax + 0x14c], ecx
lea ecx, [eax + 0xa8]
lea edx, [ebp - 0x48c]
call fcn.0053df80
mov esi, eax
lea eax, [ebp - 0x454]
cmp eax, esi
je 0x541118
cmp dword [ebp - 0x440], 0x10
jb 0x5410af
mov ecx, dword [ebp - 0x454]
push ecx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov edi, 0xf
mov dword [ebp - 0x440], edi
mov dword [ebp - 0x444], 0
mov byte [ebp - 0x454], 0
cmp dword [esi + 0x14], 0x10
jae 0x5410e9
mov eax, dword [esi + 0x10]
inc eax
push eax
lea edx, [ebp - 0x454]
push esi
push edx
call dword [sym.imp.MSVCR100.dll_memmove]
add esp, 0xc
jmp 0x5410f7
mov eax, dword [esi]
mov dword [ebp - 0x454], eax
mov dword [esi], 0
mov ecx, dword [esi + 0x10]
mov dword [ebp - 0x444], ecx
mov edx, dword [esi + 0x14]
mov dword [ebp - 0x440], edx
mov dword [esi + 0x14], edi
mov dword [esi + 0x10], 0
mov byte [esi], 0
jmp 0x54111d
mov edi, 0xf
mov esi, 0x10
mov byte [ebp - 4], 8
cmp dword [ebp - 0x478], esi
jb 0x54113e
mov eax, dword [ebp - 0x48c]
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov eax, dword [ebp - 0x454]
mov dword [ebp - 0x478], edi
mov dword [ebp - 0x47c], 0
mov byte [ebp - 0x48c], 0
cmp dword [ebp - 0x440], esi
jae 0x541169
lea eax, [ebp - 0x454]
mov ecx, dword [ebp - 0x444]
mov edx, dword [ebx]
mov edx, dword [edx + 0x2c]
push ecx
push eax
mov ecx, ebx
call edx
mov eax, dword [ebp - 0x508]
mov ecx, dword [ebp - 0x50c]
push eax
push ecx
push str._r_n___r_nstartxref_r_n_I64d_r_n____EOF_r_n
mov esi, 0x400
lea edi, [ebp - 0x41c]
call fcn.004f9520
mov eax, edi
add esp, 0xc
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x5411a5
mov edx, dword [ebx]
mov edx, dword [edx + 0x2c]
sub eax, esi
push eax
lea eax, [ebp - 0x41c]
push eax
mov ecx, ebx
call edx
mov eax, dword [ebp - 0x50c]
mov ecx, dword [ebp - 0x508]
mov byte [ebp - 4], 7
cmp dword [ebp - 0x424], 0x10
mov dword [ebp - 0x524], eax
mov dword [ebp - 0x520], ecx
jb 0x5411f4
mov edx, dword [ebp - 0x438]
push edx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov ebx, dword [ebp - 0x500]
mov dword [ebp - 0x424], 0xf
mov dword [ebp - 0x428], 0
mov byte [ebp - 0x438], 0
mov eax, dword [ebp - 0x4f8]
inc ebx
mov dword [ebp - 0x500], ebx
cmp ebx, dword [eax + 0x888]
jl 0x540a4d
xor ebx, ebx
xor edi, edi
mov esi, dword [ebp - 0x4f0]
mov edx, dword [esi]
mov eax, dword [edx + 0x20]
mov ecx, esi
call eax
mov edx, dword [esi]
mov eax, dword [edx]
push 1
mov ecx, esi
call eax
lea ecx, [ebp - 0x5d4]
mov byte [ebp - 4], 6
call fcn.0053ad60
cmp dword [ebp - 0x440], 0x10
jb 0x541273
mov ecx, dword [ebp - 0x454]
push ecx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov esi, 0xf
mov byte [ebp - 4], 4
mov dword [ebp - 0x440], esi
mov dword [ebp - 0x444], ebx
mov byte [ebp - 0x454], bl
cmp dword [ebp - 0x518], ebx
je 0x5412a4
mov ecx, dword [ebp - 0x518]
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
cmp dword [ebp - 0x45c], 0x10
jb 0x5412bd
mov ecx, dword [ebp - 0x470]
push ecx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
lea ecx, [ebp - 0x4cc]
mov dword [ebp - 0x45c], esi
mov dword [ebp - 0x460], ebx
mov byte [ebp - 0x470], bl
mov byte [ebp - 4], 2
call fcn.00495f40
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x530], ebx
je 0x5412fb
mov ecx, dword [ebp - 0x530]
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
mov eax, edi
jmp 0x5408b4
lea esi, [ebp - 0x438]
call fcn.004542a0
lea ecx, [ebp - 0x5d4]
mov byte [ebp - 4], 6
call fcn.0053ad60
lea esi, [ebp - 0x454]
call fcn.004542a0
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0x518]
test ecx, ecx
je 0x54133d
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
lea esi, [ebp - 0x470]
call fcn.004542a0
lea ecx, [ebp - 0x4cc]
mov byte [ebp - 4], 2
call fcn.00495f40
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x530]
test ecx, ecx
je 0x5408b1
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
jmp 0x5408b1
lea esi, [ebp - 0x438]
or edi, 0xffffffff
mov byte [ebp - 4], 7
call fcn.004542a0
xor ebx, ebx
jmp 0x541232