Function at 0x401c70
Capabilities:
Check if file exists
Get common file path
Get file attributes

Disassembly:
push 0xffffffffffffffff
push 0x40aa51
mov eax, dword fs:[0]
push eax
mov eax, 0x1028
mov dword fs:[0], esp
call fcn.00403540
mov eax, dword [0x40e0b0]
push ebx
push ebp
push esi
push edi
push str._n_PETrim_v1.02___c_2004_Bitsum_Technologies
mov dword [esp + 0x1038], eax
call fcn.00403ee8
push str.Jun_15_2005
push str.00:49:40
push str._n_Compiled:__s__s
call fcn.00403ee8
push str._n_http:__www.bitsum.com
call fcn.00403ee8
push 0x40b820
call fcn.00403ee8
mov ebx, dword [esp + 0x1060]
add esp, 0x18
cmp ebx, 2
jge 0x401d8b
push str._n_Usage:
call fcn.00403ee8
push str._n__PETrim_filespec___Alignxx____StripFixups:YNA____StripDebug:YN____r_
call fcn.00403ee8
push str._n_n___Filespec_is_the_name__wildcards_supported__of_the_file_s__to_trim.
call fcn.00403ee8
push str._n___The__Align_switch_specifies_the_new_alignment._Default_is_minimum_512.
call fcn.00403ee8
push str._n___The__StripFixups_switch_indicates_whether_or_not_to_strip_fixups._The
call fcn.00403ee8
push str._n_______default_value_is__Auto___A___which_indicates_that_they_should_be
call fcn.00403ee8
push str._n_______stripped_for_EXEs_and_not_for_DLLs.
call fcn.00403ee8
push str._n___The__StripDebug_switch_indicates_whether_or_not_to_strip_debug_information.
call fcn.00403ee8
push str._n_______The_default_value_is__Yes_.
call fcn.00403ee8
push str._n___The__r_switch_turns_on_directory_recursion.
call fcn.00403ee8
push str._n_n_Press_any_key_to_exit_...
call fcn.00403ee8
add esp, 0x2c
call fcn.0040a808
test eax, eax
je 0x401d55
call fcn.0040a747
or eax, 0xffffffff
mov ecx, dword [esp + 0x1038]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x1034]
call fcn.0040352b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1034
ret
mov eax, dword [0x40e7cc]
mov ecx, 0x40e7cc
mov dword [esp + 0x1c], 0x200
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [esp + 0x10], esi
xor edi, edi
mov ebp, 1
cmp ebx, ebp
mov dword [esp + 0x1040], edi
mov byte [esp + 0x2c], 1
mov byte [esp + 0x14], 0
mov dword [esp + 0x24], 2
jle 0x401fcb
mov ebx, dword [esp + 0x104c]
mov eax, dword [ebx + ebp*4]
lea edx, [esp + 0x34]
sub edx, eax
nop
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x401de0
lea ecx, [esp + 0x34]
push ecx
call fcn.00403e76
lea edx, [esp + 0x38]
push str._STRIPDEBUG
push edx
call fcn.004033ed
mov esi, eax
add esp, 0xc
cmp esi, edi
je 0x401e5e
add esi, 0xc
push 0x40b58c
push esi
call fcn.004033ed
add esp, 8
test eax, eax
je 0x401e2b
mov byte [esp + 0x2c], 1
jmp 0x401fb7
push 0x40b588
push esi
call fcn.004033ed
add esp, 8
test eax, eax
je 0x401e47
mov byte [esp + 0x2c], 0
jmp 0x401fb7
lea eax, [esp + 0x34]
push eax
push str._n___Warning:_Unrecognized_value_in_parameter___s_.
call fcn.00403ee8
add esp, 8
jmp 0x401fb7
lea ecx, [esp + 0x34]
push str._STRIPFIXUPS
push ecx
call fcn.004033ed
mov esi, eax
add esp, 8
cmp esi, edi
je 0x401ee9
add esi, 0xd
push 0x40b58c
push esi
call fcn.004033ed
add esp, 8
test eax, eax
je 0x401e98
mov dword [esp + 0x24], 1
jmp 0x401fb7
push 0x40b588
push esi
call fcn.004033ed
add esp, 8
test eax, eax
je 0x401eb3
mov dword [esp + 0x24], edi
jmp 0x401fb7
push 0x40b540
push esi
call fcn.004033ed
add esp, 8
test eax, eax
je 0x401ed2
mov dword [esp + 0x24], 2
jmp 0x401fb7
lea edx, [esp + 0x34]
push edx
push str._n___Warning:_Unrecognized_value_in_parameter___s_.
call fcn.00403ee8
add esp, 8
jmp 0x401fb7
lea eax, [esp + 0x34]
push 0x40b53c
push eax
call fcn.00403580
add esp, 8
test eax, eax
je 0x401f16
push str._n__Recursion_is_ON.
call fcn.00403ee8
add esp, 4
mov byte [esp + 0x14], 1
jmp 0x401fb7
lea ecx, [esp + 0x34]
push str._ALIGN
push ecx
call fcn.00403580
add esp, 8
test eax, eax
je 0x401f8f
lea edx, [esp + 0x3b]
push 0x40b1a0
push edx
call fcn.00403580
add esp, 8
test eax, eax
jne 0x401f53
lea eax, [esp + 0x1c]
push eax
push 0x40b518
lea ecx, [esp + 0x43]
push ecx
jmp 0x401f62
lea edx, [esp + 0x1c]
push edx
push 0x40b514
lea eax, [esp + 0x45]
push eax
call fcn.00403f19
mov eax, dword [esp + 0x28]
cdq
and edx, 0xf
add eax, edx
sar eax, 4
shl eax, 4
add esp, 0xc
push eax
push eax
push str._n_Alignment_will_be_set_to__d__0x_X_
mov dword [esp + 0x28], eax
call fcn.00403ee8
add esp, 0xc
jmp 0x401fb7
cmp byte [esp + 0x34], 0x2f
jne 0x401faa
lea ecx, [esp + 0x34]
push ecx
push str._n___WARNING:_Unrecognized_parameter:__s.
call fcn.00403ee8
add esp, 8
jmp 0x401fb7
mov edx, dword [ebx + ebp*4]
push edx
lea ecx, [esp + 0x14]
call fcn.00401480
mov eax, dword [esp + 0x1048]
inc ebp
cmp ebp, eax
jl 0x401dd6
mov esi, dword [esp + 0x10]
mov eax, dword [0x40e7cc]
mov ecx, 0x40e7cc
call dword [eax + 0xc]
add eax, 0x10
mov dword [esp + 0x18], eax
cmp dword [esi - 4], 1
mov byte [esp + 0x1040], 1
jle 0x401ffe
mov ecx, dword [esi - 0xc]
push ecx
lea ecx, [esp + 0x14]
call fcn.00401170
mov esi, dword [esp + 0x10]
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40201e
test al, 0x10
je 0x40201e
push 4
push str..
lea ecx, [esp + 0x18]
call fcn.00401380
lea edx, [esp + 0x10]
push edx
lea ecx, [esp + 0x1c]
xor esi, esi
xor ebx, ebx
call fcn.00401410
mov ebp, dword [esp + 0x18]
cmp esi, edi
mov eax, dword [ebp - 0xc]
jl 0x402061
cmp esi, eax
jg 0x402061
add esi, ebp
push 0x40b19c
push esi
call fcn.004033ed
add esp, 8
cmp eax, edi
je 0x402061
sub eax, ebp
mov esi, eax
cmp esi, 0xffffffff
je 0x402061
mov ebx, esi
inc esi
jmp 0x402034
mov eax, dword [ebp - 4]
mov ecx, 1
sub ecx, eax
mov eax, dword [ebp - 8]
sub eax, ebx
or eax, ecx
jge 0x402082
push ebx
lea ecx, [esp + 0x1c]
call fcn.00401240
mov ebp, dword [esp + 0x18]
cmp ebx, edi
jl 0x4022bb
cmp ebx, dword [ebp - 8]
jg 0x4022bb
mov dword [ebp - 0xc], ebx
mov byte [ebx + ebp], 0
cmp dword [ebp - 0xc], edi
jne 0x4020d2
lea eax, [esp + 0x34]
push eax
push 0x1000
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
lea eax, [esp + 0x34]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4020b6
sub eax, edx
push eax
lea ecx, [esp + 0x38]
push ecx
lea ecx, [esp + 0x20]
call fcn.004012e0
mov ebp, dword [esp + 0x18]
mov ebx, dword [esp + 0x10]
lea edx, [esp + 0x20]
push edx
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x2c]
push eax
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x38]
push ecx
mov ecx, dword [esp + 0x38]
push edx
mov edx, dword [esp + 0x34]
push eax
push ecx
push edx
push ecx
mov dword [esp + 0x40], edi
mov dword [esp + 0x48], edi
mov dword [esp + 0x50], edi
mov ecx, dword [ebx - 0x10]
mov eax, dword [ecx]
add ebx, 0xfffffff0
mov dword [esp + 0x4c], esp
mov dword [esp + 0x34], esp
call dword [eax + 0x10]
mov edx, dword [ebx + 0xc]
cmp edx, edi
lea ecx, [ebx + 0xc]
jl 0x402134
cmp eax, dword [ebx]
jne 0x402134
mov eax, ebx
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x402169
mov ecx, dword [ebx + 4]
mov edx, dword [eax]
push 1
push ecx
mov ecx, eax
call dword [edx]
cmp eax, edi
jne 0x402149
jmp fcn.00401090
mov edx, dword [ebx + 4]
mov dword [eax + 4], edx
mov ecx, dword [ebx + 4]
inc ecx
mov edx, ecx
shr ecx, 2
lea esi, [ebx + 0x10]
lea edi, [eax + 0x10]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor edi, edi
mov ecx, dword [esp + 0x34]
add eax, 0x10
mov dword [ecx], eax
push ecx
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx]
add ebp, 0xfffffff0
mov dword [esp + 0x38], esp
mov byte [esp + 0x1064], 2
mov dword [esp + 0x38], esp
call dword [edx + 0x10]
mov ecx, dword [ebp + 0xc]
cmp ecx, edi
lea edx, [ebp + 0xc]
jl 0x4021aa
cmp eax, dword [ebp]
jne 0x4021aa
mov eax, ebp
mov ecx, 1
lock xadd dword [edx], ecx
jmp 0x4021df
mov ecx, dword [ebp + 4]
mov edx, dword [eax]
push 1
push ecx
mov ecx, eax
call dword [edx]
cmp eax, edi
jne 0x4021bf
jmp fcn.00401090
mov edx, dword [ebp + 4]
mov dword [eax + 4], edx
mov ecx, dword [ebp + 4]
inc ecx
mov edx, ecx
shr ecx, 2
lea esi, [ebp + 0x10]
lea edi, [eax + 0x10]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor edi, edi
mov ecx, dword [esp + 0x38]
add eax, 0x10
mov dword [ecx], eax
mov byte [esp + 0x1064], 1
call fcn.004014c0
push 0x40b820
call fcn.00403ee8
mov eax, dword [esp + 0x50]
add esp, 0x28
cmp eax, edi
je 0x402265
cmp dword [esp + 0x20], edi
je 0x402265
mov edx, dword [esp + 0x30]
push edx
push str._n____Modules_trimed:__d
call fcn.00403ee8
mov eax, dword [esp + 0x30]
push eax
push str._n____Total_original_size:__d
call fcn.00403ee8
mov ecx, dword [esp + 0x30]
push ecx
push str._n____New_size:__d
call fcn.00403ee8
mov esi, dword [esp + 0x38]
mov ecx, dword [esp + 0x40]
mov eax, esi
imul eax, eax, 0x64
cdq
idiv ecx
mov edx, 0x64
sub ecx, esi
sub edx, eax
push edx
push ecx
push str._n____Reduced_by:__d_bytes____d___
call fcn.00403ee8
add esp, 0x24
push str._n_n__All_done__n
call fcn.00403ee8
add esp, 4
mov byte [esp + 0x1040], 0
lea eax, [ebp + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x402292
mov ecx, dword [ebp]
mov edx, dword [ecx]
push ebp
call dword [edx + 4]
mov dword [esp + 0x1040], 0xffffffff
lea eax, [ebx + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x4022b4
mov ecx, dword [ebx]
mov edx, dword [ecx]
push ebx
call dword [edx + 4]
xor eax, eax
jmp 0x401d66
push 0x80070057
call fcn.00401060
int3