Function at 0x401318
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
push edi
push esi
push ebx
sub esp, 0x74
call sym.___main
mov dword [esp], 0
call sym._time
mov dword [esp], eax
call sym._srand
mov dword [esp + 4], 0x403024
mov dword [esp], str.drug.dat
call sym._fopen
mov dword [esp + 0x50], eax
cmp dword [esp + 0x50], 0
jne 0x401372
mov dword [esp], 0x403030
call sym._puts
mov eax, 0
jmp 0x4016f3
mov dword [esp], 0x68
call sym._malloc
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x58]
mov dword [esp + 0x5c], eax
mov dword [esp + 0x4c], 0
jmp 0x4013e4
mov eax, dword [esp + 0x50]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x68
mov eax, dword [esp + 0x5c]
mov dword [esp], eax
call sym._fread
mov dword [esp], 0x68
call sym._malloc
mov edx, eax
mov eax, dword [esp + 0x5c]
mov dword [eax + 0x60], edx
mov eax, dword [esp + 0x5c]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x5c]
mov eax, dword [eax + 0x60]
mov dword [esp + 0x5c], eax
inc dword [esp + 0x4c]
cmp dword [esp + 0x4c], 0x63
jle 0x401394
mov eax, dword [esp + 0x5c]
mov dword [esp], eax
call sym._free
mov eax, dword [esp + 0x60]
mov dword [eax + 0x60], 0
mov dword [esp], 0x38
call sym._malloc
mov dword [esp + 0x64], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call sym._fclose
mov dword [esp + 0x4c], 1
mov eax, dword [esp + 0x58]
mov dword [esp + 0x5c], eax
jmp 0x4015ce
mov dword [esp + 0x48], 0
jmp 0x4015b8
mov eax, dword [esp + 0x5c]
mov edx, dword [esp + 0x68]
add edx, 0xc
mov dword [esp + 4], eax
mov dword [esp], edx
call sym._strcpy
mov eax, dword [esp + 0x5c]
lea edx, [eax + 0xf]
mov eax, dword [esp + 0x68]
add eax, 0x1b
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._strcpy
call sym._rand
mov edx, 3
mov ecx, edx
cdq
idiv ecx
mov eax, edx
lea edx, [eax + 0x7da]
mov eax, dword [esp + 0x68]
mov dword [eax], edx
call sym._rand
mov edx, 0xc
mov ecx, edx
cdq
idiv ecx
mov eax, edx
lea edx, [eax + 1]
mov eax, dword [esp + 0x68]
mov dword [eax + 4], edx
mov eax, dword [esp + 0x68]
mov eax, dword [eax + 4]
cmp eax, 0xc
ja case.0x4014c4.27
mov eax, dword [eax*4 + 0x403068]
jmp eax
call sym._rand
mov edx, 0x1f
mov ecx, edx
cdq
idiv ecx
mov eax, edx
lea edx, [eax + 1]
mov eax, dword [esp + 0x68]
mov dword [eax + 8], edx
jmp case.0x4014c4.27
call sym._rand
mov edx, 0x1e
mov ecx, edx
cdq
idiv ecx
mov eax, edx
lea edx, [eax + 1]
mov eax, dword [esp + 0x68]
mov dword [eax + 8], edx
jmp case.0x4014c4.27
call sym._rand
mov edx, 0x1c
mov ecx, edx
cdq
idiv ecx
mov eax, edx
lea edx, [eax + 1]
mov eax, dword [esp + 0x68]
mov dword [eax + 8], edx
call sym._rand
and eax, 1
test al, al
je 0x401531
mov eax, dword [esp + 0x68]
mov byte [eax + 0x2f], 0x2b
jmp 0x401539
mov eax, dword [esp + 0x68]
mov byte [eax + 0x2f], 0x2d
call sym._rand
mov edx, 0x14
mov ecx, edx
cdq
idiv ecx
mov eax, edx
lea edx, [eax + 1]
mov eax, dword [esp + 0x68]
mov dword [eax + 0x30], edx
mov dword [esp], 0x38
call sym._malloc
mov edx, eax
mov eax, dword [esp + 0x68]
mov dword [eax + 0x34], edx
mov eax, dword [esp + 0x68]
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x68]
mov eax, dword [eax + 0x34]
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], eax
mov dword [esp], 0x403039
call sym._printf
mov eax, dword [esp + 0x4c]
mov edx, 5
mov ecx, edx
cdq
idiv ecx
mov eax, edx
test eax, eax
jne 0x4015b0
mov dword [esp], 0xa
call sym._putchar
inc dword [esp + 0x4c]
inc dword [esp + 0x48]
cmp dword [esp + 0x48], 9
jle 0x401448
mov eax, dword [esp + 0x5c]
mov eax, dword [eax + 0x60]
mov dword [esp + 0x5c], eax
cmp dword [esp + 0x5c], 0
jne 0x40143b
mov eax, dword [esp + 0x68]
mov dword [esp], eax
call sym._free
mov eax, dword [esp + 0x6c]
mov dword [eax + 0x34], 0
mov eax, dword [esp + 0x64]
mov dword [esp + 0x68], eax
mov dword [esp + 4], 0x40303d
mov dword [esp], str.io_note.dat
call sym._fopen
mov dword [esp + 0x54], eax
mov dword [esp + 0x4c], 0
jmp 0x4016d7
mov eax, dword [esp + 0x54]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x68
mov eax, dword [esp + 0x68]
mov dword [esp], eax
call sym._fwrite
mov eax, dword [esp + 0x68]
mov eax, dword [eax + 0x30]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x68]
mov al, byte [eax + 0x2f]
movsx edi, al
mov eax, dword [esp + 0x68]
mov esi, dword [eax + 8]
mov eax, dword [esp + 0x68]
mov ebx, dword [eax + 4]
mov eax, dword [esp + 0x68]
mov ecx, dword [eax]
mov eax, dword [esp + 0x68]
add eax, 0x1b
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x68]
lea edx, [eax + 0xc]
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], ecx
mov ecx, dword [esp + 0x3c]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], str._s__s__d._d._d__c__d__d_n
call sym._printf
mov eax, dword [esp + 0x68]
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x68]
mov eax, dword [eax + 0x34]
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x60]
mov dword [esp], eax
call sym._free
inc dword [esp + 0x4c]
cmp dword [esp + 0x68], 0
jne 0x40161d
mov eax, dword [esp + 0x54]
mov dword [esp], eax
call sym._fclose
mov eax, 0
add esp, 0x74
pop ebx
pop esi
pop edi
leave
ret